Skip to content

Commit

Permalink
Merge pull request #3180 from nextcloud/dependabot/composer/psalm/pha…
Browse files Browse the repository at this point in the history
…r-5.26.0
  • Loading branch information
provokateurin authored Sep 9, 2024
2 parents 0f9b3f6 + c4d2877 commit b8b4258
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,29 @@ public function listTrashRoot(IUser $user): array {
/**
* @return list<ITrashItem>
*/
public function listTrashFolder(ITrashItem $trashItem): array {
if (!$trashItem instanceof GroupTrashItem) {
public function listTrashFolder(ITrashItem $folder): array {
if (!$folder instanceof GroupTrashItem) {
return [];
}
$user = $trashItem->getUser();
$folder = $this->getNodeForTrashItem($user, $trashItem);
if (!$folder instanceof Folder) {
$user = $folder->getUser();
$folderNode = $this->getNodeForTrashItem($user, $folder);
if (!$folderNode instanceof Folder) {
return [];
}
$content = $folder->getDirectoryListing();
$this->aclManagerFactory->getACLManager($user)->preloadRulesForFolder($trashItem->getPath());
return array_values(array_filter(array_map(function (Node $node) use ($trashItem, $user) {
if (!$this->userHasAccessToPath($user, $trashItem->getPath() . '/' . $node->getName())) {
$content = $folderNode->getDirectoryListing();
$this->aclManagerFactory->getACLManager($user)->preloadRulesForFolder($folder->getPath());
return array_values(array_filter(array_map(function (Node $node) use ($folder, $user) {
if (!$this->userHasAccessToPath($user, $folder->getPath() . '/' . $node->getName())) {
return null;
}
return new GroupTrashItem(
$this,
$trashItem->getOriginalLocation() . '/' . $node->getName(),
$trashItem->getDeletedTime(),
$trashItem->getTrashPath() . '/' . $node->getName(),
$folder->getOriginalLocation() . '/' . $node->getName(),
$folder->getDeletedTime(),
$folder->getTrashPath() . '/' . $node->getName(),
$node,
$user,
$trashItem->getGroupFolderMountPoint()
$folder->getGroupFolderMountPoint()
);
}, $content)));
}
Expand Down

0 comments on commit b8b4258

Please sign in to comment.