function Yaml::parse
Parses YAML into a PHP value.
Usage: <code> $array = Yaml::parse(file_get_contents('config.yml')); print_r($array); </code>
Parameters
string $input A string containing YAML:
int-mask-of<self::PARSE_*> $flags A bit field of PARSE_* constants to customize the YAML parser behavior:
Throws
ParseException If the YAML is not valid
8 calls to Yaml::parse()
- AutoAddedKeysSniff::process in vendor/
drupal/ coder/ coder_sniffer/ Drupal/ Sniffs/ InfoFiles/ AutoAddedKeysSniff.php - Processes this test, when one of its tokens is encountered.
- CoreVersionRequirementSniff::process in vendor/
drupal/ coder/ coder_sniffer/ DrupalPractice/ Sniffs/ InfoFiles/ CoreVersionRequirementSniff.php - Processes this test, when one of its tokens is encountered.
- DependenciesArraySniff::process in vendor/
drupal/ coder/ coder_sniffer/ Drupal/ Sniffs/ InfoFiles/ DependenciesArraySniff.php - Processes this test when one of its tokens is encountered.
- Extension::parseInfo in vendor/
mglaman/ phpstan-drupal/ src/ Drupal/ Extension.php - FailureMarker::getData in core/
modules/ package_manager/ src/ FailureMarker.php - Gets the data from the file if it exists.
File
-
vendor/
symfony/ yaml/ Yaml.php, line 73
Class
- Yaml
- Yaml offers convenience methods to load and dump YAML.
Namespace
Symfony\Component\YamlCode
public static function parse(string $input, int $flags = 0) : mixed {
$yaml = new Parser();
return $yaml->parse($input, $flags);
}