Skip to content

Commit

Permalink
add stub to add generic type to paginator when created from query ins…
Browse files Browse the repository at this point in the history
…tance
  • Loading branch information
84m authored and ondrejmirtes committed Sep 18, 2023
1 parent c501503 commit cba50e9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ parameters:
- stubs/ORM/Query/Expr/Composite.stub
- stubs/ORM/Query/Expr/Func.stub
- stubs/ORM/Query/Expr/Join.stub
- stubs/ORM/Tools/Pagination/Paginator.stub
- stubs/Persistence/Mapping/ClassMetadata.stub
- stubs/ServiceDocumentRepository.stub

Expand Down
33 changes: 33 additions & 0 deletions stubs/ORM/Tools/Pagination/Paginator.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Doctrine\ORM\Tools\Pagination;

use ArrayIterator;
use Countable;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use IteratorAggregate;

/**
* @template T
* @implements IteratorAggregate<array-key, T>
*/
class Paginator implements Countable, IteratorAggregate
{

/**
* @param Query<mixed, T>|QueryBuilder $query
* @param bool $fetchJoinCollection
*/
public function __construct($query, $fetchJoinCollection = true)
{
}

/**
* @return ArrayIterator<array-key, T>
*/
public function getIterator()
{
}

}

0 comments on commit cba50e9

Please sign in to comment.