File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,22 @@ class MessageEntity extends Entity
18
18
protected $ url ;
19
19
20
20
/**
21
- * @todo check for value from this list: https://core.telegram.org/bots/api#messageentity
22
- * @todo "empty($this->offset) && $this->offset != 0" - not an ideal solution?
21
+ * @todo check for type value from this list: https://core.telegram.org/bots/api#messageentity
23
22
*/
24
23
public function __construct (array $ data )
25
24
{
26
25
$ this ->type = isset ($ data ['type ' ]) ? $ data ['type ' ] : null ;
27
- if (empty ($ this ->type )) { //
26
+ if (empty ($ this ->type )) {
28
27
throw new TelegramException ('type is empty! ' );
29
28
}
30
29
31
30
$ this ->offset = isset ($ data ['offset ' ]) ? $ data ['offset ' ] : null ;
32
- if (empty ( $ this ->offset ) && $ this -> offset != 0 ) { //
31
+ if ($ this ->offset === '' ) {
33
32
throw new TelegramException ('offset is empty! ' );
34
33
}
35
34
36
35
$ this ->length = isset ($ data ['length ' ]) ? $ data ['length ' ] : null ;
37
- if (empty ( $ this ->length ) && $ this -> offset != 0 ) { //
36
+ if ($ this ->length === '' ) {
38
37
throw new TelegramException ('length is empty! ' );
39
38
}
40
39
You can’t perform that action at this time.
0 commit comments