| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.0054 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 2 | protected function mapConfig(JobBase $job) : array |
|
| 42 | { |
||
| 43 | 2 | if (!$job instanceof JobExchangePublish) { |
|
| 44 | throw new WrongArgumentException($job, JobExchangePublish::class); |
||
| 45 | } |
||
| 46 | |||
| 47 | $body = [ |
||
| 48 | 2 | 'payload' => (string)$job->getMessage(), |
|
| 49 | 2 | 'payload_encoding' => 'string', // TODO |
|
| 50 | 2 | 'routing_key' => (string)$job->getRoutingKey(), |
|
| 51 | 'properties' => [ |
||
| 52 | 2 | 'delivery_mode' => $job->getDeliveryMode()->__toInt(), |
|
| 53 | 'headers' => [] // TODO |
||
| 54 | ] |
||
| 55 | ]; |
||
| 56 | |||
| 57 | 2 | return array_merge(parent::mapConfig($job), [ |
|
| 58 | 2 | 'json' => $body, |
|
| 59 | ]); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |