Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit e7648b4

Browse files
committed
rename property, bug fix with elementSelector acc. to issue #9
1 parent b8a4537 commit e7648b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/RecursivePagination.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RecursivePagination {
2525
/**
2626
* @var array
2727
*/
28-
protected $defaultXpath = [];
28+
protected $elementSelector = [];
2929

3030

3131
/**
@@ -72,7 +72,7 @@ public function getNextPage($customXpath = null) {
7272
}
7373
$page = $this->parser->getLastPage();
7474
if (!empty($page)) {
75-
foreach ($this->defaultXpath as $xpath) {
75+
foreach ($this->elementSelector as $xpath => $state) {
7676
$queueLinks = $page->attribute($xpath)->getItems();
7777
if (!empty($queueLinks)) {
7878
$queueLinks = array_combine($queueLinks, array_fill(0, count($queueLinks), false));
@@ -104,7 +104,7 @@ private function addXpath($xpath) {
104104
if (!is_string($path)) {
105105
throw new \InvalidArgumentException('Incorrect xpath, should be an array or a string');
106106
}
107-
$this->defaultXpath[] = $path;
107+
$this->elementSelector[$path] = true;
108108
}
109109
}
110110

0 commit comments

Comments
 (0)