@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $reflectAPI = new \ReflectionClass(self::class); |
59 | 59 | $methodsList = []; |
60 | - $list = $reflectAPI->getMethods(RM::IS_FINAL | RM::IS_STATIC & RM::IS_PRIVATE); |
|
60 | + $list = $reflectAPI->getMethods(RM::IS_FINAL|RM::IS_STATIC & RM::IS_PRIVATE); |
|
61 | 61 | foreach ($list as $method) { |
62 | 62 | $methodsList[$method->name] = $method->getClosure($this); |
63 | 63 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | private function checkHandlerArgument($tagName, $node) |
79 | 79 | { |
80 | - if (!($node instanceof Node) && !($node instanceof NodeList) ) { |
|
80 | + if (!($node instanceof Node) && !($node instanceof NodeList)) { |
|
81 | 81 | throw new \Exception(sprintf(self::WRONG_VALUE, $tagName, gettype($node))); |
82 | 82 | } |
83 | 83 | } |
@@ -143,7 +143,7 @@ discard block |
||
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 |
||
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 = []; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function build(&$parent = null) |
30 | 30 | { |
31 | 31 | $built = is_object($this->value) ? $this->value->build($parent) : null; |
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; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function skipOnContext(Node &$target):bool |
23 | 23 | { |
24 | 24 | if (!$this->identifier) { |
25 | - $target = $target->getParent(-1);//if alone-on-line comment --> set parent to root |
|
25 | + $target = $target->getParent(-1); //if alone-on-line comment --> set parent to root |
|
26 | 26 | return true; |
27 | 27 | } |
28 | 28 | return false; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function getTargetOnLessIndent(Node $previous):Node |
32 | 32 | { |
33 | 33 | if ($this->indent === 0) { |
34 | - return $previous->getParent(-1);//get root |
|
34 | + return $previous->getParent(-1); //get root |
|
35 | 35 | } else { |
36 | 36 | return parent::getTargetOnLessIndent($previous); |
37 | 37 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function getTargetonEqualIndent(Node &$previous):Node |
48 | 48 | { |
49 | 49 | if ($this->indent === 0) { |
50 | - return $previous->getParent(-1);//get root |
|
50 | + return $previous->getParent(-1); //get root |
|
51 | 51 | } else { |
52 | 52 | return parent::getTargetonEqualIndent($previous); |
53 | 53 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | parent::__construct($nodeString, $line); |
16 | 16 | $this->value = new NodeList(); |
17 | - preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(ltrim($nodeString), 1,-1)), $matches); |
|
17 | + preg_match_all(Regex::SEQUENCE_VALUES, trim(substr(ltrim($nodeString), 1, -1)), $matches); |
|
18 | 18 | foreach ($matches['item'] as $key => $item) { |
19 | 19 | $this->value->push(new NodeItem('- '.$item, $line)); |
20 | 20 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $result = substr($first->raw, $first->indent); |
87 | 87 | foreach ($list as $child) { |
88 | 88 | if ($this instanceof NodeLitFolded) { |
89 | - if($child->indent > $refIndent || ($child instanceof NodeBlank)) { |
|
89 | + if ($child->indent > $refIndent || ($child instanceof NodeBlank)) { |
|
90 | 90 | $separator = "\n"; |
91 | 91 | } else { |
92 | 92 | $separator = !empty($result) && $result[-1] === "\n" ? '' : $refSeparator; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // $val .= $cursor->value; |
111 | 111 | }*/ |
112 | 112 | } |
113 | - $result .= $separator .$val; |
|
113 | + $result .= $separator.$val; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | return $result.($this->modifier === '-' ? "" : "\n"); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function __constructor(string $nodeString, int $line) |
14 | 14 | { |
15 | 15 | parent::__construct($nodeString, $line); |
16 | - preg_match_all(Regex::MAPPING_VALUES, trim(substr(ltrim($nodeString), 1,-1)), $matches); |
|
16 | + preg_match_all(Regex::MAPPING_VALUES, trim(substr(ltrim($nodeString), 1, -1)), $matches); |
|
17 | 17 | foreach ($matches['k'] as $index => $property) { |
18 | 18 | $pair = $property.': '.trim($matches['v'][$index]); |
19 | 19 | // $fakeMatches = [0 => $property, 1 => trim($matches['v'][$index])]; |
@@ -46,9 +46,9 @@ |
||
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); |