Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.032 |
Changes | 0 |
1 | <?php |
||
25 | public function process(\Swarrot\Broker\Message $message, array $options) |
||
26 | 1 | { |
|
27 | $message = new MessageAdapter($message); |
||
28 | 1 | $message = $this->onConsume($message); |
|
29 | |||
30 | $this->workerContext->getLogger()->debug((string) $message); |
||
31 | |||
32 | 1 | $this->onWorkerProcess(); |
|
33 | |||
34 | 1 | try |
|
35 | { |
||
36 | $processResult = $this->workerContext->getWorker()->process($message); |
||
37 | } |
||
38 | catch(\Exception $exception) |
||
39 | { |
||
40 | $this->onWorkerProcessed(); |
||
41 | 1 | ||
42 | throw $exception; |
||
43 | 1 | } |
|
44 | |||
45 | $this->onWorkerProcessed(); |
||
46 | 1 | ||
47 | return $processResult; |
||
48 | 1 | } |
|
49 | 1 | ||
60 |