diff --git a/src/Appwrite/CLI/Tasks/Doctor.php b/src/Appwrite/CLI/Tasks/Doctor.php index 35fe9d048e..600be03a2f 100644 --- a/src/Appwrite/CLI/Tasks/Doctor.php +++ b/src/Appwrite/CLI/Tasks/Doctor.php @@ -13,7 +13,10 @@ use Utopia\Platform\Action; class Doctor extends Action { - public const NAME = 'doctor'; + public static function getName(): string + { + return 'doctor'; + } public function __construct() { diff --git a/src/Appwrite/CLI/Tasks/Install.php b/src/Appwrite/CLI/Tasks/Install.php index fbf2ec5a3b..9bcc2e7096 100644 --- a/src/Appwrite/CLI/Tasks/Install.php +++ b/src/Appwrite/CLI/Tasks/Install.php @@ -14,7 +14,10 @@ use Utopia\Platform\Action; class Install extends Action { - public const NAME = 'install'; + public static function getName(): string + { + return 'install'; + } public function __construct() { diff --git a/src/Appwrite/CLI/Tasks/Maintenance.php b/src/Appwrite/CLI/Tasks/Maintenance.php index b535bdb7e1..7aae40cc11 100644 --- a/src/Appwrite/CLI/Tasks/Maintenance.php +++ b/src/Appwrite/CLI/Tasks/Maintenance.php @@ -17,7 +17,10 @@ use Utopia\Platform\Action; class Maintenance extends Action { - public const NAME = 'maintenance'; + public static function getName(): string + { + return 'maintenance'; + } protected function getConsoleDB(): Database { diff --git a/src/Appwrite/CLI/Tasks/Migrate.php b/src/Appwrite/CLI/Tasks/Migrate.php index 1e5d06a7c7..d1e41a02f0 100644 --- a/src/Appwrite/CLI/Tasks/Migrate.php +++ b/src/Appwrite/CLI/Tasks/Migrate.php @@ -16,11 +16,15 @@ use Swoole\Event; class Migrate extends Action { - public const NAME = 'migrate'; + public static function getName(): string + { + return 'migrate'; + } public function __construct() { $this + ->desc('Migrate Appwrite to new version') ->param('version', APP_VERSION_STABLE, new Text(8), 'Version to migrate to.', true) ->callback(fn ($version) => $this->action($version)); } diff --git a/src/Appwrite/CLI/Tasks/SDKs.php b/src/Appwrite/CLI/Tasks/SDKs.php index ea9fc51452..a9be206fbe 100644 --- a/src/Appwrite/CLI/Tasks/SDKs.php +++ b/src/Appwrite/CLI/Tasks/SDKs.php @@ -27,11 +27,15 @@ use Throwable; class SDKs extends Action { - public const NAME = 'sdks'; + public static function getName(): string + { + return 'sdks'; + } public function __construct() { $this + ->desc('Generate Appwrite SDKs') ->callback(fn () => $this->action()); } diff --git a/src/Appwrite/CLI/Tasks/SSL.php b/src/Appwrite/CLI/Tasks/SSL.php index 79400e9eb2..6379253789 100644 --- a/src/Appwrite/CLI/Tasks/SSL.php +++ b/src/Appwrite/CLI/Tasks/SSL.php @@ -11,7 +11,10 @@ use Utopia\Validator\Hostname; class SSL extends Action { - public const NAME = 'ssl'; + public static function getName(): string + { + return 'ssl'; + } public function __construct() { diff --git a/src/Appwrite/CLI/Tasks/Specs.php b/src/Appwrite/CLI/Tasks/Specs.php index bcf1911ff3..5c030a4880 100644 --- a/src/Appwrite/CLI/Tasks/Specs.php +++ b/src/Appwrite/CLI/Tasks/Specs.php @@ -18,11 +18,15 @@ use Exception; class Specs extends Action { - public const NAME = 'specs'; + public static function getName(): string + { + return 'specs'; + } public function __construct() { $this + ->desc('Generate Appwrite API specifications') ->param('version', 'latest', new Text(8), 'Spec version', true) ->param('mode', 'normal', new WhiteList(['normal', 'mocks']), 'Spec Mode', true) ->callback(fn ($version, $mode) => $this->action($version, $mode)); diff --git a/src/Appwrite/CLI/Tasks/Usage.php b/src/Appwrite/CLI/Tasks/Usage.php index 1b58809155..b40f17c069 100644 --- a/src/Appwrite/CLI/Tasks/Usage.php +++ b/src/Appwrite/CLI/Tasks/Usage.php @@ -12,7 +12,10 @@ use Utopia\Database\Validator\Authorization; class Usage extends Task { - public const NAME = 'usage'; + public static function getName(): string + { + return 'usage'; + } public function __construct() { diff --git a/src/Appwrite/CLI/Tasks/Vars.php b/src/Appwrite/CLI/Tasks/Vars.php index 442e1dc4ce..7286cc5382 100644 --- a/src/Appwrite/CLI/Tasks/Vars.php +++ b/src/Appwrite/CLI/Tasks/Vars.php @@ -9,7 +9,10 @@ use Utopia\Platform\Action; class Vars extends Action { - public const NAME = 'vars'; + public static function getName(): string + { + return 'vars'; + } public function __construct() { diff --git a/src/Appwrite/CLI/Tasks/Version.php b/src/Appwrite/CLI/Tasks/Version.php index 0a53482ce1..164b8b0766 100644 --- a/src/Appwrite/CLI/Tasks/Version.php +++ b/src/Appwrite/CLI/Tasks/Version.php @@ -8,7 +8,10 @@ use Utopia\Platform\Action; class Version extends Action { - public const NAME = 'version'; + public static function getName(): string + { + return 'version'; + } public function __construct() { diff --git a/src/Appwrite/CLI/TasksService.php b/src/Appwrite/CLI/TasksService.php index c91b3a9777..c6dba81dbc 100644 --- a/src/Appwrite/CLI/TasksService.php +++ b/src/Appwrite/CLI/TasksService.php @@ -20,15 +20,15 @@ class TasksService extends Service { $this->type = self::TYPE_CLI; $this - ->addAction(Version::NAME, new Version()) - ->addAction(Usage::NAME, new Usage()) - ->addAction(Vars::NAME, new Vars()) - ->addAction(SSL::NAME, new SSL()) - ->addAction(Doctor::NAME, new Doctor()) - ->addAction(Install::NAME, new Install()) - ->addAction(Maintenance::NAME, new Maintenance()) - ->addAction(Migrate::NAME, new Migrate()) - ->addAction(SDKs::NAME, new SDKs()) - ->addAction(Specs::NAME, new Specs()); + ->addAction(Version::getName(), new Version()) + ->addAction(Usage::getName(), new Usage()) + ->addAction(Vars::getName(), new Vars()) + ->addAction(SSL::getName(), new SSL()) + ->addAction(Doctor::getName(), new Doctor()) + ->addAction(Install::getName(), new Install()) + ->addAction(Maintenance::getName(), new Maintenance()) + ->addAction(Migrate::getName(), new Migrate()) + ->addAction(SDKs::getName(), new SDKs()) + ->addAction(Specs::getName(), new Specs()); } }