| 1 | <?php |
||
| 6 | class GoogleStructuredDataTestToolServiceProvider extends ServiceProvider |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Indicates if loading of the provider is deferred. |
||
| 10 | * |
||
| 11 | * @var bool |
||
| 12 | */ |
||
| 13 | protected $defer = true; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Bootstrap the application events. |
||
| 17 | * |
||
| 18 | * @return void |
||
| 19 | */ |
||
| 20 | public function boot() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Register the service provider. |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | public function register() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get the services provided by the provider. |
||
| 52 | * |
||
| 53 | * @return string[] |
||
| 54 | */ |
||
| 55 | public function provides() |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param $app |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public function dummy($app) |
||
| 71 | } |
||
| 72 |
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: