GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LaravelLocalizationMiddlewareBase::shouldIgnore()   A
last analyzed

Complexity

Conditions 4
Paths 5

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 4
nc 5
nop 1
1
<?php
2
3
namespace Mcamara\LaravelLocalization\Middleware;
4
5
6
class LaravelLocalizationMiddlewareBase
7
{
8
    /**
9
     * The URIs that should not be localized.
10
     *
11
     * @var array
12
     */
13
    protected $except;
14
15
    /**
16
     * Determine if the request has a URI that should not be localized.
17
     *
18
     * @param  \Illuminate\Http\Request  $request
19
     * @return bool
20
     */
21
    protected function shouldIgnore($request)
22
    {
23
        $this->except = $this->except ?? config('laravellocalization.urlsIgnored', []);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->except ?? config(....urlsIgnored', array()) of type * is incompatible with the declared type array of property $except.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
        foreach ($this->except as $except) {
25
            if ($except !== '/') {
26
                $except = trim($except, '/');
27
            }
28
29
            if ($request->is($except)) {
30
                return true;
31
            }
32
        }
33
34
        return false;
35
    }
36
}
37