r87394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87393‎ | r87394 | r87395 >
Date:11:50, 4 May 2011
Author:pcopp
Status:resolved (Comments)
Tags:
Comment:
Remove references from function parameters in Wiki.php. They aren't needed for objects and sometimes cause warnings when called with non-vars.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -48,11 +48,11 @@
4949 return $default;
5050 }
5151
52 - public function request( WebRequest &$x = null ){
 52+ public function request( WebRequest $x = null ){
5353 return wfSetVar( $this->context->request, $x );
5454 }
5555
56 - public function output( OutputPage &$x = null ){
 56+ public function output( OutputPage $x = null ){
5757 return wfSetVar( $this->context->output, $x );
5858 }
5959
@@ -67,7 +67,7 @@
6868 *
6969 * @param $article Article
7070 */
71 - public function performRequestForTitle( &$article ) {
 71+ public function performRequestForTitle( $article ) {
7272 wfProfileIn( __METHOD__ );
7373
7474 if ( $this->context->request->getVal( 'printable' ) === 'yes' ) {
@@ -267,7 +267,7 @@
268268 * @param $context RequestContext
269269 * @return Article object
270270 */
271 - public static function articleFromTitle( &$title, RequestContext &$context ) {
 271+ public static function articleFromTitle( $title, RequestContext $context ) {
272272 if ( NS_MEDIA == $title->getNamespace() ) {
273273 // FIXME: where should this go?
274274 $title = Title::makeTitle( NS_FILE, $title->getDBkey() );
@@ -461,7 +461,7 @@
462462 *
463463 * @param $article Article
464464 */
465 - private function performAction( &$article ) {
 465+ private function performAction( $article ) {
466466 wfProfileIn( __METHOD__ );
467467
468468 if ( !wfRunHooks( 'MediaWikiPerformAction', array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r87411Follow-up r87394: Add reference back to MediaWiki::performRequestForTitle per...pcopp17:17, 4 May 2011

Comments

#Comment by IAlex (talk | contribs)   16:29, 4 May 2011

The latest one is needed to set $wgArticle correctly.

#Comment by IAlex (talk | contribs)   16:31, 4 May 2011

Sorry, it's the one on line 70, not the latest one.

#Comment by P.Copp (talk | contribs)   17:19, 4 May 2011

Thanks for spotting this. Re-added the reference in r87411. This should probably be better documented somehow.

Status & tagging log