Test Failed
Branch master (b38a7a)
by stéphane
12:04
created
sources/nodes/NodeLiterals.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
 
26 26
     public function add(Node $child):Node
27 27
     {
28
-        if (is_null($this->value)) $this->value = new NodeList();
28
+        if (is_null($this->value)) {
29
+            $this->value = new NodeList();
30
+        }
29 31
         $candidate = $child;
30 32
         if (!Yaml::isOneOf($child, ['NodeScalar', 'NodeBlank', 'NodeComment', 'NodeQuoted'])) {
31 33
             $candidate = new NodeScalar((string) $child->raw, $child->line);
Please login to merge, or discard this patch.
sources/Yaml.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,9 @@
 block discarded – undo
107 107
     {
108 108
         foreach ($comparison as $className) {
109 109
             $fqn = __NAMESPACE__."\\Yaml\\$className";
110
-            if ($subject instanceof $fqn) return true;
110
+            if ($subject instanceof $fqn) {
111
+                return true;
112
+            }
111 113
         }
112 114
         return false;
113 115
     }
Please login to merge, or discard this patch.
sources/NodeList.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@  discard block
 block discarded – undo
37 37
         $tmp->rewind();
38 38
         $fqn = __NAMESPACE__."\\$nodeType";
39 39
         foreach ($tmp as $child) {
40
-            if ($child instanceof $fqn) return true;
40
+            if ($child instanceof $fqn) {
41
+                return true;
42
+            }
41 43
         }
42 44
         return false;
43 45
     }
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
                 && !($child instanceof NodeDirective)
52 54
                 && !($child instanceof NodeBlank)
53 55
                 && !($child instanceof NodeDocstart
54
-                && is_null($child->value)) ) return true;
56
+                && is_null($child->value)) ) {
57
+                return true;
58
+            }
55 59
         }
56 60
         return false;
57 61
     }
@@ -59,9 +63,11 @@  discard block
 block discarded – undo
59 63
     public function push($node)
60 64
     {
61 65
         $type = null;
62
-        if     ($node instanceof NodeItem )    $type = self::SEQUENCE;
63
-        elseif ($node instanceof NodeKey)      $type = self::MAPPING;
64
-        elseif ($node instanceof NodeSetKey
66
+        if     ($node instanceof NodeItem ) {
67
+            $type = self::SEQUENCE;
68
+        } elseif ($node instanceof NodeKey) {
69
+            $type = self::MAPPING;
70
+        } elseif ($node instanceof NodeSetKey
65 71
              || $node instanceof NodeSetValue) {
66 72
             $type = self::SET;
67 73
         } elseif ($node instanceof NodeScalar ){
Please login to merge, or discard this patch.
sources/Builder.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,8 +89,12 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public static function getScalar(string $v, bool $onlyScalar = false)
91 91
     {
92
-        if (Regex::isDate($v))   return self::$dateAsObject && !$onlyScalar ? date_create($v) : $v;
93
-        if (Regex::isNumber($v)) return self::getNumber($v);
92
+        if (Regex::isDate($v)) {
93
+            return self::$dateAsObject && !$onlyScalar ? date_create($v) : $v;
94
+        }
95
+        if (Regex::isNumber($v)) {
96
+            return self::getNumber($v);
97
+        }
94 98
         $types = ['yes'   => true,
95 99
                   'no'    => false,
96 100
                   'true'  => true,
@@ -113,8 +117,12 @@  discard block
 block discarded – undo
113 117
      */
114 118
     private static function getNumber(string $v)
115 119
     {
116
-        if (preg_match(Regex::OCTAL_NUM, $v)) return intval(base_convert($v, 8, 10));
117
-        if (preg_match(Regex::HEX_NUM, $v))   return intval(base_convert($v, 16, 10));
120
+        if (preg_match(Regex::OCTAL_NUM, $v)) {
121
+            return intval(base_convert($v, 8, 10));
122
+        }
123
+        if (preg_match(Regex::HEX_NUM, $v)) {
124
+            return intval(base_convert($v, 16, 10));
125
+        }
118 126
         return is_bool(strpos($v, '.')) || substr_count($v, '.') > 1 ? intval($v) : floatval($v);
119 127
     }
120 128
 
Please login to merge, or discard this patch.