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