| Total Complexity | 10 |
| Total Lines | 94 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 5 | trait ViberAddition |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @see https://turbosms.ua/api.html |
||
| 9 | */ |
||
| 10 | protected $ttl; |
||
| 11 | protected $imageUrl; |
||
| 12 | protected $caption; |
||
| 13 | protected $action; |
||
| 14 | protected $countClicks; |
||
| 15 | protected $isTransactional; |
||
| 16 | protected $viberReplaceText; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param int $ttl |
||
| 20 | * @return $this |
||
| 21 | */ |
||
| 22 | public function setTTL(int $ttl): self |
||
| 23 | { |
||
| 24 | $this->ttl = $ttl; |
||
| 25 | |||
| 26 | return $this; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $image |
||
| 31 | * @return $this |
||
| 32 | */ |
||
| 33 | public function setImageURL(string $image): self |
||
| 34 | { |
||
| 35 | $this->imageUrl = $image; |
||
| 36 | |||
| 37 | return $this; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $caption |
||
| 42 | * @return $this |
||
| 43 | */ |
||
| 44 | public function setCaption(string $caption): self |
||
| 45 | { |
||
| 46 | $this->caption = $caption; |
||
| 47 | |||
| 48 | return $this; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $action |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | public function setAction(string $action): self |
||
| 56 | { |
||
| 57 | $this->action = $action; |
||
| 58 | |||
| 59 | return $this; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param int $countClicks |
||
| 64 | * @return $this |
||
| 65 | */ |
||
| 66 | public function setCountClicks(int $countClicks): self |
||
| 67 | { |
||
| 68 | if ($countClicks) { |
||
| 69 | $this->countClicks = 1; |
||
| 70 | } |
||
| 71 | |||
| 72 | return $this; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @param int $isTransactional |
||
| 77 | * @return $this |
||
| 78 | */ |
||
| 79 | public function setTransactional(int $isTransactional): self |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param string $viberReplaceText |
||
| 90 | * @return $this |
||
| 91 | */ |
||
| 92 | public function setViberText(string $viberReplaceText): self |
||
| 99 | } |
||
| 100 | } |
||
| 101 |