1 | <?php |
||
23 | abstract class AbstractReadModel implements ReadModelInterface |
||
24 | { |
||
25 | use SerializerTrait, DeserializerTrait, MessageMapperTrait { |
||
26 | SerializerTrait::serialize as serializeData; |
||
27 | DeserializerTrait::deserialize as deserializeData; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected static $mappings = array(); |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public static function deserialize(array $attributes) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function serialize() |
||
60 | |||
61 | /** |
||
62 | * Mapping data base on mapping keys. |
||
63 | * |
||
64 | * @param array $attributes |
||
65 | * @param array $mappingKeys |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | protected static function map(array $attributes, array $mappingKeys) |
||
73 | } |
||
74 |
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.