Skip to content

Added missing @template tag to Selection stub #167

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

Merged
merged 1 commit into from
Feb 12, 2025
Merged
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
15 changes: 8 additions & 7 deletions stubs/Database/Table/Selection.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
namespace Nette\Database\Table;

/**
* @phpstan-implements \Iterator<string, ActiveRow>
* @phpstan-implements \ArrayAccess<string, \Nette\Database\IRow>
* @template T of ActiveRow
* @phpstan-implements \Iterator<string, T>
* @phpstan-implements \ArrayAccess<string, T>
*/
class Selection implements \Iterator, \ArrayAccess
{
/**
* @phpstan-param positive-int|0|null $limit
* @phpstan-param positive-int|0|null $offset
* @return static
* @return static<T>
*/
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
* @return static<T>
*/
public function page(int $page, int $itemsPerPage, &$numOfPages = null)
{
Expand All @@ -30,12 +31,12 @@ class Selection implements \Iterator, \ArrayAccess
/**
* @param string|array<string|int,mixed> $condition
* @param mixed $params
* @return static
* @return static<T>
*/
public function where($condition, ...$params)
{
}

/**
* @param string $column
* @return positive-int|0
Expand Down