1 | <?php namespace Arcanesoft\Blog\Providers; |
||
13 | class RouteServiceProvider extends ServiceProvider |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Define the routes for the application. |
||
21 | * |
||
22 | * @param \Illuminate\Contracts\Routing\Registrar $router |
||
23 | */ |
||
24 | 6 | public function map(Router $router) |
|
29 | |||
30 | /** |
||
31 | * Define the public routes for the application. |
||
32 | * |
||
33 | * @param \Illuminate\Contracts\Routing\Registrar $router |
||
34 | */ |
||
35 | 6 | private function mapPublicRoutes(Router $router) |
|
39 | |||
40 | /** |
||
41 | * Define the foundation routes for the application. |
||
42 | * |
||
43 | * @param \Illuminate\Contracts\Routing\Registrar $router |
||
44 | */ |
||
45 | 6 | private function mapAdminRoutes(Router $router) |
|
61 | } |
||
62 |
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: