DateLocale   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Jenssegers\Date\Date;
7
8
class DateLocale
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @return mixed
16
     */
17 58
    public function handle($request, Closure $next)
18
    {
19 58
        Date::setLocale(app()->getLocale());
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

19
        Date::setLocale(/** @scrutinizer ignore-call */ app()->getLocale());
Loading history...
20
        
21 58
        return $next($request);
22
    }
23
}
24