Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
75 | public static function loadValidatorMetadata(ClassMetadata $classMetadata) |
||
76 | { |
||
77 | $classMetadata->addPropertyConstraint('title', Assert::stringType()->notBlank()); |
||
|
|||
78 | $classMetadata->addPropertyConstraint('content', Assert::stringType()); |
||
79 | |||
80 | $classMetadata->addPropertyConstraint('title', Assert::intType()->notBlank(), 'foo'); |
||
81 | $classMetadata->addPropertyConstraint('content', Assert::intType()->notBlank(), 'foo'); |
||
82 | } |
||
83 | } |
||
84 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.