Test Failed
Push — master ( 41f581...fc4f20 )
by stéphane
13:19
created
sources/Dumper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         self::$options = is_int($options) ? $options : self::OPTIONS;
42 42
         $dumpHandler = new DumperHandlers($options);
43 43
         if (is_scalar($dataType)) {
44
-            return "--- ".$dumpHandler->dumpScalar($dataType). self::LINEFEED ;
44
+            return "--- ".$dumpHandler->dumpScalar($dataType).self::LINEFEED;
45 45
         }
46 46
         return $dumpHandler->dump($dataType, 0);
47 47
     }
Please login to merge, or discard this patch.
sources/DumperHandlers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
         // \x20 \xA0 \x85 \u2028 \u2029
191 191
         // A A A"
192 192
         $str = json_encode(ltrim($str));
193
-        return strspn(substr($str,1,-1), "-:?{}[]#,&*!>|'\"%") > 0 ? $str : trim($str, '"');
193
+        return strspn(substr($str, 1, -1), "-:?{}[]#,&*!>|'\"%") > 0 ? $str : trim($str, '"');
194 194
     }
195 195
 
196 196
     public function dumpTagged(Tagged $obj, int $indent):string
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
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 {
13 13
     public function build(&$parent = null)
14 14
     {
15
-        return substr(Scalar::replaceSequences(trim($this->raw)), 1,-1);
15
+        return substr(Scalar::replaceSequences(trim($this->raw)), 1, -1);
16 16
     }
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
sources/nodes/Scalar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function getTargetOnLessIndent(NodeGeneric &$node):NodeGeneric
51 51
     {
52
-        if ($node instanceof Scalar || $node instanceof Blank ) {
52
+        if ($node instanceof Scalar || $node instanceof Blank) {
53 53
             return $this->getParent();
54 54
         } else {
55 55
             return $this->getParent($node->indent);
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
         return array_key_exists(strtolower($v), $types) ? $types[strtolower($v)] : self::replaceSequences($v);
111 111
     }
112 112
 
113
-    public function replaceSequences($value='')
113
+    public function replaceSequences($value = '')
114 114
     {
115
-      $replaceUnicodeSeq = function ($matches) {
115
+      $replaceUnicodeSeq = function($matches) {
116 116
             return json_decode('"'.$matches[1].'"');
117 117
       };
118
-      $replaceNonPrintable = function ($matches) {
118
+      $replaceNonPrintable = function($matches) {
119 119
             // var_dump($matches[1]);
120 120
         return $matches[1]."";
121 121
       };
Please login to merge, or discard this patch.
examples/read.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
6 6
 /**
7 7
  * Display some use cases for Yaml library
8 8
  */
9
-const JSON_OPTIONS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION | JSON_PARTIAL_OUTPUT_ON_ERROR;
9
+const JSON_OPTIONS = JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_LINE_TERMINATORS|JSON_UNESCAPED_UNICODE|JSON_PRESERVE_ZERO_FRACTION|JSON_PARTIAL_OUTPUT_ON_ERROR;
10 10
 
11 11
 $debug = (int) (isset($argv[1]) ? $argv[1] : null);
12 12
 
13
-echo memory_get_usage() . "\n";
13
+echo memory_get_usage()."\n";
14 14
 /* USE CASE 1
15 15
 * load and parse if file exists
16 16
 */
17
-$content = file_get_contents('./tests/cases/examples/Example_2_25.yml');//var_dump($content);
17
+$content = file_get_contents('./tests/cases/examples/Example_2_25.yml'); //var_dump($content);
18 18
 $yaml = Yaml::parse($content, 0, $debug);
19 19
 
20
-echo memory_get_usage() . "\n";
20
+echo memory_get_usage()."\n";
21 21
 // var_dump($yaml);
22 22
 var_dump(json_encode($yaml, JSON_OPTIONS));
23 23
 exit(0);
Please login to merge, or discard this patch.
examples/write.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 define('PROJECT_ROOT', __DIR__."/../");
3 3
 
4
-require_once PROJECT_ROOT . 'vendor/autoload.php';
4
+require_once PROJECT_ROOT.'vendor/autoload.php';
5 5
 
6 6
 use Dallgoot\Yaml;
7 7
 // use Dallgoot\Yaml\{Loader, Dumper};
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 // $yaml = (new Loader('./dummy.yml', null, 0))->parse();
15 15
 // var_dump($yaml);
16 16
 $testName = 'yamlObject_properties';
17
-$yamlObject = (include PROJECT_ROOT . "tests/cases/dumping/$testName.php");
18
-echo memory_get_usage() . "\n";
17
+$yamlObject = (include PROJECT_ROOT."tests/cases/dumping/$testName.php");
18
+echo memory_get_usage()."\n";
19 19
 
20 20
 $text = Yaml::dump($yamlObject, 0);
21 21
 
22
-echo memory_get_usage() . "\n";
23
-$nameResultPair = get_object_vars(/** @scrutinizer ignore-type */ Yaml::parseFile(PROJECT_ROOT . 'tests/definitions/dumping_tests.yml'));
22
+echo memory_get_usage()."\n";
23
+$nameResultPair = get_object_vars(/** @scrutinizer ignore-type */ Yaml::parseFile(PROJECT_ROOT.'tests/definitions/dumping_tests.yml'));
24 24
 
25 25
 // var_dump($nameResultPair);
26 26
 
Please login to merge, or discard this patch.