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

Keyboard   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getButtons() 0 4 1
A addButton() 0 6 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