Passed
Pull Request — master (#53)
by
unknown
01:19
created

ConfirmationDialogBlock::getDeny()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Nexylan packages.
7
 *
8
 * (c) Nexylan SAS <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Nexy\Slack;
15
16
/**
17
 * @author Sullivan Senechal <[email protected]>
18
 * @author Mikey McLellan <[email protected]>
19
 */
20
final class ConfirmationDialogBlock extends Block
21
{
22
    /**
23
     * @var TextBlock
24
     */
25
    protected $title;
26
27
    /**
28
     * @var TextBlock
29
     */
30
    protected $text;
31
32
    /**
33
     * @var TextBlock
34
     */
35
    protected $confirm;
36
37
    /**
38
     * @var TextBlock
39
     */
40
    protected $deny;
41
42
    public function __construct()
43
    {
44
        parent::__construct(null);
45
    }
46
47
    /**
48
     * @param TextBlock $text
49
     */
50
    public function setText(TextBlock $text): self
51
    {
52
        $this->text = $text;
53
54
        return $this;
55
    }
56
57
    /**
58
     * @return TextBlock
59
     */
60
    public function getText(): TextBlock
61
    {
62
        return $this->text;
63
    }
64
65
    /**
66
     * @param TextBlock $confirm
67
     */
68
    public function setConfirm(TextBlock $confirm): self
69
    {
70
        $this->confirm = $confirm;
71
72
        return $this;
73
    }
74
75
    /**
76
     * @return TextBlock
77
     */
78
    public function getConfirm(): TextBlock
79
    {
80
        return $this->confirm;
81
    }
82
83
    /**
84
     * @param TextBlock $deny
85
     */
86
    public function setDeny(TextBlock $deny): self
87
    {
88
        $this->deny = $deny;
89
90
        return $this;
91
    }
92
93
    /**
94
     * @return TextBlock
95
     */
96
    public function getDeny(): TextBlock
97
    {
98
        return $this->deny;
99
    }
100
101
    /**
102
     * @param TextBlock $title
103
     */
104
    public function setTitle(TextBlock $title): self
105
    {
106
        $this->title = $title;
107
108
        return $this;
109
    }
110
111
    /**
112
     * @return TextBlock
113
     */
114
    public function getTitle(): TextBlock
115
    {
116
        return $this->title;
117
    }
118
119
    /**
120
     * Convert this block to its array representation.
121
     *
122
     * @return array
123
     */
124
    public function toArray(): array
125
    {
126
        $data = [
127
            'title' => $this->title->toArray(),
128
            'text' => $this->text->toArray(),
129
            'confirm' => $this->confirm->toArray(),
130
            'deny' => $this->deny->toArray(),
131
        ];
132
133
        return array_merge(parent::toArray(), $this->removeNulls($data));
134
    }
135
}
136