Completed
Push — master ( 7a7d3a...83c752 )
by Jakub
01:47
created

ChainTestSuitesFinder::getSuites()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace MyTester;
5
6
/**
7
 * @author Jakub Konečný
8
 * @internal
9
 */
10
final class ChainTestSuitesFinder implements ITestSuitesFinder
11
{
12
    /** @var ITestSuitesFinder[] */
13
    private array $finders;
14
15 1
    public function registerFinder(ITestSuitesFinder $finder): void
16
    {
17 1
        $this->finders[] = $finder;
18 1
    }
19
20 1
    public function getSuites(string $folder): array
21
    {
22 1
        $suites = [];
23 1
        foreach ($this->finders as $finder) {
24 1
            $suites = array_unique(array_merge($suites, $finder->getSuites($folder)));
25
        }
26 1
        return $suites;
27
    }
28
}
29