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

SummaryLogTrait::resetSummaryLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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