From ad08dc930b291645b498e1ac30ccd15b15e403b4 Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Wed, 8 Sep 2021 14:17:49 +0530 Subject: [PATCH] Comments Updated --- .../Console/Commands/DownChannelCommand.php | 7 +++++ .../Core/src/Console/Commands/DownCommand.php | 10 +++++++ .../src/Console/Commands/UpChannelCommand.php | 13 ++++++++- .../Core/src/Console/Commands/UpCommand.php | 10 +++++++ .../src/Providers/CoreServiceProvider.php | 27 +++++++------------ 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/packages/Webkul/Core/src/Console/Commands/DownChannelCommand.php b/packages/Webkul/Core/src/Console/Commands/DownChannelCommand.php index 7c904d764..8b7a0dcd4 100644 --- a/packages/Webkul/Core/src/Console/Commands/DownChannelCommand.php +++ b/packages/Webkul/Core/src/Console/Commands/DownChannelCommand.php @@ -17,6 +17,13 @@ class DownChannelCommand extends OriginalCommand {--secret= : The secret phrase that may be used to bypass maintenance mode} {--status=503 : The status code that should be used when returning the maintenance mode response}'; + /** + * The console command description. + * + * @var string + */ + protected $description = 'Down channel command. Same as parent but database will not update.'; + /** * Execute the console command. * diff --git a/packages/Webkul/Core/src/Console/Commands/DownCommand.php b/packages/Webkul/Core/src/Console/Commands/DownCommand.php index b81317916..1568644cb 100644 --- a/packages/Webkul/Core/src/Console/Commands/DownCommand.php +++ b/packages/Webkul/Core/src/Console/Commands/DownCommand.php @@ -7,6 +7,11 @@ use Webkul\Core\Models\Channel; class DownCommand extends OriginalCommand { + /** + * Execute the console command. + * + * @return int + */ public function handle() { $this->downAllChannels(); @@ -14,6 +19,11 @@ class DownCommand extends OriginalCommand parent::handle(); } + /** + * Update all channels. + * + * @return mixed + */ protected function downAllChannels() { $this->comment('All channels are down.'); diff --git a/packages/Webkul/Core/src/Console/Commands/UpChannelCommand.php b/packages/Webkul/Core/src/Console/Commands/UpChannelCommand.php index 8036576fe..6bfb52691 100644 --- a/packages/Webkul/Core/src/Console/Commands/UpChannelCommand.php +++ b/packages/Webkul/Core/src/Console/Commands/UpChannelCommand.php @@ -3,7 +3,6 @@ namespace Webkul\Core\Console\Commands; use Illuminate\Foundation\Console\UpCommand as OriginalCommand; -use Webkul\Core\Models\Channel; class UpChannelCommand extends OriginalCommand { @@ -14,6 +13,18 @@ class UpChannelCommand extends OriginalCommand */ protected $name = 'channel:up'; + /** + * The console command description. + * + * @var string + */ + protected $description = 'Up channel command. Same as parent but database will not update.'; + + /** + * Execute the console command. + * + * @return int + */ public function handle() { parent::handle(); diff --git a/packages/Webkul/Core/src/Console/Commands/UpCommand.php b/packages/Webkul/Core/src/Console/Commands/UpCommand.php index b752c7d5e..d09850769 100644 --- a/packages/Webkul/Core/src/Console/Commands/UpCommand.php +++ b/packages/Webkul/Core/src/Console/Commands/UpCommand.php @@ -7,6 +7,11 @@ use Webkul\Core\Models\Channel; class UpCommand extends OriginalCommand { + /** + * Execute the console command. + * + * @return int + */ public function handle() { $this->upAllChannels(); @@ -14,6 +19,11 @@ class UpCommand extends OriginalCommand parent::handle(); } + /** + * Update all channels. + * + * @return mixed + */ protected function upAllChannels() { $this->comment('Activating all channels.'); diff --git a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php index 4e5892ee7..d47c9bf53 100755 --- a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php +++ b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php @@ -8,14 +8,6 @@ use Illuminate\Foundation\AliasLoader; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; -use Webkul\Core\Console\Commands\BagistoVersion; -use Webkul\Core\Console\Commands\BookingCron; -use Webkul\Core\Console\Commands\DownChannelCommand; -use Webkul\Core\Console\Commands\DownCommand; -use Webkul\Core\Console\Commands\ExchangeRateUpdate; -use Webkul\Core\Console\Commands\Install; -use Webkul\Core\Console\Commands\UpChannelCommand; -use Webkul\Core\Console\Commands\UpCommand; use Webkul\Core\Core; use Webkul\Core\Exceptions\Handler; use Webkul\Core\Facades\Core as CoreFacade; @@ -71,11 +63,11 @@ class CoreServiceProvider extends ServiceProvider }); $this->app->extend('command.down', function () { - return new DownCommand; + return new \Webkul\Core\Console\Commands\DownCommand; }); $this->app->extend('command.up', function () { - return new UpCommand; + return new \Webkul\Core\Console\Commands\UpCommand; }); } @@ -109,7 +101,7 @@ class CoreServiceProvider extends ServiceProvider } /** - * Register the console commands of this package + * Register the console commands of this package. * * @return void */ @@ -117,16 +109,16 @@ class CoreServiceProvider extends ServiceProvider { if ($this->app->runningInConsole()) { $this->commands([ - BagistoVersion::class, - Install::class, - ExchangeRateUpdate::class, - BookingCron::class, + \Webkul\Core\Console\Commands\BagistoVersion::class, + \Webkul\Core\Console\Commands\Install::class, + \Webkul\Core\Console\Commands\ExchangeRateUpdate::class, + \Webkul\Core\Console\Commands\BookingCron::class, ]); } $this->commands([ - DownChannelCommand::class, - UpChannelCommand::class, + \Webkul\Core\Console\Commands\DownChannelCommand::class, + \Webkul\Core\Console\Commands\UpChannelCommand::class, ]); } @@ -134,7 +126,6 @@ class CoreServiceProvider extends ServiceProvider * Register factories. * * @param string $path - * * @return void * @throws \Illuminate\Contracts\Container\BindingResolutionException */