ArrayHandler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 31
ccs 8
cts 10
cp 0.8
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRecords() 0 4 1
A getFormattedMessages() 0 6 2
A write() 0 4 1
1
<?php
2
3
namespace Oqq\Minc\Log\Handler;
4
5
use Oqq\Minc\Log\Record;
6
7
/**
8
 * @author Eric Braun <[email protected]>
9
 */
10
class ArrayHandler extends AbstractHandler
11
{
12
    /** @var Record[] */
13
    protected $records = [];
14
15
    /**
16
     * @return Record[]
17
     */
18
    public function getRecords()
19
    {
20
        return $this->records;
21
    }
22
23
    /**
24
     * @return \Generator
25
     */
26 9
    public function getFormattedMessages()
27
    {
28 9
        foreach ($this->records as $record) {
29 9
            yield $this->getFormattedMessage($record);
30 9
        }
31 9
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36 12
    protected function write(Record $record)
37
    {
38 12
        $this->records[] = $record;
39 12
    }
40
}
41