Skip to content

Commit 599946a

Browse files
committed
chore: Fix psalm issue from rector
Signed-off-by: Louis Chemineau <[email protected]>
1 parent e4271ee commit 599946a

6 files changed

Lines changed: 4 additions & 17 deletions

File tree

lib/Controller/AlbumsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function validFile(File $file, bool $shared): bool {
149149

150150
private function isShared(Node $node): bool {
151151
return $node->getStorage()->instanceOfStorage(SharedStorage::class) ||
152-
$node->getStorage()->instanceOfStorage(GroupFolderStorage::class);
152+
$node->getStorage()->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class);
153153
}
154154

155155
private function scanFolder(Folder $folder, int $depth, bool $shared): bool {

lib/Sabre/Album/PublicAlbumPhoto.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
use Sabre\DAV\IFile;
1313

1414
class PublicAlbumPhoto extends AlbumPhoto implements IFile {
15-
/** @return void */
1615
public function delete(): never {
1716
throw new NotFoundException('Deleting photos from a public album is not allowed.');
1817
}
1918

20-
/** @return void */
2119
public function put($data): never {
2220
throw new NotFoundException('Changing a photo from a public album is not allowed.');
2321
}

lib/Sabre/Album/PublicAlbumRoot.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@
1414
use Sabre\DAV\INode;
1515

1616
class PublicAlbumRoot extends AlbumRoot {
17-
/**
18-
* @return void
19-
*/
2017
public function delete(): never {
2118
throw new Forbidden('Not allowed to delete a public album');
2219
}
2320

24-
/**
25-
* @return void
26-
*/
2721
public function setName($name): never {
2822
throw new Forbidden('Not allowed to rename a public album');
2923
}

lib/Sabre/Album/SharedAlbumRoot.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,10 @@ public function __construct(
3737
);
3838
}
3939

40-
/**
41-
* @return void
42-
*/
4340
public function delete() {
4441
$this->albumMapper->deleteUserFromAlbumCollaboratorsList($this->userId, $this->album->getAlbum()->getId());
4542
}
4643

47-
/**
48-
* @return void
49-
*/
5044
public function setName($name): never {
5145
throw new Forbidden('Not allowed to rename a shared album');
5246
}

lib/Sabre/PhotosHome.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public function delete(): never {
4646
}
4747

4848
public function getName(): string {
49-
[, $name] = preg_split($this->principalInfo['uri']);
49+
[, $name] = \Sabre\Uri\split($this->principalInfo['uri']);
50+
5051
return $name;
5152
}
5253

lib/Sabre/RootCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(
4747
* @param array $principalInfo
4848
*/
4949
public function getChildForPrincipal(array $principalInfo): PhotosHome {
50-
[, $name] = preg_split($principalInfo['uri']);
50+
[, $name] = \Sabre\Uri\split($principalInfo['uri']);
5151
$user = $this->userSession->getUser();
5252
if (is_null($user) || $name !== $user->getUID()) {
5353
throw new Forbidden();

0 commit comments

Comments
 (0)