Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
871e8f54
Commit
871e8f54
authored
May 17, 2016
by
Jack'lul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick fix
parent
ebfd9b06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
MessageEntity.php
src/Entities/MessageEntity.php
+4
-5
No files found.
src/Entities/MessageEntity.php
View file @
871e8f54
...
...
@@ -18,23 +18,22 @@ class MessageEntity extends Entity
protected
$url
;
/**
* @todo check for value from this list: https://core.telegram.org/bots/api#messageentity
* @todo "empty($this->offset) && $this->offset != 0" - not an ideal solution?
* @todo check for type value from this list: https://core.telegram.org/bots/api#messageentity
*/
public
function
__construct
(
array
$data
)
{
$this
->
type
=
isset
(
$data
[
'type'
])
?
$data
[
'type'
]
:
null
;
if
(
empty
(
$this
->
type
))
{
//
if
(
empty
(
$this
->
type
))
{
throw
new
TelegramException
(
'type is empty!'
);
}
$this
->
offset
=
isset
(
$data
[
'offset'
])
?
$data
[
'offset'
]
:
null
;
if
(
empty
(
$this
->
offset
)
&&
$this
->
offset
!=
0
)
{
//
if
(
$this
->
offset
===
''
)
{
throw
new
TelegramException
(
'offset is empty!'
);
}
$this
->
length
=
isset
(
$data
[
'length'
])
?
$data
[
'length'
]
:
null
;
if
(
empty
(
$this
->
length
)
&&
$this
->
offset
!=
0
)
{
//
if
(
$this
->
length
===
''
)
{
throw
new
TelegramException
(
'length is empty!'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment