@@ -227,7 +227,7 @@ private function doParse(string $value, int $flags)
227227 }
228228
229229 if (!\is_string ($ key ) && !\is_int ($ key )) {
230- throw new ParseException (sprintf ( ' %s keys are not supported. Quote your evaluable mapping keys instead. ', is_numeric ( $ key ) ? ' Numeric ' : ' Non-string ' ) , $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine );
230+ throw new ParseException (( is_numeric ( $ key ) ? ' Numeric ' : ' Non-string ' ). ' keys are not supported. Quote your evaluable mapping keys instead. ' , $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine );
231231 }
232232
233233 // Convert float keys to strings, to avoid being converted to integers by PHP
@@ -242,7 +242,7 @@ private function doParse(string $value, int $flags)
242242 $ refName = substr (rtrim ($ values ['value ' ]), 1 );
243243 if (!\array_key_exists ($ refName , $ this ->refs )) {
244244 if (false !== $ pos = array_search ($ refName , $ this ->refsBeingParsed , true )) {
245- throw new ParseException (sprintf ('Circular reference [%s, %s ] detected for reference "%s". ' , implode (', ' , \array_slice ($ this ->refsBeingParsed , $ pos )), $ refName , $ refName ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
245+ throw new ParseException (sprintf ('Circular reference [%s] detected for reference "%s". ' , implode (', ' , array_merge ( \array_slice ($ this ->refsBeingParsed , $ pos ), [ $ refName])) , $ refName ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
246246 }
247247
248248 throw new ParseException (sprintf ('Reference "%s" does not exist. ' , $ refName ), $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine , $ this ->filename );
@@ -724,7 +724,7 @@ private function parseValue(string $value, int $flags, string $context)
724724
725725 if (!\array_key_exists ($ value , $ this ->refs )) {
726726 if (false !== $ pos = array_search ($ value , $ this ->refsBeingParsed , true )) {
727- throw new ParseException (sprintf ('Circular reference [%s, %s ] detected for reference "%s". ' , implode (', ' , \array_slice ($ this ->refsBeingParsed , $ pos )), $ value , $ value ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
727+ throw new ParseException (sprintf ('Circular reference [%s] detected for reference "%s". ' , implode (', ' , array_merge ( \array_slice ($ this ->refsBeingParsed , $ pos ), [ $ value])) , $ value ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
728728 }
729729
730730 throw new ParseException (sprintf ('Reference "%s" does not exist. ' , $ value ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
@@ -1217,7 +1217,7 @@ private function lexInlineQuotedString(int &$cursor = 0): string
12171217 }
12181218 } while ($ this ->moveToNextLine ());
12191219
1220- throw new ParseException ('Malformed inline YAML string ' );
1220+ throw new ParseException ('Malformed inline YAML string. ' );
12211221 }
12221222
12231223 private function lexUnquotedString (int &$ cursor ): string
@@ -1288,7 +1288,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag): string
12881288 }
12891289 } while ($ this ->moveToNextLine ());
12901290
1291- throw new ParseException ('Malformed inline YAML string ' );
1291+ throw new ParseException ('Malformed inline YAML string. ' );
12921292 }
12931293
12941294 private function consumeWhitespaces (int &$ cursor ): bool
0 commit comments