@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | namespace Platine\Config; |
| 49 | 49 | |
| 50 | -class Config implements \ArrayAccess |
|
| 51 | -{ |
|
| 50 | +class Config implements \ArrayAccess { |
|
| 52 | 51 | |
| 53 | 52 | /** |
| 54 | 53 | * The config loader to use |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | * @param LoaderInterface $loader the loader to use |
| 74 | 73 | * @param string $env the name of the environment |
| 75 | 74 | */ |
| 76 | - public function __construct(LoaderInterface $loader, string $env = '') |
|
| 77 | - { |
|
| 75 | + public function __construct(LoaderInterface $loader, string $env = '') { |
|
| 78 | 76 | $this->loader = $loader; |
| 79 | 77 | $this->env = $env; |
| 80 | 78 | } |
@@ -95,8 +93,7 @@ discard block |
||
| 95 | 93 | * @param mixed $default the default value if can not find the config item |
| 96 | 94 | * @return mixed |
| 97 | 95 | */ |
| 98 | - public function get(string $key, $default = null) |
|
| 99 | - { |
|
| 96 | + public function get(string $key, $default = null) { |
|
| 100 | 97 | list($group, $item) = $this->parseKey($key); |
| 101 | 98 | $this->load($group); |
| 102 | 99 | |
@@ -179,32 +176,28 @@ discard block |
||
| 179 | 176 | /** |
| 180 | 177 | * {@inheritdoc} |
| 181 | 178 | */ |
| 182 | - public function offsetExists($key) |
|
| 183 | - { |
|
| 179 | + public function offsetExists($key) { |
|
| 184 | 180 | return $this->has($key); |
| 185 | 181 | } |
| 186 | 182 | |
| 187 | 183 | /** |
| 188 | 184 | * {@inheritdoc} |
| 189 | 185 | */ |
| 190 | - public function offsetGet($key) |
|
| 191 | - { |
|
| 186 | + public function offsetGet($key) { |
|
| 192 | 187 | return $this->get($key); |
| 193 | 188 | } |
| 194 | 189 | |
| 195 | 190 | /** |
| 196 | 191 | * {@inheritdoc} |
| 197 | 192 | */ |
| 198 | - public function offsetSet($key, $value) |
|
| 199 | - { |
|
| 193 | + public function offsetSet($key, $value) { |
|
| 200 | 194 | $this->set($key, $value); |
| 201 | 195 | } |
| 202 | 196 | |
| 203 | 197 | /** |
| 204 | 198 | * {@inheritdoc} |
| 205 | 199 | */ |
| 206 | - public function offsetUnset($key) |
|
| 207 | - { |
|
| 200 | + public function offsetUnset($key) { |
|
| 208 | 201 | $this->set($key, null); |
| 209 | 202 | } |
| 210 | 203 | |
@@ -248,8 +241,7 @@ discard block |
||
| 248 | 241 | * @param mixed $default |
| 249 | 242 | * @return mixed |
| 250 | 243 | */ |
| 251 | - protected function getValue(array $items, ?string $key, $default) |
|
| 252 | - { |
|
| 244 | + protected function getValue(array $items, ?string $key, $default) { |
|
| 253 | 245 | if (is_null($key)) { |
| 254 | 246 | return $items; |
| 255 | 247 | } |
@@ -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 | |
@@ -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 |