src/Queues/Queue.php
public function pop(?string $worker = null, ?int $numJobs = null)
    {
        $workerName = $worker ?: $this->client->getWorkerName();
        $jids = json_decode($this->client->pop($this->name, $workerName, $numJobs ?: 1), true);

        $jobs = [];
        array_map(function (array $data) use (&$jobs) {
            $job = new BaseJob($this->client, $data);
            $job->setEventsManager($this->getEventsManager());

            $jobs[] = $job;
        }, $jids ?: []);

        return $numJobs === null ? array_shift($jobs) : $jobs;
    }
public function pop(?string $worker = null, ?int $numJobs = null)
    {
        $workerName = $worker ?: $this->client->getWorkerName();
        $jids = json_decode($this->client->pop($this->name, $workerName, $numJobs ?: 1), true);

        $jobs = [];
        array_map(function (array $data) use (&$jobs) {
            $job = new BaseJob($this->client, $data);
            $job->setEventsManager($this->getEventsManager());

            $jobs[] = $job;
        }, $jids ?: []);

        return $numJobs === null ? array_shift($jobs) : $jobs;
    }
Get the next job on this queue.

@param string|null $worker  Worker name popping the job.
@param int         $numJobs Number of jobs to pop off of the queue.

@return BaseJob|BaseJob[]|null

@throws QlessException