Passed
Push — master ( 4b45e8...9cf991 )
by Koldo
02:48
created

QueueEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 7
c 1
b 0
f 1
dl 0
loc 20
ccs 4
cts 8
cp 0.5
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isPropagationStopped() 0 3 1
A occur() 0 6 1
A payload() 0 3 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