Passed
Push — master ( a4ffc4...615af5 )
by Alexander
03:23
created

CollectorTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A startup() 0 3 1
A shutdown() 0 4 1
A isActive() 0 3 1
A getName() 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 11
    public function startup(): void
12
    {
13 11
        $this->isActive = true;
14
    }
15
16 9
    public function shutdown(): void
17
    {
18 9
        $this->reset();
19 9
        $this->isActive = false;
20
    }
21
22 9
    public function getName(): string
23
    {
24 9
        return str_replace('\\', '', self::class);
25
    }
26
27
    private function reset(): void
28
    {
29
    }
30
31 16
    private function isActive(): bool
32
    {
33 16
        return $this->isActive;
34
    }
35
}
36