@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | * @param array $variables |
56 | 56 | * @return void |
57 | 57 | */ |
58 | - public function __construct(?string $prefix=null, $delimiter=self::DEFAULT_DELIMITER, array $variables=[]) |
|
58 | + public function __construct(?string $prefix = null, $delimiter = self::DEFAULT_DELIMITER, array $variables = []) |
|
59 | 59 | { |
60 | 60 | $this->delimiter = $delimiter; |
61 | 61 | $this->prefix = $prefix ? strtolower($prefix) : ''; |
62 | 62 | |
63 | - if(count($variables) === 0) { |
|
63 | + if (count($variables) === 0) { |
|
64 | 64 | $this->store = $this->variablesToTree(array_merge($_ENV, $_SERVER)); |
65 | 65 | } else { |
66 | 66 | $this->store = $this->variablesToTree($variables); |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | foreach ($variables as $name => $value) { |
106 | 106 | $name = explode($this->delimiter, $name); |
107 | 107 | |
108 | - if($this->prefix !== null) { |
|
109 | - if($name[0] !== $this->prefix) { |
|
108 | + if ($this->prefix !== null) { |
|
109 | + if ($name[0] !== $this->prefix) { |
|
110 | 110 | continue; |
111 | 111 | } else { |
112 | 112 | array_shift($name); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $tree = $tree->$key; |
128 | 128 | } catch (Exception $e) { |
129 | 129 | // set value if last keypart or create subtree |
130 | - if($i == (count($name) - 1)) { |
|
130 | + if ($i == (count($name) - 1)) { |
|
131 | 131 | $tree[$key] = $value; |
132 | 132 | } else { |
133 | 133 | $tree[$key] = new Config(); |