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

MessageProcessed::assertPayload()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 0
c 1
b 1
f 1
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
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