Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
36 | 4 | public function handle($request, Closure $next) |
|
37 | { |
||
38 | 4 | $url = $this->multilang->getRedirectUrl($request); |
|
39 | 4 | if ($url !== null) { |
|
40 | 3 | return $this->redirector->to($url); |
|
41 | } |
||
42 | |||
43 | 1 | $this->app->setLocale($this->multilang->getLocale()); |
|
44 | |||
45 | 1 | return $next($request); |
|
46 | } |
||
47 | } |
||
48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: