| 1 | <?php |
||
| 10 | class Keyboard implements Template |
||
| 11 | { |
||
| 12 | /** @var Button[] */ |
||
| 13 | private $buttons; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param Button[] $buttons |
||
| 17 | */ |
||
| 18 | 1 | public function __construct(array $buttons = []) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @param Button[] $buttons |
||
| 25 | * |
||
| 26 | * @return static |
||
| 27 | */ |
||
| 28 | public static function create(array $buttons = []) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get name. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 1 | public function getName(): string |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Get buttons. |
||
| 45 | * |
||
| 46 | * @return Button[] |
||
| 47 | */ |
||
| 48 | 1 | public function getButtons(): array |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Add button. |
||
| 55 | * |
||
| 56 | * @param Button $button |
||
| 57 | * |
||
| 58 | * @return Keyboard |
||
| 59 | */ |
||
| 60 | 1 | public function addButton(Button $button): Keyboard |
|
| 66 | } |
||
| 67 |