@@ -17,7 +17,7 @@ |
||
17 | 17 | $result = ''; |
18 | 18 | $list = $list->filterComment(); |
19 | 19 | if ($this->identifier !== '+') { |
20 | - self::litteralStripTrailing($list); |
|
20 | + self::litteralStripTrailing($list); |
|
21 | 21 | } |
22 | 22 | if ($list->count()) { |
23 | 23 | $list->setIteratorMode(NodeList::IT_MODE_DELETE); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function setIdentifier(string $keyString) |
36 | 36 | { |
37 | 37 | if ($keyString === '') { |
38 | - throw new \ParseError(sprintf(self::ERROR_NO_KEYNAME, $this->line)); |
|
38 | + throw new \ParseError(sprintf(self::ERROR_NO_KEYNAME, $this->line)); |
|
39 | 39 | } else { |
40 | 40 | $keyNode = NodeFactory::get($keyString); |
41 | 41 | if ($keyNode instanceof Tag || $keyNode instanceof Quoted) { |
@@ -61,7 +61,7 @@ discard block |
||
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 |
||
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) { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | public function add(NodeGeneric $child):NodeGeneric |
14 | 14 | { |
15 | - if($this->_parent instanceof NodeGeneric) { |
|
15 | + if ($this->_parent instanceof NodeGeneric) { |
|
16 | 16 | return $this->_parent->add($child); |
17 | 17 | } else { |
18 | 18 | throw new \ParseError(__METHOD__." no parent to add to", 1); |
@@ -29,7 +29,7 @@ |
||
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; |
@@ -34,7 +34,9 @@ |
||
34 | 34 | $built = is_null($this->value) ? null : $this->value->build(); |
35 | 35 | $stringKey = is_string($built) && Regex::isProperlyQuoted($built) ? trim($built, '\'" '): $built; |
36 | 36 | $key = json_encode($stringKey, JSON_PARTIAL_OUTPUT_ON_ERROR|JSON_UNESCAPED_SLASHES); |
37 | - if (empty($key)) throw new \Exception("Cant serialize complex key: ".var_export($this->value, true)); |
|
37 | + if (empty($key)) { |
|
38 | + throw new \Exception("Cant serialize complex key: ".var_export($this->value, true)); |
|
39 | + } |
|
38 | 40 | $parent->{trim($key, '\'" ')} = null; |
39 | 41 | return null; |
40 | 42 | } |
@@ -21,8 +21,8 @@ |
||
21 | 21 | $result = ''; |
22 | 22 | $list = $value->filterComment(); |
23 | 23 | if ($this->identifier !== '+') { |
24 | - self::litteralStripLeading($list); |
|
25 | - self::litteralStripTrailing($list); |
|
24 | + self::litteralStripLeading($list); |
|
25 | + self::litteralStripTrailing($list); |
|
26 | 26 | } |
27 | 27 | if ($list->count()) { |
28 | 28 | $refSeparator = ' '; |
@@ -31,10 +31,10 @@ |
||
31 | 31 | $result = $this->getChildValue($first, $indent); |
32 | 32 | foreach ($list as $child) { |
33 | 33 | $separator = ($result && $result[-1] === "\n") ? '' : $refSeparator; |
34 | - if($child->indent > $indent || $child instanceof Blank) { |
|
34 | + if ($child->indent > $indent || $child instanceof Blank) { |
|
35 | 35 | $separator = "\n"; |
36 | 36 | } |
37 | - $result .= $separator .$this->getChildValue($child, $indent); |
|
37 | + $result .= $separator.$this->getChildValue($child, $indent); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | return $result; |
@@ -12,6 +12,6 @@ |
||
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 |
@@ -21,12 +21,12 @@ |
||
21 | 21 | class LocalNamespace implements NamespaceInterface |
22 | 22 | { |
23 | 23 | public const LEGACY_TAGS_HANDLERS = ['!!str' => 'strHandler', |
24 | - '!!binary' => 'binaryHandler', |
|
25 | - '!set' => 'setHandler', |
|
26 | - '!!omap' => 'omapHandler', |
|
27 | - '!php/object' => 'symfonyPHPobjectHandler', |
|
28 | - '!inline' => 'inlineHandler', |
|
29 | - ]; |
|
24 | + '!!binary' => 'binaryHandler', |
|
25 | + '!set' => 'setHandler', |
|
26 | + '!!omap' => 'omapHandler', |
|
27 | + '!php/object' => 'symfonyPHPobjectHandler', |
|
28 | + '!inline' => 'inlineHandler', |
|
29 | + ]; |
|
30 | 30 | |
31 | 31 | |
32 | 32 | /** |
@@ -91,7 +91,7 @@ |
||
91 | 91 | // $list[] = self::strHandler($child)->raw; |
92 | 92 | $list[] = self::strHandler($child); |
93 | 93 | } |
94 | - return new Nodes\Scalar(implode('',$list), 0); |
|
94 | + return new Nodes\Scalar(implode('', $list), 0); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 |