@@ -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; |
@@ -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 |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | public static function transform(string $identifier, $value) |
| 79 | 79 | { |
| 80 | 80 | if (self::isKnown($identifier)) { |
| 81 | - if (!($value instanceof NodeGeneric) && !($value instanceof NodeList) ) { |
|
| 81 | + if (!($value instanceof NodeGeneric) && !($value instanceof NodeList)) { |
|
| 82 | 82 | throw new \Exception(sprintf(self::WRONG_VALUE, $identifier, gettype($value))); |
| 83 | 83 | } |
| 84 | 84 | // return self::$tagsNamespaces[$identifier]($value); |
@@ -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 | |