-
Notifications
You must be signed in to change notification settings - Fork 753
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
fix for invalid expires value #929
fix for invalid expires value #929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #929 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 190 181 -9
===========================================
Files 20 20
Lines 514 463 -51
===========================================
- Hits 514 463 -51
|
|
||
$token = $this->getAccessToken($options); | ||
|
||
$this->assertSame($token->getExpires(), $token->getTimeNow()); |
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'm not sure what you're trying to test here, but 'TEXT'
can't be the same as the return value of getTimeNow()
, which is the current time stamp, so the tests are failing.
if (!is_numeric($expires)) { | ||
$expires = intval($expires); |
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'm not sure this check is useful. If something is not numeric, it usually won't have an intval worth using.
For example: https://3v4l.org/9r3Wj
Merged to the Thank you for contributing! 🎉 |
Fixes bug for PHP 7.1+:
When attempting to add a non-numeric value
$expires
togetTimeNow
an error is thrown. This should be non-breaking and preserve PHP 5 behavior.