Passed
Push — master ( 4b45e8...9cf991 )
by Koldo
02:48
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
use Psr\EventDispatcher\StoppableEventInterface;
8
9
abstract class QueueEvent implements StoppableEventInterface
10
{
11
    protected array $payload;
12
13 4
    public static function occur(array $payload): self
14
    {
15 4
        $self = new static();
16 4
        $self->payload = $payload;
17
18 4
        return $self;
19
    }
20
21
    public function payload(): array
22
    {
23
        return $this->payload;
24
    }
25
26
    public function isPropagationStopped(): bool
27
    {
28
        return false;
29
    }
30
}
31