Passed
Push — master ( d67625...fee625 )
by Dispositif
08:37
created

SummaryLogTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 24
rs 10
c 2
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSummaryLog() 0 3 1
A resetSummaryLog() 0 3 1
A addSummaryLog() 0 4 2
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application (@github)
4
 * 2019/2020 © Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the license file.
6
 */
7
8
declare(strict_types=1);
9
10
11
namespace App\Domain;
12
13
/**
14
 * todo Refac to class ?
15
 * Trait SummaryLogTrait
16
 */
17
trait SummaryLogTrait
18
{
19
    protected $summaryLog = [];
20
21
    /**
22
     * @return array
23
     */
24
    public function getSummaryLog(): array
25
    {
26
        return $this->summaryLog;
27
    }
28
29
    public function resetSummaryLog(): void
30
    {
31
        $this->summaryLog = [];
32
    }
33
34
    /**
35
     * @param string $string
36
     */
37
    protected function addSummaryLog(string $string): void
38
    {
39
        if (!empty($string)) {
40
            $this->summaryLog[] = trim($string);
41
        }
42
    }
43
}
44