1 | <?php |
||
51 | class Application extends Container |
||
52 | { |
||
53 | /** |
||
54 | * Service Providers. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $providers = [ |
||
59 | ServiceProviders\ServerServiceProvider::class, |
||
60 | ServiceProviders\UserServiceProvider::class, |
||
61 | ServiceProviders\JsServiceProvider::class, |
||
62 | ServiceProviders\MenuServiceProvider::class, |
||
63 | ServiceProviders\BroadcastServiceProvider::class, |
||
64 | ServiceProviders\CardServiceProvider::class, |
||
65 | ServiceProviders\MaterialServiceProvider::class, |
||
66 | ServiceProviders\AgentServiceProvider::class, |
||
67 | ServiceProviders\ChatServiceProvider::class, |
||
68 | ServiceProviders\SoterServiceProvider::class, |
||
69 | ServiceProviders\OAuthServiceProvider::class, |
||
70 | ServiceProviders\PaymentServiceProvider::class, |
||
71 | ServiceProviders\ShakeAroundServiceProvider::class, |
||
72 | ServiceProviders\StaffServiceProvider::class, |
||
73 | ServiceProviders\SuiteServiceProvider::class, |
||
74 | ServiceProviders\FundamentalServiceProvider::class, |
||
75 | ServiceProviders\OAServiceProvider::class, |
||
76 | ]; |
||
77 | |||
78 | /** |
||
79 | * Application constructor. |
||
80 | * |
||
81 | * @param array $config |
||
82 | */ |
||
83 | public function __construct($config) |
||
103 | |||
104 | /** |
||
105 | * Load account. |
||
106 | * |
||
107 | * @param string $account |
||
108 | * |
||
109 | * @throws InvalidConfigException |
||
110 | * |
||
111 | * @return Application |
||
112 | */ |
||
113 | public function account($account) |
||
123 | |||
124 | /** |
||
125 | * Log configuration. |
||
126 | * |
||
127 | * @param array $config |
||
128 | */ |
||
129 | public function logConfiguration($config) |
||
144 | |||
145 | /** |
||
146 | * Add a provider. |
||
147 | * |
||
148 | * @param string $provider |
||
149 | * |
||
150 | * @return Application |
||
151 | */ |
||
152 | public function addProvider($provider) |
||
158 | |||
159 | /** |
||
160 | * Set providers. |
||
161 | * |
||
162 | * @param array $providers |
||
163 | */ |
||
164 | public function setProviders(array $providers) |
||
172 | |||
173 | /** |
||
174 | * Return all providers. |
||
175 | * |
||
176 | * @return array |
||
177 | */ |
||
178 | public function getProviders() |
||
182 | |||
183 | /** |
||
184 | * Magic get access. |
||
185 | * |
||
186 | * @param string $id |
||
187 | * |
||
188 | * @return mixed |
||
189 | */ |
||
190 | public function __get($id) |
||
194 | |||
195 | /** |
||
196 | * Magic set access. |
||
197 | * |
||
198 | * @param string $id |
||
199 | * @param mixed $value |
||
200 | */ |
||
201 | public function __set($id, $value) |
||
205 | |||
206 | /** |
||
207 | * Register providers. |
||
208 | */ |
||
209 | private function registerProviders() |
||
215 | |||
216 | /** |
||
217 | * Register basic providers. |
||
218 | */ |
||
219 | private function registerBase() |
||
241 | |||
242 | /** |
||
243 | * Initialize logger. |
||
244 | */ |
||
245 | private function initializeLogger() |
||
268 | } |
||
269 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: