| 1 | <?php |
||
| 18 | abstract class AbstractMetric extends BaseObject implements MetricInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var float |
||
| 22 | */ |
||
| 23 | public $weight = 1; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | public $version = '1.0.0'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var float |
||
| 32 | */ |
||
| 33 | public $score; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return float |
||
| 37 | */ |
||
| 38 | abstract protected function calculateScore(): float; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritdoc |
||
| 42 | * @throws \ReflectionException |
||
| 43 | */ |
||
| 44 | public static function displayName(): string |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritdoc |
||
| 54 | */ |
||
| 55 | public function getVersion(): string |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritdoc |
||
| 62 | */ |
||
| 63 | public function getWeight(): float |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return float |
||
| 70 | */ |
||
| 71 | public function getScore(): float |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @inheritdoc |
||
| 82 | */ |
||
| 83 | public function toConfig(): array |
||
| 92 | } |
||
| 93 |