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.
Completed
Push — master ( 5a4e01...d07e87 )
by Marc
8s
created

LaravelLocalizationMiddlewareBase::shouldIgnore()   A

Complexity

Conditions 4
Paths 5

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.2
cc 4
eloc 7
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
        foreach ($this->except as $except) {
24
            if ($except !== '/') {
25
                $except = trim($except, '/');
26
            }
27
28
            if ($request->is($except)) {
29
                return true;
30
            }
31
        }
32
33
        return false;
34
    }
35
}
36