Skip to content

[DependencyInjection] Do we support scalar services? #32411

@derrabus

Description

@derrabus

While working on #32266, I noticed that adding object type declarations for services breaks the test suite.

Supporting scalar services would be legal according to PSR-11, but it violates the contract documented by the docblocks of our ContainerInterface.

I suggest to either…

  • Document the possibility of scalar services and cover this behavior with tests inside the DI component or…
  • deprecate scalar services in 4.4 and add object type declarations to master.

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