| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | private function setupPaths(Container $app): void |
||
| 18 | { |
||
| 19 | $app['app.dir'] = dirname(__DIR__, 2); |
||
| 20 | $app['app.template_dir'] = $app['app.dir'] . '/templates'; |
||
| 21 | $app['app.config_dir'] = $app['app.dir'] . '/config'; |
||
| 22 | $app['app.cache_dir'] = static function ($app) { |
||
| 23 | return $app['config']['cache'] ?? $app['app.dir'] . '/cache'; |
||
| 24 | }; |
||
| 25 | } |
||
| 26 | |||
| 45 |
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: