ResetSession   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace SwooleTW\Http\Server\Resetters;
4
5
use Illuminate\Contracts\Container\Container;
6
use SwooleTW\Http\Server\Sandbox;
7
8
class ResetSession implements ResetterContract
9
{
10
    /**
11
     * "handle" function for resetting app.
12
     *
13
     * @param \Illuminate\Contracts\Container\Container $app
14
     * @param \SwooleTW\Http\Server\Sandbox $sandbox
15
     *
16
     * @return \Illuminate\Contracts\Container\Container
17
     */
18
    public function handle(Container $app, Sandbox $sandbox)
19
    {
20
        if (isset($app['session'])) {
21
            $session = $app->make('session');
22
            $session->flush();
23
            $session->regenerate();
24
        }
25
26
        return $app;
27
    }
28
}
29