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

InMemoryRecorder::record()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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