@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $result = $isURIFragmentId ? '#' : ''; |
| 30 | 30 | foreach ($pathItems as $pathItem) { |
| 31 | - $result .= '/' . self::escapeSegment($pathItem, $isURIFragmentId); |
|
| 31 | + $result .= '/'.self::escapeSegment($pathItem, $isURIFragmentId); |
|
| 32 | 32 | } |
| 33 | 33 | return $result; |
| 34 | 34 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return self::splitPathURIFragment($pathItems); |
| 47 | 47 | } else { |
| 48 | 48 | if ($first !== '') { |
| 49 | - throw new Exception('Path must start with "/": ' . $path); |
|
| 49 | + throw new Exception('Path must start with "/": '.$path); |
|
| 50 | 50 | } |
| 51 | 51 | return self::splitPathJsonString($pathItems); |
| 52 | 52 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $ref = &$ref->$key; |
| 94 | 94 | } else { |
| 95 | 95 | if (!isset($ref->$key) && count($pathItems)) { |
| 96 | - throw new Exception('Non-existent path item: ' . $key); |
|
| 96 | + throw new Exception('Non-existent path item: '.$key); |
|
| 97 | 97 | } else { |
| 98 | 98 | $ref = &$ref->$key; |
| 99 | 99 | } |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | } else { // null or array |
| 102 | 102 | $intKey = filter_var($key, FILTER_VALIDATE_INT); |
| 103 | 103 | if ($ref === null && (false === $intKey || $intKey !== 0)) { |
| 104 | - $key = (string)$key; |
|
| 104 | + $key = (string) $key; |
|
| 105 | 105 | if ($recursively) { |
| 106 | 106 | $ref = new \stdClass(); |
| 107 | 107 | $ref = &$ref->{$key}; |
| 108 | 108 | } else { |
| 109 | - throw new Exception('Non-existent path item: ' . $key); |
|
| 109 | + throw new Exception('Non-existent path item: '.$key); |
|
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | 112 | if ($recursively && $ref === null) $ref = array(); |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | if (array_key_exists($key, $a)) { |
| 139 | 139 | return true; |
| 140 | 140 | } |
| 141 | - $key = (string)$key; |
|
| 141 | + $key = (string) $key; |
|
| 142 | 142 | foreach ($a as $k => $v) { |
| 143 | - if ((string)$k === $key) { |
|
| 143 | + if ((string) $k === $key) { |
|
| 144 | 144 | return true; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -149,9 +149,9 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | private static function arrayGet($key, array $a) |
| 151 | 151 | { |
| 152 | - $key = (string)$key; |
|
| 152 | + $key = (string) $key; |
|
| 153 | 153 | foreach ($a as $k => $v) { |
| 154 | - if ((string)$k === $key) { |
|
| 154 | + if ((string) $k === $key) { |
|
| 155 | 155 | return $v; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -175,20 +175,20 @@ discard block |
||
| 175 | 175 | Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $vars = (array)$ref; |
|
| 178 | + $vars = (array) $ref; |
|
| 179 | 179 | if (self::arrayKeyExists($key, $vars)) { |
| 180 | 180 | $ref = self::arrayGet($key, $vars); |
| 181 | 181 | } else { |
| 182 | - throw new Exception('Key not found: ' . $key); |
|
| 182 | + throw new Exception('Key not found: '.$key); |
|
| 183 | 183 | } |
| 184 | 184 | } elseif (is_array($ref)) { |
| 185 | 185 | if (self::arrayKeyExists($key, $ref)) { |
| 186 | 186 | $ref = $ref[$key]; |
| 187 | 187 | } else { |
| 188 | - throw new Exception('Key not found: ' . $key); |
|
| 188 | + throw new Exception('Key not found: '.$key); |
|
| 189 | 189 | } |
| 190 | 190 | } else { |
| 191 | - throw new Exception('Key not found: ' . $key); |
|
| 191 | + throw new Exception('Key not found: '.$key); |
|
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | return $ref; |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | if (property_exists($ref, $key)) { |
| 222 | 222 | $ref = &$ref->$key; |
| 223 | 223 | } else { |
| 224 | - throw new Exception('Key not found: ' . $key); |
|
| 224 | + throw new Exception('Key not found: '.$key); |
|
| 225 | 225 | } |
| 226 | 226 | } else { |
| 227 | 227 | if (array_key_exists($key, $ref)) { |
| 228 | 228 | $ref = &$ref[$key]; |
| 229 | 229 | } else { |
| 230 | - throw new Exception('Key not found: ' . $key); |
|
| 230 | + throw new Exception('Key not found: '.$key); |
|
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | } |