| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
||
| 21 | { |
||
| 22 | $metadata->addPropertyConstraints('tipoDoc', [ |
||
|
|
|||
| 23 | new Assert(), |
||
| 24 | new Assert\Length([ |
||
| 25 | 'min' => 2, |
||
| 26 | 'max' => 2, |
||
| 27 | ]), |
||
| 28 | ]); |
||
| 29 | $metadata->addPropertyConstraints('serie', [ |
||
| 30 | new Assert\NotBlank(), |
||
| 31 | new Assert\Length([ 'max' => 4]), |
||
| 32 | ]); |
||
| 33 | $metadata->addPropertyConstraints('correlativo', [ |
||
| 34 | new Assert\NotBlank(), |
||
| 35 | new Assert\Length(['max' => 8]), |
||
| 36 | ]); |
||
| 37 | $metadata->addPropertyConstraints('desMotivoBaja', [ |
||
| 38 | new Assert\NotBlank(), |
||
| 39 | new Assert\Length(['max' => 100]), |
||
| 40 | ]); |
||
| 41 | } |
||
| 42 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: