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 | * @return array |
||
32 | */ |
||
33 | public static function relations() |
||
37 | |||
38 | /** |
||
39 | * @return array |
||
40 | */ |
||
41 | public static function mappings() |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public static function deserialize(array $attributes) |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function serialize() |
||
72 | |||
73 | /** |
||
74 | * Mapping data base on mapping keys. |
||
75 | * |
||
76 | * @param array $attributes |
||
77 | * @param array $mappingKeys |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | protected static function mapBaseOnKeys(array $attributes, array $mappingKeys) |
||
85 | |||
86 | /** |
||
87 | * @param array $serialized |
||
88 | * |
||
89 | * @return mixed |
||
90 | */ |
||
91 | protected static function cleanMappingKeys(array $serialized) |
||
95 | |||
96 | /** |
||
97 | * @param array $attributesKeys |
||
98 | * @param array $mappingKeys |
||
99 | * |
||
100 | * @return mixed |
||
101 | */ |
||
102 | protected static function mergeMappingKeys(array $attributesKeys, array $mappingKeys) |
||
108 | |||
109 | /** |
||
110 | * @param array $attributesKeys |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | protected static function extraKeys(array $attributesKeys) |
||
126 | |||
127 | /** |
||
128 | * @param array $record |
||
129 | * @param array $attributes |
||
130 | * |
||
131 | * @return array |
||
132 | */ |
||
133 | protected static function fixedDeserializeMapping(array $record, array $attributes) |
||
143 | } |
||
144 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.