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