ArrayLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLog() 0 3 1
A append() 0 3 1
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