| Conditions | 7 |
| Paths | 7 |
| Total Lines | 23 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 28 | public function __construct($argumentValue) |
||
| 29 | { |
||
| 30 | $type = \gettype($argumentValue); |
||
| 31 | switch ($type) { |
||
| 32 | case 'boolean': |
||
| 33 | $displayName = $argumentValue ? 'true' : 'false'; |
||
| 34 | break; |
||
| 35 | case 'integer': |
||
| 36 | case 'double': |
||
| 37 | $displayName = (string) $argumentValue; |
||
| 38 | break; |
||
| 39 | case 'string': |
||
| 40 | $displayName = $argumentValue; |
||
| 41 | break; |
||
| 42 | case 'object': |
||
| 43 | $displayName = \get_class($argumentValue); |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | $displayName = $type; |
||
| 47 | break; |
||
| 48 | } |
||
| 49 | |||
| 50 | parent::__construct(\sprintf(\sprintf('\'%s\' is not a valid DateTime(Immutable) instance', $displayName))); |
||
| 51 | } |
||
| 53 |