@@ -33,7 +33,7 @@ discard block |
||
| 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 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | // $list[] = self::strHandler($child)->raw; |
| 105 | 105 | $list[] = self::strHandler($child); |
| 106 | 106 | } |
| 107 | - return new NodeScalar(implode('',$list), 0); |
|
| 107 | + return new NodeScalar(implode('', $list), 0); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | public static function transform(string $identifier, $value) |
| 172 | 172 | { |
| 173 | 173 | if (self::isKnown($identifier)) { |
| 174 | - if (!($value instanceof Node) && !($value instanceof NodeList) ) { |
|
| 174 | + if (!($value instanceof Node) && !($value instanceof NodeList)) { |
|
| 175 | 175 | throw new \Exception(sprintf(self::WRONG_VALUE, $identifier, gettype($value))); |
| 176 | 176 | } |
| 177 | 177 | return self::$registeredHandlers[$identifier]($value); |
@@ -125,8 +125,12 @@ |
||
| 125 | 125 | try { |
| 126 | 126 | foreach ($generator as $lineNb => $lineString) { |
| 127 | 127 | $node = NodeFactory::get($lineString, $lineNb); |
| 128 | - if ($this->_debug === 1) echo get_class($node)."\n"; |
|
| 129 | - if ($this->needsSpecialProcess($node, $previous)) continue; |
|
| 128 | + if ($this->_debug === 1) { |
|
| 129 | + echo get_class($node)."\n"; |
|
| 130 | + } |
|
| 131 | + if ($this->needsSpecialProcess($node, $previous)) { |
|
| 132 | + continue; |
|
| 133 | + } |
|
| 130 | 134 | $this->attachBlankLines($previous); |
| 131 | 135 | switch ($node->indent <=> $previous->indent) { |
| 132 | 136 | case -1: $target = $previous->getTargetOnLessIndent($node); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function setIdentifier(string $keyString) |
| 34 | 34 | { |
| 35 | 35 | if ($keyString === '') { |
| 36 | - throw new \ParseError(sprintf(self::ERROR_NO_KEYNAME, $this->line)); |
|
| 36 | + throw new \ParseError(sprintf(self::ERROR_NO_KEYNAME, $this->line)); |
|
| 37 | 37 | } else { |
| 38 | 38 | $keyNode = NodeFactory::get($keyString); |
| 39 | 39 | if ($keyNode instanceof NodeTag || $keyNode instanceof NodeQuoted) { |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | $result = $this->getChildValue($first, $indent); |
| 33 | 33 | foreach ($list as $child) { |
| 34 | 34 | $separator = ($result && $result[-1] === "\n") ? '' : $refSeparator; |
| 35 | - if($child->indent > $indent || $child instanceof NodeBlank) { |
|
| 35 | + if ($child->indent > $indent || $child instanceof NodeBlank) { |
|
| 36 | 36 | $separator = "\n"; |
| 37 | 37 | } |
| 38 | - $result .= $separator .$this->getChildValue($child, $indent); |
|
| 38 | + $result .= $separator.$this->getChildValue($child, $indent); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | return $result; |