src/Util/Yaml/Dumper.php
private static function requiresSingleQuoting(string $value): bool
	{
		// Determines if a PHP value is entirely composed of a value that would
		// require single quoting in YAML.
		if (\in_array(\strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'], true)) {
			return true;
		}

		// Determines if the PHP value contains any single characters that would
		// cause it to require single quoting in YAML.
		return \preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
	}
private static function requiresSingleQuoting(string $value): bool
	{
		// Determines if a PHP value is entirely composed of a value that would
		// require single quoting in YAML.
		if (\in_array(\strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'], true)) {
			return true;
		}

		// Determines if the PHP value contains any single characters that would
		// cause it to require single quoting in YAML.
		return \preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
	}
private static function requiresSingleQuoting ( string $ value ) : bool { // Determines if a PHP value is entirely composed of a value that would // require single quoting in YAML. if ( \ in_array ( \ strtolower ( $ value ) , [ 'null' , '~' , 'true' , 'false' , 'y' , 'n' , 'yes' , 'no' , 'on' , 'off' ] , true ) ) { return true ; } // Determines if the PHP value contains any single characters that would // cause it to require single quoting in YAML. return \ preg_match ( '/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x' , $ value ) ; }
Determines if a PHP value would require single quoting in YAML.

@param string $value A PHP value

@return bool True if the value would require single quotes
Determines if a PHP value would require single quoting in YAML .