Skip to content
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

Merged
merged 2 commits into from
Sep 12, 2014
Merged

Conversation

bcrowe
Copy link
Contributor

@bcrowe bcrowe commented Sep 12, 2014

No description provided.

@markstory markstory added this to the 3.0.0 milestone Sep 12, 2014
markstory added a commit that referenced this pull request Sep 12, 2014
3.0 - Replace intval() with int typecasts
@markstory markstory merged commit ab24722 into cakephp:3.0 Sep 12, 2014
@@ -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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think a cast is required at all; __LINE__ already is an integer (var_dump(__LINE__); // int 2), however, possibly wrap the calculation in parentheses (__LINE__ - 7) because of the concatenation; alternatively cast the result to a string, instead of the concatenation, if that is the intention ((string)(__LINE__ - 7)) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. This could be done without casting but with () wrapping.
The string cast is not necessary as the concatination automatically casts :)

@dereuromark
Copy link
Member

Wouldn't most have ended in 3.x anyway from my 2.x PR? Maybe waiting until after the 2.x => 3.x merge would have avoided some work here.

Refs #4570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants