Completed
Push — master ( 66971a...13a85d )
by Andrew
02:16
created

InMemoryRecorder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 23
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A release() 0 8 1
A clear() 0 4 1
A record() 0 4 1
1
<?php namespace Cairns\Radiate\Recorder;
2
3
final class InMemoryRecorder implements Recorder
4
{
5
    private $events = [];
6
7
    public function release()
8
    {
9
        $events = $this->events;
10
11
        $this->clear();
12
13
        return $events;
14
    }
15
16
    public function clear()
17
    {
18
        $this->events = [];
19
    }
20
21
    public function record($events)
22
    {
23
        $this->events[] = array_merge($this->events, $events);
24
    }
25
}
26