Skip to content
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

Support template generics in PSALM class inheritance #164

Open
klesun opened this issue Aug 17, 2020 · 0 comments
Open

Support template generics in PSALM class inheritance #164

klesun opened this issue Aug 17, 2020 · 0 comments
Assignees

Comments

@klesun
Copy link
Owner

klesun commented Aug 17, 2020

Originally requested in #162 (comment)

Quoting @zmitic:


There is one minor issue, probably irrelevant. Because of nested-set requiring its own parent repository (not one from example under), I put code in trait like this:

class CityRepository extends ServiceEntityRepository
{
    /** @use RepositoryUtilsTrait<City> */
    use RepositoryUtilsTrait;

    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, City::class);
    }
}

Trait itself:

    /**
     * @return ?T
     */
    public function getOneResultOrNull(Generator ...$generators)
    {
       // ...
    }

No results:

image

@klesun klesun self-assigned this Aug 17, 2020
@klesun klesun changed the title Template generics in PSALM inheritance Support template generics in PSALM class inheritance Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant