Recorder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A record() 0 6 1
A glows() 0 4 1
A reset() 0 4 1
1
<?php
2
3
namespace Facade\FlareClient\Glows;
4
5
class Recorder
6
{
7
    const GLOW_LIMIT = 30;
8
9
    private $glows = [];
10
11
    public function record(Glow $glow)
12
    {
13
        $this->glows[] = $glow;
14
15
        $this->glows = array_slice($this->glows, static::GLOW_LIMIT * -1, static::GLOW_LIMIT);
16
    }
17
18
    public function glows(): array
19
    {
20
        return $this->glows;
21
    }
22
23
    public function reset()
24
    {
25
        $this->glows = [];
26
    }
27
}
28