Skip to content

Commit 08fd6d8

Browse files
committed
Merge pull request #135 from phpcr/fix-array-search
fix bug about array_search
2 parents 38ce61e + ae8a97b commit 08fd6d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPCR/Util/TreeWalker.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(ItemVisitorInterface $nodeVisitor, ItemVisitorInterf
6363
*/
6464
public function addNodeFilter(TreeWalkerFilterInterface $filter)
6565
{
66-
if (!array_search($filter, $this->nodeFilters)) {
66+
if (!in_array($filter, $this->nodeFilters)) {
6767
$this->nodeFilters[] = $filter;
6868
}
6969
}
@@ -75,7 +75,7 @@ public function addNodeFilter(TreeWalkerFilterInterface $filter)
7575
*/
7676
public function addPropertyFilter(TreeWalkerFilterInterface $filter)
7777
{
78-
if (!array_search($filter, $this->propertyFilters)) {
78+
if (!in_array($filter, $this->propertyFilters)) {
7979
$this->propertyFilters[] = $filter;
8080
}
8181
}

0 commit comments

Comments
 (0)