Completed
Push — master ( 714c30...9cdd17 )
by Maxime
04:22
created

OpCache::handle()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 5
nc 3
nop 2
1
<?php
2
3
namespace Distilleries\Expendable\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Contracts\Foundation\Application;
7
8
class OpCache
9
{
10
    protected $app;
11
12
    public function __construct(Application $app)
13
    {
14
        $this->app = $app;
15
    }
16
17
    /**
18
     * Handle an incoming request.
19
     *
20
     * @param  \Illuminate\Http\Request $request
21
     * @param  \Closure $next
22
     * @return mixed
23
     */
24
    public function handle($request, Closure $next)
25
    {
26
27
        if (($this->app->environment() != 'production')) {
28
            if (function_exists('opcache_reset')) {
29
                opcache_reset();
30
            }
31
32
        }
33
34
        return $next($request);
35
    }
36
}