@@ -37,6 +37,9 @@ discard block |
||
| 37 | 37 | private const EXCEPTION_READ_ERROR = self::class.": file '%s' failed to be loaded (permission denied ?)"; |
| 38 | 38 | private const EXCEPTION_LINE_SPLIT = self::class.": content is not a string(maybe a file error?)"; |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $absolutePath |
|
| 42 | + */ |
|
| 40 | 43 | public function __construct($absolutePath = null, $options = null, $debug = 0) |
| 41 | 44 | { |
| 42 | 45 | $this->debug = is_int($debug) ? min($debug, 3) : 1; |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | return $this; |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param string $strContent |
|
| 81 | + */ |
|
| 76 | 82 | private function getSourceIterator($strContent = null) |
| 77 | 83 | { |
| 78 | 84 | $source = $this->content ?? preg_split("/\n/m", preg_replace('/(\r\n|\r)/', "\n", $strContent), 0, PREG_SPLIT_DELIM_CAPTURE); |
@@ -181,9 +181,9 @@ |
||
| 181 | 181 | $this->value = $nodeValue; |
| 182 | 182 | return; |
| 183 | 183 | } elseif (in_array($first, ['{', '['])) { |
| 184 | - $this->onCompact(trim($nodeValue)); |
|
| 185 | - return; |
|
| 186 | - } elseif (in_array($first, ['!', '&', '*'])) { |
|
| 184 | + $this->onCompact(trim($nodeValue)); |
|
| 185 | + return; |
|
| 186 | + } elseif (in_array($first, ['!', '&', '*'])) { |
|
| 187 | 187 | $this->onNodeAction($nodeValue); |
| 188 | 188 | return; |
| 189 | 189 | } elseif(in_array($first, ['?', ':'])) {// Note : php don't like '?' as an array key -_-' |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | if ($n->type & (Y::REF_CALL|Y::SCALAR)) return self::getScalar((string) $n->value); |
| 28 | 28 | if ($n->type & Y::JSON) return $n->value; |
| 29 | 29 | $expected = [Y::QUOTED => trim((string) $n->value, "\"'"), |
| 30 | - Y::RAW => strval((string) $n->value)]; |
|
| 30 | + Y::RAW => strval((string) $n->value)]; |
|
| 31 | 31 | return $expected[$n->type] ?? null; |
| 32 | 32 | } |
| 33 | 33 | |