Skip to content

FormBuilderInterface::getForm() should not return FormInterface<TData|null>, but FormInterface<TData>? #466

Description

@devnix

I think https://github.com/phpstan/phpstan-symfony/blob/2.0.x/stubs/Symfony/Component/Form/FormBuilderInterface.stub#L14-L17 is wrong: when I'm carrying around a FormBuilderInterface<SomeModel>, I would expect to build a form for a function that receives FormInterface<SomeModel>.

Indeed, then FormInterface::getData() would return SomeModel|null, but that would not be a requirement for FormBuilderInterface::getForm() to return FormInterface<SomeModel|null>. But maybe I'm missing something obvious here!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions