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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A shouldIgnore() 0 15 4
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