diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-06 01:01:08 +0300 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-05-16 12:05:54 +0300 |
commit | f7be76125f885d66caac4a8d6697e121dce52708 (patch) | |
tree | 5abff07b0daa376ef90ad60b648611d2fc82d809 /apps/dav/lib/Connector | |
parent | 829490ab7a02579c6b31573c3f53428e86cbf2e0 (diff) |
Fix more psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/dav/lib/Connector')
9 files changed, 11 insertions, 10 deletions
diff --git a/apps/dav/lib/Connector/PublicAuth.php b/apps/dav/lib/Connector/PublicAuth.php index ba5e635e5f3..cc51a249e75 100644 --- a/apps/dav/lib/Connector/PublicAuth.php +++ b/apps/dav/lib/Connector/PublicAuth.php @@ -44,7 +44,7 @@ use Sabre\DAV\Auth\Backend\AbstractBasic; */ class PublicAuth extends AbstractBasic { private const BRUTEFORCE_ACTION = 'public_webdav_auth'; - private IShare $share; + private ?IShare $share = null; private IManager $shareManager; private ISession $session; private IRequest $request; @@ -121,6 +121,7 @@ class PublicAuth extends AbstractBasic { } public function getShare(): IShare { + assert($this->share !== null); return $this->share; } } diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 1588e5a2e6c..1610c554b9b 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -54,7 +54,7 @@ class Auth extends AbstractBasic { private ISession $session; private Session $userSession; private IRequest $request; - private string $currentUser; + private ?string $currentUser = null; private Manager $twoFactorManager; private Throttler $throttler; diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php index 830c92d2c30..2d2be631416 100644 --- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php +++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php @@ -37,7 +37,7 @@ use Sabre\DAV\Server; * @package OCA\DAV\Connector\Sabre */ class BlockLegacyClientPlugin extends ServerPlugin { - protected Server $server; + protected ?Server $server = null; protected IConfig $config; public function __construct(IConfig $config) { diff --git a/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php b/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php index c023d918c42..c222923bc8e 100644 --- a/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php +++ b/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php @@ -29,7 +29,7 @@ use Sabre\HTTP\ResponseInterface; use Sabre\DAV\Server; class ChecksumUpdatePlugin extends ServerPlugin { - protected Server $server; + protected ?Server $server = null; public function initialize(Server $server) { $this->server = $server; diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index f9a087daeb0..4a1205e8606 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -36,7 +36,7 @@ class CommentPropertiesPlugin extends ServerPlugin { public const PROPERTY_NAME_COUNT = '{http://owncloud.org/ns}comments-count'; public const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}comments-unread'; - protected Server $server; + protected ?Server $server = null; private ICommentsManager $commentsManager; private IUserSession $userSession; private array $cachedUnreadCount = []; diff --git a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php index 5dd0dc6f231..f3ea94be3b6 100644 --- a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php @@ -35,7 +35,7 @@ use Sabre\DAV\Server; * or mangle Etag headers. */ class CopyEtagHeaderPlugin extends \Sabre\DAV\ServerPlugin { - private Server $server; + private ?Server $server = null; /** * This initializes the plugin. diff --git a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php index bc6c6f5c25f..8e35afe2e7c 100644 --- a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php +++ b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php @@ -44,7 +44,7 @@ use Sabre\DAV\Server; * @package OCA\DAV\Connector\Sabre */ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { - protected Server $server; + protected ?Server $server = null; /** * @param \Sabre\DAV\Server $server diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php index c803358ede1..ea94b5c8933 100644 --- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php @@ -112,7 +112,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { /** * Log exception */ - public function logException(\Throwable $ex): void { + public function logException(\Throwable $ex) { $exceptionClass = get_class($ex); if (isset($this->nonFatalExceptions[$exceptionClass]) || ( diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 9474ed91f85..b784764f8fe 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -86,7 +86,7 @@ class FilesPlugin extends ServerPlugin { public const FILE_METADATA_SIZE = '{http://nextcloud.org/ns}file-metadata-size'; /** Reference to main server object */ - private Server $server; + private ?Server $server = null; private Tree $tree; private IUserSession $userSession; @@ -345,7 +345,7 @@ class FilesPlugin extends ServerPlugin { $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) { return json_encode($this->previewManager->isAvailable($node->getFileInfo())); }); - $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node): int { + $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node): ?int { return $node->getSize(); }); $propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) { |