1 | <?php namespace Arcanesoft\Auth\Providers; |
||
15 | class PackagesServiceProvider extends ServiceProvider |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Main Functions |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * Register the service provider. |
||
23 | */ |
||
24 | 12 | public function register() |
|
25 | { |
||
26 | 12 | $this->registerGravatarPackage(); |
|
27 | 12 | $this->registerLaravelAuthPackage(); |
|
28 | 12 | } |
|
29 | |||
30 | /* ------------------------------------------------------------------------------------------------ |
||
31 | | Register Packages |
||
32 | | ------------------------------------------------------------------------------------------------ |
||
33 | */ |
||
34 | /** |
||
35 | * Register the gravatar package. |
||
36 | */ |
||
37 | 12 | private function registerGravatarPackage() |
|
41 | |||
42 | /** |
||
43 | * Register the laravel auth package. |
||
44 | */ |
||
45 | 12 | private function registerLaravelAuthPackage() |
|
53 | |||
54 | /* ------------------------------------------------------------------------------------------------ |
||
55 | | Config Packages |
||
56 | | ------------------------------------------------------------------------------------------------ |
||
57 | */ |
||
58 | /** |
||
59 | * Config the laravel auth package (override). |
||
60 | */ |
||
61 | 12 | private function configLaravelAuthPackage() |
|
71 | |||
72 | /** |
||
73 | * Rebind the auth models. |
||
74 | */ |
||
75 | 12 | private function rebindModels() |
|
98 | |||
99 | /** |
||
100 | * Register the package dependencies. |
||
101 | */ |
||
102 | 12 | private function registerDependencies() |
|
106 | |||
107 | /* ------------------------------------------------------------------------------------------------ |
||
108 | | Other Functions |
||
109 | | ------------------------------------------------------------------------------------------------ |
||
110 | */ |
||
111 | /** |
||
112 | * Get the config repository instance. |
||
113 | * |
||
114 | * @return \Illuminate\Contracts\Config\Repository |
||
115 | */ |
||
116 | 12 | protected function config() |
|
120 | } |
||
121 |
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: