Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 315: Wrong phpdoc type callback #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Components/Actions/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @author Petr Bugyík
*
* @property-read Html $element
* @property-write callback $customRender
* @property-write callback $disable
* @property-write callable $customRender
* @property-write callable $disable
* @property Html $elementPrototype
* @property string $primaryKey
* @property string $options
Expand All @@ -35,13 +35,13 @@ abstract class Action extends \Grido\Components\Component
/** @var Html <a> html tag */
protected $elementPrototype;

/** @var callback for custom rendering */
/** @var callable for custom rendering */
protected $customRender;

/** @var string - name of primary key f.e.: link->('Article:edit', array($primaryKey => 1)) */
protected $primaryKey;

/** @var callback for disabling */
/** @var callable for disabling */
protected $disable;

/** @var string */
Expand Down Expand Up @@ -73,7 +73,7 @@ public function setElementPrototype(Html $elementPrototype)

/**
* Sets callback for custom rendering.
* @param callback
* @param callable
* @return Action
*/
public function setCustomRender($callback)
Expand All @@ -96,7 +96,7 @@ public function setPrimaryKey($primaryKey)
/**
* Sets callback for disable.
* Callback should return TRUE if the action is not allowed for current item.
* @param callback
* @param callable
* @return Action
*/
public function setDisable($callback)
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Actions/Href.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Href extends Action
/** @var array second param for method $presenter->link() */
protected $arguments = [];

/** @var callback for custom href attribute creating */
/** @var callable for custom href attribute creating */
protected $customHref;

/**
Expand All @@ -50,7 +50,7 @@ public function __construct($grid, $name, $label, $destination = NULL, array $ar

/**
* Sets callback for custom link creating.
* @param callback $callback
* @param callable $callback
* @return Href
*/
public function setCustomHref($callback)
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Columns/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @property-read string $sort
* @property-read \Nette\Utils\Html $cellPrototype
* @property-read \Nette\Utils\Html $headerPrototype
* @property-write callback $cellCallback
* @property-write callable $cellCallback
* @property-write string $defaultSorting
* @property mixed $customRender
* @property-write array $customRenderVariables
Expand All @@ -51,7 +51,7 @@ abstract class Column extends \Grido\Components\Component
/** @var \Nette\Utils\Html <td> html tag */
protected $cellPrototype;

/** @var callback returns td html element; function($row, Html $td) */
/** @var callable returns td html element; function($row, Html $td) */
protected $cellCallback;

/** @var \Nette\Utils\Html <th> html tag */
Expand Down Expand Up @@ -149,7 +149,7 @@ public function setCustomRenderExport($callback)
}

/**
* @param callback $callback
* @param callable $callback
* @return Column
*/
public function setCellCallback($callback)
Expand Down
26 changes: 13 additions & 13 deletions src/Components/Columns/Editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @author Petr Bugyík
*
* @property \Nette\Forms\IControl $editableControl
* @property callback $editableCallback
* @property callback $editableValueCallback
* @property callback $editableRowCallback
* @property callable $editableCallback
* @property callable $editableValueCallback
* @property callable $editableRowCallback
* @property bool $editable
* @property bool $editableDisabled
*/
Expand All @@ -39,18 +39,18 @@ abstract class Editable extends Column
/** @var \Nette\Forms\IControl Custom control for inline editing */
protected $editableControl;

/** @var callback for custom handling with edited data; function($id, $newValue, $oldValue, Editable $column) {} */
/** @var callable for custom handling with edited data; function($id, $newValue, $oldValue, Editable $column) {} */
protected $editableCallback;

/** @var callback for custom value; function($row, Columns\Editable $column) {} */
/** @var callable for custom value; function($row, Columns\Editable $column) {} */
protected $editableValueCallback;

/** @var callback for getting row; function($row, Columns\Editable $column) {} */
/** @var callable for getting row; function($row, Columns\Editable $column) {} */
protected $editableRowCallback;

/**
* Sets column as editable.
* @param callback $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
* @param callable $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
* @param \Nette\Forms\IControl $control
* @return Editable
*/
Expand Down Expand Up @@ -80,7 +80,7 @@ public function setEditableControl(\Nette\Forms\IControl $control)

