Passed
Pull Request — master (#118)
by Alexander
04:27 queued 02:08
created

WebViewCollector::getCollected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector;
6
7
use Yiisoft\View\Event\WebView\AfterRender;
8
9
final class WebViewCollector implements CollectorInterface
10
{
11
    use CollectorTrait;
12
13
    private array $view = [];
14
15 1
    public function getCollected(): array
16
    {
17 1
        return $this->view;
18
    }
19
20 1
    public function collect(AfterRender $event): void
21
    {
22 1
        if (!$this->isActive()) {
23
            return;
24
        }
25
26 1
        $this->view[] = [
27 1
            'output' => $event->getResult(),
28 1
            'file' => $event->getFile(),
29 1
            'parameters' => $event->getParameters(),
30
        ];
31
    }
32
33 1
    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...
34
    {
35 1
        $this->view = [];
36
    }
37
}
38