diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-09-28 16:04:28 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-19 11:43:59 +0200 |
commit | 1202171b3214e7d9588bfc37b72a54f5f63b360c (patch) | |
tree | ddd40c45590219a0681ec296fde47ec8349b08a0 | |
parent | a3ec716c333a5ad081619a5b2e84a83c2d27f74d (diff) | |
download | nextcloud-server-1202171b3214e7d9588bfc37b72a54f5f63b360c.tar.gz nextcloud-server-1202171b3214e7d9588bfc37b72a54f5f63b360c.zip |
Fix docblock and types for new public API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/public/AppFramework/Bootstrap/IRegistrationContext.php | 5 | ||||
-rw-r--r-- | lib/public/SetupCheck/ISetupCheck.php | 9 | ||||
-rw-r--r-- | lib/public/SetupCheck/SetupResult.php | 38 |
3 files changed, 24 insertions, 28 deletions
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php index ad83129514f..2398c5ef931 100644 --- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php +++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php @@ -376,9 +376,8 @@ interface IRegistrationContext { * Register an implementation of \OCP\SetupCheck\ISetupCheck that * will handle the implementation of a setup check * - * @psalm-param class-string<\OCP\SetupCheck\ISetupCheck> $setupCheckClass - * @return void - * @since 25.0.0 + * @param class-string<\OCP\SetupCheck\ISetupCheck> $setupCheckClass + * @since 28.0.0 */ public function registerSetupCheck(string $setupCheckClass): void; } diff --git a/lib/public/SetupCheck/ISetupCheck.php b/lib/public/SetupCheck/ISetupCheck.php index 05b43778651..e11b07e8e90 100644 --- a/lib/public/SetupCheck/ISetupCheck.php +++ b/lib/public/SetupCheck/ISetupCheck.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); namespace OCP\SetupCheck; @@ -8,21 +9,21 @@ namespace OCP\SetupCheck; * setup checks in your application. The results of these checks will them * be displayed in the admin overview. * - * @since 25.0.0 + * @since 28.0.0 */ interface ISetupCheck { /** - * @since 25.0.0 + * @since 28.0.0 */ public function getCategory(): string; /** - * @since 25.0.0 + * @since 28.0.0 */ public function getName(): string; /** - * @since 25.0.0 + * @since 28.0.0 */ public function run(): SetupResult; } diff --git a/lib/public/SetupCheck/SetupResult.php b/lib/public/SetupCheck/SetupResult.php index d2096301690..beb97d9d922 100644 --- a/lib/public/SetupCheck/SetupResult.php +++ b/lib/public/SetupCheck/SetupResult.php @@ -5,33 +5,30 @@ namespace OCP\SetupCheck; /** * @brief This class is used for storing the result of a setup check * - * @since 25.0.0 + * @since 28.0.0 */ class SetupResult implements \JsonSerializable { - const SUCCESS = 'success'; - const INFO = 'info'; - const WARNING = 'warning'; - const ERROR = 'error'; - - private string $severity; - private ?string $description; - private ?string $linkToDoc; + public const SUCCESS = 'success'; + public const INFO = 'info'; + public const WARNING = 'warning'; + public const ERROR = 'error'; /** - * @psalm-param self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity - * @since 25.0.0 + * @param self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity + * @since 28.0.0 */ - public function __construct(string $severity, ?string $description = null, ?string $linkToDoc = null) { - $this->severity = $severity; - $this->description = $description; - $this->linkToDoc = $linkToDoc; + public function __construct( + private string $severity, + private ?string $description = null, + private ?string $linkToDoc = null, + ) { } /** * @brief Get the severity for the setup check result * - * @psalm-return self::INFO|self::WARNING|self::ERROR - * @since 25.0.0 + * @return self::SUCCESS|self::INFO|self::WARNING|self::ERROR + * @since 28.0.0 */ public function getSeverity(): string { return $this->severity; @@ -40,7 +37,7 @@ class SetupResult implements \JsonSerializable { /** * @brief Get the description for the setup check result * - * @since 25.0.0 + * @since 28.0.0 */ public function getDescription(): ?string { return $this->description; @@ -49,14 +46,13 @@ class SetupResult implements \JsonSerializable { /** * @brief Get a link to the doc for the explanation. * - * @since 25.0.0 + * @since 28.0.0 */ public function getLinkToDoc(): ?string { return $this->linkToDoc; } - #[\ReturnTypeWillChange] - function jsonSerialize() { + public function jsonSerialize(): array { return [ 'severity' => $this->severity, 'description' => $this->description, |