@@ -212,7 +212,7 @@ private function doParse(string $value, int $flags)
212
212
array_pop ($ this ->refsBeingParsed );
213
213
}
214
214
} elseif (
215
- self ::preg_match ('#^(?P<key>(?:![^\s]++\s++)?(?: ' .Inline::REGEX_QUOTED_STRING .'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:( ++(?P<value>.+))?$#u ' , rtrim ($ this ->currentLine ), $ values )
215
+ self ::preg_match ('#^(?P<key>(?:![^\s]++\s++)?(?: ' .Inline::REGEX_QUOTED_STRING .'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t) ++(?P<value>.+))?$#u ' , rtrim ($ this ->currentLine ), $ values )
216
216
&& (false === strpos ($ values ['key ' ], ' # ' ) || \in_array ($ values ['key ' ][0 ], ['" ' , "' " ]))
217
217
) {
218
218
if ($ context && 'sequence ' == $ context ) {
@@ -230,7 +230,7 @@ private function doParse(string $value, int $flags)
230
230
}
231
231
232
232
if (!\is_string ($ key ) && !\is_int ($ key )) {
233
- 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 );
233
+ throw new ParseException (( is_numeric ( $ key ) ? ' Numeric ' : ' Non-string ' ). ' keys are not supported. Quote your evaluable mapping keys instead. ' , $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine );
234
234
}
235
235
236
236
// Convert float keys to strings, to avoid being converted to integers by PHP
@@ -245,7 +245,7 @@ private function doParse(string $value, int $flags)
245
245
$ refName = substr (rtrim ($ values ['value ' ]), 1 );
246
246
if (!\array_key_exists ($ refName , $ this ->refs )) {
247
247
if (false !== $ pos = array_search ($ refName , $ this ->refsBeingParsed , true )) {
248
- 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 );
248
+ 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 );
249
249
}
250
250
251
251
throw new ParseException (sprintf ('Reference "%s" does not exist. ' , $ refName ), $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine , $ this ->filename );
@@ -732,7 +732,7 @@ private function parseValue(string $value, int $flags, string $context)
732
732
733
733
if (!\array_key_exists ($ value , $ this ->refs )) {
734
734
if (false !== $ pos = array_search ($ value , $ this ->refsBeingParsed , true )) {
735
- 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 );
735
+ 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 );
736
736
}
737
737
738
738
throw new ParseException (sprintf ('Reference "%s" does not exist. ' , $ value ), $ this ->currentLineNb + 1 , $ this ->currentLine , $ this ->filename );
@@ -1225,7 +1225,7 @@ private function lexInlineQuotedString(int &$cursor = 0): string
1225
1225
}
1226
1226
} while ($ this ->moveToNextLine ());
1227
1227
1228
- throw new ParseException ('Malformed inline YAML string ' );
1228
+ throw new ParseException ('Malformed inline YAML string. ' );
1229
1229
}
1230
1230
1231
1231
private function lexUnquotedString (int &$ cursor ): string
@@ -1296,7 +1296,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag): string
1296
1296
}
1297
1297
} while ($ this ->moveToNextLine ());
1298
1298
1299
- throw new ParseException ('Malformed inline YAML string ' );
1299
+ throw new ParseException ('Malformed inline YAML string. ' );
1300
1300
}
1301
1301
1302
1302
private function consumeWhitespaces (int &$ cursor ): bool
0 commit comments