Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 2, 2019
1 parent 15cbb5a commit ddaf6e6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Illuminate/Support/Testing/Fakes/QueueFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,9 @@ public function connection($value = null)
*/
public function size($queue = null)
{
/** @var int $count how many jobs in the given queue. */
$count = 0;
foreach ($this->jobs as $jobClass) {
foreach ($jobClass as $job) {
$count += $job['queue'] === $queue;
}
}

return $count;
return collect($this->jobs)->flatten(1)->filter(function ($job) use ($queue) {
return $job['queue'] === $queue;
})->count();
}

/**
Expand Down

0 comments on commit ddaf6e6

Please sign in to comment.