Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class ItemWasAddedToShoppingBasket implements EventPayload |
||
9 | { |
||
10 | use EqualsUsesWindUp; |
||
11 | private $itemCode; |
||
12 | private $quantity; |
||
13 | |||
14 | public function __construct(string $itemCode, int $quantity) |
||
15 | { |
||
16 | $this->itemCode = $itemCode; |
||
17 | $this->quantity = $quantity; |
||
18 | } |
||
19 | |||
20 | public static function unwind(array $spool): Windable |
||
21 | { |
||
22 | return new static($spool[0], $spool[1]); |
||
23 | } |
||
24 | |||
25 | public function getItemCode(): string |
||
26 | { |
||
27 | return $this->itemCode; |
||
28 | } |
||
29 | |||
30 | public function getQuantity(): int |
||
31 | { |
||
32 | return $this->quantity; |
||
33 | } |
||
34 | |||
35 | public function windUp(): array |
||
38 | } |
||
39 | } |
||
40 |