Completed
Push — 3.0 ( fea5eb...c29f0e )
by Vermeulen
02:17
created

AbstractSystem::isRun()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BFW\Core\AppSystems;
4
5
/**
6
 * Abstract class for Core System.
7
 * Implement SystemInterface and define some methods with the default behavior
8
 */
9
abstract class AbstractSystem implements SystemInterface
10
{
11
    /**
12
     * @var boolean $initStatus To know if the init method has been called
13
     */
14
    protected $initStatus = false;
15
    
16
    /**
17
     * @var boolean $runStatus To know if the run method has been called
18
     */
19
    protected $runStatus = false;
20
    
21
    /**
22
     * PHP Magic method
23
     * Called when the class is called like a function
24
     * 
25
     * @return mixed
26
     */
27
    abstract function __invoke();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
28
    
29
    /**
30
     * {@inheritdoc}
31
     * Should change initStatus to true.
32
     */
33
    public function init()
34
    {
35
        $this->initStatus = true;
36
    }
37
    
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function isInit()
42
    {
43
        return $this->initStatus;
44
    }
45
    
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function toRun()
50
    {
51
        return false;
52
    }
53
    
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function isRun()
58
    {
59
        return $this->runStatus;
60
    }
61
    
62
    /**
63
     * {@inheritdoc}
64
     * Should change runStatus to true.
65
     */
66
    public function run()
67
    {
68
        $this->runStatus = true;
69
    }
70
}
71