Skip to content

Form is not subtype of native type FormInterface #350

Open
@daniel-calderini

Description

@daniel-calderini

Starting with version 1.3.0 of phpstan/phpstan-symfony, the following code is not valid anymore.

// src/Controller/DefaultController.php

use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormInterface;

...

/** @var Form&FormInterface $form */
$form = $this->createForm(...);

Until version 1.2.25, no problems were reported here, but now I get the following error:

PHPDoc tag @var with type Symfony\Component\Form\Form is not subtype of native type Symfony\Component\Form\FormInterface.

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