ActionConfirmation::getTitle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
namespace Maknz\Slack;
3
4
class ActionConfirmation extends Payload
5
{
6
    /**
7
     * The required title for the pop up window.
8
     *
9
     * @var string
10
     */
11
    protected $title;
12
13
    /**
14
     * The required description.
15
     *
16
     * @var string
17
     */
18
    protected $text;
19
20
    /**
21
     * The text label for the OK button.
22
     *
23
     * @var string
24
     */
25
    protected $okText;
26
27
    /**
28
     * The text label for the Cancel button.
29
     *
30
     * @var string
31
     */
32
    protected $dismissText;
33
34
    /**
35
     * Internal attribute to property map.
36
     *
37
     * @var array
38
     */
39
    protected static $availableAttributes = [
40
        'title'        => 'title',
41
        'text'         => 'text',
42
        'ok_text'      => 'ok_text',
43
        'dismiss_text' => 'dismiss_text',
44
    ];
45
46
    /**
47
     * Instantiate a new ActionConfirmation.
48
     *
49
     * @param array $attributes
50
     */
51 4
    public function __construct(array $attributes)
52
    {
53 4
        parent::__construct($attributes);
54 4
    }
55
56
    /**
57
     * @return string
58
     */
59 2
    public function getTitle()
60
    {
61 2
        return $this->title;
62
    }
63
64
    /**
65
     * @param string $title
66
     * @return ActionConfirmation
67
     */
68 4
    public function setTitle($title)
69
    {
70 4
        $this->title = $title;
71
72 4
        return $this;
73
    }
74
75
    /**
76
     * @return string
77
     */
78 2
    public function getText()
79
    {
80 2
        return $this->text;
81
    }
82
83
    /**
84
     * @param string $text
85
     * @return ActionConfirmation
86
     */
87 4
    public function setText($text)
88
    {
89 4
        $this->text = $text;
90
91 4
        return $this;
92
    }
93
94
    /**
95
     * @return string
96
     */
97 2
    public function getOkText()
98
    {
99 2
        return $this->okText;
100
    }
101
102
    /**
103
     * @param string $okText
104
     * @return ActionConfirmation
105
     */
106 4
    public function setOkText($okText)
107
    {
108 4
        $this->okText = $okText;
109
110 4
        return $this;
111
    }
112
113
    /**
114
     * @return string
115
     */
116 2
    public function getDismissText()
117
    {
118 2
        return $this->dismissText;
119
    }
120
121
    /**
122
     * @param string $dismissText
123
     * @return ActionConfirmation
124
     */
125 4
    public function setDismissText($dismissText)
126
    {
127 4
        $this->dismissText = $dismissText;
128
129 4
        return $this;
130
    }
131
132
    /**
133
     * Get the array representation of this action confirmation.
134
     *
135
     * @return array
136
     */
137 2
    public function toArray()
138
    {
139
        return [
140 2
            'title' => $this->getTitle(),
141 2
            'text' => $this->getText(),
142 2
            'ok_text' => $this->getOkText(),
143 2
            'dismiss_text' => $this->getDismissText(),
144
        ];
145
    }
146
}
147