From 6d2e53178b6dc83845f4eaabde458c2c5b2d24fb Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 22 Dec 2023 11:03:47 +0100 Subject: [PATCH] Typed Minz_Extension (#5957) Replaces https://github.com/FreshRSS/FreshRSS/pull/5837 The signature of methods supposed to be overriden by existing thid-party extensions cannot be modified --- lib/Minz/Extension.php | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php index 5386a64e7..057bdd19e 100644 --- a/lib/Minz/Extension.php +++ b/lib/Minz/Extension.php @@ -5,24 +5,18 @@ declare(strict_types=1); * The extension base class. */ abstract class Minz_Extension { - /** @var string */ - private $name; - /** @var string */ - private $entrypoint; - /** @var string */ - private $path; - /** @var string */ - private $author; - /** @var string */ - private $description; - /** @var string */ - private $version; + private string $name; + private string $entrypoint; + private string $path; + private string $author; + private string $description; + private string $version; /** @var 'system'|'user' */ - private $type; + private string $type; /** @var array|null */ - private $user_configuration; + private ?array $user_configuration; /** @var array|null */ - private $system_configuration; + private ?array $system_configuration; /** @var array{0:'system',1:'user'} */ public static array $authorized_types = [ @@ -30,8 +24,7 @@ abstract class Minz_Extension { 'user', ]; - /** @var bool */ - private $is_enabled; + private bool $is_enabled; /** * The constructor to assign specific information to the extension.