Skip to content

Commit d9fc6d6

Browse files
adaamzdg
authored andcommitted
Use phpstan callable definitions (#216)
1 parent 7ef0d56 commit d9fc6d6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Forms/Container.php

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

2727
private const ARRAY = 'array';
2828

29-
/** @var callable[] function (Container $sender): void; Occurs when the form is validated */
29+
/** @var callable[]&(callable(Container): void)[]; Occurs when the form is validated */
3030
public $onValidate;
3131

3232
/** @var ControlGroup|null */

src/Forms/Controls/SubmitButton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
*/
2020
class SubmitButton extends Button implements Nette\Forms\ISubmitterControl
2121
{
22-
/** @var callable[] function (SubmitButton $sender): void; Occurs when the button is clicked and form is successfully validated */
22+
/** @var callable[]&(callable(SubmitButton): void)[]; Occurs when the button is clicked and form is successfully validated */
2323
public $onClick;
2424

25-
/** @var callable[] function (SubmitButton $sender): void; Occurs when the button is clicked and form is not validated */
25+
/** @var callable[]&(callable(SubmitButton): void)[]; Occurs when the button is clicked and form is not validated */
2626
public $onInvalidClick;
2727

2828
/** @var array|null */

src/Forms/Form.php

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

84-
/** @var callable[] function (Form $sender): void; Occurs when the form is submitted and successfully validated */
84+
/** @var callable[]&((callable(Form, array): void)|(callable(Form, ArrayHash): void))[]; Occurs when the form is submitted and successfully validated */
8585
public $onSuccess;
8686

87-
/** @var callable[] function (Form $sender): void; Occurs when the form is submitted and is not valid */
87+
/** @var callable[]&(callable(Form): void)[]; Occurs when the form is submitted and is not valid */
8888
public $onError;
8989

90-
/** @var callable[] function (Form $sender): void; Occurs when the form is submitted */
90+
/** @var callable[]&(callable(Form): void)[]; Occurs when the form is submitted */
9191
public $onSubmit;
9292

93-
/** @var callable[] function (Form $sender): void; Occurs before the form is rendered */
93+
/** @var callable[]&(callable(Form): void)[]; Occurs before the form is rendered */
9494
public $onRender;
9595

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

0 commit comments

Comments
 (0)