Skip to content

Commit a693e11

Browse files
committed
Suppress Phan warnings about calling undeclared class methods
The DeletedShareAPIController and ShareAPIController helpers for room shares are defined in Talk, so the classes do not exist when Talk is not installed. Due to this when the object returned by "getRoomShareHelper" is used Phan complains that the class is not declared. This is not a problem, though, because when the class is not available "getRoomShareHelper" throws an exception, which is then caught where that method was called. Therefore now those warnings from Phan are suppressed (it would be better to use "@phan-suppress-next-line" instead, but it is not yet available in our Phan version). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 5326296 commit a693e11

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

apps/files_sharing/lib/Controller/DeletedShareAPIController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public function __construct(string $appName,
8686
$this->serverContainer = $serverContainer;
8787
}
8888

89+
/**
90+
* @suppress PhanUndeclaredClassMethod
91+
*/
8992
private function formatShare(IShare $share): array {
9093

9194
$result = [

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public function __construct(
141141
* @param Node|null $recipientNode
142142
* @return array
143143
* @throws NotFoundException In case the node can't be resolved.
144+
*
145+
* @suppress PhanUndeclaredClassMethod
144146
*/
145147
protected function formatShare(\OCP\Share\IShare $share, Node $recipientNode = null): array {
146148
$sharedBy = $this->userManager->get($share->getSharedBy());
@@ -914,6 +916,9 @@ public function updateShare(
914916
return new DataResponse($this->formatShare($share));
915917
}
916918

919+
/**
920+
* @suppress PhanUndeclaredClassMethod
921+
*/
917922
protected function canAccessShare(\OCP\Share\IShare $share, bool $checkGroups = true): bool {
918923
// A file with permissions 0 can't be accessed by us. So Don't show it
919924
if ($share->getPermissions() === 0) {

0 commit comments

Comments
 (0)