1 | <?php |
||
5 | class ModuleList extends AbstractSystem |
||
6 | { |
||
7 | /** |
||
8 | * @var \BFW\ModuleList|null $moduleList |
||
9 | */ |
||
10 | protected $moduleList; |
||
11 | |||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | * |
||
15 | * @return \BFW\ModuleList|null |
||
16 | */ |
||
17 | public function __invoke() |
||
21 | |||
22 | /** |
||
23 | * Getter accessor to property moduleList |
||
24 | * |
||
25 | * @return \BFW\ModuleList|null |
||
26 | */ |
||
27 | public function getModuleList() |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | * Initialize the ModuleList system |
||
35 | */ |
||
36 | public function init() |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function toRun() |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | * |
||
53 | * Load all modules, run all core and app modules |
||
54 | */ |
||
55 | public function run() |
||
63 | |||
64 | /** |
||
65 | * Read all directories in modules directory and add each module to Modules |
||
66 | * class. |
||
67 | * Generate the load tree. |
||
68 | * Not initialize modules ! |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | protected function loadAllModules() |
||
89 | |||
90 | /** |
||
91 | * Load core modules defined into config bfw file. |
||
92 | * Only module for controller, router, database and template only. |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | protected function runAllCoreModules() |
||
114 | |||
115 | /** |
||
116 | * Load all modules (except core). |
||
117 | * Get the load tree, read him and load all modules with the order |
||
118 | * declared into the tree. |
||
119 | * |
||
120 | * @return void |
||
121 | */ |
||
122 | protected function runAllAppModules() |
||
134 | |||
135 | /** |
||
136 | * Load a module |
||
137 | * |
||
138 | * @param string $moduleName The module's name to load |
||
139 | * |
||
140 | * @return void |
||
141 | */ |
||
142 | protected function runModule($moduleName) |
||
154 | } |
||
155 |
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: