FlowController::start()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Dazzle\Loop\Flow;
4
5
class FlowController
6
{
7
    /**
8
     * @var bool
9
     */
10
    public $isRunning;
11
12
    /**
13
     *
14
     */
15 64
    public function __construct()
16
    {
17 64
        $this->isRunning = false;
18 64
    }
19
20
    /**
21
     *
22
     */
23 14
    public function __destruct()
24
    {
25 14
        unset($this->isRunning);
26 14
    }
27
28
    /**
29
     * Check if FlowController allows loop to run.
30
     *
31
     * @return bool
32
     */
33 5
    public function isRunning()
34
    {
35 5
        return $this->isRunning;
36
    }
37
38
    /**
39
     * Set FlowController to allow loop to run.
40
     */
41 2
    public function start()
42
    {
43 2
        $this->isRunning = true;
44 2
    }
45
46
    /**
47
     * Set FlowController to not allow loop to run.
48
     */
49 1
    public function stop()
50
    {
51 1
        $this->isRunning = false;
52 1
    }
53
}
54