Skip to content

Commit cba50e9

Browse files
84mondrejmirtes
authored andcommitted
add stub to add generic type to paginator when created from query instance
1 parent c501503 commit cba50e9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

extension.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ parameters:
5050
- stubs/ORM/Query/Expr/Composite.stub
5151
- stubs/ORM/Query/Expr/Func.stub
5252
- stubs/ORM/Query/Expr/Join.stub
53+
- stubs/ORM/Tools/Pagination/Paginator.stub
5354
- stubs/Persistence/Mapping/ClassMetadata.stub
5455
- stubs/ServiceDocumentRepository.stub
5556

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Doctrine\ORM\Tools\Pagination;
4+
5+
use ArrayIterator;
6+
use Countable;
7+
use Doctrine\ORM\Query;
8+
use Doctrine\ORM\QueryBuilder;
9+
use IteratorAggregate;
10+
11+
/**
12+
* @template T
13+
* @implements IteratorAggregate<array-key, T>
14+
*/
15+
class Paginator implements Countable, IteratorAggregate
16+
{
17+
18+
/**
19+
* @param Query<mixed, T>|QueryBuilder $query
20+
* @param bool $fetchJoinCollection
21+
*/
22+
public function __construct($query, $fetchJoinCollection = true)
23+
{
24+
}
25+
26+
/**
27+
* @return ArrayIterator<array-key, T>
28+
*/
29+
public function getIterator()
30+
{
31+
}
32+
33+
}

0 commit comments

Comments
 (0)