Issues (1019)

src/Illuminate/Cleaners/SessionCleaner.php (11 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace Hhxsv5\LaravelS\Illuminate\Cleaners;
4
5
6
use Illuminate\Container\Container;
0 ignored issues
show
The type Illuminate\Container\Container was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Illuminate\Routing\Redirector;
0 ignored issues
show
The type Illuminate\Routing\Redirector was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Illuminate\Support\Facades\Facade;
0 ignored issues
show
The type Illuminate\Support\Facades\Facade was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class SessionCleaner extends BaseCleaner
0 ignored issues
show
Missing doc comment for class SessionCleaner
Loading history...
11
{
12
    private $drivers;
0 ignored issues
show
Private member variable "drivers" must be prefixed with an underscore
Loading history...
13
14
    public function __construct(Container $currentApp, Container $snapshotApp)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
15
    {
16
        parent::__construct($currentApp, $snapshotApp);
17
18
        if (!isset($this->currentApp['session'])) {
19
            return;
20
        }
21
        $ref = new \ReflectionObject($this->currentApp['session']);
22
        $this->drivers = $ref->getProperty('drivers');
23
        $this->drivers->setAccessible(true);
24
25
    }
26
27
    public function clean()
0 ignored issues
show
Missing doc comment for function clean()
Loading history...
28
    {
29
        if (!isset($this->currentApp['session'])) {
30
            return;
31
        }
32
33
        $this->drivers->setValue($this->currentApp['session'], []);
34
        $this->currentApp->forgetInstance('session.store');
35
        Facade::clearResolvedInstance('session.store');
36
37
        if (isset($this->currentApp['redirect'])) {
38
            /**@var Redirector $redirect */
0 ignored issues
show
The open comment tag must be the only content on the line
Loading history...
Missing short description in doc comment
Loading history...
The close comment tag must be the only content on the line
Loading history...
39
            $redirect = $this->currentApp['redirect'];
40
            $redirect->setSession($this->currentApp->make('session.store'));
41
        }
42
    }
43
}