Skip to content

Commit

Permalink
Fix last old-style queue job fired by the core.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 6, 2017
1 parent 8c90e7f commit c9e8854
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function call($command, array $parameters = [], $outputBuffer = null)
public function queue($command, array $parameters = [])
{
$this->app[QueueContract::class]->push(
QueuedJob::class, func_get_args()
new QueuedCommand(func_get_args())
);
}

Expand Down
38 changes: 38 additions & 0 deletions src/Illuminate/Foundation/Console/QueuedCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace Illuminate\Foundation\Console;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Console\Kernel as KernelContract;

class QueuedCommand implements ShouldQueue
{
/**
* The data to pass to the Artisan command.
*
* @var array
*/
protected $data;

/**
* Create a new job instance.
*
* @param array $data
* @return void
*/
public function __construct($data)
{
$this->data = $data;
}

/**
* Handle the job.
*
* @param \Illuminate\Contracts\Console\Kernel $kernel
* @return void
*/
public function handle(KernelContract $kernel)
{
call_user_func_array([$kernel, 'call'], $this->data);
}
}
40 changes: 0 additions & 40 deletions src/Illuminate/Foundation/Console/QueuedJob.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Jobs/JobName.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function parse($job)
*/
public static function resolve($name, $payload)
{
if (isset($payload['name'])) {
if (isset($payload['name']) && ! empty($payload['name'])) {
return $payload['name'];
}

Expand Down

0 comments on commit c9e8854

Please sign in to comment.