1 | <?php |
||
32 | class Jarvis extends Container implements BroadcasterInterface |
||
33 | { |
||
34 | use BroadcasterTrait { |
||
35 | broadcast as traitBroadcast; |
||
36 | } |
||
37 | |||
38 | const DEFAULT_DEBUG = false; |
||
39 | const CONTAINER_PROVIDER_FQCN = ContainerProvider::class; |
||
40 | |||
41 | private $masterSetter = false; |
||
42 | |||
43 | /** |
||
44 | * Creates an instance of Jarvis. It can take settings as first argument. |
||
45 | * List of accepted options: |
||
46 | * - providers (type: string|array): fqcn of your container provider |
||
47 | * - extra |
||
48 | * |
||
49 | * @param array $settings Your own settings to modify Jarvis behavior |
||
50 | */ |
||
51 | public function __construct(array $settings = []) |
||
61 | |||
62 | public function __destruct() |
||
66 | |||
67 | /** |
||
68 | * This method is an another way to get a locked value. |
||
69 | * |
||
70 | * Example: $this['foo'] is equal to $this->foo, but it ONLY works for locked values. |
||
71 | * |
||
72 | * @param string $key The key of the locked value |
||
73 | * @return mixed |
||
74 | * @throws \InvalidArgumentException if the requested key is not associated to a locked service |
||
75 | */ |
||
76 | public function __get(string $key) |
||
86 | |||
87 | /** |
||
88 | * Sets new attributes to Jarvis. Note that this method is reserved to Jarvis itself only. |
||
89 | * |
||
90 | * @param string $key The key name of the new attribute |
||
91 | * @param mixed $value The value to associate to provided key |
||
92 | * @throws \LogicException if this method is not called by Jarvis itself |
||
93 | */ |
||
94 | public function __set(string $key, $value) |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function offsetSet($id, $v): void |
||
133 | |||
134 | /** |
||
135 | * @param Request|null $request |
||
136 | * @return Response |
||
137 | */ |
||
138 | public function run(Request $request = null): Response |
||
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | public function broadcast(string $name, EventInterface $event = null): void |
||
178 | |||
179 | /** |
||
180 | * Sets new attribute into Jarvis. |
||
181 | * |
||
182 | * @param string $key The name of the new attribute |
||
183 | * @param mixed $value The value of the new attribute |
||
184 | */ |
||
185 | private function masterSet(string $key, $value): void |
||
191 | |||
192 | /** |
||
193 | * Enables master emitter mode. |
||
194 | */ |
||
195 | private function masterBroadcast(string $name, EventInterface $event = null): void |
||
201 | } |
||
202 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.