Skip to content

Commit

Permalink
fix return type of built-in artisan commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rizqyhi committed Nov 17, 2023
1 parent 71575a0 commit add9451
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/Illuminate/Queue/Console/FailedTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ public function __construct(Filesystem $files)
/**
* Execute the console command.
*
* @return void
*/
* @return int
*/
public function fire()
{
$fullPath = $this->createBaseMigration();

$this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/failed_jobs.stub'));

$this->info('Migration created successfully!');

return 0;
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Queue/Console/FlushFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class FlushFailedCommand extends Command {
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Queue/Console/ForgetFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ForgetFailedCommand extends Command {
/**
* Execute the console command.
*
* @return void
*/
* @return int
*/
public function fire()
{
if ($this->laravel['queue.failer']->forget($this->argument('id')))
Expand All @@ -34,6 +34,8 @@ public function fire()
{
$this->error('No failed job matches the given ID.');
}

return 0;
}

/**
Expand Down
9 changes: 6 additions & 3 deletions src/Illuminate/Queue/Console/ListFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ListFailedCommand extends Command {
/**
* Execute the console command.
*
* @return void
*/
* @return int
*/
public function fire()
{
$rows = array();
Expand All @@ -34,14 +34,17 @@ public function fire()

if (count($rows) == 0)
{
return $this->info('No failed jobs!');
$this->info('No failed jobs!');
return 0;
}

$table = $this->getHelperSet()->get('table');

$table->setHeaders(array('ID', 'Connection', 'Queue', 'Class', 'Failed At'))
->setRows($rows)
->render($this->output);

return 0;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Queue/Console/RestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ class RestartCommand extends Command {
/**
* Execute the console command.
*
* @return void
*/
* @return int
*/
public function fire()
{
$this->laravel['cache']->forever('illuminate:queue:restart', time());

$this->info('Broadcasting queue restart signal.');

return 0;
}

}
6 changes: 4 additions & 2 deletions src/Illuminate/Queue/Console/RetryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class RetryCommand extends Command {
/**
* Execute the console command.
*
* @return void
*/
* @return int
*/
public function fire()
{
$failed = $this->laravel['queue.failer']->find($this->argument('id'));
Expand All @@ -42,6 +42,8 @@ public function fire()
{
$this->error('No failed job matches the given ID.');
}

return 0;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Queue/Console/SubscribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class SubscribeCommand extends Command {
/**
* Execute the console command.
*
* @return void
*
* @return int
*
* @throws \RuntimeException
*/
public function fire()
Expand All @@ -48,6 +48,8 @@ public function fire()
$iron->getIron()->updateQueue($this->argument('queue'), $this->getQueueOptions());

$this->line('<info>Queue subscriber added:</info> <comment>'.$this->argument('url').'</comment>');

return 0;
}

/**
Expand Down

0 comments on commit add9451

Please sign in to comment.