Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Missing method in stub Symfony Form FormFactoryInterface #445

Open
@Kazadri

Description

Hi ! I noticed that the interface FormFactoryInterface define 6 methods, but the current stub only includes two of them.
For example, in this snippet:

class MyService
{
	public function __construct(private FormFactoryInterface $formFactory) {}
	/**
	 * @return FormInterface<Foo>
 */
	public function getForm(): FormInterface
	{
		$builder = $this->formFactoryInterface->createBuilder(FormType::class, new Foo());
		// add field(s)
		
		return $builder->getForm();
	}
}

PHPStan reports the following error:

Method MyService::getForm() should return Symfony\Component\Form\FormInterface<Foo> but return Symfony\Component\Form\FormInterface<mixed>.

I'd be happy to help contribute a PR to complete the stub if that's welcome! :)

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

        AltStyle によって変換されたページ (->オリジナル) /