InMemoryRecorder   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 27
ccs 0
cts 17
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A release() 0 8 1
A clear() 0 4 1
A record() 0 8 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
        if (! $events) {
24
            return;
25
        }
26
27
        $this->events = array_merge($this->events, $events);
28
    }
29
}
30