Skip to content

Commit f10dfe9

Browse files
committed
fix(TreeMapper): Replace removed array_flatten function
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 1779adf commit f10dfe9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/Db/TreeMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public function findByAncestorFolder(string $type, int $folderId): array {
323323
$newDescendants = $this->findChildren($type, $folderId);
324324
do {
325325
array_push($descendants, ...$newDescendants);
326-
$newDescendants = array_flatten(array_map(function (Entity $descendant) use ($type) {
326+
$newDescendants = array_merge(...array_map(function (Entity $descendant) use ($type) {
327327
return $this->findChildren($type, $descendant->getId());
328328
}, $newDescendants));
329329
} while (count($newDescendants) > 0);
@@ -341,7 +341,7 @@ public function hasDescendant(int $folderId, string $type, int $descendantId): b
341341
while (!in_array($folderId, array_map(static function (Entity $ancestor) {
342342
return $ancestor->getId();
343343
}, $ancestors), true)) {
344-
$ancestors = array_flatten(array_map(function (Entity $ancestor) {
344+
$ancestors = array_merge(...array_map(function (Entity $ancestor) {
345345
return $this->findParentsOf(TreeMapper::TYPE_FOLDER, $ancestor->getId(), true);
346346
}, $ancestors));
347347
if (count($ancestors) === 0) {

0 commit comments

Comments
 (0)