Total Complexity | 5 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | final class LoopCreatorClassExtractor implements ILoopCreatorClassExtractor |
||
14 | { |
||
15 | public function extract(Traversable $probes): ?string |
||
16 | { |
||
17 | /** @var IStaticProbe $probe */ |
||
18 | foreach ($probes as $probe) { |
||
19 | self::assertProbe($probe); |
||
20 | if ($probe::isSupported()) { |
||
21 | return $probe::getCreatorClass(); |
||
22 | } |
||
23 | } |
||
24 | return null; |
||
25 | } |
||
26 | |||
27 | private static function assertProbe(mixed $probe): void |
||
34 | ) |
||
35 | ); |
||
39 |