Passed
Push — master ( baec40...9ab24f )
by Koldo
02:35
created

MessageProcessed::occur()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
ccs 7
cts 7
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Queue\Event;
6
7
use Enqueue\Consumption\Result;
8
9
class MessageProcessed extends QueueEvent
10
{
11 4
    public static function occur(Result $result): self
12
    {
13 4
        $self = new static();
14 4
        $self->payload = [
15 4
            'status' => $result->getStatus(),
16 4
            'reason' => $result->getReason(),
17 4
            'reply' => $result->getReply(),
18
        ];
19
20 4
        return $self;
21
    }
22
}
23