Completed
Push — master ( d069a6...fdd0b3 )
by Jakub
01:41
created

ChainTestsSuitesFinder::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 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
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 ChainTestsSuitesFinder implements ITestsSuitesFinder
11
{
12
    /** @var ITestsSuitesFinder[] */
13
    private array $finders;
14
15 1
    public function registerFinder(ITestsSuitesFinder $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