Passed
Push — master ( 33d5ac...775805 )
by Dmitriy
03:03
created

AssetCollector::reset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector\Web;
6
7
use Yiisoft\Assets\AssetBundle;
8
use Yiisoft\Yii\Debug\Collector\CollectorInterface;
9
use Yiisoft\Yii\Debug\Collector\CollectorTrait;
10
use Yiisoft\Yii\Debug\Collector\IndexCollectorInterface;
11
12
final class AssetCollector implements CollectorInterface, IndexCollectorInterface
13
{
14
    use CollectorTrait;
15
16
    private array $assetBundles = [];
17
18
    public function getCollected(): array
19
    {
20
        return $this->assetBundles;
21
    }
22
23
    public function collect(AssetBundle $assetBundle): void
24
    {
25
        if (!$this->isActive()) {
26
            return;
27
        }
28
29
        $this->assetBundles[] = $assetBundle;
30
    }
31
32
    public function getIndexData(): array
33
    {
34
        return [
35
            'asset' => [
36
                'bundles' => [
37
                    'total' => count($this->assetBundles),
38
                ],
39
            ],
40
        ];
41
    }
42
43
    private function reset(): void
0 ignored issues
show
Unused Code introduced by
The method reset() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
44
    {
45
        $this->assetBundles = [];
46
    }
47
}
48