1 | <?php |
||
9 | abstract class AbstractSystem implements SystemInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var boolean $initStatus To know if the init method has been called |
||
13 | */ |
||
14 | protected $initStatus = false; |
||
15 | |||
16 | /** |
||
17 | * @var boolean $runStatus To know if the run method has been called |
||
18 | */ |
||
19 | protected $runStatus = false; |
||
20 | |||
21 | /** |
||
22 | * PHP Magic method |
||
23 | * Called when the class is called like a function |
||
24 | * |
||
25 | * @return mixed |
||
26 | */ |
||
27 | abstract function __invoke(); |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | * Should change initStatus to true. |
||
32 | */ |
||
33 | public function init() |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function isInit() |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function toRun() |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function isRun() |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | * Should change runStatus to true. |
||
65 | */ |
||
66 | public function run() |
||
70 | } |
||
71 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.