Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge 3.x into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Sep 4, 2016
2 parents af47bcc + 6b31516 commit 12ded96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
28 changes: 21 additions & 7 deletions Backend/AMQPBackendDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(array $settings, array $queues, $defaultQueue, array
}

/**
* @return AMQPChannelannel
* @return AMQPChannel
*/
public function getChannel()
{
Expand Down Expand Up @@ -115,15 +115,19 @@ public function getBackend($type)
*/
public function getIterator()
{
throw new \RuntimeException('You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.');
throw new \RuntimeException(
'You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.'
);
}

/**
* {@inheritdoc}
*/
public function handle(MessageInterface $message, EventDispatcherInterface $dispatcher)
{
throw new \RuntimeException('You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.');
throw new \RuntimeException(
'You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.'
);
}

/**
Expand All @@ -149,11 +153,16 @@ public function getStatus()
}

if ($checked !== count($this->queues)) {
return new Failure('Not all queues for the available notification types registered in the rabbitmq broker. Are the consumer commands running?');
return new Failure(
'Not all queues for the available notification types registered in the rabbitmq broker. '
.'Are the consumer commands running?'
);
}

if (count($missingConsumers) > 0) {
return new Failure('There are no rabbitmq consumers running for the queues: '.implode(', ', $missingConsumers));
return new Failure(
'There are no rabbitmq consumers running for the queues: '.implode(', ', $missingConsumers)
);
}
} catch (\Exception $e) {
return new Failure($e->getMessage());
Expand All @@ -167,7 +176,9 @@ public function getStatus()
*/
public function cleanup()
{
throw new \RuntimeException('You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.');
throw new \RuntimeException(
'You need to use a specific rabbitmq backend supporting the selected queue to run a consumer.'
);
}

public function shutdown()
Expand Down Expand Up @@ -198,7 +209,10 @@ public function initialize()
protected function getApiQueueStatus()
{
if (class_exists('Guzzle\Http\Client') === false) {
throw new \RuntimeException('The guzzle http client library is required to run rabbitmq health checks. Make sure to add guzzle/guzzle to your composer.json.');
throw new \RuntimeException(
'The guzzle http client library is required to run rabbitmq health checks. '
.'Make sure to add guzzlehttp/guzzle to your composer.json.'
);
}

$client = new \Guzzle\Http\Client();
Expand Down
2 changes: 1 addition & 1 deletion Consumer/LoggerConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LoggerConsumer implements ConsumerInterface
public function __construct($logger)
{
if ($logger instanceof LegacyLoggerInterface) {
trigger_error(sprintf('Using an instance of "%s" is deprecated since version 2.3. Use Psr\Log\LoggerInterface instead.', get_class($logger)), E_USER_DEPRECATED);
@trigger_error(sprintf('Using an instance of "%s" is deprecated since version 2.3. Use Psr\Log\LoggerInterface instead.', get_class($logger)), E_USER_DEPRECATED);
}
$this->logger = $logger;
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"suggest": {
"sonata-project/admin-bundle": "To be able to use MessageAdmin.",
"sonata-project/doctrine-orm-admin-bundle": "^3.0",
"guzzle/guzzle" : "^3.9",
"guzzlehttp/guzzle" : "If you want to get a status report when using the rabbitMQ backend.",
"liip/monitor-bundle": "^1.0",
"php-amqplib/php-amqplib": "^2.0"
},
"require-dev": {
"sonata-project/doctrine-orm-admin-bundle": "^3.0",
"guzzle/guzzle" : "^3.8",
"guzzlehttp/guzzle" : "^3.8",
"php-amqplib/php-amqplib": "^2.0",
"liip/monitor-bundle": "^2.0",
"symfony/phpunit-bridge": "^2.7 || ^3.0",
Expand Down

0 comments on commit 12ded96

Please sign in to comment.