Completed
Push — master ( 86484b...f97b0a )
by stéphane
05:27
created
sources/Dumper.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public static function toString($dataType, int $options = null):string
45 45
     {
46
-        if (empty($dataType)) throw new \Exception(self::class.": No content to convert to Yaml");
46
+        if (empty($dataType)) {
47
+            throw new \Exception(self::class.": No content to convert to Yaml");
48
+        }
47 49
         self::$options = is_int($options) ? $options : self::OPTIONS;
48 50
         if (is_scalar($dataType)) {
49 51
             // TODO: what to woth comments ???
@@ -79,8 +81,12 @@  discard block
 block discarded – undo
79 81
     private static function dump($dataType, int $indent)
80 82
     {
81 83
         if (is_scalar($dataType)) {
82
-            if ($dataType === \INF) return '.inf';
83
-            if ($dataType === -\INF) return '-.inf';
84
+            if ($dataType === \INF) {
85
+                return '.inf';
86
+            }
87
+            if ($dataType === -\INF) {
88
+                return '-.inf';
89
+            }
84 90
             switch (gettype($dataType)) {
85 91
                 case 'boolean': return $dataType ? 'true' : 'false';
86 92
                 case 'float': //fall through
@@ -102,7 +108,9 @@  discard block
 block discarded – undo
102 108
      */
103 109
     private static function dumpYamlObject(YamlObject $obj)
104 110
     {
105
-        if ($obj->hasDocStart() && self::$result instanceof DLL) self::$result->push("---");
111
+        if ($obj->hasDocStart() && self::$result instanceof DLL) {
112
+            self::$result->push("---");
113
+        }
106 114
         // self::dump($obj, 0);
107 115
         if (count($obj) > 0) {
108 116
             self::dumpArray($obj->getArrayCopy(), 0);
Please login to merge, or discard this patch.
examples/write.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,4 +21,6 @@
 block discarded – undo
21 21
 if ($nameResultPair[$testName] !== $text) {
22 22
     var_dump('EXPECTED', $nameResultPair[$testName]);
23 23
     var_dump('RECEIVED', $text);
24
-} else echo 'OK';
24
+} else {
25
+    echo 'OK';
26
+}
Please login to merge, or discard this patch.