Conditions | 3 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
39 | public function createCallback() |
||
40 | { |
||
41 | $callback = function (AMQPMessage $request) use ($this) { |
||
42 | |||
43 | $body = $this->buildService(); |
||
44 | |||
45 | if (!is_string($body) || is_null($body)) { |
||
46 | throw new InvalidBodyAMQPMessageException('Invalid Body: Content should be string and not null.'); |
||
47 | } |
||
48 | $message = new AMQPMessage( |
||
49 | $body, |
||
50 | ['correlation_id' => $request->get('correlation_id')] |
||
51 | ); |
||
52 | |||
53 | $request->delivery_info['channel']->basic_publish( |
||
54 | $message, |
||
55 | '', |
||
56 | $request->get('reply_to') |
||
57 | ); |
||
58 | $request->delivery_info['channel']->basic_ack( |
||
59 | $request->delivery_info['delivery_tag'] |
||
60 | ); |
||
61 | }; |
||
62 | |||
63 | return $callback; |
||
64 | } |
||
65 | |||
70 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.