1 | <?php |
||
10 | class EntityNotExistsValidator extends AbstractEntityValidator |
||
11 | { |
||
12 | const ERROR_VALUE_EXISTS = 'valueExists'; |
||
13 | |||
14 | /** |
||
15 | * @var array Message templates |
||
16 | */ |
||
17 | protected $messageTemplates = [ |
||
18 | self::ERROR_VALUE_EXISTS => 'The value already exists', |
||
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.