EventsCounter::getEventsArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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