Skip to content

[PHPStan] improve FactoryCollection generics annotation with template-type #894

Description

@edglev

Looks like there is an issue with phpstan type definition, specifically &Proxy<T> part breaking extension chain resolving to Factory<T>.

I don't understand why T&Proxy<T> is a not a subtype of object.
Is this a problem in PhpStan itself?

Minimal reproducer https://phpstan.org/r/eece4718-641c-4e5b-bac9-e4f1430f8fda

Just as a test - removing &Proxy<T> part from PersistentProxyObjectFactory makes PhpStan happy.

https://phpstan.org/r/dc467615-ce04-4f6c-8370-b6be346ec8c0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions