CookieCleaner   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 11
c 1
b 1
f 0
dl 0
loc 21
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A clean() 0 6 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Hhxsv5\LaravelS\Illuminate\Cleaners;
4
5
use Illuminate\Container\Container;
0 ignored issues
show
Bug introduced by
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...
6
7
class CookieCleaner extends BaseCleaner
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class CookieCleaner
Loading history...
8
{
9
    private $queued;
0 ignored issues
show
Coding Style introduced by
Private member variable "queued" must be prefixed with an underscore
Loading history...
10
11
    public function __construct(Container $currentApp, Container $snapshotApp)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
12
    {
13
        parent::__construct($currentApp, $snapshotApp);
14
        if (!isset($this->currentApp['cookie'])) {
15
            return;
16
        }
17
        $ref = new \ReflectionObject($this->currentApp['cookie']);
18
        $this->queued = $ref->getProperty('queued');
19
        $this->queued->setAccessible(true);
20
    }
21
22
    public function clean()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function clean()
Loading history...
23
    {
24
        if (!isset($this->currentApp['cookie'])) {
25
            return;
26
        }
27
        $this->queued->setValue($this->currentApp['cookie'], []);
28
    }
29
}