-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PossiblyUnusedParam #145
Comments
What version of the doctrine bundle (where |
@weirdan doctrine/doctrine-bundle 2.10.0 |
Thanks. My guess is that Psalm is confused with a conditional class definition here: https://github.com/doctrine/DoctrineBundle/blob/2.10.x/Repository/ServiceEntityRepository.php Do you also use https://github.com/psalm/psalm-plugin-doctrine (you most likely should)? |
@weirdan Yes. I use it too. |
@bohdanmoshchenko I believe this issue belongs here, as it's doctrine-specific. |
you can temporally fix it by this: <?php
use Doctrine\Bundle\DoctrineBundle\Repository\LazyServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @template T of object
* @template-extends LazyServiceEntityRepository<T>
*
* @psalm-suppress InternalClass
*/
class ServiceEntityRepository extends LazyServiceEntityRepository
{
/**
* @psalm-param class-string $entityClass
*
* @psalm-suppress InternalMethod
*/
public function __construct(ManagerRegistry $registry, string $entityClass)
{
parent::__construct($registry, $entityClass);
}
}
class MyRepository extends ServiceEntityRepository
{
} |
With Symfony 6.3.1, vimeo/psalm 5.13.0 and doctrine/doctrine-bundle 2.10.0
ERROR: PossiblyUnusedParam - src/User/Repository/UserTokenRepository.php:16:49 - Param psalm/psalm-plugin-symfony#1 is never referenced in this method (see https://psalm.dev/134)
public function __construct(ManagerRegistry $registry)
ERROR: PossiblyUnusedParam - src/User/Repository/UserTokenRepository.php:24:49 - Param psalm/psalm-plugin-symfony#1 is never referenced in this method (see https://psalm.dev/134)
public function findOneByTypeAndHash(string $type, string $hash): ?UserToken
ERROR: PossiblyUnusedParam - src/User/Repository/UserTokenRepository.php:24:63 - Param psalm/psalm-plugin-symfony#2 is never referenced in this method (see https://psalm.dev/134)
public function findOneByTypeAndHash(string $type, string $hash): ?UserToken
CODE:
The text was updated successfully, but these errors were encountered: