summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-10-17 11:50:32 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-10-17 11:53:11 +0200
commit9319bbb00ce98bbb6da8f8772199356872f1873b (patch)
tree3bae4ba54b8071c46fdd1805c45fbbfec2e25e79 /apps
parent3790ff86f150ca25262531fd07647839e41c07c6 (diff)
downloadnextcloud-server-9319bbb00ce98bbb6da8f8772199356872f1873b.tar.gz
nextcloud-server-9319bbb00ce98bbb6da8f8772199356872f1873b.zip
More type safety
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Auth/AuthMechanism.php4
-rw-r--r--apps/files_external/lib/Lib/Backend/Backend.php14
-rw-r--r--apps/files_external/lib/Lib/FrontendDefinitionTrait.php6
-rw-r--r--apps/files_external/lib/Lib/IFrontendDefinition.php6
-rw-r--r--apps/files_external/lib/Lib/MissingDependency.php10
5 files changed, 15 insertions, 25 deletions
diff --git a/apps/files_external/lib/Lib/Auth/AuthMechanism.php b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
index 16354fa37fa..e43f6d06b47 100644
--- a/apps/files_external/lib/Lib/Auth/AuthMechanism.php
+++ b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
@@ -30,7 +30,7 @@ use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Lib\StorageModifierTrait;
use OCA\Files_External\Lib\VisibilityTrait;
use OCA\Files_External\Lib\IIdentifier;
-use OCA\Files_External\Lib\IFrontendDefintion;
+use OCA\Files_External\Lib\IFrontendDefinition;
/**
* Authentication mechanism
@@ -52,7 +52,7 @@ use OCA\Files_External\Lib\IFrontendDefintion;
* - StorageModifierTrait
* Object can affect storage mounting
*/
-class AuthMechanism implements \JsonSerializable, IIdentifier, IFrontendDefintion {
+class AuthMechanism implements \JsonSerializable, IIdentifier, IFrontendDefinition {
/** Standard authentication schemes */
public const SCHEME_NULL = 'null';
public const SCHEME_BUILTIN = 'builtin';
diff --git a/apps/files_external/lib/Lib/Backend/Backend.php b/apps/files_external/lib/Lib/Backend/Backend.php
index afedfd213eb..845f51f5432 100644
--- a/apps/files_external/lib/Lib/Backend/Backend.php
+++ b/apps/files_external/lib/Lib/Backend/Backend.php
@@ -31,7 +31,7 @@ use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Lib\StorageModifierTrait;
use OCA\Files_External\Lib\VisibilityTrait;
use OCA\Files_External\Lib\IIdentifier;
-use OCA\Files_External\Lib\IFrontendDefintion;
+use OCA\Files_External\Lib\IFrontendDefinition;
/**
* Storage backend
@@ -57,7 +57,7 @@ use OCA\Files_External\Lib\IFrontendDefintion;
* - StorageModifierTrait
* Object can affect storage mounting
*/
-class Backend implements \JsonSerializable, IIdentifier, IFrontendDefintion {
+class Backend implements \JsonSerializable, IIdentifier, IFrontendDefinition {
use VisibilityTrait;
use FrontendDefinitionTrait;
use PriorityTrait;
@@ -120,21 +120,17 @@ class Backend implements \JsonSerializable, IIdentifier, IFrontendDefintion {
return $this->legacyAuthMechanism;
}
- /**
- * @param AuthMechanism $authMechanism
- * @return self
- */
- public function setLegacyAuthMechanism(AuthMechanism $authMechanism) {
+ public function setLegacyAuthMechanism(AuthMechanism $authMechanism): self {
$this->legacyAuthMechanism = $authMechanism;
return $this;
}
/**
* @param callable $callback dynamic auth mechanism selection
- * @return self
*/
- public function setLegacyAuthMechanismCallback(callable $callback) {
+ public function setLegacyAuthMechanismCallback(callable $callback): self {
$this->legacyAuthMechanism = $callback;
+ return $this;
}
/**
diff --git a/apps/files_external/lib/Lib/FrontendDefinitionTrait.php b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
index 6b2dc8672f3..fd72b2fa7aa 100644
--- a/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
+++ b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
@@ -31,7 +31,7 @@ trait FrontendDefinitionTrait {
/** @var string human-readable mechanism name */
private string $text = "";
- /** @var DefinitionParameter[] parameters for mechanism */
+ /** @var array<string, DefinitionParameter> parameters for mechanism */
private array $parameters = [];
/** @var string[] custom JS */
@@ -51,14 +51,14 @@ trait FrontendDefinitionTrait {
}
/**
- * @return DefinitionParameter[]
+ * @return array<string, DefinitionParameter>
*/
public function getParameters(): array {
return $this->parameters;
}
/**
- * @param DefinitionParameter[] $parameters
+ * @param list<DefinitionParameter> $parameters
*/
public function addParameters(array $parameters): self {
foreach ($parameters as $parameter) {
diff --git a/apps/files_external/lib/Lib/IFrontendDefinition.php b/apps/files_external/lib/Lib/IFrontendDefinition.php
index 1a518a4ee76..3c625c21c15 100644
--- a/apps/files_external/lib/Lib/IFrontendDefinition.php
+++ b/apps/files_external/lib/Lib/IFrontendDefinition.php
@@ -19,19 +19,19 @@
*/
namespace OCA\Files_External\Lib;
-interface IFrontendDefintion {
+interface IFrontendDefinition {
public function getText(): string;
public function setText(string $text): self;
/**
- * @return list<DefinitionParameter>
+ * @return array<string, DefinitionParameter>
*/
public function getParameters(): array;
/**
- * @param DefinitionParameter[] $parameters
+ * @param list<DefinitionParameter> $parameters
*/
public function addParameters(array $parameters): self;
diff --git a/apps/files_external/lib/Lib/MissingDependency.php b/apps/files_external/lib/Lib/MissingDependency.php
index b740f4596b2..a8e9f9ecc45 100644
--- a/apps/files_external/lib/Lib/MissingDependency.php
+++ b/apps/files_external/lib/Lib/MissingDependency.php
@@ -39,17 +39,11 @@ class MissingDependency {
$this->dependency = $dependency;
}
- /**
- * @return string
- */
- public function getDependency() {
+ public function getDependency(): string {
return $this->dependency;
}
- /**
- * @return string|null
- */
- public function getMessage() {
+ public function getMessage(): ?string {
return $this->message;
}