1 | <?php |
||
9 | class Application |
||
10 | { |
||
11 | /** |
||
12 | * Container |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | private $container = []; |
||
17 | |||
18 | /** |
||
19 | * Set and rename core classes |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private $classes = []; |
||
24 | |||
25 | /** |
||
26 | * Application Object |
||
27 | * |
||
28 | * @var \System\Application |
||
29 | */ |
||
30 | private static $instance; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @property object $file |
||
36 | * @property object $error |
||
37 | * @param \System\File $file |
||
38 | */ |
||
39 | private function __construct(File $file) |
||
53 | |||
54 | /** |
||
55 | * Get Application instance |
||
56 | * |
||
57 | * @param \System\File $file |
||
58 | * @return \System\Application |
||
59 | */ |
||
60 | public static function getInstance($file) |
||
66 | |||
67 | /** |
||
68 | * Run the Application |
||
69 | * |
||
70 | * @property object $session |
||
71 | * @property object $request |
||
72 | * @property object $file |
||
73 | * @property object $route |
||
74 | * @property object $response |
||
75 | * @return void |
||
76 | */ |
||
77 | public function run() |
||
93 | |||
94 | /** |
||
95 | * Share the given key|value through Application |
||
96 | * |
||
97 | * @param string $key |
||
98 | * @param mixed $value |
||
99 | * @return void |
||
100 | */ |
||
101 | public function share($key, $value) |
||
109 | |||
110 | /** |
||
111 | * Get shared value |
||
112 | * When the key exists in the $classes, it will look if it was sharing before |
||
113 | * is not sharing: it will create in an object and add it to the $container |
||
114 | * is sharing: it will grab it direct from the $container |
||
115 | * |
||
116 | * When the key is not exists in the core $classes it will look in all the folders and subfolders |
||
117 | * is it exists: it will process the name and create an object and add it to the $container |
||
118 | * is it not exists: it will throw an Exception |
||
119 | * |
||
120 | * @property object $file |
||
121 | * @param string $key |
||
122 | * @return mixed |
||
123 | */ |
||
124 | public function get($key) |
||
156 | |||
157 | /** |
||
158 | * Determine if the given key is shared through Application |
||
159 | * |
||
160 | * @param string $key |
||
161 | * @return bool |
||
162 | */ |
||
163 | public function isSharing($key) |
||
167 | |||
168 | /** |
||
169 | * Determine if the given key is an alias to core class |
||
170 | * |
||
171 | * @param string $key |
||
172 | * @return bool |
||
173 | */ |
||
174 | public function isClassAliasIsset($key) |
||
178 | |||
179 | /** |
||
180 | * Create new object for the core class based on the given key |
||
181 | * |
||
182 | * @param string $key |
||
183 | * @return object |
||
184 | */ |
||
185 | public function createObject($key) |
||
191 | |||
192 | /** |
||
193 | * Get shared value dynamically |
||
194 | * |
||
195 | * @param string $key |
||
196 | * @return mixed |
||
197 | */ |
||
198 | public function __get($key) |
||
202 | } |
||
203 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.