Symfony\Component\Yaml\Escaper
Escaper encapsulates escaping rules for single and double-quoted YAML strings.
- Author: Matthew Lewinski <matthew@lewinski.org>
Synopsis
class Escaper
{
- // constants
- const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
- // methods
- public static Boolean requiresDoubleQuoting()
- public static string escapeWithDoubleQuotes()
- public static Boolean requiresSingleQuoting()
- public static string escapeWithSingleQuotes()
Constants
Name | Value |
---|---|
REGEX_CHARACTER_TO_ESCAPE | "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9" |
Members
private
- $escaped
- $escapees
Methods
public
- escapeWithDoubleQuotes() — Escapes and surrounds a PHP value with double quotes.
- escapeWithSingleQuotes() — Escapes and surrounds a PHP value with single quotes.
- requiresDoubleQuoting() — Determines if a PHP value would require double quoting in YAML.
- requiresSingleQuoting() — Determines if a PHP value would require single quoting in YAML.