ShoppingBasketWasCheckedOut::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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 ShoppingBasketWasCheckedOut 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