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) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function serialize() |
||
71 | |||
72 | /** |
||
73 | * Mapping data base on mapping keys. |
||
74 | * |
||
75 | * @param array $attributes |
||
76 | * @param array $mappingKeys |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | protected static function mapBaseOnKeys(array $attributes, array $mappingKeys) |
||
84 | |||
85 | /** |
||
86 | * @param array $serialized |
||
87 | * |
||
88 | * @return mixed |
||
89 | */ |
||
90 | protected static function cleanMappingKeys(array $serialized) |
||
94 | |||
95 | /** |
||
96 | * @param array $attributesKeys |
||
97 | * @param array $mappingKeys |
||
98 | * |
||
99 | * @return mixed |
||
100 | */ |
||
101 | protected static function mergeMappingKeys(array $attributesKeys, array $mappingKeys) |
||
107 | |||
108 | /** |
||
109 | * @param array $attributesKeys |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | protected static function extraKeys(array $attributesKeys) |
||
125 | } |
||
126 |
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.