diff --git a/core/lib/Drupal/Component/Yaml/Symfony.php b/core/lib/Drupal/Component/Yaml/Symfony.php index e262765..9371802 100644 --- a/core/lib/Drupal/Component/Yaml/Symfony.php +++ b/core/lib/Drupal/Component/Yaml/Symfony.php @@ -49,7 +49,7 @@ public function parse($input) { public function dump($value) { // The level where you switch to inline YAML is set to PHP_INT_MAX to ensure // this does not occur. - return $this->getDumper()->dump($value, PHP_INT_MAX); + return $this->getDumper()->dump($value, PHP_INT_MAX, 0, TRUE); } /** diff --git a/core/lib/Drupal/Component/Yaml/Yaml.php b/core/lib/Drupal/Component/Yaml/Yaml.php index e8cb4d3..c016f69 100644 --- a/core/lib/Drupal/Component/Yaml/Yaml.php +++ b/core/lib/Drupal/Component/Yaml/Yaml.php @@ -16,64 +16,64 @@ class Yaml implements YamlInterface { /** - * The YAML plugin class to use. + * The YAML implementation class to use. * * @var string */ - protected static $pluginClass; + protected static $implementationClass; /** - * Holds the YAML implementation. + * The current YAML implementation. * * @var \Drupal\Component\Yaml\YamlInterface */ - protected $plugin; + protected $implementation; /** * Instantiates the correct YAML object. */ public function __construct() { - $class = $this->determinePlugin(); - $this->plugin = new $class(); + $class = $this->determineImplementation(); + $this->implementation = new $class(); } /** * {@inheritdoc} */ public function parse($input) { - return $this->plugin->parse($input); + return $this->implementation->parse($input); } /** * {@inheritdoc} */ public function dump($value) { - return $this->plugin->dump($value); + return $this->implementation->dump($value); } /** * Determines the optimal implementation to use for encoding and parsing Yaml. * - * The selection is made based on the enabled PHP extensions with the - * most performant available option chosen. + * The selection is made based on the enabled PHP extensions, with the most + * performant available option chosen. * * @return string * The class name for the optimal YAML implementation. */ - protected function determinePlugin() { - if (isset(static::$pluginClass)) { - return static::$pluginClass; + protected function determineImplementation() { + if (isset(static::$implementationClass)) { + return static::$implementationClass; } // If the PECL YAML extension installed, use that. if (function_exists('yaml_emit')) { - static::$pluginClass = 'Drupal\Component\Yaml\Pecl'; + static::$implementationClass = 'Drupal\Component\Yaml\Pecl'; } else { // Otherwise, fallback to the Symfony implementation. - static::$pluginClass = 'Drupal\Component\Yaml\Symfony'; + static::$implementationClass = 'Drupal\Component\Yaml\Symfony'; } - return static::$pluginClass; + return static::$implementationClass; } }