| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 24 | public function __construct(string $parameter, string $class, mixed $argument) |
|
| 16 | { |
||
| 17 | 24 | $type = \is_object($argument) |
|
| 18 | 9 | ? 'Instance of ' . \get_class($argument) |
|
| 19 | 15 | : \ucfirst(\get_debug_type($argument)); |
|
| 20 | 24 | parent::__construct(\sprintf( |
|
| 21 | 24 | '%s should be instance of %s or its declaration. %s was received instead.', |
|
| 22 | 24 | $parameter, |
|
| 23 | 24 | $class, |
|
| 24 | 24 | $type |
|
| 25 | 24 | )); |
|
| 28 |