Passed
Push — master ( 04aa1f...4b45e8 )
by Koldo
02:50
created

QueueEvent::occur()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Queue\Event;
6
7
abstract class QueueEvent
8
{
9
    protected array $payload;
10
11 4
    public static function occur(array $payload): self
12
    {
13 4
        $self = new static();
14 4
        $self->payload = $payload;
15
16 4
        return $self;
17
    }
18
19
    public function payload(): array
20
    {
21
        return $this->payload;
22
    }
23
}
24