| @@ 34-49 (lines=16) @@ | ||
| 31 | /** |
|
| 32 | * {@inheritdoc} |
|
| 33 | */ |
|
| 34 | protected function validate() |
|
| 35 | { |
|
| 36 | $inline_keyboard = $this->getProperty('inline_keyboard'); |
|
| 37 | ||
| 38 | if ($inline_keyboard !== null) { |
|
| 39 | if (!is_array($inline_keyboard)) { |
|
| 40 | throw new TelegramException('Inline Keyboard field is not an array!'); |
|
| 41 | } |
|
| 42 | ||
| 43 | foreach ($inline_keyboard as $item) { |
|
| 44 | if (!is_array($item)) { |
|
| 45 | throw new TelegramException('Inline Keyboard subfield is not an array!'); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | } |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 130-145 (lines=16) @@ | ||
| 127 | /** |
|
| 128 | * {@inheritdoc} |
|
| 129 | */ |
|
| 130 | protected function validate() |
|
| 131 | { |
|
| 132 | $keyboard = $this->getProperty('keyboard'); |
|
| 133 | ||
| 134 | if ($keyboard !== null) { |
|
| 135 | if (!is_array($keyboard)) { |
|
| 136 | throw new TelegramException('Keyboard field is not an array!'); |
|
| 137 | } |
|
| 138 | ||
| 139 | foreach ($keyboard as $item) { |
|
| 140 | if (!is_array($item)) { |
|
| 141 | throw new TelegramException('Keyboard subfield is not an array!'); |
|
| 142 | } |
|
| 143 | } |
|
| 144 | } |
|
| 145 | } |
|
| 146 | ||
| 147 | /** |
|
| 148 | * Hide the current custom keyboard and display the default letter-keyboard. |
|