| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function validate(array $attributes, array $rules) |
||
| 23 | { |
||
| 24 | /** @var Validator $validator */ |
||
| 25 | $validator = static::getValidatorFactory()->make($attributes, $rules); |
||
| 26 | if (true === $validator->fails()) { |
||
| 27 | $message = $validator->messages()->first(); |
||
| 28 | |||
| 29 | $exception = new ValidationException(); |
||
| 30 | $exception->statusMessage = $exception->statusMessage . ': ' . $message; |
||
| 31 | $exception->validation = $validator->messages(); |
||
|
|
|||
| 32 | |||
| 33 | throw $exception; |
||
| 34 | } |
||
| 45 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..