/**
* Sets editable callback.
* @param callback $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
* @param callable $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
* @return Editable
*/
public function setEditableCallback($callback)
Expand All @@ -93,7 +93,7 @@ public function setEditableCallback($callback)

/**
* Sets editable value callback.
* @param callback $callback for custom value; function($row, Columns\Editable $column) {}
* @param callable $callback for custom value; function($row, Columns\Editable $column) {}
* @return Editable
*/
public function setEditableValueCallback($callback)
Expand All @@ -106,7 +106,7 @@ public function setEditableValueCallback($callback)

/**
* Sets editable row callback - it's required when used editable collumn with customRenderCallback
* @param callback $callback for getting row; function($id, Columns\Editable $column) {}
* @param callable $callback for getting row; function($id, Columns\Editable $column) {}
* @return Editable
*/
public function setEditableRowCallback($callback)
Expand Down Expand Up @@ -224,7 +224,7 @@ public function getEditableControl()
}

/**
* @return callback
* @return callable
* @internal
*/
public function getEditableCallback()
Expand All @@ -233,7 +233,7 @@ public function getEditableCallback()
}

/**
* @return callback
* @return callable
* @internal
*/
public function getEditableValueCallback()
Expand All @@ -242,7 +242,7 @@ public function getEditableValueCallback()
}

/**
* @return callback
* @return callable
* @internal
*/
public function getEditableRowCallback()
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function addActionHref($name, $label, $destination = NULL, array $argumen
/**
* @param string $name
* @param string $label
* @param callback $onClick
* @param callable $onClick
* @return Actions\Event
*/
public function addActionEvent($name, $label, $onClick = NULL)
Expand All @@ -382,7 +382,7 @@ public function addActionEvent($name, $label, $onClick = NULL)

/**
* @param array $operations
* @param callback $onSubmit - callback after operation submit
* @param callable $onSubmit - callback after operation submit
* @return Operation
*/
public function setOperation(array $operations, $onSubmit)
Expand Down Expand Up @@ -415,7 +415,7 @@ public function addButton($name, $label = NULL, $destination = NULL, array $argu
/**
* Sets all columns as editable.
* First parameter is optional and is for implementation of method for saving modified data.
* @param callback $callback function($id, $newValue, $oldValue, Editable $column) {}
* @param callable $callback function($id, $newValue, $oldValue, Editable $column) {}
* @return Grid
*/
public function setEditableColumns($callback = NULL)
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Filters/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author Petr Bugyík
*
* @property int $suggestionLimit
* @property-write callback $suggestionCallback
* @property-write callable $suggestionCallback
*/
class Text extends Filter
{
Expand All @@ -40,7 +40,7 @@ class Text extends Filter
/** @var int */
protected $suggestionLimit = 10;

/** @var callback */
/** @var callable */
protected $suggestionCallback;

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ public function setSuggestionLimit($limit)

/**
* Sets custom data callback.
* @param callback $callback
* @param callable $callback
* @return \Grido\Components\Filters\Text
*/
public function setSuggestionCallback($callback)
Expand All @@ -102,7 +102,7 @@ public function getSuggestionLimit()
}

/**
* @return callback
* @return callable
*/
public function getSuggestionCallback()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Operation extends Component
/**
* @param \Grido\Grid $grid
* @param array $operations
* @param callback $onSubmit - callback after operation submit
* @param callable $onSubmit - callback after operation submit
*/
public function __construct($grid, array $operations, $onSubmit)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @property string $primaryKey
* @property string $filterRenderType
* @property DataSources\IDataSource $model
* @property callback $rowCallback
* @property callable $rowCallback
* @property bool $strictMode
* @method void onRegistered(Grid $grid)
* @method void onRender(Grid $grid)
Expand Down Expand Up @@ -77,7 +77,7 @@ class Grid extends Components\Container
/** @var array event for modifying data */
public $onFetchData;

/** @var callback returns tr html element; function($row, Html $tr) */
/** @var callable returns tr html element; function($row, Html $tr) */
protected $rowCallback;

/** @var \Nette\Utils\Html */
Expand Down Expand Up @@ -432,7 +432,7 @@ public function getRememberState()

/**
* Returns row callback.
* @return callback
* @return callable
*/
public function getRowCallback()
{
Expand Down