Please sign in to comment.
feature #18547 DX: better error message if factory class is empty (dbu)
This PR was merged into the 3.1-dev branch. Discussion ---------- DX: better error message if factory class is empty | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | - | License | MIT | Doc PR | - i was trying to debug this service configuration: ```xml <service id="repository.user" class="Doctrine\ORM\EntityRepository"> <argument>%user_entity_class%</argument> <factory id="doctrine.orm.default_entity_manager" method="getRepository"/> </service> ``` Turns out i should have used `<factory service=...` instead of `<factory id=...` but the error message does not even tell which service is wrong. The same happens when only specifying the `method=` attribute. The current exception message tells: Cannot dump definition because of invalid class name ('') With this change, the message at least tells the context, hopefully helping the developer debug the issue: Empty class for factory of service repository.user and no factory service specified Commits ------- 0999326 better error message if factory class is empty
- Loading branch information...
Showing with 7 additions and 3 deletions.