function Yaml::decode
Overrides SerializationInterface::decode
7 calls to Yaml::decode()
- Finder::__construct in core/
lib/ Drupal/ Core/ DefaultContent/ Finder.php - GenerateTheme::execute in core/
lib/ Drupal/ Core/ Command/ GenerateTheme.php - Executes the current command.
- GenerateTheme::loadStarterKitConfig in core/
lib/ Drupal/ Core/ Command/ GenerateTheme.php - InstalledPackage::scanForProjectName in core/
modules/ package_manager/ src/ InstalledPackage.php - Scans a given path to determine the Drupal project name.
- Recipe::parse in core/
lib/ Drupal/ Core/ Recipe/ Recipe.php - Parses and validates a recipe.yml file.
File
-
core/
lib/ Drupal/ Component/ Serialization/ Yaml.php, line 32
Class
- Yaml
- Provides a YAML serialization implementation using symfony/yaml.
Namespace
Drupal\Component\SerializationCode
public static function decode($raw) {
try {
$yaml = new Parser();
// Make sure we have a single trailing newline. A very simple config like
// 'foo: bar' with no newline will fail to parse otherwise.
return $yaml->parse($raw, SymfonyYaml::PARSE_EXCEPTION_ON_INVALID_TYPE | SymfonyYaml::PARSE_CUSTOM_TAGS);
} catch (\Exception $e) {
throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e);
}
}