ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Bundle.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 use ilObjUser;
27 
28 final class Bundle implements SelfRegistration
29 {
33  public function __construct(
34  private readonly array $self_registrations
35  ) {
36  }
37 
38  public function legacyInputGUIs(): array
39  {
40  return array_merge(...$this->callAll(__FUNCTION__));
41  }
42 
43  public function saveLegacyForm(ilPropertyFormGUI $form): bool
44  {
45  $and = fn($a, $b) => $a && $b;
46  return array_reduce($this->callAll(__FUNCTION__, $form), $and, true);
47  }
48 
49  public function userCreation(ilObjUser $user): void
50  {
51  $this->callAll(__FUNCTION__, $user);
52  }
53 
54  private function callAll(string $call_what, ...$args): array
55  {
56  return array_map(fn($reg) => $reg->$call_what(...$args), $this->self_registrations);
57  }
58 }
__construct(private readonly array $self_registrations)
Definition: Bundle.php:33
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples