forked from phpstan/phpstan-symfony
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormFactoryInterface.stub
36 lines (32 loc) · 1.14 KB
/
FormFactoryInterface.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\Type\FormType;
interface FormFactoryInterface
{
/**
* @template TFormType of FormTypeInterface<TData>
* @template TData
*
* @param class-string<TFormType> $type
* @param TData $data
* @param array<string, mixed> $options
*
* @phpstan-return ($data is null ? FormInterface<null|TData> : FormInterface<TData>)
*
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
*/
public function create(string $type = FormType::class, $data = null, array $options = []): FormInterface;
/**
* @template TFormType of FormTypeInterface<TData>
* @template TData
*
* @param class-string<TFormType> $type
* @param TData $data
* @param array<string, mixed> $options
*
* @phpstan-return ($data is null ? FormInterface<null|TData> : FormInterface<TData>)
*
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
*/
public function createNamed(string $name, string $type = FormType::class, $data = null, array $options = []): FormInterface;
}