| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class GroupConfig implements GroupConfigInterface |
||
| 21 | { |
||
| 22 | const CONFIG_PATH = 'path'; |
||
| 23 | |||
| 24 | /** @var string */ |
||
| 25 | private $path; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * SchemaConfig constructor. |
||
| 29 | * |
||
| 30 | * @param array $options Array of options |
||
| 31 | * |
||
| 32 | * @throws \Graze\ConfigValidation\Exceptions\ConfigValidationFailedException |
||
| 33 | */ |
||
| 34 | public function __construct(array $options = []) |
||
| 35 | { |
||
| 36 | $options = static::getValidator()->validate($options); |
||
| 37 | $this->path = $options[static::CONFIG_PATH]; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return ConfigValidatorInterface |
||
| 42 | */ |
||
| 43 | public static function getValidator(): ConfigValidatorInterface |
||
| 44 | { |
||
| 45 | return Validate::arr(false) |
||
| 46 | ->required(static::CONFIG_PATH, v::stringType()); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function getPath(): string |
||
| 55 | } |
||
| 56 | } |
||
| 57 |