Completed
Push — master ( 3eacba...3b6a73 )
by stéphane
02:25
created
sources/Dumper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         foreach ($array as $key => $item) {
144 144
             $lineStart = current($refKeys) === $key ? "- " : "- $key: ";
145 145
             if (is_scalar($item)) {
146
-                self::add($lineStart.self::dump($item,0), $indent);
146
+                self::add($lineStart.self::dump($item, 0), $indent);
147 147
             } else {
148 148
                 self::add(rtrim($lineStart), $indent);
149 149
                 self::dump($item, $indent + self::INDENT);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
         if (is_array($subject) || $subject instanceof \ArrayIterator) {
214 214
             $max = count($subject);
215 215
             $objectAsArray = is_array($subject) ? $subject : $subject->getArrayCopy();
216
-            if(array_keys($objectAsArray) !== range(0, $max-1)) {
216
+            if (array_keys($objectAsArray) !== range(0, $max - 1)) {
217 217
                 $pairs = $objectAsArray;
218 218
             } else {
219 219
                 $valuesList = [];
Please login to merge, or discard this patch.
examples/load_modify_save.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Dallgoot\Yaml;
3 3
 
4
-require_once __DIR__ . '/../../dependencies/autoload.php';
4
+require_once __DIR__.'/../../dependencies/autoload.php';
5 5
 
6 6
 use Dallgoot;
7 7
 
8
-$fileName = __DIR__ . '/../dummy.yml';
8
+$fileName = __DIR__.'/../dummy.yml';
9 9
 
10 10
 $yamlObject = Yaml::parseFile($fileName, $options = null, $debug = null);
11 11
 
Please login to merge, or discard this patch.
sources/nodes/NodeCompactSequence.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function __construct(string $nodeString, int $line)
14 14
     {
15 15
         parent::__construct($nodeString, $line);
16
-        preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(trim($nodeString), 1,-1)), $matches);
16
+        preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(trim($nodeString), 1, -1)), $matches);
17 17
         foreach ($matches['item'] as $key => $item) {
18 18
             $i = new NodeItem('', $line);
19 19
             $i->indent = null;
Please login to merge, or discard this patch.
sources/nodes/NodeQuoted.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(trim($this->raw), 1,-1);
15
+        return substr(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/NodeSetKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function build(&$parent = null)
30 30
     {
31 31
         $built = is_null($this->value) ? null : $this->value->build();
32
-        $stringKey = is_string($built) && Regex::isProperlyQuoted($built) ? trim($built, '\'" '): $built;
32
+        $stringKey = is_string($built) && Regex::isProperlyQuoted($built) ? trim($built, '\'" ') : $built;
33 33
         $key = json_encode($stringKey, JSON_PARTIAL_OUTPUT_ON_ERROR|JSON_UNESCAPED_SLASHES);
34 34
         if (empty($key)) throw new \Exception("Cant serialize complex key: ".var_export($this->value, true));
35 35
         $parent->{trim($key, '\'" ')} = null;
Please login to merge, or discard this patch.
sources/nodes/NodeScalar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
     public function getTargetOnLessIndent(Node &$node):Node
45 45
     {
46
-        if ($node instanceof NodeScalar || $node instanceof NodeBlank ) {
46
+        if ($node instanceof NodeScalar || $node instanceof NodeBlank) {
47 47
             return $this->getParent();
48 48
         } else {
49 49
             return $this->getParent($node->indent);
Please login to merge, or discard this patch.
sources/API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
             return $this->_anchors[$name];
70 70
         }
71 71
         throw new \UnexpectedValueException(sprintf(self::UNKNOWN_REFERENCE,
72
-                                                    $name, implode(',',array_keys($this->_anchors)))
72
+                                                    $name, implode(',', array_keys($this->_anchors)))
73 73
                                                 );
74 74
     }
75 75
 
Please login to merge, or discard this patch.
sources/types/YamlObject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
     public function __call($funcName, $arguments)
47 47
     {
48 48
         $reflectAPI = new \ReflectionClass(get_class($this->__yaml__object__api));
49
-        $getName    = function ($o) { return $o->name; };
49
+        $getName    = function($o) { return $o->name; };
50 50
         $publicApi  = array_map($getName, $reflectAPI->getMethods(\ReflectionMethod::IS_PUBLIC));
51
-        if (!in_array($funcName, $publicApi) ) {
51
+        if (!in_array($funcName, $publicApi)) {
52 52
             throw new \BadMethodCallException(sprintf(self::UNDEFINED_METHOD, $funcName, implode(",", $publicApi)));
53 53
         }
54 54
         return call_user_func_array([$this->__yaml__object__api, $funcName], $arguments);
Please login to merge, or discard this patch.
sources/TagFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $reflectAPI = new \ReflectionClass(self::class);
35 35
         $methodsList = [];
36
-        $list = $reflectAPI->getMethods(RM::IS_FINAL | RM::IS_STATIC & RM::IS_PRIVATE);
36
+        $list = $reflectAPI->getMethods(RM::IS_FINAL|RM::IS_STATIC & RM::IS_PRIVATE);
37 37
         foreach ($list as $method) {
38 38
             $methodsList[$method->name] = $method->getClosure();
39 39
         }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             foreach ($node as $key => $child) {
104 104
                 $list[] = self::strHandler($child)->raw;
105 105
             }
106
-            return new NodeScalar(implode('',$list), 0);
106
+            return new NodeScalar(implode('', $list), 0);
107 107
         }
108 108
     }
109 109
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     public static function transform(string $identifier, $value)
171 171
     {
172 172
         if (self::isKnown($identifier)) {
173
-            if (!($value instanceof Node) && !($value instanceof NodeList) ) {
173
+            if (!($value instanceof Node) && !($value instanceof NodeList)) {
174 174
                 throw new \Exception(sprintf(self::WRONG_VALUE, $identifier, gettype($value)));
175 175
             }
176 176
             return self::$registeredHandlers[$identifier]($value);
Please login to merge, or discard this patch.