Attempt to fix psalm false-positive
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -35,7 +35,7 @@ use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use OCP\IPreview;
|
||||
use OCP\IRequest;
|
||||
use OCP\Share;
|
||||
use OCP\Share\Exceptions\ShareNotFound;
|
||||
use OCP\Share\IManager;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
@@ -140,9 +140,10 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
||||
}
|
||||
|
||||
public function display(Attachment $attachment) {
|
||||
/** @psalm-suppress InvalidCatch */
|
||||
try {
|
||||
$share = $this->shareProvider->getShareById($attachment->getId());
|
||||
} catch (Share\Exceptions\ShareNotFound $e) {
|
||||
} catch (ShareNotFound $e) {
|
||||
throw new NotFoundException('File not found');
|
||||
}
|
||||
$file = $share->getNode();
|
||||
|
||||
@@ -562,6 +562,7 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws ShareNotFound
|
||||
*/
|
||||
public function getShareById($id, $recipientId = null) {
|
||||
$qb = $this->dbConnection->getQueryBuilder();
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
<code>$this->rootFolder</code>
|
||||
<code>$this->rootFolder</code>
|
||||
<code>IRootFolder</code>
|
||||
<code>Share\Exceptions\ShareNotFound</code>
|
||||
<code>ShareNotFound</code>
|
||||
</MissingDependency>
|
||||
</file>
|
||||
<file src="lib/Service/PermissionService.php">
|
||||
@@ -298,7 +298,7 @@
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>getSharesInFolder</code>
|
||||
</InvalidReturnType>
|
||||
<MissingDependency occurrences="7">
|
||||
<MissingDependency occurrences="8">
|
||||
<code>GenericShareException</code>
|
||||
<code>GenericShareException</code>
|
||||
<code>ShareNotFound</code>
|
||||
@@ -306,6 +306,7 @@
|
||||
<code>ShareNotFound</code>
|
||||
<code>ShareNotFound</code>
|
||||
<code>ShareNotFound</code>
|
||||
<code>ShareNotFound</code>
|
||||
</MissingDependency>
|
||||
</file>
|
||||
<file src="lib/Sharing/Listener.php">
|
||||
|
||||
Reference in New Issue
Block a user