Skip to content

Commit

Permalink
Use phpstan callable definitions (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
adaamz authored and dg committed Apr 6, 2019
1 parent a7d8f73 commit e2c8d4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Forms/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Container extends Nette\ComponentModel\Container implements \ArrayAccess

private const ARRAY = 'array';

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

/** @var ControlGroup|null */
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Controls/SubmitButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*/
class SubmitButton extends Button implements Nette\Forms\ISubmitterControl
{
/** @var callable[] function (SubmitButton $sender): void; Occurs when the button is clicked and form is successfully validated */
/** @var callable[]&(callable(SubmitButton): void)[]; Occurs when the button is clicked and form is successfully validated */
public $onClick;

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

/** @var array|null */
Expand Down
8 changes: 4 additions & 4 deletions src/Forms/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ class Form extends Container implements Nette\Utils\IHtmlString
/** @internal protection token ID */
public const PROTECTOR_ID = '_token_';

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

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

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

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

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

0 comments on commit e2c8d4b

Please sign in to comment.