1 | <?php |
||
32 | abstract class ElementMetric extends ActiveRecordWithId implements MetricInterface |
||
33 | { |
||
34 | use ElementAttribute; |
||
35 | |||
36 | /** |
||
37 | * The default score weight |
||
38 | */ |
||
39 | const WEIGHT = 1; |
||
40 | |||
41 | /** |
||
42 | * The default metric version |
||
43 | */ |
||
44 | const VERSION = '1.0'; |
||
45 | |||
46 | /** |
||
47 | * The table alias |
||
48 | */ |
||
49 | const TABLE_ALIAS = 'scorecard_element_metrics'; |
||
50 | |||
51 | /** |
||
52 | * @inheritdoc |
||
53 | */ |
||
54 | protected $getterPriorityAttributes = ['elementId', 'score']; |
||
55 | |||
56 | /** |
||
57 | * @return float |
||
58 | */ |
||
59 | abstract protected function calculateScore(): float; |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | public function init() |
||
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | public static function find() |
||
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | public static function instantiate($row) |
||
103 | |||
104 | /** |
||
105 | * @inheritdoc |
||
106 | */ |
||
107 | public function rules() |
||
158 | |||
159 | |||
160 | /******************************************* |
||
161 | * METRIC INTERFACE |
||
162 | *******************************************/ |
||
163 | |||
164 | /** |
||
165 | * @inheritdoc |
||
166 | * @throws \ReflectionException |
||
167 | */ |
||
168 | public static function displayName(): string |
||
175 | |||
176 | /** |
||
177 | * @inheritdoc |
||
178 | */ |
||
179 | public function getWeight(): float |
||
183 | |||
184 | /** |
||
185 | * @inheritdoc |
||
186 | */ |
||
187 | public function getVersion(): string |
||
191 | |||
192 | /** |
||
193 | * @inheritdoc |
||
194 | */ |
||
195 | public function getScore(): float |
||
203 | |||
204 | /** |
||
205 | * @return array |
||
206 | */ |
||
207 | public function toConfig(): array |
||
211 | } |
||
212 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.