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