Passed
Push — master ( f81cc4...5281ab )
by stéphane
04:50
created
sources/nodes/abstract/Literals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
      * @return     string  The child value.
95 95
      * @todo       double check behaviour for KEY and ITEM
96 96
      */
97
-    protected function getChildValue(object $child, $refIndent=0):string
97
+    protected function getChildValue(object $child, $refIndent = 0):string
98 98
     {
99 99
         $value = $child->value;
100 100
         $start = '';
Please login to merge, or discard this patch.
sources/nodes/Key.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function add(NodeGeneric $child):NodeGeneric
63 63
     {
64
-        if ($this->value instanceof NodeGeneric && $this->value->isOneOf('Literal','LiteralFolded', 'Anchor')) {
64
+        if ($this->value instanceof NodeGeneric && $this->value->isOneOf('Literal', 'LiteralFolded', 'Anchor')) {
65 65
             return $this->value->add($child);
66 66
         } else {
67 67
             return parent::add($child);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         if ($current instanceof Comment) {
97 97
             return true;
98 98
         }
99
-        if($current instanceof Scalar) {
99
+        if ($current instanceof Scalar) {
100 100
             return $node->isOneOf('Scalar', 'Blank');
101 101
         }
102 102
         if ($current instanceof Item) {
Please login to merge, or discard this patch.
examples/write.php 1 patch
Spacing   +3 added lines, -3 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,10 +14,10 @@  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");
17
+$yamlObject = (include PROJECT_ROOT."tests/cases/dumping/$testName.php");
18 18
 $text = Yaml::dump($yamlObject, 0);
19 19
 
20
-$nameResultPair = get_object_vars(Yaml::parseFile(PROJECT_ROOT . 'tests/definitions/dumping_tests.yml'));
20
+$nameResultPair = get_object_vars(Yaml::parseFile(PROJECT_ROOT.'tests/definitions/dumping_tests.yml'));
21 21
 
22 22
 // var_dump($nameResultPair);
23 23
 
Please login to merge, or discard this patch.
sources/DumperHandlers.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function dump($dataType, int $indent):string
34 34
     {
35
-        if(is_null($dataType)) {
35
+        if (is_null($dataType)) {
36 36
             return '';
37
-        } elseif(is_resource($dataType)) {
37
+        } elseif (is_resource($dataType)) {
38 38
             return get_resource_type($dataType);
39 39
         } elseif (is_scalar($dataType)) {
40 40
             return $this->dumpScalar($dataType, $indent);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             //var_dump("ARRAY");
74 74
             $iterator = new \ArrayIterator($compound);
75 75
             $mask = '-';
76
-            $refKeys = range(0, count($compound)-1);
76
+            $refKeys = range(0, count($compound) - 1);
77 77
             // var_dump("newarray",array_keys($compound), $refKeys);
78 78
             if (array_keys($compound) !== $refKeys) {
79 79
                 $mask = '%s:';
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
     }
112 112
 
113 113
 
114
-    private function iteratorToString(\Iterator $iterable, string $keyMask, int $indent, bool $isCompact=false):string
114
+    private function iteratorToString(\Iterator $iterable, string $keyMask, int $indent, bool $isCompact = false):string
115 115
     {
116 116
         $pairs = [];
117 117
         foreach ($iterable as $key => $value) {
118 118
             $separator = "\n";
119 119
             $valueIndent = $indent + self::INDENT;
120
-            if (is_scalar($value) || $value instanceof Compact || $value instanceof \DateTime ) {
120
+            if (is_scalar($value) || $value instanceof Compact || $value instanceof \DateTime) {
121 121
                 $separator   = ' ';
122 122
                 $valueIndent = 0;
123 123
             }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         if (is_array($subject) || $subject instanceof \ArrayIterator) {
146 146
             $max = count($subject);
147 147
             $objectAsArray = is_array($subject) ? $subject : $subject->getArrayCopy();
148
-            if(array_keys($objectAsArray) !== range(0, $max-1)) {
148
+            if (array_keys($objectAsArray) !== range(0, $max - 1)) {
149 149
                 $pairs = $objectAsArray;
150 150
             } else {
151 151
                 $valuesList = [];
Please login to merge, or discard this patch.
sources/nodes/DocStart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             throw new \Exception(__METHOD__." expects a YamlObject as parent", 1);
40 40
         }
41 41
         if (!is_null($this->value)) {
42
-            if ($this->value instanceof Tag){
42
+            if ($this->value instanceof Tag) {
43 43
                 if (!preg_match(Regex::TAG_PARTS, $this->value->raw, $matches)) {
44 44
                     throw new \UnexpectedValueException("Tag '$this->value->raw' is invalid", 1);
45 45
                 }
Please login to merge, or discard this patch.