| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | public function __construct( |
||
| 40 | /** |
||
| 41 | * @var string Expected class name of a rule. |
||
| 42 | */ |
||
| 43 | string $expectedClassName, |
||
| 44 | /** |
||
| 45 | * @var object An actual given object that's not an instance of `$expectedClassName`. |
||
| 46 | */ |
||
| 47 | object $actualObject, |
||
| 48 | /** |
||
| 49 | * @var int The Exception code. |
||
| 50 | */ |
||
| 51 | int $code = 0, |
||
| 52 | /** |
||
| 53 | * @var Throwable|null The previous throwable used for the exception chaining. |
||
| 54 | */ |
||
| 55 | ?Throwable $previous = null, |
||
| 56 | ) { |
||
| 57 | parent::__construct( |
||
| 58 | sprintf( |
||
| 59 | 'Expected "%s", but "%s" given.', |
||
| 60 | $expectedClassName, |
||
| 61 | $actualObject::class |
||
| 62 | ), |
||
| 63 | $code, |
||
| 64 | $previous, |
||
| 65 | ); |
||
| 68 |