Skip to content

Commit

Permalink
Client does not need a referece to ConsumerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Janda committed Jun 16, 2017
1 parent 1e4efca commit bac3e9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 1 addition & 19 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

namespace Gamee\RabbitMQ;

use Gamee\RabbitMQ\Consumer\Consumer;
use Gamee\RabbitMQ\Consumer\ConsumerFactory;
use Gamee\RabbitMQ\Consumer\Exception\ConsumerFactoryException;
use Gamee\RabbitMQ\Producer\Exception\ProducerFactoryException;
use Gamee\RabbitMQ\Producer\Producer;
use Gamee\RabbitMQ\Producer\ProducerFactory;
Expand All @@ -29,16 +26,10 @@ final class Client
*/
private $producerFactory;

/**
* @var ConsumerFactory
*/
private $consumerFactory;


public function __construct(ProducerFactory $producerFactory, ConsumerFactory $consumerFactory)
public function __construct(ProducerFactory $producerFactory)
{
$this->producerFactory = $producerFactory;
$this->consumerFactory = $consumerFactory;
}


Expand All @@ -50,13 +41,4 @@ public function getProducer(string $name): Producer
return $this->producerFactory->getProducer($name);
}


/**
* @throws ConsumerFactoryException
*/
public function getConsumer(string $name): Consumer
{
return $this->consumerFactory->getConsumer($name);
}

}
2 changes: 1 addition & 1 deletion src/DI/RabbitMQExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function beforeCompile(): void
* Consumers
* @var ServiceDefinition
*/
$consumersFactory = $this->consumersHelper->setup($builder, $config['consumers']);
$consumerFactory = $this->consumersHelper->setup($builder, $config['consumers']);

/**
* Register Client class
Expand Down

0 comments on commit bac3e9b

Please sign in to comment.