-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
3.0 - Replace intval() with int typecasts #4584
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,7 +200,7 @@ public function testChangeOutputFormats() { | |
'error' => array(), | ||
'code' => array(), '8', '/code', | ||
'file' => array(), 'preg:/[^<]+/', '/file', | ||
'line' => array(), '' . (intval(__LINE__) - 7), '/line', | ||
'line' => array(), '' . (int)__LINE__ - 7, '/line', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think a cast is required at all; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. This could be done without casting but with () wrapping. |
||
'preg:/Undefined variable:\s+foo/', | ||
'/error' | ||
); | ||
|
@@ -259,7 +259,7 @@ public function testAddFormat() { | |
'<error', | ||
'<code', '8', '/code', | ||
'<file', 'preg:/[^<]+/', '/file', | ||
'<line', '' . (intval(__LINE__) - 7), '/line', | ||
'<line', '' . (int)__LINE__ - 7, '/line', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here? |
||
'preg:/Undefined variable:\s+foo/', | ||
'/error' | ||
); | ||
|
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.
pico-optimization;
$choice = (int)$this->in($prompt, null, 1);
instead of doing it twice inside theif(..