Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Serialization / Yaml.php
1 <?php
2
3 namespace Drupal\Core\Serialization;
4
5 use Drupal\Core\Site\Settings;
6 use Drupal\Component\Serialization\Yaml as ComponentYaml;
7
8 /**
9  * Provides a YAML serialization implementation.
10  *
11  * Allow settings to override the YAML implementation resolution.
12  */
13 class Yaml extends ComponentYaml {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected static function getSerializer() {
19     // Allow settings.php to override the YAML serializer.
20     if (!isset(static::$serializer) &&
21       $class = Settings::get('yaml_parser_class')) {
22
23       static::$serializer = $class;
24     }
25     return parent::getSerializer();
26   }
27
28 }