@@ -297,7 +297,7 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi
297297 $ i += \strlen ($ output );
298298 $ output = trim ($ output );
299299 } else {
300- throw new ParseException (sprintf ('Malformed inline YAML string: %s . ' , $ scalar ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
300+ throw new ParseException (sprintf ('Malformed inline YAML string: "%s" . ' , $ scalar ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
301301 }
302302
303303 // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >)
@@ -321,7 +321,7 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi
321321 private static function parseQuotedScalar (string $ scalar , int &$ i ): string
322322 {
323323 if (!Parser::preg_match ('/ ' .self ::REGEX_QUOTED_STRING .'/Au ' , substr ($ scalar , $ i ), $ match )) {
324- throw new ParseException (sprintf ('Malformed inline YAML string: %s . ' , substr ($ scalar , $ i )), self ::$ parsedLineNumber + 1 , $ scalar , self ::$ parsedFilename );
324+ throw new ParseException (sprintf ('Malformed inline YAML string: "%s" . ' , substr ($ scalar , $ i )), self ::$ parsedLineNumber + 1 , $ scalar , self ::$ parsedFilename );
325325 }
326326
327327 $ output = substr ($ match [0 ], 1 , \strlen ($ match [0 ]) - 2 );
@@ -397,7 +397,7 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0,
397397 ++$ i ;
398398 }
399399
400- throw new ParseException (sprintf ('Malformed inline YAML string: %s . ' , $ sequence ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
400+ throw new ParseException (sprintf ('Malformed inline YAML string: "%s" . ' , $ sequence ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
401401 }
402402
403403 /**
@@ -538,7 +538,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
538538 }
539539 }
540540
541- throw new ParseException (sprintf ('Malformed inline YAML string: %s . ' , $ mapping ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
541+ throw new ParseException (sprintf ('Malformed inline YAML string: "%s" . ' , $ mapping ), self ::$ parsedLineNumber + 1 , null , self ::$ parsedFilename );
542542 }
543543
544544 /**
0 commit comments