Skip to content

Commit

Permalink
Fix PHPStan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Feb 16, 2024
1 parent 207abd0 commit faf0ea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Repository/EntitySpecificationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* This class allows you to use a Specification to query entities.
*
* @template T
* @template T of object
* @phpstan-extends EntityRepository<T>
*/
class EntitySpecificationRepository extends EntityRepository implements EntitySpecificationRepositoryInterface
Expand Down
9 changes: 1 addition & 8 deletions src/Repository/EntitySpecificationRepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,7 @@ public function getQueryBuilder($specification, ?string $alias = null): QueryBui
public function iterate($specification, ?ResultModifier $modifier = null): \Traversable
{
$query = $this->getQuery($specification, $modifier);

if (method_exists($query, 'toIterable')) {
yield from $query->toIterable();
} else {
foreach ($query->iterate() as $key => $row) {
yield $key => current($row);
}
}
yield from $query->toIterable();
}

/**
Expand Down

0 comments on commit faf0ea1

Please sign in to comment.