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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

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