Passed
Push — master ( ba4e4b...37ef79 )
by Alexander
02:56
created

CollectorTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 22
ccs 9
cts 11
cp 0.8182
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A startup() 0 3 1
A shutdown() 0 4 1
A isActive() 0 3 1
A reset() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector;
6
7
trait CollectorTrait
8
{
9
    private bool $isActive = false;
10
11 5
    public function startup(): void
12
    {
13 5
        $this->isActive = true;
14 5
    }
15
16 5
    public function shutdown(): void
17
    {
18 5
        $this->reset();
19 5
        $this->isActive = false;
20 5
    }
21
22
    private function reset(): void
23
    {
24
    }
25
26 5
    private function isActive(): bool
27
    {
28 5
        return $this->isActive;
29
    }
30
}
31