Completed
Push — master ( 53214f...7b5764 )
by Kamil
03:10
created

ReactTimer::isPeriodic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
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\Bridge\React;
4
5
use Dazzle\Loop\Timer\TimerInterface;
6
7
class ReactTimer implements ReactTimerInterface
8
{
9
    /**
10
     * @var TimerInterface
11
     */
12
    protected $timer;
13
14
    /**
15
     * @param TimerInterface $timer
16
     */
17 15
    public function __construct(TimerInterface $timer)
18
    {
19 15
        $this->timer = $timer;
20 15
    }
21
22
    /**
23
     *
24
     */
25 15
    public function __destruct()
26
    {
27 15
        unset($this->timer);
28 15
    }
29
30
    /**
31
     * @override
32
     * @inheritDoc
33
     */
34 1
    public function getActualTimer()
35
    {
36 1
        return $this->timer;
37
    }
38
39
    /**
40
     * @override
41
     * @inheritDoc
42
     */
43 1
    public function getLoop()
44
    {
45 1
        return new ReactLoop($this->timer->getLoop());
46
    }
47
48
    /**
49
     * @override
50
     * @inheritDoc
51
     */
52 1
    public function getInterval()
53
    {
54 1
        return $this->timer->getInterval();
55
    }
56
57
    /**
58
     * @override
59
     * @inheritDoc
60
     */
61 1
    public function getCallback()
62
    {
63 1
        return $this->timer->getCallback();
64
    }
65
66
    /**
67
     * @override
68
     * @inheritDoc
69
     */
70 1
    public function setData($data)
71
    {
72 1
        return $this->timer->setData($data);
73
    }
74
75
    /**
76
     * @override
77
     * @inheritDoc
78
     */
79 1
    public function getData()
80
    {
81 1
        return $this->timer->getData();
82
    }
83
84
    /**
85
     * @override
86
     * @inheritDoc
87
     */
88 2
    public function isPeriodic()
89
    {
90 2
        return $this->timer->isPeriodic();
91
    }
92
93
    /**
94
     * @override
95
     * @inheritDoc
96
     */
97 2
    public function isActive()
98
    {
99 2
        return $this->timer->isActive();
100
    }
101
102
    /**
103
     * @override
104
     * @inheritDoc
105
     */
106 1
    public function cancel()
107
    {
108 1
        $this->timer->cancel();
109 1
    }
110
}
111