Conditions | 6 |
Paths | 10 |
Total Lines | 27 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 6.0131 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 5 | public function getInterfaces(string|null $target = null): array |
|
17 | { |
||
18 | 5 | if (!empty($target)) { |
|
19 | 2 | $target = new \ReflectionClass($target); |
|
20 | } |
||
21 | |||
22 | 5 | $result = []; |
|
23 | 5 | foreach ($this->availableInterfaces() as $interface) { |
|
24 | try { |
||
25 | 5 | $reflection = $this->classReflection($interface); |
|
26 | 4 | } catch (LocatorException $e) { |
|
27 | 4 | if ($this->debug) { |
|
28 | throw $e; |
||
29 | } |
||
30 | |||
31 | //Ignoring |
||
32 | 4 | continue; |
|
33 | } |
||
34 | |||
35 | 5 | if (!$this->isTargeted($reflection, $target)) { |
|
36 | 2 | continue; |
|
37 | } |
||
38 | |||
39 | 5 | $result[$reflection->getName()] = $reflection; |
|
40 | } |
||
41 | |||
42 | 5 | return $result; |
|
43 | } |
||
75 |