| Total Complexity | 7 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Keyboard implements Template |
||
| 12 | { |
||
| 13 | /** @var Button[] */ |
||
| 14 | private $buttons; |
||
| 15 | private $parameters; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param Button[] $buttons |
||
| 19 | * @param array $parameters |
||
| 20 | */ |
||
| 21 | 3 | public function __construct(array $buttons = [], array $parameters = []) |
|
| 22 | { |
||
| 23 | 3 | $this->buttons = $buttons; |
|
| 24 | 3 | $this->parameters = collect($parameters); |
|
| 25 | 3 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param Button[] $buttons |
||
| 29 | * @param array $parameters |
||
| 30 | * |
||
| 31 | * @return static |
||
| 32 | */ |
||
| 33 | 3 | public static function make(array $buttons = [], array $parameters = []) |
|
| 34 | { |
||
| 35 | 3 | return new static($buttons, $parameters); |
|
| 36 | } |
||
| 37 | |||
| 38 | 2 | public function getName(): string |
|
| 39 | { |
||
| 40 | 2 | return 'Keyboard'; |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return Button[] |
||
| 45 | */ |
||
| 46 | 1 | public function getButtons(): array |
|
| 49 | } |
||
| 50 | |||
| 51 | public function addButton(Button $button): Keyboard |
||
| 52 | { |
||
| 53 | $this->buttons[] = $button; |
||
| 54 | |||
| 55 | return $this; |
||
| 56 | } |
||
| 57 | |||
| 58 | 1 | public function getParameters(): Collection |
|
| 59 | { |
||
| 60 | 1 | return $this->parameters; |
|
| 61 | } |
||
| 62 | |||
| 63 | public function setParameters(array $parameters): Keyboard |
||
| 68 | } |
||
| 69 | } |
||
| 70 |