diff --git a/src/Console/LiapConfigPublishCommand.php b/src/Console/LiapConfigPublishCommand.php index f1dce3d..a4506bd 100644 --- a/src/Console/LiapConfigPublishCommand.php +++ b/src/Console/LiapConfigPublishCommand.php @@ -9,29 +9,17 @@ use Imdhemy\Purchases\ServiceProviders\LiapServiceProvider; /** - * Config publish command. - * - * This command is used to publish LIAP configuration file + * This command is used to publish LIAP configuration file. */ class LiapConfigPublishCommand extends Command { - /** - * @const string The failure message to display if file is already published - */ public const MESSAGE_ALREADY_INSTALLED = 'liap.php is already published.'; - - /** - * @const string The success message to display if file is published successfully - */ public const MESSAGE_SUCCESS = 'liap.php published successfully'; protected $signature = 'liap:config:publish {--f|force}'; protected $description = 'Publishes the LIAP configuration file.'; - /** - * Executes the console command. - */ public function handle(): int { if ($this->shouldForce()) { @@ -39,7 +27,7 @@ public function handle(): int } if ($this->isInstalled()) { - return $this->fail(); + return $this->publishFailed(); } return $this->publishConfig(); @@ -53,9 +41,6 @@ private function shouldForce(): bool return (bool)$this->option('force'); } - /** - * Publish configurations. - */ private function publishConfig(bool $force = false): int { $params = [ @@ -73,18 +58,12 @@ private function publishConfig(bool $force = false): int return $result; } - /** - * Check if the freya is installed. - */ private function isInstalled(): bool { return File::exists(config_path(LiapServiceProvider::CONFIG_KEY.'.php')); } - /** - * Should run on command failure. - */ - private function fail(): int + private function publishFailed(): int { $this->error(self::MESSAGE_ALREADY_INSTALLED);