| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 46 | public function registerOs(array $classNames) |
||
| 47 | { |
||
| 48 | foreach ($classNames as $className) { |
||
| 49 | $os = new $className; |
||
| 50 | |||
| 51 | if (!$os instanceof OsInterface) { |
||
| 52 | throw new \UnexpectedValueException("Class {$className} must implement ".OsInterface::class); |
||
| 53 | } |
||
| 54 | |||
| 55 | if ($os->inUse()) { |
||
| 56 | $this->os = $os; |
||
| 57 | |||
| 58 | // The OS has been found, no need to iterate anymore |
||
| 59 | break; |
||
| 60 | } |
||
| 74 |