55use  Doctrine \ORM \QueryBuilder  as  DoctrineQueryBuilder ;
66use  Doctrine \ORM \Tools \Pagination \CountWalker ;
77use  Doctrine \ORM \Tools \Pagination \Paginator  as  DoctrinePaginator ;
8+ use  ArrayIterator ;
9+ use  IteratorAggregate ;
810use  Traversable ;
11+ use  Countable ;
12+ use  Iterator ;
913
10- class  Paginator implements  \ Countable, \ IteratorAggregate
14+ class  Paginator implements  Countable, IteratorAggregate
1115{
1216    public  const  PAGE_SIZE  = 30 ;
1317
@@ -35,13 +39,13 @@ public function paginate(int $page = 1): self
3539            ->setMaxResults ($ this pageSize )
3640            ->getQuery ();
3741
38-         if  (0  === \ count$ this queryBuilder ->getDQLPart ('join ' ))) {
42+         if  (0  === count ($ this queryBuilder ->getDQLPart ('join ' ))) {
3943            $ querysetHint (CountWalker::HINT_DISTINCT , false );
4044        }
4145
4246        $ paginatornew  DoctrinePaginator ($ querytrue );
4347
44-         $ useOutputWalkers\ count$ this queryBuilder ->getDQLPart ('having ' ) ?: []) > 0 ;
48+         $ useOutputWalkerscount ($ this queryBuilder ->getDQLPart ('having ' ) ?: []) > 0 ;
4549        $ paginatorsetUseOutputWalkers ($ useOutputWalkers
4650
4751        $ this results  = $ paginatorgetIterator ();
@@ -135,15 +139,15 @@ public function getIterator(): Traversable
135139    {
136140        $ results$ this getResults ();
137141
138-         if  ($ resultsinstanceof  \ Iterator) {
142+         if  ($ resultsinstanceof  Iterator) {
139143            return  $ results
140144        }
141145
142-         if  ($ resultsinstanceof  \ IteratorAggregate) {
146+         if  ($ resultsinstanceof  IteratorAggregate) {
143147            return  $ resultsgetIterator ();
144148        }
145149
146-         return  new  \ ArrayIterator ($ results
150+         return  new  ArrayIterator ($ results
147151    }
148152
149153    public  function  calculateStartAndEndPage (): void 
@@ -184,4 +188,4 @@ private function calculateStartPageForEndPageOverflow($startPage, $endPage): int
184188    {
185189        return  max ($ startPage$ endPage$ this getNumberOfPages ()), 1 );
186190    }
187- }
191+ }
0 commit comments