Total Complexity | 8 |
Total Lines | 84 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | class App implements Application |
||
19 | { |
||
20 | /** |
||
21 | * @var Context |
||
22 | */ |
||
23 | private $ctx = null; |
||
24 | |||
25 | /** |
||
26 | * @var Input |
||
27 | */ |
||
28 | private $input = null; |
||
29 | |||
30 | /** |
||
31 | * @var Waited |
||
32 | */ |
||
33 | private $starting = null; |
||
34 | |||
35 | /** |
||
36 | * @var Waited |
||
37 | */ |
||
38 | private $stopping = null; |
||
39 | |||
40 | /** |
||
41 | * @return Context |
||
42 | */ |
||
43 | public function ctx() : Context |
||
44 | { |
||
45 | return $this->ctx ?? $this->ctx = new Context(); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return Config |
||
50 | */ |
||
51 | public function conf() : Config |
||
52 | { |
||
53 | return conf(); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function name() : string |
||
60 | { |
||
61 | return $this->ctx()->get('APP_NAME') ?? ''; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @param string $name |
||
66 | */ |
||
67 | public function named(string $name) : void |
||
68 | { |
||
69 | $this->ctx()->set('APP_NAME', $name); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return Input |
||
74 | */ |
||
75 | public function input() : Input |
||
76 | { |
||
77 | return $this->input; |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * @param InputInterface $set |
||
82 | */ |
||
83 | public function inputs(InputInterface $set) : void |
||
84 | { |
||
85 | $this->input = new Input($set); |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @return Waited |
||
90 | */ |
||
91 | public function starting() : Waited |
||
92 | { |
||
93 | return $this->starting ?? $this->starting = new Waited(); |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * @return Waited |
||
98 | */ |
||
99 | public function stopping() : Waited |
||
102 | } |
||
103 | } |
||
104 |