Conditions | 7 |
Paths | 6 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function getIterator(): iterable |
||
39 | { |
||
40 | foreach ($this->getBoundIterator() as $className => $reflectedClass) { |
||
41 | try { |
||
42 | if ($reflectedClass->implementsInterface($this->typename)) { |
||
43 | yield $className => $reflectedClass; |
||
44 | } |
||
45 | } catch (\ReflectionException $e) { |
||
46 | try { |
||
47 | if ( |
||
48 | $reflectedClass->isSubclassOf($this->typename) |
||
49 | || $reflectedClass->getName() == $this->typename |
||
50 | ) { |
||
51 | yield $className => $reflectedClass; |
||
52 | } |
||
53 | } catch (\ReflectionException $e) { |
||
54 | // Nope |
||
55 | } |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |