symfony / symfony/maker-bundle
Psalm LessSpecificImplementedReturnType error on Repository's `findAll()` docblock
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 427
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 20
Description
Psalm is reporting this:
ERROR: LessSpecificImplementedReturnType - src/Repository/LinkRepository.php:8:12 - The inherited return type 'list' for Doctrine\ORM\EntityRepository::findAll is more specific than the implemented return type for Doctrine\ORM\EntityRepository::findall 'array<array-key, App\Entity\Link>' (see https://psalm.dev/166)
/**
- @method Link|null find($id, $lockMode = null, $lockVersion = null)
- @method Link|null findOneBy(array $criteria, array $orderBy = null)
- @method Link[] findAll()
- @method Link[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- @extends ServiceEntityRepository
*/
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
Start with src/Repository/LinkRepository.php at the reported docblock and compare the findAll() annotation with the inherited Doctrine return type in the Psalm error. Run Psalm against the repository and confirm that the LessSpecificImplementedReturnType error is resolved without introducing new errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100