Total Complexity | 5 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class GamePlayEvent extends AbstractEvent |
||
10 | { |
||
11 | public const NAME = 'game_play'; |
||
12 | |||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | protected $timestamp; |
||
17 | |||
18 | /** |
||
19 | * @var \Kerox\Messenger\Model\Callback\GamePlay |
||
20 | */ |
||
21 | protected $gamePlay; |
||
22 | |||
23 | /** |
||
24 | * GamePlayEvent constructor. |
||
25 | * |
||
26 | * @param string $senderId |
||
27 | * @param string $recipientId |
||
28 | * @param int $timestamp |
||
29 | * @param \Kerox\Messenger\Model\Callback\GamePlay $gamePlay |
||
30 | */ |
||
31 | public function __construct(string $senderId, string $recipientId, int $timestamp, GamePlay $gamePlay) |
||
32 | { |
||
33 | parent::__construct($senderId, $recipientId); |
||
34 | |||
35 | $this->timestamp = $timestamp; |
||
36 | $this->gamePlay = $gamePlay; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return int |
||
41 | */ |
||
42 | public function getTimestamp(): int |
||
43 | { |
||
44 | return $this->timestamp; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return \Kerox\Messenger\Model\Callback\GamePlay |
||
49 | */ |
||
50 | public function getGamePlay(): GamePlay |
||
51 | { |
||
52 | return $this->gamePlay; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getName(): string |
||
59 | { |
||
60 | return self::NAME; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @param array $payload |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public static function create(array $payload) |
||
76 | } |
||
77 | } |
||
78 |