| 1 | <?php |
||
| 10 | class EntityExistsValidator extends AbstractEntityValidator |
||
| 11 | { |
||
| 12 | const ERROR_ENTITY_NOT_EXISTS = 'entityNotExists'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var array Message templates |
||
| 16 | */ |
||
| 17 | protected $messageTemplates = [ |
||
| 18 | self::ERROR_ENTITY_NOT_EXISTS => 'Entity not found', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@inheritdoc} |
||
| 23 | */ |
||
| 24 | 2 | public function isValid($value) |
|
| 36 | } |
||
| 37 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.