Skip to content

Commit

Permalink
Merge pull request #798 from baijunyao/master
Browse files Browse the repository at this point in the history
The argument of `array_key_exists` cannot be `null`
  • Loading branch information
ob-stripe authored Nov 7, 2019
2 parents 05d5f7c + 85f77f3 commit e1bc86b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ public function autoPagingIterator()
$page = $this;

while (true) {
if (array_key_exists('ending_before', $this->filters) &&
!array_key_exists('starting_after', $this->filters)) {
$filters = $this->filters ?: [];
if (array_key_exists('ending_before', $filters) &&
!array_key_exists('starting_after', $filters)) {
foreach ($page->getReverseIterator() as $item) {
yield $item;
}
Expand Down

0 comments on commit e1bc86b

Please sign in to comment.