Passed
Push — master ( cf37f2...bd53e8 )
by Alexander
02:23
created

CollectorTrait::getName()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 11
    }
15
16 9
    public function shutdown(): void
17
    {
18 9
        $this->reset();
19 9
        $this->isActive = false;
20 9
    }
21
22 9
    public function getName(): string
23
    {
24 9
        return str_replace('\\', '', self::class);
25
    }
26
27 1
    private function reset(): void
28
    {
29 1
    }
30
31 16
    private function isActive(): bool
32
    {
33 16
        return $this->isActive;
34
    }
35
}
36