Completed
Push — master ( 59b9fb...b4679f )
by Vladimir
02:55
created

Keyboard::getButtons()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Templates;
6
7
use FondBot\Contracts\Template;
8
use FondBot\Templates\Keyboard\Button;
9
10
class Keyboard implements Template
11
{
12
    /** @var Button[] */
13
    private $buttons;
14
15
    /**
16
     * Get name.
17
     *
18
     * @return string
19
     */
20 1
    public function getName(): string
21
    {
22 1
        return 'Keyboard';
23
    }
24
25
    /**
26
     * Get buttons.
27
     *
28
     * @return Button[]
29
     */
30 1
    public function getButtons(): array
31
    {
32 1
        return $this->buttons;
33
    }
34
35
    /**
36
     * Add button.
37
     *
38
     * @param Button $button
39
     *
40
     * @return Keyboard
41
     */
42 1
    public function addButton(Button $button): Keyboard
43
    {
44 1
        $this->buttons[] = $button;
45
46 1
        return $this;
47
    }
48
}
49