Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | 6 | public function resolve($payload): callable |
|
21 | { |
||
22 | 6 | if (empty($payload[JobOptions::PAYLOAD_SERVICE_ID])) { |
|
23 | 1 | throw BadPayloadException::missingOrEmptyKeyValue($payload, JobOptions::PAYLOAD_SERVICE_ID, 'string', __CLASS__); |
|
24 | } |
||
25 | |||
26 | 5 | $id = sprintf($this->idFormat, $payload[JobOptions::PAYLOAD_SERVICE_ID]); |
|
27 | |||
28 | 5 | return empty($payload[JobOptions::PAYLOAD_SERVICE_METHOD]) |
|
29 | ? $this->container->get($id) |
||
30 | : [$this->container->get($id), $payload[JobOptions::PAYLOAD_SERVICE_METHOD]]; |
||
31 | } |
||
33 |