Completed
Push — master ( 77bb57...53214f )
by Kamil
02:36
created

ReactTimer::getLoop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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