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.