1 | <?php |
||
8 | class ModuleInstall extends AbstractSystem |
||
9 | { |
||
10 | /** |
||
11 | * @var \BFW\Install\ModuleInstall[] $listToInstall |
||
12 | */ |
||
13 | protected $listToInstall = []; |
||
14 | |||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | * |
||
18 | * @return $this |
||
19 | */ |
||
20 | public function __invoke() |
||
24 | |||
25 | /** |
||
26 | * Getter accessor to property listToInstall |
||
27 | * |
||
28 | * @return type |
||
29 | */ |
||
30 | public function getListToInstall() |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function init() |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function toRun() |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | * Run install of all modules |
||
54 | */ |
||
55 | public function run() |
||
60 | |||
61 | /** |
||
62 | * Add a new module to the list to install |
||
63 | * |
||
64 | * @param \BFW\Install\ModuleInstall $module The new module |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function addToList(\BFW\Install\ModuleInstall $module) |
||
76 | |||
77 | /** |
||
78 | * Install all modules in the order of the dependency tree. |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | protected function installAllModules() |
||
105 | |||
106 | /** |
||
107 | * Install a module |
||
108 | * |
||
109 | * @param string $moduleName The module name |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | protected function installModule($moduleName) |
||
137 | } |
||
138 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: