1 | <?php |
||
5 | class Cli extends AbstractSystem |
||
6 | { |
||
7 | /** |
||
8 | * @var \BFW\Core\Cli|null $cli |
||
9 | */ |
||
10 | protected $cli; |
||
11 | |||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | * |
||
15 | * @return \BFW\Core\Cli|null |
||
16 | */ |
||
17 | public function __invoke() |
||
21 | |||
22 | /** |
||
23 | * Getter accessor to cli property |
||
24 | * |
||
25 | * @return \BFW\Core\Cli|null |
||
26 | */ |
||
27 | public function getCli() |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | * Define the cli property |
||
35 | */ |
||
36 | public function init() |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function toRun() |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function run() |
||
58 | |||
59 | /** |
||
60 | * Run the cli file if we're in cli mode |
||
61 | * |
||
62 | * @return void |
||
63 | * |
||
64 | * @throws Exception If no file is specified or if the file not exist. |
||
65 | */ |
||
66 | protected function runCliFile() |
||
80 | } |
||
81 |
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: