TimerEvents   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A asCsv() 0 7 2
A append() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace IntegerNet\DeployerTimer;
5
6
class TimerEvents
7
{
8
    /**
9
     * @var TimerEvent[]
10
     */
11
    private $items = [];
12
13 9
    public function append(TimerEvent $event)
14
    {
15 9
        $this->items[] = $event;
16 9
    }
17
18 9
    public function asCsv(): string
19
    {
20 9
        $lines = [];
21 9
        foreach ($this->items as $item) {
22 9
            $lines[] = $item->asCsvLine();
23
        }
24 9
        return implode("\n", $lines);
25
    }
26
}
27