Skip to content

Commit 05d14fe

Browse files
committed
phpDoc: fixed event type hints [Closes #265]
1 parent 9650ade commit 05d14fe

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

src/Forms/Container.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ class Container extends Nette\ComponentModel\Container implements \ArrayAccess
2626

2727
private const ARRAY = 'array';
2828

29-
/** @var callable[]&((callable(Container, array|object|null): void)|(callable(array|object|null): void))[]; Occurs when the form was validated */
29+
/**
30+
* Occurs when the form was validated
31+
* @var array<callable(self, array|object): void|callable(array|object): void>
32+
*/
3033
public $onValidate = [];
3134

3235
/** @var ControlGroup|null */

src/Forms/Controls/SubmitButton.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919
*/
2020
class SubmitButton extends Button implements Nette\Forms\SubmitterControl
2121
{
22-
/** @var callable[]&((callable(Nette\Forms\Form|SubmitButton, array|object): void)|(callable(array|object): void))[]; Occurs when the button is clicked and form is successfully validated */
22+
/**
23+
* Occurs when the button is clicked and form is successfully validated
24+
* @var array<callable(self, array|object): void|callable(Nette\Forms\Form, array|object): void|callable(array|object): void>
25+
*/
2326
public $onClick = [];
2427

25-
/** @var callable[]&(callable(SubmitButton): void)[]; Occurs when the button is clicked and form is not validated */
28+
/** @var array<callable(self): void> Occurs when the button is clicked and form is not validated */
2629
public $onInvalidClick = [];
2730

2831
/** @var array|null */

src/Forms/Form.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,19 @@ class Form extends Container implements Nette\HtmlStringable
8282
/** @internal protection token ID */
8383
public const PROTECTOR_ID = '_token_';
8484

85-
/** @var callable[]&((callable(Form, array|object): void)|(callable(array|object): void))[]; Occurs when the form is submitted and successfully validated */
85+
/**
86+
* Occurs when the form is submitted and successfully validated
87+
* @var array<callable(self, array|object): void|callable(array|object): void>
88+
*/
8689
public $onSuccess = [];
8790

88-
/** @var callable[]&(callable(Form): void)[]; Occurs when the form is submitted and is not valid */
91+
/** @var array<callable(self): void> Occurs when the form is submitted and is not valid */
8992
public $onError = [];
9093

91-
/** @var callable[]&(callable(Form): void)[]; Occurs when the form is submitted */
94+
/** @var array<callable(self): void> Occurs when the form is submitted */
9295
public $onSubmit = [];
9396

94-
/** @var callable[]&(callable(Form): void)[]; Occurs before the form is rendered */
97+
/** @var array<callable(self): void> Occurs before the form is rendered */
9598
public $onRender = [];
9699

97100
/** @internal @var Nette\Http\IRequest used only by standalone form */

0 commit comments

Comments
 (0)