EventsCounter   A
last analyzed

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