@@ -26,9 +26,15 @@ discard block |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | private function isConfigObjectMerge($key, $value) { |
29 | - if (!$this->offsetExists($key)) return false; |
|
30 | - if (!$this->isConfigObject($value)) return false; |
|
31 | - if (!$this->isConfigObject($this->{$key})) return false; |
|
29 | + if (!$this->offsetExists($key)) { |
|
30 | + return false; |
|
31 | + } |
|
32 | + if (!$this->isConfigObject($value)) { |
|
33 | + return false; |
|
34 | + } |
|
35 | + if (!$this->isConfigObject($this->{$key})) { |
|
36 | + return false; |
|
37 | + } |
|
32 | 38 | return true; |
33 | 39 | } |
34 | 40 | |
@@ -38,7 +44,9 @@ discard block |
||
38 | 44 | |
39 | 45 | private function nextNumericIndex() { |
40 | 46 | $numericKeys = array_filter(array_keys($this->rawValues()), 'is_numeric'); |
41 | - if (count($numericKeys) === 0) return 0; |
|
47 | + if (count($numericKeys) === 0) { |
|
48 | + return 0; |
|
49 | + } |
|
42 | 50 | return max($numericKeys) + 1; |
43 | 51 | } |
44 | 52 | } |
45 | 53 | \ No newline at end of file |
@@ -12,10 +12,12 @@ discard block |
||
12 | 12 | private $values = []; |
13 | 13 | |
14 | 14 | public function __construct(array $arrayConfig = []) { |
15 | - foreach($arrayConfig as $key => $value) |
|
16 | - $this->offsetSet($key, $value); |
|
17 | - if (method_exists($this, 'onConstruct')) |
|
18 | - $this->onConstruct(); |
|
15 | + foreach($arrayConfig as $key => $value) { |
|
16 | + $this->offsetSet($key, $value); |
|
17 | + } |
|
18 | + if (method_exists($this, 'onConstruct')) { |
|
19 | + $this->onConstruct(); |
|
20 | + } |
|
19 | 21 | } |
20 | 22 | |
21 | 23 | public function isLocked() { |
@@ -45,8 +47,9 @@ discard block |
||
45 | 47 | public function path($path, $default = null, $delimiter = '.') { |
46 | 48 | $tokens = explode($delimiter, $path); |
47 | 49 | $token = array_shift($tokens); |
48 | - if ($this->get($token) instanceof self) |
|
49 | - return $this[$token]->path(implode('.', $tokens), $default); |
|
50 | + if ($this->get($token) instanceof self) { |
|
51 | + return $this[$token]->path(implode('.', $tokens), $default); |
|
52 | + } |
|
50 | 53 | return $this->get($token, $default); |
51 | 54 | } |
52 | 55 | |
@@ -63,8 +66,9 @@ discard block |
||
63 | 66 | } |
64 | 67 | |
65 | 68 | public function offsetGet($offset) { |
66 | - if (!$this->offsetExists($offset)) |
|
67 | - throw new \OutOfBoundsException("offset '{$offset}' does not exist"); |
|
69 | + if (!$this->offsetExists($offset)) { |
|
70 | + throw new \OutOfBoundsException("offset '{$offset}' does not exist"); |
|
71 | + } |
|
68 | 72 | return $this->values[$offset]; |
69 | 73 | } |
70 | 74 | |
@@ -118,7 +122,8 @@ discard block |
||
118 | 122 | } |
119 | 123 | |
120 | 124 | private function blockIfLocked() { |
121 | - if ($this->isLocked()) |
|
122 | - throw new CanNotMutateException(); |
|
125 | + if ($this->isLocked()) { |
|
126 | + throw new CanNotMutateException(); |
|
127 | + } |
|
123 | 128 | } |
124 | 129 | } |
125 | 130 | \ No newline at end of file |