| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | abstract class BaseValidator implements Validator |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $key; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param EditableConfig $config The configuration object. |
||
| 22 | * @param mixed $value The value to validate. |
||
| 23 | */ |
||
| 24 | abstract protected function validateValue(EditableConfig $config, $value): void; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $key The key of the configuration to validate. |
||
| 28 | */ |
||
| 29 | public function __construct(string $key) |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Returns the configuration key. |
||
| 36 | */ |
||
| 37 | #[\Override] |
||
| 38 | public function getKey(): string |
||
| 39 | { |
||
| 40 | return $this->key; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param EditableConfig $config The configuration object. |
||
| 45 | * @param array<mixed> $configuration The array containing the configuration values. |
||
| 46 | */ |
||
| 47 | #[\Override] |
||
| 58 | } |
||
| 59 | } |
||
| 60 |