Test Failed
Pull Request — master (#74)
by Peter
12:33 queued 05:48
created

getTotalCountOfFiles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 9
rs 10
ccs 5
cts 5
cp 1
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace YamlStandards\Model\Config;
6
7
class YamlStandardConfigTotalData
8
{
9
    /**
10
     * @var \YamlStandards\Model\Config\YamlStandardConfigSingleData[]
11
     */
12
    private $yamlStandardConfigsSingleData;
13
14
    /**
15
     * @param \YamlStandards\Model\Config\YamlStandardConfigSingleData[] $yamlStandardConfigsSingleData
16
     */
17 9
    public function __construct(array $yamlStandardConfigsSingleData)
18
    {
19 9
        $this->yamlStandardConfigsSingleData = $yamlStandardConfigsSingleData;
20
    }
21
22
    /**
23
     * @return \YamlStandards\Model\Config\YamlStandardConfigSingleData[]
24
     */
25 9
    public function getYamlStandardConfigsSingleData(): array
26
    {
27 9
        return $this->yamlStandardConfigsSingleData;
28
    }
29
30
    /**
31
     * @return int
32
     */
33 9
    public function getTotalCountOfFiles(): int
34
    {
35 9
        $totalFiles = 0;
36
37 9
        foreach ($this->getYamlStandardConfigsSingleData() as $yamlStandardConfigSingleData) {
38 9
            $totalFiles += count($yamlStandardConfigSingleData->getPathToFiles());
39
        }
40
41 9
        return $totalFiles;
42
    }
43
}
44