Deprecate \Drupal\Core\Serialization\Yaml

Created on 22 May 2017, over 7 years ago
Updated 3 November 2024, about 2 months ago

Problem/Motivation

We have \Drupal\Core\Serialization\Yaml and \Drupal\Component\Serialization\Yaml.

The Core extends the Component class to add the ability to force via a setting yaml_parser_class. The problem is that this setting does not affect all yaml parsing. For example, \Drupal\Component\Discovery\YamlDirectoryDiscovery. This is because YamlDirectoryDiscovery is a component too and therefore shouldn't depend on core code.

Proposed resolution

Remove this unnecessary complexity. At the moment if you the PECL Yaml extension installed it will use it unless this setting is set to use the Symfony class. We should not have set-ability in Drupal. The set-ability should just be determined by whether you have the extension or not.

Remaining tasks

  1. Create change record
  2. Add deprecate notice to code
  3. Replace all usages in core

User interface changes

None

API changes

Deprecating \Drupal\Core\Serialization\Yaml in favour of \Drupal\Component\Serialization\Yaml

Data model changes

None

πŸ“Œ Task
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024