Skip to content

Commit

Permalink
fix(psalm issues)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Jul 5, 2024
1 parent 4e69ade commit 5d67a34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Hooks/FileListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,11 @@ public function postInsert(Node $node, bool $recurse = true): void {
public function postRename(Node $source, Node $target): void {
$targetUserIds = $this->getUsersWithFileAccess($target);

$usersToAdd = array_diff($targetUserIds, $this->sourceUserIds);
$usersToAdd = array_values(array_diff($targetUserIds, $this->sourceUserIds));
$existingUsers = array_diff($targetUserIds, $usersToAdd);
$ownerId = $source->getOwner() ? $source->getOwner()->getUID() : ($target->getOwner() ? $target->getOwner()->getUID() : $existingUsers[0]);
$sourceOwner = $source->getOwner();
$targetOwner = $target->getOwner();
$ownerId = $sourceOwner !== null ? $sourceOwner->getUID() : ($targetOwner ? $targetOwner->getUID() : $existingUsers[0]);

$this->copyFaceDetectionsForNode($ownerId, $usersToAdd, $targetUserIds, $target);
}
Expand Down

0 comments on commit 5d67a34

Please sign in to comment.