| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 3 | protected function mapConfig(JobBase $job) : array |
|
| 42 | { |
||
| 43 | 3 | if (!$job instanceof JobExchangeCreate) { |
|
| 44 | throw new WrongArgumentException($job, JobExchangeCreate::class); |
||
| 45 | } |
||
| 46 | |||
| 47 | $body = [ |
||
| 48 | 3 | 'auto_delete' => $job->isAutoDelete(), |
|
| 49 | 3 | 'durable' => $job->isDurable(), |
|
| 50 | 'arguments' => [] |
||
| 51 | ]; |
||
| 52 | |||
| 53 | 3 | foreach ($job->getArguments() as $argument) { |
|
| 54 | 1 | $body['arguments'][$argument->getArgumentName()] = $argument->getValue(); |
|
| 55 | }; |
||
| 56 | |||
| 57 | 3 | return array_merge(parent::mapConfig($job), [ |
|
| 58 | 3 | 'json' => $body, |
|
| 59 | ]); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |