-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BugFix : count() func error when textColor is null #89
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like $this->textColor
should never be null... The default value is array()
and the only way to change it is via setTextColor()
if(is_null($this->textColor)){ | ||
$this->textColor = array(); | ||
} | ||
|
||
if (!$this->textColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!$this->textColor) { | |
if ($this->textColor === null || ! $this->textColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when textColor always be an array, why should it compared with null?
The if is for empty arrays i think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you edit it. !$this->textColor
should be enough. If $this->textColor
is null its also true.
// Define a empty array when textColor is null | ||
if(is_null($this->textColor)){ | ||
$this->textColor = array(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Define a empty array when textColor is null | |
if(is_null($this->textColor)){ | |
$this->textColor = array(); | |
} |
I think this PR is obsolet. It is already fixed by a4f7d0f |
when count() function receive a null arg happens Warning (in PHP V7+) and Fatal error (in PHP V8+)
with this pull request i tried solve this problem.thanks :)