ShoppingBasketWasPickedUpByReturningCustomer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 23
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A unwind() 0 3 1
A getReturningCustomerId() 0 3 1
A __construct() 0 3 1
A windUp() 0 3 1
1
<?php declare(strict_types=1);
2
namespace Kepawni\Twilted\Basic\TestSample\Event;
3
4
use Kepawni\Twilted\Basic\EqualsUsesWindUp;
5
use Kepawni\Twilted\EventPayload;
6
use Kepawni\Twilted\Windable;
7
8
class ShoppingBasketWasPickedUpByReturningCustomer implements EventPayload
9
{
10
    use EqualsUsesWindUp;
11
    private $returningCustomerId;
12
13
    public function __construct(string $returningCustomerId)
14
    {
15
        $this->returningCustomerId = $returningCustomerId;
16
    }
17
18
    public static function unwind(array $spool): Windable
19
    {
20
        return new static($spool[0]);
21
    }
22
23
    public function getReturningCustomerId(): string
24
    {
25
        return $this->returningCustomerId;
26
    }
27
28
    public function windUp(): array
29
    {
30
        return [$this->returningCustomerId];
31
    }
32
}
33