| Total Complexity | 3 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
|
|
|||
| 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() |
|
| 48 | } |
||
| 49 | } |