Skip to content

Commit

Permalink
Added precise typehints for limit() and page() methods in Selection
Browse files Browse the repository at this point in the history
  • Loading branch information
lulco committed Mar 2, 2021
1 parent 16a1457 commit 0fd6953
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion stubs/Database/Table/Selection.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,22 @@ namespace Nette\Database\Table;
*/
class Selection implements \Iterator, \ArrayAccess
{

/**
* @phpstan-param positive-int|0|null $limit
* @phpstan-param positive-int|0|null $offset
* @return static
*/
public function limit(?int $limit, int $offset = null)
{
}

/**
* @phpstan-param positive-int|0 $page
* @phpstan-param positive-int|0 $itemsPerPage
* @param int $numOfPages [optional]
* @return static
*/
public function page(int $page, int $itemsPerPage, &$numOfPages = null)
{
}
}

0 comments on commit 0fd6953

Please sign in to comment.