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

YamlStandardConfigTotalData   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getYamlStandardConfigsSingleData() 0 3 1
A __construct() 0 3 1
A getTotalCountOfFiles() 0 9 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