Total Complexity | 6 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Coverage | 62.5% |
Changes | 0 |
1 | <?php |
||
10 | abstract class Button implements Template |
||
11 | { |
||
12 | protected $label; |
||
13 | protected $parameters; |
||
14 | |||
15 | 3 | public function __construct(string $label, array $parameters = []) |
|
16 | { |
||
17 | 3 | $this->label = $label; |
|
18 | 3 | $this->parameters = collect($parameters); |
|
19 | 3 | } |
|
20 | |||
21 | /** |
||
22 | * Get name. |
||
23 | * |
||
24 | * @return string |
||
25 | */ |
||
26 | 3 | public function getName(): string |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * Get label. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | 3 | public function getLabel(): ?string |
|
37 | { |
||
38 | 3 | return $this->label; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * Set label. |
||
43 | * |
||
44 | * @param string $label |
||
45 | * |
||
46 | * @return static |
||
47 | */ |
||
48 | public function setLabel(string $label): Button |
||
49 | { |
||
50 | $this->label = $label; |
||
51 | |||
52 | return $this; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Get button parameters. |
||
57 | * |
||
58 | * @return Collection |
||
59 | */ |
||
60 | 1 | public function getParameters(): Collection |
|
61 | { |
||
62 | 1 | return $this->parameters; |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * Set parameters. |
||
67 | * |
||
68 | * @param array $parameters |
||
69 | * |
||
70 | * @return static |
||
71 | */ |
||
72 | public function setParameters(array $parameters): Button |
||
77 | } |
||
78 | } |
||
79 |