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 | * Account Instances. |
||
80 | * |
||
81 | * @var array |
||
82 | */ |
||
83 | protected $accounts = []; |
||
84 | |||
85 | /** |
||
86 | * Application constructor. |
||
87 | * |
||
88 | * @param array $config |
||
89 | */ |
||
90 | public function __construct($config) |
||
110 | |||
111 | /** |
||
112 | * Load account. |
||
113 | * |
||
114 | * @param string $account |
||
115 | * |
||
116 | * @throws InvalidConfigException |
||
117 | * |
||
118 | * @return Application |
||
119 | */ |
||
120 | public function account($account) |
||
134 | |||
135 | /** |
||
136 | * Log configuration. |
||
137 | * |
||
138 | * @param array $config |
||
139 | */ |
||
140 | public function logConfiguration($config) |
||
155 | |||
156 | /** |
||
157 | * Add a provider. |
||
158 | * |
||
159 | * @param string $provider |
||
160 | * |
||
161 | * @return Application |
||
162 | */ |
||
163 | public function addProvider($provider) |
||
169 | |||
170 | /** |
||
171 | * Set providers. |
||
172 | * |
||
173 | * @param array $providers |
||
174 | */ |
||
175 | public function setProviders(array $providers) |
||
183 | |||
184 | /** |
||
185 | * Return all providers. |
||
186 | * |
||
187 | * @return array |
||
188 | */ |
||
189 | public function getProviders() |
||
193 | |||
194 | /** |
||
195 | * Magic get access. |
||
196 | * |
||
197 | * @param string $id |
||
198 | * |
||
199 | * @return mixed |
||
200 | */ |
||
201 | public function __get($id) |
||
205 | |||
206 | /** |
||
207 | * Magic set access. |
||
208 | * |
||
209 | * @param string $id |
||
210 | * @param mixed $value |
||
211 | */ |
||
212 | public function __set($id, $value) |
||
216 | |||
217 | /** |
||
218 | * Register providers. |
||
219 | */ |
||
220 | private function registerProviders() |
||
226 | |||
227 | /** |
||
228 | * Register basic providers. |
||
229 | */ |
||
230 | private function registerBase() |
||
252 | |||
253 | /** |
||
254 | * Initialize logger. |
||
255 | */ |
||
256 | private function initializeLogger() |
||
279 | } |
||
280 |
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: