Completed
Push — master ( 5bb983...b9ada3 )
by stéphane
02:23
created
yaml/Node.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         elseif (in_array($first, ['?', ':']))      $this->onSetElement($nodeValue);
183 183
         elseif (in_array($first, ['!', '&', '*'])) $this->onNodeAction($nodeValue);
184 184
         else {
185
-            $characters = [ '#' =>  [Y::COMMENT, $v],
185
+            $characters = ['#' =>  [Y::COMMENT, $v],
186 186
                             '%' =>  [Y::DIRECTIVE, $v],
187 187
                             '>' =>  [Y::LITT_FOLDED, null],
188 188
                             '|' =>  [Y::LITT, null]
@@ -251,28 +251,28 @@  discard block
 block discarded – undo
251 251
     private function onCompact($value)
252 252
     {
253 253
         $this->value = json_decode($value, false, 512, JSON_PARTIAL_OUTPUT_ON_ERROR|JSON_UNESCAPED_SLASHES);
254
-        if (json_last_error() === JSON_ERROR_NONE){
254
+        if (json_last_error() === JSON_ERROR_NONE) {
255 255
             $this->type = Y::JSON;
256 256
             return;
257 257
         }
258 258
         $this->value = new NodeList();
259
-        if (preg_match(R::MAPPING, $value)){
259
+        if (preg_match(R::MAPPING, $value)) {
260 260
             $this->type = Y::COMPACT_MAPPING;
261 261
             $this->value->type = Y::COMPACT_MAPPING;
262
-            preg_match_all(R::MAPPING_VALUES, trim(substr($value, 1,-1)), $matches);
262
+            preg_match_all(R::MAPPING_VALUES, trim(substr($value, 1, -1)), $matches);
263 263
             foreach ($matches['k'] as $index => $property) {
264 264
                 $n = new Node('', $this->line);
265 265
                 $n->type = Y::KEY;
266
-                $n->identifier = trim($property, '"\' ');//TODO : maybe check for proper quoting first ?
266
+                $n->identifier = trim($property, '"\' '); //TODO : maybe check for proper quoting first ?
267 267
                 $n->value = new Node($matches['v'][$index], $this->line);
268 268
                 $this->value->push($n);
269 269
             }
270 270
             return;
271 271
         }
272
-        if (preg_match(R::SEQUENCE, $value)){
272
+        if (preg_match(R::SEQUENCE, $value)) {
273 273
             $this->type = Y::COMPACT_SEQUENCE;
274 274
             $this->value->type = Y::COMPACT_SEQUENCE;
275
-            preg_match_all(R::SEQUENCE_VALUES, trim(substr($value, 1,-1)), $matches);
275
+            preg_match_all(R::SEQUENCE_VALUES, trim(substr($value, 1, -1)), $matches);
276 276
             foreach ($matches['item'] as $key => $item) {
277 277
                 $i = new Node('', $this->line);
278 278
                 $i->type = Y::ITEM;
Please login to merge, or discard this patch.