@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $dumpHandler = new DumperHandlers($options); |
| 50 | 50 | if (is_scalar($dataType)) { |
| 51 | 51 | // TODO: what to woth comments ??? |
| 52 | - return "--- ".$dumpHandler->dumpScalar($dataType, 0). self::LINEFEED ; |
|
| 52 | + return "--- ".$dumpHandler->dumpScalar($dataType, 0).self::LINEFEED; |
|
| 53 | 53 | } |
| 54 | 54 | return $dumpHandler->dump($dataType, 0); |
| 55 | 55 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function __construct(string $nodeString, int $line) |
| 14 | 14 | { |
| 15 | 15 | parent::__construct($nodeString, $line); |
| 16 | - preg_match_all(Regex::MAPPING_VALUES, trim(substr(trim($nodeString), 1,-1)), $matches); |
|
| 16 | + preg_match_all(Regex::MAPPING_VALUES, trim(substr(trim($nodeString), 1, -1)), $matches); |
|
| 17 | 17 | foreach ($matches['k'] as $index => $property) { |
| 18 | 18 | $pair = $property.': '.trim($matches['v'][$index]); |
| 19 | 19 | $child = NodeFactory::get($pair, $line); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | throw new \Exception(__METHOD__." expects a YamlObject as parent", 1); |
| 39 | 39 | } |
| 40 | 40 | if (!is_null($this->value)) { |
| 41 | - if ($this->value instanceof Tag){ |
|
| 41 | + if ($this->value instanceof Tag) { |
|
| 42 | 42 | $parent->addTag($this->value->tag); |
| 43 | 43 | $this->value->build($parent); |
| 44 | 44 | } else { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function __construct(string $nodeString, int $line) |
| 19 | 19 | { |
| 20 | 20 | parent::__construct($nodeString, $line); |
| 21 | - preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(trim($nodeString), 1,-1)), $matches); |
|
| 21 | + preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(trim($nodeString), 1, -1)), $matches); |
|
| 22 | 22 | foreach ($matches['item'] as $key => $item) { |
| 23 | 23 | $i = new Item('', $line); |
| 24 | 24 | $i->indent = null; |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | public function getTargetOnLessIndent(NodeGeneric &$node):NodeGeneric |
| 50 | 50 | { |
| 51 | - if ($node instanceof Scalar || $node instanceof Blank ) { |
|
| 51 | + if ($node instanceof Scalar || $node instanceof Blank) { |
|
| 52 | 52 | return $this->getParent(); |
| 53 | 53 | } else { |
| 54 | 54 | return $this->getParent($node->indent); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | if (is_null($this->value)) $this->value = new NodeList(); |
| 36 | 36 | $candidate = $child; |
| 37 | - if (!$child->isOneOf( ['Scalar', 'Blank', 'Comment', 'Quoted'])) { |
|
| 37 | + if (!$child->isOneOf(['Scalar', 'Blank', 'Comment', 'Quoted'])) { |
|
| 38 | 38 | $candidate = new Scalar((string) $child->raw, $child->line); |
| 39 | 39 | } |
| 40 | 40 | return parent::add($candidate); |
@@ -94,7 +94,7 @@ discard block |
||
| 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 = ''; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function getParent(int $indent = null):NodeGeneric |
| 73 | 73 | { |
| 74 | - if (!is_int($indent)){ |
|
| 74 | + if (!is_int($indent)) { |
|
| 75 | 75 | if ($this->_parent instanceof NodeGeneric) { |
| 76 | 76 | return $this->_parent; |
| 77 | 77 | } else { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if ($this->tag) $props['tag'] = "($this->tag)"; |
| 246 | 246 | if ($this->value) $props['value'] = $this->value; |
| 247 | 247 | // $props['value'] = $this->value; |
| 248 | - $props['raw'] = $this->raw; |
|
| 248 | + $props['raw'] = $this->raw; |
|
| 249 | 249 | if (!$this->_parent) $props['parent'] = 'NO PARENT!!!'; |
| 250 | 250 | return $props; |
| 251 | 251 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ($value instanceof Key && $child instanceof Key) { |
| 32 | 32 | if ($value->indent === $child->indent) { |
| 33 | 33 | return parent::add($child); |
| 34 | - } elseif ($value->isAwaitingChild($child)){ |
|
| 34 | + } elseif ($value->isAwaitingChild($child)) { |
|
| 35 | 35 | return $value->add($child); |
| 36 | 36 | } else { |
| 37 | 37 | // throw new \ParseError('key ('.$value->identifier.')@'.$value->line.' has already a value', 1); |
@@ -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) { |