| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 31 | public function to($interface, $class) |
|
| 33 | { |
||
| 34 | 31 | if (! class_exists($class)) { |
|
| 35 | 1 | throw new NotFound($class); |
|
| 36 | } |
||
| 37 | 30 | if (interface_exists($interface) && ! (new \ReflectionClass($class))->implementsInterface($interface)) { |
|
| 38 | 1 | $msg = "[{$class}] is no implemented [{$interface}] interface"; |
|
| 39 | 1 | throw new InvalidType($msg); |
|
| 40 | } |
||
| 41 | 29 | } |
|
| 42 | |||
| 62 |