1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace Ctefan\Redux\Action; |
||
5 | |||
6 | class Action implements ActionInterface |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $type; |
||
12 | |||
13 | /** |
||
14 | * @var mixed |
||
15 | */ |
||
16 | protected $payload; |
||
17 | |||
18 | /** |
||
19 | * Action constructor. |
||
20 | * |
||
21 | * @param string $type |
||
22 | * @param null $payload |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
23 | */ |
||
24 | 13 | public function __construct(string $type, $payload = null) |
|
25 | { |
||
26 | 13 | $this->type = $type; |
|
27 | 13 | $this->payload = $payload; |
|
28 | 13 | } |
|
29 | |||
30 | /** |
||
31 | * Get the action type. |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 10 | public function getType(): string |
|
36 | { |
||
37 | 10 | return $this->type; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Get the action payload. |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 6 | public function getPayload() |
|
46 | { |
||
47 | 6 | return $this->payload; |
|
48 | } |
||
49 | } |