ArrayLogger::append()   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 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Smoren\EventRouter\Loggers;
4
5
use Smoren\EventRouter\Interfaces\EventInterface;
6
use Smoren\EventRouter\Interfaces\LoggerInterface;
7
8
/**
9
 * ArrayLogger class
10
 */
11
class ArrayLogger implements LoggerInterface
12
{
13
    /**
14
     * @var EventInterface[] events log
15
     */
16
    protected array $log = [];
17
18
    /**
19
     * {@inheritDoc}
20
     */
21 10
    public function append(EventInterface $event): void
22
    {
23 10
        $this->log[] = $event;
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29 2
    public function getLog(): array
30
    {
31 2
        return $this->log;
32
    }
33
}
34