- Notifications
You must be signed in to change notification settings - Fork 95
Open
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
Labels
No labels