Completed
Push — master ( fafbf7...a6c735 )
by Vladimir
04:01
created

UrlButton::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 4
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Templates\Keyboard;
6
7 View Code Duplication
class UrlButton extends Button
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    private $url;
10
11 1
    public function __construct(string $label, string $url, array $parameters = [])
12
    {
13 1
        parent::__construct($label, $parameters);
14
15 1
        $this->url = $url;
16 1
    }
17
18 1
    public static function make(string $label, string $url, array $parameters = [])
19
    {
20 1
        return new static($label, $url, $parameters);
21
    }
22
23
    /**
24
     * Get URL.
25
     *
26
     * @return string
27
     */
28 1
    public function getUrl(): string
29
    {
30 1
        return $this->url;
31
    }
32
33
    /**
34
     * Set URL.
35
     *
36
     * @param mixed $url
37
     *
38
     * @return UrlButton
39
     */
40
    public function setUrl($url): UrlButton
41
    {
42
        $this->url = $url;
43
44
        return $this;
45
    }
46
}
47