Skip to content

Commit

Permalink
Add stubs with templates for AbstractController::createForm() (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-demb authored Mar 23, 2021
1 parent 39ac9e4 commit 3a35eb7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Stubs/4/AbstractController.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ class AbstractController implements ServiceSubscriberInterface
* @psalm-suppress PropertyNotSetInConstructor
*/
protected $container;

/**
* @template TData
* @template TFormType of FormTypeInterface<TData>
*
* @psalm-param class-string<TFormType> $type
*
* @psalm-return FormInterface<TData>
*/
public function createForm(string $type, $data = null, array $options = []): FormInterface {}
}
10 changes: 10 additions & 0 deletions src/Stubs/5/AbstractController.stubphp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ class AbstractController implements ServiceSubscriberInterface
* @psalm-suppress PropertyNotSetInConstructor
*/
protected $container;

/**
* @template TData
* @template TFormType of FormTypeInterface<TData>
*
* @psalm-param class-string<TFormType> $type
*
* @psalm-return FormInterface<TData>
*/
public function createForm(string $type, $data = null, array $options = []): FormInterface {}
}

0 comments on commit 3a35eb7

Please sign in to comment.