@@ -37,7 +37,9 @@ |
||
| 37 | 37 | |
| 38 | 38 | private function nextNumericIndex() { |
| 39 | 39 | $numericKeys = array_filter(array_keys($this->rawValues()), 'is_numeric'); |
| 40 | - if (count($numericKeys) === 0) return 0; |
|
| 40 | + if (count($numericKeys) === 0) { |
|
| 41 | + return 0; |
|
| 42 | + } |
|
| 41 | 43 | return max($numericKeys) + 1; |
| 42 | 44 | } |
| 43 | 45 | } |
| 44 | 46 | \ No newline at end of file |
@@ -12,8 +12,9 @@ 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); |
|
| 15 | + foreach($arrayConfig as $key => $value) { |
|
| 16 | + $this->offsetSet($key, $value); |
|
| 17 | + } |
|
| 17 | 18 | |
| 18 | 19 | $this->onConstruct(); |
| 19 | 20 | } |
@@ -36,8 +37,9 @@ discard block |
||
| 36 | 37 | public function toArray() { |
| 37 | 38 | $array = []; |
| 38 | 39 | |
| 39 | - foreach ($this->values as $key => $value) |
|
| 40 | - $array[$key] = $this->extractValue($value); |
|
| 40 | + foreach ($this->values as $key => $value) { |
|
| 41 | + $array[$key] = $this->extractValue($value); |
|
| 42 | + } |
|
| 41 | 43 | |
| 42 | 44 | return $array; |
| 43 | 45 | } |
@@ -59,8 +61,9 @@ discard block |
||
| 59 | 61 | public function path($path, $default = null, $delimiter = '.') { |
| 60 | 62 | $tokens = explode($delimiter, $path); |
| 61 | 63 | $token = array_shift($tokens); |
| 62 | - if ($this->get($token) instanceof self) |
|
| 63 | - return $this[$token]->path(implode('.', $tokens), $default); |
|
| 64 | + if ($this->get($token) instanceof self) { |
|
| 65 | + return $this[$token]->path(implode('.', $tokens), $default); |
|
| 66 | + } |
|
| 64 | 67 | return $this->get($token, $default); |
| 65 | 68 | } |
| 66 | 69 | |
@@ -77,8 +80,9 @@ discard block |
||
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | public function offsetGet($offset) { |
| 80 | - if (!$this->offsetExists($offset)) |
|
| 81 | - throw new \OutOfBoundsException("offset '{$offset}' does not exist"); |
|
| 83 | + if (!$this->offsetExists($offset)) { |
|
| 84 | + throw new \OutOfBoundsException("offset '{$offset}' does not exist"); |
|
| 85 | + } |
|
| 82 | 86 | return $this->values[$offset]; |
| 83 | 87 | } |
| 84 | 88 | |
@@ -130,7 +134,8 @@ discard block |
||
| 130 | 134 | } |
| 131 | 135 | |
| 132 | 136 | private function blockIfLocked() { |
| 133 | - if ($this->isLocked()) |
|
| 134 | - throw new CanNotMutateException(); |
|
| 137 | + if ($this->isLocked()) { |
|
| 138 | + throw new CanNotMutateException(); |
|
| 139 | + } |
|
| 135 | 140 | } |
| 136 | 141 | } |
| 137 | 142 | \ No newline at end of file |