| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 2 | public function getAllClassNames(): array |
|
| 44 | { |
||
| 45 | 2 | $classes = []; |
|
| 46 | 2 | foreach ($this->drivers as $driver) { |
|
| 47 | 2 | if (!$driver instanceof AdvancedDriverInterface) { |
|
| 48 | 1 | throw new \RuntimeException( |
|
| 49 | 1 | sprintf( |
|
| 50 | 'Driver "%s" must be an instance of "AdvancedDriverInterface" to use ' . |
||
| 51 | 1 | '"DriverChain::getAllClassNames()".', |
|
| 52 | 1 | get_class($driver) |
|
| 53 | ) |
||
| 54 | ); |
||
| 55 | } |
||
| 56 | |||
| 57 | 1 | $driverClasses = $driver->getAllClassNames(); |
|
| 58 | 1 | if (!empty($driverClasses)) { |
|
| 59 | 1 | $classes = array_merge($classes, $driverClasses); |
|
| 60 | } |
||
| 61 | } |
||
| 62 | |||
| 63 | 1 | return $classes; |
|
| 64 | } |
||
| 66 |