Skip to content

Commit 27af5fc

Browse files
committed
Adjusted to rdfInterface 0.8.1
1 parent 31e7127 commit 27af5fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/simpleRdf/Dataset.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ public function deleteExcept(iQuadCompare | iQuadIterator | callable $filter): i
157157

158158
public function forEach(callable $fn): void {
159159
foreach ($this->quads as $n => $i) {
160-
$this->quads[$n] = $fn($i, $this);
160+
unset($this->quads[$n]);
161+
$val = $fn($i, $this);
162+
if ($val !== null) {
163+
$this->add($val);
164+
}
161165
}
166+
$this->quads = array_values($this->quads);
162167
}
163168

164169
// QuadIterator

0 commit comments

Comments
 (0)