Sylius / Sylius/SyliusResourceBundle
[Repository] Impossible to use a repository that implements ServiceEntityRepositoryInterface
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 235
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
Sylius version affected: all
Description
It is possible to use a repository that inherits from ServiceEntityRepository but not a repository that "just" implements ServiceEntityRepositoryInterface. Besides it's useful when you already extends from some other base repository.
Steps to reproduce
- Create a repository that implements
ServiceEntityRepositoryInterface - Use it in the resource bundle config
Possible Solution
Check against the interface instead of the class.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect src/Bundle/DependencyInjection/Driver/Doctrine/DoctrineORMDriver.php around line 74 and trace how the repository class is checked during resource bundle configuration. Reproduce the configuration with a repository implementing ServiceEntityRepositoryInterface, then verify that it is accepted without requiring inheritance from ServiceEntityRepository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100