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