Commit 4ed4395c authored by Jack'lul's avatar Jack'lul

fix mistakes

parent 193aa44c
...@@ -20,16 +20,16 @@ class InputContactMessageContent extends InputMessageContent ...@@ -20,16 +20,16 @@ class InputContactMessageContent extends InputMessageContent
public function __construct(array $data) public function __construct(array $data)
{ {
$this->phone_number isset($data['phone_number']) ? $data['phone_number'] : null; $this->phone_number = isset($data['phone_number']) ? $data['phone_number'] : null;
if (empty($this->phone_number)) { if (empty($this->phone_number)) {
throw new TelegramException('phone_number is empty!'); throw new TelegramException('phone_number is empty!');
} }
$this->first_name isset($data['first_name']) ? $data['first_name'] : null; $this->first_name = isset($data['first_name']) ? $data['first_name'] : null;
if (empty($this->first_name)) { if (empty($this->first_name)) {
throw new TelegramException('first_name is empty!'); throw new TelegramException('first_name is empty!');
} }
$this->last_name isset($data['last_name']) ? $data['last_name'] : null; $this->last_name = isset($data['last_name']) ? $data['last_name'] : null;
} }
} }
...@@ -19,12 +19,12 @@ class InputLocationMessageContent extends InputMessageContent ...@@ -19,12 +19,12 @@ class InputLocationMessageContent extends InputMessageContent
public function __construct(array $data) public function __construct(array $data)
{ {
$this->latitude isset($data['latitude']) ? $data['latitude'] : null; $this->latitude = isset($data['latitude']) ? $data['latitude'] : null;
if (empty($this->latitude)) { if (empty($this->latitude)) {
throw new TelegramException('latitude is empty!'); throw new TelegramException('latitude is empty!');
} }
$this->longitude isset($data['longitude']) ? $data['longitude'] : null; $this->longitude = isset($data['longitude']) ? $data['longitude'] : null;
if (empty($this->longitude)) { if (empty($this->longitude)) {
throw new TelegramException('longitude is empty!'); throw new TelegramException('longitude is empty!');
} }
......
...@@ -20,12 +20,12 @@ class InputTextMessageContent extends InputMessageContent ...@@ -20,12 +20,12 @@ class InputTextMessageContent extends InputMessageContent
public function __construct(array $data) public function __construct(array $data)
{ {
$this->message_text isset($data['message_text']) ? $data['message_text'] : null; $this->message_text = isset($data['message_text']) ? $data['message_text'] : null;
if (empty($this->message_text)) { if (empty($this->message_text)) {
throw new TelegramException('message_text is empty!'); throw new TelegramException('message_text is empty!');
} }
$this->parse_mode isset($data['parse_mode']) ? $data['parse_mode'] : null; $this->parse_mode = isset($data['parse_mode']) ? $data['parse_mode'] : null;
$this->disable_web_page_preview isset($data['disable_web_page_preview']) ? $data['disable_web_page_preview'] : null; $this->disable_web_page_preview = isset($data['disable_web_page_preview']) ? $data['disable_web_page_preview'] : null;
} }
} }
...@@ -22,26 +22,26 @@ class InputVenueMessageContent extends InputMessageContent ...@@ -22,26 +22,26 @@ class InputVenueMessageContent extends InputMessageContent
public function __construct(array $data) public function __construct(array $data)
{ {
$this->latitude isset($data['latitude']) ? $data['latitude'] : null; $this->latitude = isset($data['latitude']) ? $data['latitude'] : null;
if (empty($this->latitude)) { if (empty($this->latitude)) {
throw new TelegramException('latitude is empty!'); throw new TelegramException('latitude is empty!');
} }
$this->longitude isset($data['longitude']) ? $data['longitude'] : null; $this->longitude = isset($data['longitude']) ? $data['longitude'] : null;
if (empty($this->longitude)) { if (empty($this->longitude)) {
throw new TelegramException('longitude is empty!'); throw new TelegramException('longitude is empty!');
} }
$this->title isset($data['title']) ? $data['title'] : null; $this->title = isset($data['title']) ? $data['title'] : null;
if (empty($this->title)) { if (empty($this->title)) {
throw new TelegramException('title is empty!'); throw new TelegramException('title is empty!');
} }
$this->address isset($data['address']) ? $data['address'] : null; $this->address = isset($data['address']) ? $data['address'] : null;
if (empty($this->address)) { if (empty($this->address)) {
throw new TelegramException('address is empty!'); throw new TelegramException('address is empty!');
} }
$this->foursquare_id isset($data['foursquare_id']) ? $data['foursquare_id'] : null; $this->foursquare_id = isset($data['foursquare_id']) ? $data['foursquare_id'] : null;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment