Passed
Push — master ( 25257e...5200e3 )
by Alec
04:00
created

EventsCounter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEventsArray() 0 3 1
A getEvents() 0 3 1
A getRawEventsData() 0 3 1
A addEvent() 0 3 1
1
<?php
2
/**
3
 * User: alec
4
 * Date: 19.11.18
5
 * Time: 17:17
6
 */
7
8
namespace AlecRabbit\Counters;
9
10
class EventsCounter extends TimedCounter
11
{
12
    /**
13
     * Alias to add() method
14
     * @param int|null $time
15
     */
16 1
    public function addEvent(?int $time = null): void
17
    {
18 1
        $this->add($time);
19 1
    }
20
21
    /**
22
     * @return array
23
     */
24 1
    public function getRawEventsData(): array
25
    {
26 1
        return $this->getRawData();
27
    }
28
29
    /**
30
     * @param bool|null $reset
31
     * @return array
32
     */
33 1
    public function getEventsArray(?bool $reset = null): array
34
    {
35 1
        return $this->getDataArray($reset);
36
    }
37
38
    /**
39
     * @param bool|null $reset
40
     * @return object
41
     */
42 1
    public function getEvents(?bool $reset = null): object
43
    {
44 1
        return $this->getDataObject($reset);
45
    }
46
}
47