@@ -54,13 +54,13 @@ |
||
| 54 | 54 | { |
| 55 | 55 | $originalJson = file_get_contents($this->originalPath); |
| 56 | 56 | if (!$originalJson) { |
| 57 | - $this->response->error('Unable to read ' . $this->originalPath); |
|
| 57 | + $this->response->error('Unable to read '.$this->originalPath); |
|
| 58 | 58 | return; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $newJson = file_get_contents($this->newPath); |
| 62 | 62 | if (!$newJson) { |
| 63 | - $this->response->error('Unable to read ' . $this->newPath); |
|
| 63 | + $this->response->error('Unable to read '.$this->newPath); |
|
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | && !is_int($key) |
| 23 | 23 | && false === filter_var($key, FILTER_VALIDATE_INT) |
| 24 | 24 | ) { |
| 25 | - $key = (string)$key; |
|
| 25 | + $key = (string) $key; |
|
| 26 | 26 | $ref = new \stdClass(); |
| 27 | 27 | $ref = &$ref->{$key}; |
| 28 | 28 | } else { |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | if (array_key_exists($key, $a)) { |
| 38 | 38 | return true; |
| 39 | 39 | } |
| 40 | - $key = (string)$key; |
|
| 40 | + $key = (string) $key; |
|
| 41 | 41 | foreach ($a as $k => $v) { |
| 42 | - if ((string)$k === $key) { |
|
| 42 | + if ((string) $k === $key) { |
|
| 43 | 43 | return true; |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | private static function arrayGet($key, array $a) |
| 50 | 50 | { |
| 51 | - $key = (string)$key; |
|
| 51 | + $key = (string) $key; |
|
| 52 | 52 | foreach ($a as $k => $v) { |
| 53 | - if ((string)$k === $key) { |
|
| 53 | + if ((string) $k === $key) { |
|
| 54 | 54 | return $v; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -68,17 +68,17 @@ discard block |
||
| 68 | 68 | while (null !== $key = array_shift($pathItems)) { |
| 69 | 69 | $key = urldecode($key); |
| 70 | 70 | if ($ref instanceof \stdClass) { |
| 71 | - $vars = (array)$ref; |
|
| 71 | + $vars = (array) $ref; |
|
| 72 | 72 | if (self::arrayKeyExists($key, $vars)) { |
| 73 | 73 | $ref = self::arrayGet($key, $vars); |
| 74 | 74 | } else { |
| 75 | - throw new Exception('Key not found: ' . $key); |
|
| 75 | + throw new Exception('Key not found: '.$key); |
|
| 76 | 76 | } |
| 77 | 77 | } else { |
| 78 | 78 | if (self::arrayKeyExists($key, $ref)) { |
| 79 | 79 | $ref = $ref[$key]; |
| 80 | 80 | } else { |
| 81 | - throw new Exception('Key not found: ' . $key); |
|
| 81 | + throw new Exception('Key not found: '.$key); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | if (property_exists($ref, $key)) { |
| 101 | 101 | $ref = &$ref->$key; |
| 102 | 102 | } else { |
| 103 | - throw new Exception('Key not found: ' . $key); |
|
| 103 | + throw new Exception('Key not found: '.$key); |
|
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | 106 | if (array_key_exists($key, $ref)) { |
| 107 | 107 | $ref = &$ref[$key]; |
| 108 | 108 | } else { |
| 109 | - throw new Exception('Key not found: ' . $key); |
|
| 109 | + throw new Exception('Key not found: '.$key); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | foreach ($originalKeys as $key => $originalValue) { |
| 190 | 190 | $path = $this->path; |
| 191 | - $this->path .= '/' . urlencode($key); |
|
| 191 | + $this->path .= '/'.urlencode($key); |
|
| 192 | 192 | |
| 193 | 193 | if (array_key_exists($key, $newArray)) { |
| 194 | 194 | $newOrdered[$key] = $this->process($originalValue, $newArray[$key]); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | // additions |
| 208 | 208 | foreach ($newArray as $key => $value) { |
| 209 | 209 | $newOrdered[$key] = $value; |
| 210 | - $path = $this->path . '/' . urlencode($key); |
|
| 210 | + $path = $this->path.'/'.urlencode($key); |
|
| 211 | 211 | JsonProcessor::pushByPath($this->added, $path, $value); |
| 212 | 212 | $this->addedCnt++; |
| 213 | 213 | $this->addedPaths [] = $path; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - return is_array($new) ? $newOrdered : (object)$newOrdered; |
|
| 219 | + return is_array($new) ? $newOrdered : (object) $newOrdered; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | private function rearrangeArray(array $original, array $new) |