| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types = 1); |
||
| 30 | public function toPropertyMetadata(PropertyMetadata $propertyMetadata) |
||
| 31 | { |
||
| 32 | // Check if there is no type hint - we cannot inject without it |
||
| 33 | if ($propertyMetadata->typeHint === null || $propertyMetadata->typeHint === '') { |
||
| 34 | throw new TypeHintDoesNotExists('Cannot configure property "' . $propertyMetadata->name . '" injection'); |
||
| 35 | } |
||
| 36 | |||
| 37 | // Check if specified type hint exists |
||
| 38 | if (!class_exists($propertyMetadata->typeHint)) { |
||
| 39 | throw new ClassDoesNotExists('Cannot configure property "' . $propertyMetadata->name . '" with "' . $propertyMetadata->typeHint . '"'); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |