Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 9 | public function __construct($field, $expectedType, $actual) |
|
25 | { |
||
26 | 9 | $this->expectedType = $expectedType; |
|
27 | 9 | $this->actualType = gettype($actual); |
|
28 | 9 | $message = sprintf('Expected %s but found %s.', $this->expectedType, $this->actualType); |
|
29 | $error = [ |
||
30 | 9 | 'type' => 'invalid_argument', |
|
31 | 9 | 'extra' => [$this->expectedType, $this->actualType], |
|
32 | 9 | 'field' => $field, |
|
33 | 9 | 'message' => $message, |
|
34 | ]; |
||
35 | 9 | parent::__construct([$error], $message); |
|
36 | 9 | } |
|
54 |