| Total Complexity | 6 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class InvalidTypeDtoException extends TypeError |
||
| 9 | { |
||
| 10 | public function __construct(PropertyContract $property, $value) |
||
| 11 | { |
||
| 12 | $value = $this->resolveTypeFromValue($value); |
||
| 13 | |||
| 14 | $expectedTypes = $this->resolveExpectedTypes($property); |
||
| 15 | |||
| 16 | parent::__construct("Invalid type: expected {$property->getFqn()} to be of type {$expectedTypes}, instead got value `{$value}`."); |
||
| 17 | } |
||
| 18 | |||
| 19 | protected function resolveTypeFromValue($value): string |
||
| 34 | } |
||
| 35 | |||
| 36 | protected function resolveExpectedTypes(PropertyContract $property) |
||
| 39 | } |
||
| 40 | } |
||
| 41 |