Total Complexity | 5 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class Config implements \ArrayAccess |
||
22 | { |
||
23 | /** @var Builder Builder object. */ |
||
24 | protected $builder; |
||
25 | |||
26 | /** @var \Cecil\Config */ |
||
27 | protected $config; |
||
28 | |||
29 | /** @var string Current language. */ |
||
30 | protected $language; |
||
31 | |||
32 | public function __construct(Builder $builder, string $language) |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Implement ArrayAccess. |
||
41 | * |
||
42 | * @param mixed $offset |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | #[\ReturnTypeWillChange] |
||
47 | public function offsetExists($offset): bool |
||
48 | { |
||
49 | return $this->config->has($offset); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Implements \ArrayAccess. |
||
54 | * |
||
55 | * @param mixed $offset |
||
56 | * |
||
57 | * @return mixed|null |
||
58 | */ |
||
59 | #[\ReturnTypeWillChange] |
||
60 | public function offsetGet($offset) |
||
61 | { |
||
62 | return $this->config->get($offset, $this->language); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Implements \ArrayAccess. |
||
67 | * |
||
68 | * @param mixed $offset |
||
69 | * @param mixed $value |
||
70 | * |
||
71 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
72 | */ |
||
73 | #[\ReturnTypeWillChange] |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Implements \ArrayAccess. |
||
80 | * |
||
81 | * @param mixed $offset |
||
82 | * |
||
83 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
84 | */ |
||
85 | #[\ReturnTypeWillChange] |
||
90 |