-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | dev-master |
Given the new features with anonymous services and service defaults, I was assuming the following syntax would work:
services:
_defaults:
factory: [ "@doctrine", getRepository ]
MyProject\UserRepository:
arguments: [ "AppBundle:User" ]
This errors with: "Please add the class to service "_defaults" even if it is constructed by a factory since we might need to add method calls based on compile-time checks."
Changing the defaults to:
_defaults:
class: Doctrine\ORM\EntityRepository
factory: [ "@doctrine", getRepository ]
Appears to work at first, but doesn't, as this actually causes a service called _defaults
to be created, and the other services in the file to ignore the defaults altogether.