Completed
Push — master ( 8de31e...457641 )
by Vladimir
02:57
created

Button   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 70%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 7
cts 10
cp 0.7
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A getLabel() 0 4 1
A setLabel() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Templates\Keyboard;
6
7
use FondBot\Contracts\Template;
8
9
abstract class Button implements Template
10
{
11
    protected $label;
12
13 3
    public function __construct(string $label)
14
    {
15 3
        $this->label = $label;
16 3
    }
17
18
    /**
19
     * Get name.
20
     *
21
     * @return string
22
     */
23 3
    public function getName(): string
24
    {
25 3
        return class_basename($this);
26
    }
27
28
    /**
29
     * Get label.
30
     *
31
     * @return string
32
     */
33 3
    public function getLabel(): ?string
34
    {
35 3
        return $this->label;
36
    }
37
38
    /**
39
     * Set label.
40
     *
41
     * @param string $label
42
     *
43
     * @return static
44
     */
45
    public function setLabel(string $label)
46
    {
47
        $this->label = $label;
48
49
        return $this;
50
    }
51
}
52