FlowController   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 49
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __destruct() 0 4 1
A isRunning() 0 4 1
A start() 0 4 1
A stop() 0 4 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