Passed
Push — 1.0 ( 12d132...dd1957 )
by Vladimir
06:10
created

UrlButton   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLabel() 0 4 1
A getUrl() 0 4 1
A getParameters() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Templates\Keyboard;
6
7
class UrlButton implements Button
8
{
9
    private $label;
10
    private $url;
11
    private $parameters;
12
13 1
    public function __construct(string $label, string $url, array $parameters = [])
14
    {
15 1
        $this->label = $label;
16 1
        $this->url = $url;
17 1
        $this->parameters = $parameters;
18 1
    }
19
20
    /**
21
     * Button label.
22
     *
23
     * @return string
24
     */
25 1
    public function getLabel(): string
26
    {
27 1
        return $this->label;
28
    }
29
30
    /**
31
     * URL.
32
     *
33
     * @return string
34
     */
35 1
    public function getUrl(): string
36
    {
37 1
        return $this->url;
38
    }
39
40
    /**
41
     * Additional parameters.
42
     *
43
     * @return array
44
     */
45 1
    public function getParameters(): array
46
    {
47 1
        return $this->parameters;
48
    }
49
}
50