| Total Complexity | 6 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class Reaction |
||
| 8 | { |
||
| 9 | public const REACTION_SMILE = 'smile'; |
||
| 10 | public const REACTION_ANGRY = 'angry'; |
||
| 11 | public const REACTION_SAD = 'sad'; |
||
| 12 | public const REACTION_WOW = 'wow'; |
||
| 13 | public const REACTION_LOVE = 'love'; |
||
| 14 | public const REACTION_LIKE = 'like'; |
||
| 15 | public const REACTION_DISLIKE = 'dislike'; |
||
| 16 | public const REACTION_OTHER = 'other'; |
||
| 17 | |||
| 18 | public const ACTION_REACT = 'react'; |
||
| 19 | public const ACTION_UNREACT = 'unreact'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $reaction; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $emoji; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $action; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | protected $mid; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Reaction constructor. |
||
| 43 | */ |
||
| 44 | 1 | public function __construct(string $reaction, string $emoji, string $action, string $mid) |
|
| 45 | { |
||
| 46 | 1 | $this->reaction = $reaction; |
|
| 47 | 1 | $this->emoji = $emoji; |
|
| 48 | 1 | $this->action = $action; |
|
| 49 | 1 | $this->mid = $mid; |
|
| 50 | 1 | } |
|
| 51 | |||
| 52 | 1 | public function getReaction(): string |
|
| 53 | { |
||
| 54 | 1 | return $this->reaction; |
|
| 55 | } |
||
| 56 | |||
| 57 | 1 | public function getEmoji(): string |
|
| 58 | { |
||
| 59 | 1 | return $this->emoji; |
|
| 60 | } |
||
| 61 | |||
| 62 | 1 | public function getAction(): string |
|
| 63 | { |
||
| 64 | 1 | return $this->action; |
|
| 65 | } |
||
| 66 | |||
| 67 | 1 | public function getMid(): string |
|
| 68 | { |
||
| 69 | 1 | return $this->mid; |
|
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return \Kerox\Messenger\Model\Callback\Reaction |
||
| 74 | */ |
||
| 75 | 1 | public static function create(array $callbackData): self |
|
| 82 | ); |
||
| 83 | } |
||
| 84 | } |
||
| 85 |