Escaper

Escaper encapsulates escaping rules for single and double-quoted YAML strings.

author

Matthew Lewinski

Methods

Determines if a PHP value would require double quoting in YAML.

requiresDoubleQuoting(string $value) : Boolean
static

Arguments

$value

string

A PHP value

Response

Boolean

True if the value would require double quotes.

Escapes and surrounds a PHP value with double quotes.

escapeWithDoubleQuotes(string $value) : string
static

Arguments

$value

string

A PHP value

Response

string

The quoted, escaped string

Determines if a PHP value would require single quoting in YAML.

requiresSingleQuoting(string $value) : Boolean
static

Arguments

$value

string

A PHP value

Response

Boolean

True if the value would require single quotes.

Escapes and surrounds a PHP value with single quotes.

escapeWithSingleQuotes(string $value) : string
static

Arguments

$value

string

A PHP value

Response

string

The quoted, escaped string

Constants

REGEX_CHARACTER_TO_ESCAPE

REGEX_CHARACTER_TO_ESCAPE

Properties

escapees

escapees : 
static

escaped

escaped : 
static