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