mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Merge pull request #1166 from acelaya-forks/feature/fix-undefined-var
Feature/fix undefined var
This commit is contained in:
@@ -21,7 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||||||
* *Nothing*
|
* *Nothing*
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* *Nothing*
|
* [#1165](https://github.com/shlinkio/shlink/issues/1165) Fixed warning displayed when trying to locate visits and there are none pending.
|
||||||
|
|
||||||
|
|
||||||
## [2.8.1] - 2021-08-15
|
## [2.8.1] - 2021-08-15
|
||||||
|
|||||||
@@ -70,15 +70,17 @@ class VisitRepository extends EntitySpecificationRepository implements VisitRepo
|
|||||||
$qb = (clone $originalQueryBuilder)->andWhere($qb->expr()->gt('v.id', $lastId));
|
$qb = (clone $originalQueryBuilder)->andWhere($qb->expr()->gt('v.id', $lastId));
|
||||||
$iterator = $qb->getQuery()->toIterable();
|
$iterator = $qb->getQuery()->toIterable();
|
||||||
$resultsFound = false;
|
$resultsFound = false;
|
||||||
|
/** @var Visit|null $lastProcessedVisit */
|
||||||
|
$lastProcessedVisit = null;
|
||||||
|
|
||||||
foreach ($iterator as $key => $visit) {
|
foreach ($iterator as $key => $visit) {
|
||||||
$resultsFound = true;
|
$resultsFound = true;
|
||||||
|
$lastProcessedVisit = $visit;
|
||||||
yield $key => $visit;
|
yield $key => $visit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// As the query is ordered by ID, we can take the last one every time in order to exclude the whole list
|
// As the query is ordered by ID, we can take the last one every time in order to exclude the whole list
|
||||||
/** @var Visit|null $visit */
|
$lastId = $lastProcessedVisit?->getId() ?? $lastId;
|
||||||
$lastId = $visit?->getId() ?? $lastId;
|
|
||||||
} while ($resultsFound);
|
} while ($resultsFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user