@@ -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 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | foreach ($originalKeys as $key => $originalValue) { |
| 177 | 177 | $path = $this->path; |
| 178 | - $this->path .= '/' . urlencode($key); |
|
| 178 | + $this->path .= '/'.urlencode($key); |
|
| 179 | 179 | |
| 180 | 180 | if (isset($newArray[$key])) { |
| 181 | 181 | $newOrdered[$key] = $this->process($originalValue, $newArray[$key]); |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | // additions |
| 192 | 192 | foreach ($newArray as $key => $value) { |
| 193 | 193 | $newOrdered[$key] = $value; |
| 194 | - $path = $this->path . '/' . urlencode($key); |
|
| 194 | + $path = $this->path.'/'.urlencode($key); |
|
| 195 | 195 | JsonProcessor::pushByPath($this->added, $path, $value); |
| 196 | 196 | $this->addedCnt++; |
| 197 | 197 | $this->addedPaths [] = $path; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - return is_array($new) ? $newOrdered : (object)$newOrdered; |
|
| 200 | + return is_array($new) ? $newOrdered : (object) $newOrdered; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | private function rearrangeArray(array $original, array $new) |
@@ -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 | } |