forked from phpstan/phpstan-symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormFactoryInterface.stub
38 lines (34 loc) · 1.23 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
37
38
<?php
namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\Type\FormType;
interface FormFactoryInterface
{
/**
* @template TFormType of FormTypeInterface<TData, TOptions>
* @template TData
* @template TOptions of array<string, mixed>
*
* @param class-string<TFormType> $type
* @param TData $data
* @param TOptions $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, TOptions>
* @template TData
* @template TOptions of array<string, mixed>
*
* @param class-string<TFormType> $type
* @param TData $data
* @param TOptions $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;
}