Quantcast
Viewing all articles
Browse latest Browse all 295593

Service container aliases do not work

Problem/Motivation

Symfony's dependency injection container should allow you to shorthand aliases:

services:
  service1: '@service2'

This functionality is broken due to the rewrites in Drupal\Core\Component\DependencyInjection\YamlFileLoader::parseDefinitions() that add a 'provider' tag to a service definition.

Error: Cannot use string offset as an array in Drupal\Core\DependencyInjection\YamlFileLoader->parseDefinitions() (line 123 of core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php).

Proposed resolution

Verify that the service definition is an array definition, and not a shorthand alias, before attempting to add the 'provider' tag.

Remaining tasks

Patch attached to this issue.

User interface changes

N/A

API changes

N/A, however you are now able to use shorthand aliases in your container YAML's.

Data model changes

N/A


Viewing all articles
Browse latest Browse all 295593

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>