@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function getTargetOnLessIndent(NodeGeneric &$node):NodeGeneric |
51 | 51 | { |
52 | - if ($node instanceof Scalar || $node instanceof Blank ) { |
|
52 | + if ($node instanceof Scalar || $node instanceof Blank) { |
|
53 | 53 | return $this->getParent(); |
54 | 54 | } else { |
55 | 55 | return $this->getParent($node->indent); |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | return array_key_exists(strtolower($v), $types) ? $types[strtolower($v)] : self::replaceSequences($v); |
111 | 111 | } |
112 | 112 | |
113 | - public static function replaceSequences($value='') |
|
113 | + public static function replaceSequences($value = '') |
|
114 | 114 | { |
115 | - $replaceUnicodeSeq = function ($matches) { |
|
115 | + $replaceUnicodeSeq = function($matches) { |
|
116 | 116 | return json_decode('"'.$matches[1].'"'); |
117 | 117 | }; |
118 | - $replaceNonPrintable = function ($matches) { |
|
118 | + $replaceNonPrintable = function($matches) { |
|
119 | 119 | // var_dump($matches[1]); |
120 | 120 | return $matches[1].""; |
121 | 121 | }; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | $previousCompactMode = $this->dumper->_compactMode; |
104 | - $this->dumper->_compactMode = true; |
|
104 | + $this->dumper->_compactMode = true; |
|
105 | 105 | $result = $this->dumper->iteratorToString(new \ArrayIterator($source), $keyMask, ', ', $indent); |
106 | 106 | $this->dumper->_compactMode = $previousCompactMode; |
107 | 107 | return sprintf($structureFormat, $result); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | // Example 5.13. Escaped Characters |
124 | 124 | |
125 | 125 | $str = json_encode(ltrim($str)); |
126 | - return strspn(substr($str,1,-1), "-:?{}[]#,&*!>|'\"%") > 0 ? $str : trim($str, '"'); |
|
126 | + return strspn(substr($str, 1, -1), "-:?{}[]#,&*!>|'\"%") > 0 ? $str : trim($str, '"'); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | public function dumpTagged(Tagged $obj, int $indent):string |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | //public |
21 | 21 | /* @var null|string */ |
22 | 22 | public static $error; |
23 | - public const IGNORE_DIRECTIVES = 1;//DONT include_directive |
|
24 | - public const IGNORE_COMMENTS = 2;//DONT include_comments |
|
25 | - public const NO_PARSING_EXCEPTIONS = 4;//DONT throw Exception on parsing errors |
|
26 | - public const NO_OBJECT_FOR_DATE = 8;//DONT import date strings as dateTime Object |
|
23 | + public const IGNORE_DIRECTIVES = 1; //DONT include_directive |
|
24 | + public const IGNORE_COMMENTS = 2; //DONT include_comments |
|
25 | + public const NO_PARSING_EXCEPTIONS = 4; //DONT throw Exception on parsing errors |
|
26 | + public const NO_OBJECT_FOR_DATE = 8; //DONT import date strings as dateTime Object |
|
27 | 27 | |
28 | 28 | //private |
29 | 29 | /* @var null|array */ |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | { |
180 | 180 | $deepest = $previous->getDeepestNode(); |
181 | 181 | if ($deepest instanceof Nodes\Partial) { |
182 | - return $deepest->specialProcess($current, $this->_blankBuffer); |
|
183 | - } elseif(!($current instanceof Nodes\Partial)) { |
|
182 | + return $deepest->specialProcess($current, $this->_blankBuffer); |
|
183 | + } elseif (!($current instanceof Nodes\Partial)) { |
|
184 | 184 | return $current->specialProcess($previous, $this->_blankBuffer); |
185 | 185 | } |
186 | 186 | return false; |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $buffer->push($child); |
52 | 52 | } |
53 | 53 | } |
54 | - $documents[] = self::buildDocument($buffer, count($documents) +1); |
|
54 | + $documents[] = self::buildDocument($buffer, count($documents) + 1); |
|
55 | 55 | } catch (\Throwable $e) { |
56 | 56 | throw new \Exception($e->getMessage(), 1, $e); |
57 | 57 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | private $handler; |
32 | 32 | |
33 | 33 | |
34 | - public function __construct($options=null) |
|
34 | + public function __construct($options = null) |
|
35 | 35 | { |
36 | 36 | $this->options = is_int($options) ? $options : self::OPTIONS; |
37 | 37 | $this->handler = new DumperHandlers($this); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | if (empty($dataType)) throw new \Exception(self::class.": No content to convert to Yaml"); |
52 | 52 | if (is_scalar($dataType)) { |
53 | - return "--- ".$this->handler->dumpScalar($dataType). self::LINEFEED ; |
|
53 | + return "--- ".$this->handler->dumpScalar($dataType).self::LINEFEED; |
|
54 | 54 | } |
55 | 55 | return $this->dump($dataType, 0); |
56 | 56 | } |