Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Autoconfigure options overridden with PHP config #24687

Copy link
Copy link
Closed
@predakanga

Description

@predakanga
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.10, 3.4.0-BETA1, 4.0.0-BETA1
Usecase Legacy codebase, integrating Symfony DI w/o pulling in YAML
Demo repo

When using Symfony DI with autoconfiguration, there is a major discrepancy between equivalent PHP and YAML configs:
If using the YAML config, you can override default options with _instanceof.
If using the PHP config, you can not override default options with registerForAutoconfiguration.

Please note, when I say 'default options', I mean the definition used for ContainerBuilder::registerClasses($definition, $path), as shown in the example here.

The linked project demonstrates this discrepancy by attempting to use _instanceof/registerForAutoconfiguration to make the class ConsoleApplication public.

This appears to happen with any options that are changed from the Definition default values, and can be worked around by calling $definition->setChanges([])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.