@@ -48,8 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | namespace Platine\Config; |
50 | 50 | |
51 | -class FileLoader implements LoaderInterface |
|
52 | -{ |
|
51 | +class FileLoader implements LoaderInterface { |
|
53 | 52 | |
54 | 53 | /** |
55 | 54 | * The application base path to use for |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * Create new instance of file loader |
63 | 62 | * @param string $path the base path to use |
64 | 63 | */ |
65 | - public function __construct(string $path) |
|
66 | - { |
|
64 | + public function __construct(string $path) { |
|
67 | 65 | $this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR; |
68 | 66 | } |
69 | 67 |
@@ -128,7 +128,7 @@ |
||
128 | 128 | */ |
129 | 129 | protected function parse(string $env): array |
130 | 130 | { |
131 | - $environments = array_filter((array)preg_split('/(\/|\.)/', $env)); |
|
131 | + $environments = array_filter((array) preg_split('/(\/|\.)/', $env)); |
|
132 | 132 | array_unshift($environments, ''); |
133 | 133 | |
134 | 134 | return $environments; |
@@ -47,8 +47,7 @@ |
||
47 | 47 | |
48 | 48 | namespace Platine\Config; |
49 | 49 | |
50 | -interface LoaderInterface |
|
51 | -{ |
|
50 | +interface LoaderInterface { |
|
52 | 51 | |
53 | 52 | /** |
54 | 53 | * Load the configuration group for the given environment |
@@ -106,7 +106,7 @@ |
||
106 | 106 | */ |
107 | 107 | public function get(string $key, $default = null) |
108 | 108 | { |
109 | - list($group, ) = $this->parseKey($key); |
|
109 | + list($group,) = $this->parseKey($key); |
|
110 | 110 | $this->load($group); |
111 | 111 | |
112 | 112 | return Arr::get($this->items, $key, $default); |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @template T |
57 | 57 | * @implements ArrayAccess<string, mixed> |
58 | 58 | */ |
59 | -class Config implements ArrayAccess |
|
60 | -{ |
|
59 | +class Config implements ArrayAccess { |
|
61 | 60 | |
62 | 61 | /** |
63 | 62 | * The configuration loader to use |
@@ -82,8 +81,7 @@ discard block |
||
82 | 81 | * @param LoaderInterface $loader the loader to use |
83 | 82 | * @param string $env the name of the environment |
84 | 83 | */ |
85 | - public function __construct(LoaderInterface $loader, string $env = '') |
|
86 | - { |
|
84 | + public function __construct(LoaderInterface $loader, string $env = '') { |
|
87 | 85 | $this->loader = $loader; |
88 | 86 | $this->env = $env; |
89 | 87 | } |
@@ -104,8 +102,7 @@ discard block |
||
104 | 102 | * @param mixed $default the default value if can not find the config item |
105 | 103 | * @return mixed |
106 | 104 | */ |
107 | - public function get(string $key, $default = null) |
|
108 | - { |
|
105 | + public function get(string $key, $default = null) { |
|
109 | 106 | list($group, ) = $this->parseKey($key); |
110 | 107 | $this->load($group); |
111 | 108 | |
@@ -190,16 +187,14 @@ discard block |
||
190 | 187 | /** |
191 | 188 | * {@inheritdoc} |
192 | 189 | */ |
193 | - public function offsetExists($key) |
|
194 | - { |
|
190 | + public function offsetExists($key) { |
|
195 | 191 | return $this->has($key); |
196 | 192 | } |
197 | 193 | |
198 | 194 | /** |
199 | 195 | * {@inheritdoc} |
200 | 196 | */ |
201 | - public function offsetGet($key) |
|
202 | - { |
|
197 | + public function offsetGet($key) { |
|
203 | 198 | return $this->get($key); |
204 | 199 | } |
205 | 200 | |
@@ -209,16 +204,14 @@ discard block |
||
209 | 204 | * @param mixed $value |
210 | 205 | * @return void |
211 | 206 | */ |
212 | - public function offsetSet($key, $value) |
|
213 | - { |
|
207 | + public function offsetSet($key, $value) { |
|
214 | 208 | $this->set($key, $value); |
215 | 209 | } |
216 | 210 | |
217 | 211 | /** |
218 | 212 | * {@inheritdoc} |
219 | 213 | */ |
220 | - public function offsetUnset($key) |
|
221 | - { |
|
214 | + public function offsetUnset($key) { |
|
222 | 215 | $this->set($key, null); |
223 | 216 | } |
224 | 217 |