Completed
Push — master ( 205892...e583f8 )
by Viacheslav
9s
created
src/JsonPointer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             return self::splitPathURIFragment($pathItems);
33 33
         } else {
34 34
             if ($first !== '') {
35
-                throw new Exception('Path must start with "/": ' . $path);
35
+                throw new Exception('Path must start with "/": '.$path);
36 36
             }
37 37
             return self::splitPathJsonString($pathItems);
38 38
         }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             } else { // null or array
78 78
                 $intKey = filter_var($key, FILTER_VALIDATE_INT);
79 79
                 if ($ref === null && (false === $intKey || $intKey !== 0)) {
80
-                    $key = (string)$key;
80
+                    $key = (string) $key;
81 81
                     if ($recursively) {
82 82
                         $ref = new \stdClass();
83 83
                         $ref = &$ref->{$key};
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
         if (array_key_exists($key, $a)) {
115 115
             return true;
116 116
         }
117
-        $key = (string)$key;
117
+        $key = (string) $key;
118 118
         foreach ($a as $k => $v) {
119
-            if ((string)$k === $key) {
119
+            if ((string) $k === $key) {
120 120
                 return true;
121 121
             }
122 122
         }
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
     private static function arrayGet($key, array $a)
127 127
     {
128
-        $key = (string)$key;
128
+        $key = (string) $key;
129 129
         foreach ($a as $k => $v) {
130
-            if ((string)$k === $key) {
130
+            if ((string) $k === $key) {
131 131
                 return $v;
132 132
             }
133 133
         }
@@ -151,20 +151,20 @@  discard block
 block discarded – undo
151 151
                         Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED);
152 152
                 }
153 153
 
154
-                $vars = (array)$ref;
154
+                $vars = (array) $ref;
155 155
                 if (self::arrayKeyExists($key, $vars)) {
156 156
                     $ref = self::arrayGet($key, $vars);
157 157
                 } else {
158
-                    throw new Exception('Key not found: ' . $key);
158
+                    throw new Exception('Key not found: '.$key);
159 159
                 }
160 160
             } elseif (is_array($ref)) {
161 161
                 if (self::arrayKeyExists($key, $ref)) {
162 162
                     $ref = $ref[$key];
163 163
                 } else {
164
-                    throw new Exception('Key not found: ' . $key);
164
+                    throw new Exception('Key not found: '.$key);
165 165
                 }
166 166
             } else {
167
-                throw new Exception('Key not found: ' . $key);
167
+                throw new Exception('Key not found: '.$key);
168 168
             }
169 169
         }
170 170
         return $ref;
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
                 if (property_exists($ref, $key)) {
187 187
                     $ref = &$ref->$key;
188 188
                 } else {
189
-                    throw new Exception('Key not found: ' . $key);
189
+                    throw new Exception('Key not found: '.$key);
190 190
                 }
191 191
             } else {
192 192
                 if (array_key_exists($key, $ref)) {
193 193
                     $ref = &$ref[$key];
194 194
                 } else {
195
-                    throw new Exception('Key not found: ' . $key);
195
+                    throw new Exception('Key not found: '.$key);
196 196
                 }
197 197
             }
198 198
         }
Please login to merge, or discard this patch.