ViberAddition::setViberText()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Daaner\TurboSMS\Traits;
4
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
80
    {
81
        if ($isTransactional) {
82
            $this->isTransactional = 1;
83
        }
84
85
        return $this;
86
    }
87
88
    /**
89
     * @param  string  $viberReplaceText
90
     * @return $this
91
     */
92
    public function setViberText(string $viberReplaceText): self
93
    {
94
        if ($viberReplaceText) {
95
            $this->viberReplaceText = $viberReplaceText;
96
        }
97
98
        return $this;
99
    }
100
}
101