ChiefAdminLocale   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php
2
3
namespace Thinktomorrow\Chief\App\Http\Middleware;
4
5
use Closure;
6
7
class ChiefAdminLocale
8
{
9
    public function handle($request, Closure $next)
10
    {
11
        if ($adminLocale = config('chief.admin_locale')) {
12
            app()->setLocale($adminLocale);
0 ignored issues
show
introduced by
The method setLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
            app()->/** @scrutinizer ignore-call */ setLocale($adminLocale);
Loading history...
13
        }
14
15
        return $next($request);
16
    }
17
}
18