Test Failed
Push — master ( dcbcc7...505ce0 )
by stéphane
02:34
created
sources/Loader.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
     //public
21 21
     /* @var null|string */
22 22
     public static $error;
23
-    public const IGNORE_DIRECTIVES     = 0b0001;//DONT include_directive
24
-    public const IGNORE_COMMENTS       = 0b0010;//DONT include_comments
25
-    public const NO_PARSING_EXCEPTIONS = 0b0100;//DONT throw Exception on parsing errors
26
-    public const NO_OBJECT_FOR_DATE    = 0b1000;//DONT import date strings as dateTime Object
23
+    public const IGNORE_DIRECTIVES     = 0b0001; //DONT include_directive
24
+    public const IGNORE_COMMENTS       = 0b0010; //DONT include_comments
25
+    public const NO_PARSING_EXCEPTIONS = 0b0100; //DONT throw Exception on parsing errors
26
+    public const NO_OBJECT_FOR_DATE    = 0b1000; //DONT import date strings as dateTime Object
27 27
 
28 28
     //private
29 29
     /* @var null|array */
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
     {
179 179
         $deepest = $previous->getDeepestNode();
180 180
         if ($deepest instanceof Nodes\Partial) {
181
-            return $deepest->specialProcess($current,  $this->_blankBuffer);
182
-        } elseif(!($current instanceof Nodes\Partial)) {
181
+            return $deepest->specialProcess($current, $this->_blankBuffer);
182
+        } elseif (!($current instanceof Nodes\Partial)) {
183 183
             return $current->specialProcess($previous, $this->_blankBuffer);
184 184
         }
185 185
         return false;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,12 @@
 block discarded – undo
129 129
         try {
130 130
             foreach ($generator as $lineNB => $lineString) {
131 131
                 $node = NodeFactory::get($lineString, $lineNB);
132
-                if ($this->_debug === 1) echo $lineNB.":".get_class($node)."\n";
133
-                if ($this->needsSpecialProcess($node, $previous)) continue;
132
+                if ($this->_debug === 1) {
133
+                    echo $lineNB.":".get_class($node)."\n";
134
+                }
135
+                if ($this->needsSpecialProcess($node, $previous)) {
136
+                    continue;
137
+                }
134 138
                 $this->_attachBlankLines($previous);
135 139
                 switch ($node->indent <=> $previous->indent) {
136 140
                     case -1: $target = $previous->getTargetOnLessIndent($node);
Please login to merge, or discard this patch.
sources/tag/CoreSchema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function str($node, &$parent = null)
59 59
     {
60
-        if($node instanceof Nodes\Literals){
60
+        if ($node instanceof Nodes\Literals) {
61 61
             $node = $node->value;
62 62
         }
63 63
         if ($node instanceof Nodes\NodeGeneric) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 $list[] = $this->str($child);
73 73
             }
74 74
             // return new Nodes\Scalar(implode('',$list), 0);
75
-            return implode('',$list);
75
+            return implode('', $list);
76 76
         }
77 77
     }
78 78
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                 $keyValue = $key->value->build();
134 134
                 if (is_null($parent)) {
135 135
                     return [$keyName => $keyValue];
136
-                } else{
136
+                } else {
137 137
                     $parent[$keyName] = $keyValue;
138 138
                 }
139 139
             } else {
Please login to merge, or discard this patch.
sources/nodes/Quoted.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
     public function build(&$parent = null)
14 14
     {
15 15
         // return substr(Scalar::replaceSequences(trim($this->raw)), 1,-1);
16
-        return (new Scalar('', 0))->replaceSequences(substr(trim($this->raw), 1,-1));
16
+        return (new Scalar('', 0))->replaceSequences(substr(trim($this->raw), 1, -1));
17 17
     }
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
sources/nodes/Anchor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
             try {
19 19
                 return $yamlObject->getReference($name);
20 20
             } catch (\Throwable $e) {
21
-                throw new \ParseError("Unknown anchor : '$name' this:".$this->anchor,1,$e);
21
+                throw new \ParseError("Unknown anchor : '$name' this:".$this->anchor, 1, $e);
22 22
             }
23 23
         } else {
24 24
             $built = is_null($this->value) ? null : $this->value->build($parent);
Please login to merge, or discard this patch.
examples/batch_read.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 //documents to load
12 12
 $files = ['examples/dummy.yml', 'examples/config.yml'];
13 13
 
14
-foreach($files as $key => $fileName)
14
+foreach ($files as $key => $fileName)
15 15
 {
16
-    $yamlObjList[] =  $yloader->load($fileName)->parse();
16
+    $yamlObjList[] = $yloader->load($fileName)->parse();
17 17
 }
18 18
 
19 19
 var_dump($yamlObjList);
Please login to merge, or discard this patch.
examples/testing.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@
 block discarded – undo
8 8
  *
9 9
  * use as follows : "php examples/testing.php DEBUG_LEVEL YAML_FILENAME"
10 10
  */
11
-const JSON_OPTIONS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION | JSON_PARTIAL_OUTPUT_ON_ERROR;
11
+const JSON_OPTIONS = JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_LINE_TERMINATORS|JSON_UNESCAPED_UNICODE|JSON_PRESERVE_ZERO_FRACTION|JSON_PARTIAL_OUTPUT_ON_ERROR;
12 12
 
13 13
 $debug = (int) (isset($argv[1]) ? $argv[1] : null);
14 14
 $file = (string) (isset($argv[2]) ? $argv[2] : null);
15
-echo memory_get_usage() . "\n";
15
+echo memory_get_usage()."\n";
16 16
 /* USE CASE 1
17 17
 * load and parse if file exists
18 18
 */
19
-$content = file_get_contents($file);//var_dump($content);
19
+$content = file_get_contents($file); //var_dump($content);
20 20
 $yaml = Yaml::parse($content, 0, $debug);
21 21
 
22
-echo memory_get_usage() . "\n";
22
+echo memory_get_usage()."\n";
23 23
 // var_dump($yaml);
24 24
 var_dump(json_encode($yaml, JSON_OPTIONS));
25 25
\ No newline at end of file
Please login to merge, or discard this patch.