Skip to content

Commit 3a35eb7

Browse files
authored
Add stubs with templates for AbstractController::createForm() (#157)
1 parent 39ac9e4 commit 3a35eb7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Stubs/4/AbstractController.stubphp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,14 @@ class AbstractController implements ServiceSubscriberInterface
1212
* @psalm-suppress PropertyNotSetInConstructor
1313
*/
1414
protected $container;
15+
16+
/**
17+
* @template TData
18+
* @template TFormType of FormTypeInterface<TData>
19+
*
20+
* @psalm-param class-string<TFormType> $type
21+
*
22+
* @psalm-return FormInterface<TData>
23+
*/
24+
public function createForm(string $type, $data = null, array $options = []): FormInterface {}
1525
}

src/Stubs/5/AbstractController.stubphp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,14 @@ class AbstractController implements ServiceSubscriberInterface
1212
* @psalm-suppress PropertyNotSetInConstructor
1313
*/
1414
protected $container;
15+
16+
/**
17+
* @template TData
18+
* @template TFormType of FormTypeInterface<TData>
19+
*
20+
* @psalm-param class-string<TFormType> $type
21+
*
22+
* @psalm-return FormInterface<TData>
23+
*/
24+
public function createForm(string $type, $data = null, array $options = []): FormInterface {}
1525
}

0 commit comments

Comments
 (0)