@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function createCallback() |
43 | 43 | { |
44 | - $callback = function (AMQPMessage $message) { |
|
44 | + $callback = function(AMQPMessage $message) { |
|
45 | 45 | |
46 | 46 | $responseCollection = $this->rpcMessager->getResponseCollection(); |
47 | 47 | $requestCollection = $this->rpcMessager->getRequestCollection(); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @param AMQPMessage $message |
96 | - * @param $content |
|
96 | + * @param AMQPMessage $content |
|
97 | 97 | */ |
98 | 98 | public function publish(AMQPMessage $message, $content) |
99 | 99 | { |
@@ -34,6 +34,9 @@ |
||
34 | 34 | throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $path)); |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param string $path |
|
39 | + */ |
|
37 | 40 | public function matchCollection($path, MethodCollection $methods) |
38 | 41 | { |
39 | 42 | foreach ($methods as $name => $method) { |
@@ -61,6 +61,10 @@ |
||
61 | 61 | return new ControllerNameParser($kernel); |
62 | 62 | } |
63 | 63 | |
64 | + /** |
|
65 | + * @param string $namespace |
|
66 | + * @param string $name |
|
67 | + */ |
|
64 | 68 | private function getBundle($namespace, $name) |
65 | 69 | { |
66 | 70 | $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface'); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public function testLoadRouteInstance() |
13 | 13 | { |
14 | 14 | $parser = $this->createParser(); |
15 | - $path = __DIR__ . '/../../app/config'; |
|
15 | + $path = __DIR__.'/../../app/config'; |
|
16 | 16 | $loader = new YamlRpcLoader($this->getContainer(), $path, $parser); |
17 | 17 | $methodCollection = $loader->load('rpc_routing.yml'); |
18 | 18 | $method = $methodCollection->get('cmobi_rabbitmq'); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function testLoadRouteName() |
24 | 24 | { |
25 | 25 | $parser = $this->createParser(); |
26 | - $path = __DIR__ . '/../../app/config'; |
|
26 | + $path = __DIR__.'/../../app/config'; |
|
27 | 27 | $loader = new YamlRpcLoader($this->getContainer(), $path, $parser); |
28 | 28 | $methodCollection = $loader->load('rpc_routing.yml'); |
29 | 29 | $method = $methodCollection->get('cmobi_rabbitmq'); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $kernel |
42 | 42 | ->expects($this->any()) |
43 | 43 | ->method('getBundle') |
44 | - ->will($this->returnCallback(function ($bundle) use ($bundles) { |
|
44 | + ->will($this->returnCallback(function($bundle) use ($bundles) { |
|
45 | 45 | if (!isset($bundles[$bundle])) { |
46 | 46 | throw new \InvalidArgumentException(sprintf('Invalid bundle name "%s"', $bundle)); |
47 | 47 | } |
@@ -164,7 +164,7 @@ |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
167 | - * @param $body |
|
167 | + * @param string $body |
|
168 | 168 | */ |
169 | 169 | private function handleRequest($body) |
170 | 170 | { |
@@ -8,7 +8,6 @@ |
||
8 | 8 | use Cmobi\RabbitmqBundle\Rpc\Request\RpcRequest; |
9 | 9 | use Cmobi\RabbitmqBundle\Rpc\Request\RpcRequestCollection; |
10 | 10 | use Cmobi\RabbitmqBundle\Rpc\Request\RpcRequestCollectionInterface; |
11 | -use Cmobi\RabbitmqBundle\Rpc\Request\RpcRequestInterface; |
|
12 | 11 | use Cmobi\RabbitmqBundle\Rpc\Response\RpcResponse; |
13 | 12 | use Cmobi\RabbitmqBundle\Rpc\Response\RpcResponseCollection; |
14 | 13 | use PhpAmqpLib\Channel\AbstractChannel; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function onResponse(AMQPMessage $rep) |
44 | 44 | { |
45 | - if($rep->get('correlation_id') == $this->correlationId) { |
|
45 | + if ($rep->get('correlation_id') == $this->correlationId) { |
|
46 | 46 | $this->response = $rep->body; |
47 | 47 | } |
48 | 48 | } |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | $expire = self::DEFAULT_TTL |
193 | 193 | ) |
194 | 194 | { |
195 | - list($callbackQueue, ,) = $this->getChannel()->queue_declare( |
|
196 | - 'callback_to_' . $this->getQueueName() . uniqid('', true), false, false, false, true, false, [ |
|
195 | + list($callbackQueue,,) = $this->getChannel()->queue_declare( |
|
196 | + 'callback_to_'.$this->getQueueName().uniqid('', true), false, false, false, true, false, [ |
|
197 | 197 | 'x-message-ttl' => ['I', $expire], |
198 | 198 | 'x-max-priority' => ['I', RpcRequestCollectionInterface::PRIORITY_MAX] |
199 | 199 | ] |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | ); |
215 | 215 | $this->getChannel()->basic_publish($msg, '', $this->getQueueName()); |
216 | 216 | |
217 | - while(!$this->response) { |
|
217 | + while (!$this->response) { |
|
218 | 218 | $this->getChannel()->wait(); |
219 | 219 | } |
220 | 220 | $this->getChannel()->close(); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | { |
8 | 8 | const ERROR_CODE = -32600; |
9 | 9 | |
10 | - public function __construct($message = null,\Exception $previous = null) |
|
10 | + public function __construct($message = null, \Exception $previous = null) |
|
11 | 11 | { |
12 | 12 | if (is_null($message)) { |
13 | 13 | $message = 'Invalid Request'; |