Completed
Push — master ( 0bf44a...86cb0e )
by Biao
04:20 queued 52s
created

AuthCleaner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A clean() 0 12 2
1
<?php
2
3
namespace Hhxsv5\LaravelS\Illuminate\Cleaners;
4
5
6
use Illuminate\Container\Container;
7
use Illuminate\Support\Facades\Facade;
8
9
class AuthCleaner implements CleanerInterface
10
{
11
    public function clean(Container $app)
12
    {
13
        if (!$app->offsetExists('auth')) {
14
            return;
15
        }
16
        $ref = new \ReflectionObject($app['auth']);
17
        $drivers = $ref->getProperty('drivers');
18
        $drivers->setAccessible(true);
19
        $drivers->setValue($app['auth'], []);
20
21
        $app->forgetInstance('auth.driver');
22
        Facade::clearResolvedInstance('auth.driver');
23
    }
24
}