Updated classes fromArray signatures (in-progress)
This commit is contained in:
parent
59f6875edf
commit
dfb812237b
43 changed files with 288 additions and 75 deletions
|
@ -334,13 +334,17 @@
|
|||
/**
|
||||
* Constructs a new InlineKeyboardButton object from an array
|
||||
*
|
||||
* @param array $data
|
||||
* @return InlineKeyboardButton
|
||||
* @param array|null $data
|
||||
* @return InlineKeyboardButton|null
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromArray(?array $data): ?InlineKeyboardButton
|
||||
{
|
||||
$object = new self();
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->text = $data['text'] ?? null;
|
||||
$object->url = $data['url'] ?? null;
|
||||
$object->callback_data = $data['callback_data'] ?? null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue