DateLocale::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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