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
Don't call WebRequest::getLimitOffset in 1.35 #4575
Conversation
See T245779
See T245779
See T245779
See T245779
return $request->getLimitOffsetForUser( $this->getUser() ); | ||
} else { | ||
return $request->getLimitOffset(); | ||
} |
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.
You can write this without the else part:
if ( method_exists( $request, 'getLimitOffsetForUser' ) ) {
// MW 1.35+
return $request->getLimitOffsetForUser( $this->getUser() );
}
return $request->getLimitOffset();
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.
True, but I was using the same code block that I was using elsewhere where it wasn't returning, but rather setting a variable, so I kept the else block
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.
That is part of the reason why using a guard clause (the form in my variation) is nice.
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.
@DannyS712 Thanks a lot for the pull! |
See https://phabricator.wikimedia.org/T245779