Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unnecessary/incorrect Symfony Form stubs #322

@pps1

Description

@pps1
Package Version
Symfony 6.3.5
Psalm 5.15.0
Plugin 5.0.3

The plugin adds generics stubs for Symfony form components, specifically:
./vendor/psalm/plugin-symfony/src/Stubs/common/Component/Form/AbstractType.stubphp
./vendor/psalm/plugin-symfony/src/Stubs/common/Component/Form/AbstractTypeExtension.stubphp
./vendor/psalm/plugin-symfony/src/Stubs/common/Component/Form/Form.stubphp

These stubs are incorrect as these artifact interfaces do not exchange generics.

Sample psalm validation errors:

ERROR: MissingTemplateParam - src/Form/Extension/FormTypeExtension.php:18:7 - App\Form\Extension\FormTypeExtension has missing template params when extending Symfony\Component\Form\AbstractTypeExtension, expecting 1 (see https://psalm.dev/182)
class FormTypeExtension extends AbstractTypeExtension

ERROR: MissingTemplateParam - src/Form/Type/DatePickerType.php:11:7 - App\Form\Type\DatePickerType has missing template params when extending Symfony\Component\Form\AbstractType, expecting 1 (see https://psalm.dev/182)
class DatePickerType extends AbstractType

Should these stubs be removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions