Skip to content

Commit

Permalink
Fix return of function in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnabil230 committed Jun 3, 2022
1 parent 8adc9d5 commit 6a0bad8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/Commands/ForgetSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ class ForgetSetting extends Command
/**
* Execute the console command.
*
* @return void
* @return int
*/
public function handle()
{
$key = $this->argument('key');

$setting = setting();

if ($setting->has($key)) {
if ($setting->forget($key)) {
if (setting()->has($key)) {
if (setting()->forget($key)) {
$this->info('Forget one or more settings successfully.');

return Command::SUCCESS;
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/GetSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class GetSetting extends Command
/**
* Execute the console command.
*
* @return void
* @return int
*/
public function handle()
{
Expand All @@ -49,7 +49,7 @@ public function handle()
}

$settings = $this->formatSetting(Arr::dot($settings));
$this->print($settings);
return $this->print($settings);
}

/**
Expand All @@ -72,7 +72,7 @@ private function formatSetting($settings)
*
* @param Collection $settings
*
* @return void
* @return int
*/
private function print($settings)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SetOrUpdateSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SetOrUpdateSetting extends Command
/**
* Execute the console command.
*
* @return void
* @return int
*/
public function handle()
{
Expand Down

0 comments on commit 6a0bad8

Please sign in to comment.