Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Fix psalm issue from rector
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed May 19, 2025
commit 21891a16ea879a939bb75c2ff5a41eb97f3300a7
2 changes: 0 additions & 2 deletions lib/Sabre/Album/PublicAlbumPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
use Sabre\DAV\IFile;

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

/** @return void */
public function put($data): never {
throw new NotFoundException('Changing a photo from a public album is not allowed.');
}
Expand Down
6 changes: 0 additions & 6 deletions lib/Sabre/Album/PublicAlbumRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@
use Sabre\DAV\INode;

class PublicAlbumRoot extends AlbumRoot {
/**
* @return void
*/
public function delete(): never {
throw new Forbidden('Not allowed to delete a public album');
}

/**
* @return void
*/
public function setName($name): never {
throw new Forbidden('Not allowed to rename a public album');
}
Expand Down
6 changes: 0 additions & 6 deletions lib/Sabre/Album/SharedAlbumRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,10 @@ public function __construct(
);
}

/**
* @return void
*/
public function delete() {
$this->albumMapper->deleteUserFromAlbumCollaboratorsList($this->userId, $this->album->getAlbum()->getId());
}

/**
* @return void
*/
public function setName($name): never {
throw new Forbidden('Not allowed to rename a shared album');
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Sabre/PhotosHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public function delete(): never {
}

public function getName(): string {
[, $name] = preg_split($this->principalInfo['uri']);
[, $name] = \Sabre\Uri\split($this->principalInfo['uri']);

return $name;
}

Expand Down
3 changes: 0 additions & 3 deletions lib/Sabre/Place/PlacePhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function __construct(
parent::__construct($file, $userFolder);
}

/**
* @return void
*/
public function delete(): never {
throw new Forbidden('Cannot remove from a place');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Sabre/RootCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
* @param array $principalInfo
*/
public function getChildForPrincipal(array $principalInfo): PhotosHome {
[, $name] = preg_split($principalInfo['uri']);
[, $name] = \Sabre\Uri\split($principalInfo['uri']);
$user = $this->userSession->getUser();
if (is_null($user) || $name !== $user->getUID()) {
throw new Forbidden();
Expand Down