You are here

class Yaml in Drupal 10

Same name in this branch
  1. 10 core/lib/Drupal/Core/Serialization/Yaml.php \Drupal\Core\Serialization\Yaml
  2. 10 core/lib/Drupal/Component/Serialization/Yaml.php \Drupal\Component\Serialization\Yaml
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Serialization/Yaml.php \Drupal\Core\Serialization\Yaml
  2. 9 core/lib/Drupal/Core/Serialization/Yaml.php \Drupal\Core\Serialization\Yaml

Provides a YAML serialization implementation.

Allow settings to override the YAML implementation resolution.

Hierarchy

Expanded class hierarchy of Yaml

33 files declare their use of Yaml
ckeditor5-3259593.php in core/modules/ckeditor5/tests/fixtures/update/ckeditor5-3259593.php
Test fixture.
ConfigController.php in core/modules/config/src/Controller/ConfigController.php
ConfigExportUITest.php in core/modules/config/tests/src/Functional/ConfigExportUITest.php
ConfigImportUITest.php in core/modules/config/tests/src/Functional/ConfigImportUITest.php
ConfigInstallProfileUnmetDependenciesTest.php in core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php

... See full list

File

core/lib/Drupal/Core/Serialization/Yaml.php, line 13

Namespace

Drupal\Core\Serialization
View source
class Yaml extends ComponentYaml {

  /**
   * {@inheritdoc}
   */
  protected static function getSerializer() {

    // Allow settings.php to override the YAML serializer.
    if (!isset(static::$serializer) && ($class = Settings::get('yaml_parser_class'))) {
      static::$serializer = $class;
    }
    return parent::getSerializer();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Yaml::$serializer protected static property The YAML implementation to use.
Yaml::decode public static function Decodes data from the serialization format. Overrides SerializationInterface::decode
Yaml::encode public static function Encodes data into the serialization format. Overrides SerializationInterface::encode
Yaml::getFileExtension public static function Gets the file extension for this serialization format. Overrides SerializationInterface::getFileExtension
Yaml::getSerializer protected static function Determines which implementation to use for parsing YAML. Overrides Yaml::getSerializer