Startable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A start() 0 3 1
A isNotStarted() 0 3 1
A isStarted() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Traits;
4
5
trait Startable
6
{
7
    /** @var bool */
8
    protected $started = false;
9
10
    /**
11
     * @return bool
12
     */
13 2
    public function isStarted(): bool
14
    {
15 2
        return $this->started;
16
    }
17
18
    /**
19
     * @return bool
20
     */
21 2
    public function isNotStarted(): bool
22
    {
23 2
        return !$this->started;
24
    }
25
26 2
    public function start(): void
27
    {
28 2
        $this->started = true;
29 2
    }
30
}
31