@@ -227,7 +227,7 @@ private function doParse(string $value, int $flags)
227
227
}
228
228
229
229
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 );
231
231
}
232
232
233
233
// Convert float keys to strings, to avoid being converted to integers by PHP
@@ -242,7 +242,7 @@ private function doParse(string $value, int $flags)
242
242
$ refName = substr (rtrim ($ values ['value ' ]), 1 );
243
243
if (!\array_key_exists ($ refName , $ this ->refs )) {
244
244
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 );
246
246
}
247
247
248
248
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)
724
724
725
725
if (!\array_key_exists ($ value , $ this ->refs )) {
726
726
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 ParseExcepti
8000
on (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 );
728
728
}
729
729
730
730
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
1217
1217
}
1218
1218
} while ($ this ->moveToNextLine ());
1219
1219
1220
- throw new ParseException ('Malformed inline YAML string ' );
1220
+ throw new ParseException ('Malformed inline YAML string. ' );
1221
1221
}
1222
1222
1223
1223
private function lexUnquotedString (int &$ cursor ): string
@@ -1288,7 +1288,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag): string
1288
1288
}
1289
1289
} while ($ this ->moveToNextLine ());
1290
1290
1291
- throw new ParseException ('Malformed inline YAML string ' );
1291
+ throw new ParseException ('Malformed inline YAML string. ' );
1292
1292
}
1293
1293
1294
1294
private function consumeWhitespaces (int &$ cursor ): bool
0 commit comments