for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Puzzle\AMQP\Workers;
use Psr\Log\LoggerAwareTrait;
use Puzzle\AMQP\Consumer;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
class WorkerContext
{
use LoggerAwareTrait;
public
$queue,
$queue
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
class A { var $property; }
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.
$description;
private
$consumer,
$consumer
$worker;
public function __construct(\Closure $worker, Consumer $consumer, $queue)
$this->worker = $worker;
$this->consumer = $consumer;
$this->queue = $queue;
$this->logger = new NullLogger();
}
public function getWorker()
if($this->worker instanceof \Closure)
$closure = $this->worker;
$this->worker = $closure();
$this->worker->setLogger($this->logger);
return $this->worker;
public function setLogger(LoggerInterface $logger)
$this->logger = $logger;
$this->consumer->setLogger($logger);
return $this;
public function getLogger()
return $this->logger;
public function getConsumer()
return $this->consumer;
public function setDescription($description)
$this->description = $description;
public function getDescription()
return $this->description;
public function getQueue()
return $this->queue;
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.