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

ChainTestsSuitesFinder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerFinder() 0 3 1
A getSuites() 0 7 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