Skip to content

AbstractType generics in psalm but not in phpstan #320

@kissifrot

Description

@kissifrot

Hello,

I'm having issues with cross-usage of psalm and phpstan for form type classes extending AbstractType:

  • on psalm (v5) side with psalm-plugin-symfony, it's considered generic, thus adding the annotation /** @extends AbstractType<mixed> */ (or similar ^^) is needed to avoid getting MissingTemplate errors
  • on phpstan side with phpstan-symfony phpstan will complain that AbstractType is not generic

I'm a bit lost in this situation, as I guess suppressing psalm's MissingTemplate errors is not the good thing to do 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions