Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -348,12 +348,12 @@ |
349 | 349 | $this->mListed = $listed; |
350 | 350 | $this->mIncludable = $includable; |
351 | 351 | if ( !$function ) { |
352 | | - $this->mFunction = 'wfSpecial'.$name; |
| 352 | + $this->mFunction = 'wfSpecial' . $name; |
353 | 353 | } else { |
354 | 354 | $this->mFunction = $function; |
355 | 355 | } |
356 | 356 | if ( $file === 'default' ) { |
357 | | - $this->mFile = dirname(__FILE__) . "/specials/Special$name.php"; |
| 357 | + $this->mFile = dirname( __FILE__ ) . "/specials/Special$name.php"; |
358 | 358 | } else { |
359 | 359 | $this->mFile = $file; |
360 | 360 | } |
— | — | @@ -370,9 +370,9 @@ |
371 | 371 | public function __call( $fName, $a ) { |
372 | 372 | // Deprecated messages now, remove in 1.19 or 1.20? |
373 | 373 | wfDeprecated( __METHOD__, '1.17' ); |
374 | | - |
| 374 | + |
375 | 375 | // Sometimes $fName is SpecialPage, sometimes it's specialpage. <3 PHP |
376 | | - if( strtolower( $fName ) == 'specialpage' ) { |
| 376 | + if ( strtolower( $fName ) == 'specialpage' ) { |
377 | 377 | $name = isset( $a[0] ) ? $a[0] : ''; |
378 | 378 | $restriction = isset( $a[1] ) ? $a[1] : ''; |
379 | 379 | $listed = isset( $a[2] ) ? $a[2] : true; |
— | — | @@ -410,7 +410,7 @@ |
411 | 411 | * @deprecated since 1.18 |
412 | 412 | */ |
413 | 413 | function getFile() { |
414 | | - wfDeprecated( __METHOD__, '1.18' ); |
| 414 | + wfDeprecated( __METHOD__, '1.18' ); |
415 | 415 | return $this->mFile; |
416 | 416 | } |
417 | 417 | |
— | — | @@ -438,7 +438,7 @@ |
439 | 439 | * @param $x Bool |
440 | 440 | * @return Bool |
441 | 441 | */ |
442 | | - function listed( $x = null) { |
| 442 | + function listed( $x = null ) { |
443 | 443 | return wfSetVar( $this->mListed, $x ); |
444 | 444 | } |
445 | 445 | |
— | — | @@ -446,7 +446,7 @@ |
447 | 447 | * Whether it's allowed to transclude the special page via {{Special:Foo/params}} |
448 | 448 | * @return Bool |
449 | 449 | */ |
450 | | - public function isIncludable(){ |
| 450 | + public function isIncludable() { |
451 | 451 | return $this->mIncludable; |
452 | 452 | } |
453 | 453 | |
— | — | @@ -466,7 +466,7 @@ |
467 | 467 | * @return Mixed |
468 | 468 | * @deprecated since 1.18 |
469 | 469 | */ |
470 | | - function restriction( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mRestriction, $x ); } |
| 470 | + function restriction( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mRestriction, $x ); } |
471 | 471 | |
472 | 472 | /** |
473 | 473 | * These mutators are very evil, as the relevant variables should not mutate. So |
— | — | @@ -475,7 +475,7 @@ |
476 | 476 | * @return Mixed |
477 | 477 | * @deprecated since 1.18 |
478 | 478 | */ |
479 | | - function func( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFunction, $x ); } |
| 479 | + function func( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFunction, $x ); } |
480 | 480 | |
481 | 481 | /** |
482 | 482 | * These mutators are very evil, as the relevant variables should not mutate. So |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | * @return Mixed |
486 | 486 | * @deprecated since 1.18 |
487 | 487 | */ |
488 | | - function file( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFile, $x ); } |
| 488 | + function file( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFile, $x ); } |
489 | 489 | |
490 | 490 | /** |
491 | 491 | * These mutators are very evil, as the relevant variables should not mutate. So |
— | — | @@ -536,7 +536,7 @@ |
537 | 537 | public function isRestricted() { |
538 | 538 | global $wgGroupPermissions; |
539 | 539 | // DWIM: If all anons can do something, then it is not restricted |
540 | | - return $this->mRestriction != '' && empty($wgGroupPermissions['*'][$this->mRestriction]); |
| 540 | + return $this->mRestriction != '' && empty( $wgGroupPermissions['*'][$this->mRestriction] ); |
541 | 541 | } |
542 | 542 | |
543 | 543 | /** |
— | — | @@ -605,7 +605,7 @@ |
606 | 606 | |
607 | 607 | $func = $this->mFunction; |
608 | 608 | // only load file if the function does not exist |
609 | | - if( !is_callable($func) && $this->mFile ) { |
| 609 | + if ( !is_callable( $func ) && $this->mFile ) { |
610 | 610 | require_once( $this->mFile ); |
611 | 611 | } |
612 | 612 | $this->outputHeader(); |
— | — | @@ -623,7 +623,7 @@ |
624 | 624 | function outputHeader( $summaryMessageKey = '' ) { |
625 | 625 | global $wgContLang; |
626 | 626 | |
627 | | - if( $summaryMessageKey == '' ) { |
| 627 | + if ( $summaryMessageKey == '' ) { |
628 | 628 | $msg = $wgContLang->lc( $this->getName() ) . '-summary'; |
629 | 629 | } else { |
630 | 630 | $msg = $summaryMessageKey; |
— | — | @@ -781,7 +781,7 @@ |
782 | 782 | |
783 | 783 | $feedTemplate = wfScript( 'api' ) . '?'; |
784 | 784 | |
785 | | - foreach( $wgFeedClasses as $format => $class ) { |
| 785 | + foreach ( $wgFeedClasses as $format => $class ) { |
786 | 786 | $theseParams = $params + array( 'feedformat' => $format ); |
787 | 787 | $url = $feedTemplate . wfArrayToCGI( $theseParams ); |
788 | 788 | $this->getOutput()->addFeedLink( $format, $url ); |
— | — | @@ -878,7 +878,7 @@ |
879 | 879 | * Maybe do something interesting with the subpage parameter |
880 | 880 | * @param $par String |
881 | 881 | */ |
882 | | - protected function setParameter( $par ){} |
| 882 | + protected function setParameter( $par ) {} |
883 | 883 | |
884 | 884 | /** |
885 | 885 | * Called from execute() to check if the given user can perform this action. |
— | — | @@ -928,7 +928,7 @@ |
929 | 929 | parent::__construct( $name, $restriction, false, $function, $file ); |
930 | 930 | } |
931 | 931 | |
932 | | - public function isListed(){ |
| 932 | + public function isListed() { |
933 | 933 | return false; |
934 | 934 | } |
935 | 935 | } |
— | — | @@ -944,7 +944,7 @@ |
945 | 945 | parent::__construct( $name, $restriction, $listed, $function, $file, true ); |
946 | 946 | } |
947 | 947 | |
948 | | - public function isIncludable(){ |
| 948 | + public function isIncludable() { |
949 | 949 | return true; |
950 | 950 | } |
951 | 951 | } |
— | — | @@ -961,7 +961,7 @@ |
962 | 962 | // Query parameteres added by redirects |
963 | 963 | protected $mAddedRedirectParams = array(); |
964 | 964 | |
965 | | - public function execute( $par ){ |
| 965 | + public function execute( $par ) { |
966 | 966 | $redirect = $this->getRedirect( $par ); |
967 | 967 | $query = $this->getRedirectQuery(); |
968 | 968 | // Redirect to a page title with possible query parameters |
— | — | @@ -1001,13 +1001,13 @@ |
1002 | 1002 | public function getRedirectQuery() { |
1003 | 1003 | $params = array(); |
1004 | 1004 | |
1005 | | - foreach( $this->mAllowedRedirectParams as $arg ) { |
1006 | | - if( $this->getRequest()->getVal( $arg, null ) !== null ){ |
| 1005 | + foreach ( $this->mAllowedRedirectParams as $arg ) { |
| 1006 | + if ( $this->getRequest()->getVal( $arg, null ) !== null ) { |
1007 | 1007 | $params[$arg] = $this->getRequest()->getVal( $arg ); |
1008 | 1008 | } |
1009 | 1009 | } |
1010 | 1010 | |
1011 | | - foreach( $this->mAddedRedirectParams as $arg => $val ) { |
| 1011 | + foreach ( $this->mAddedRedirectParams as $arg => $val ) { |
1012 | 1012 | $params[$arg] = $val; |
1013 | 1013 | } |
1014 | 1014 | |
— | — | @@ -1044,7 +1044,7 @@ |
1045 | 1045 | * ListAdmins --> ListUsers/sysop |
1046 | 1046 | */ |
1047 | 1047 | class SpecialListAdmins extends SpecialRedirectToSpecial { |
1048 | | - function __construct(){ |
| 1048 | + function __construct() { |
1049 | 1049 | parent::__construct( 'Listadmins', 'Listusers', 'sysop' ); |
1050 | 1050 | } |
1051 | 1051 | } |
— | — | @@ -1053,7 +1053,7 @@ |
1054 | 1054 | * ListBots --> ListUsers/bot |
1055 | 1055 | */ |
1056 | 1056 | class SpecialListBots extends SpecialRedirectToSpecial { |
1057 | | - function __construct(){ |
| 1057 | + function __construct() { |
1058 | 1058 | parent::__construct( 'Listbots', 'Listusers', 'bot' ); |
1059 | 1059 | } |
1060 | 1060 | } |
— | — | @@ -1063,7 +1063,7 @@ |
1064 | 1064 | * @todo FIXME: This (and the rest of the login frontend) needs to die a horrible painful death |
1065 | 1065 | */ |
1066 | 1066 | class SpecialCreateAccount extends SpecialRedirectToSpecial { |
1067 | | - function __construct(){ |
| 1067 | + function __construct() { |
1068 | 1068 | parent::__construct( 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ); |
1069 | 1069 | } |
1070 | 1070 | } |
— | — | @@ -1158,7 +1158,7 @@ |
1159 | 1159 | |
1160 | 1160 | function getRedirect( $subpage ) { |
1161 | 1161 | $subpage = intval( $subpage ); |
1162 | | - if( $subpage === 0 ) { |
| 1162 | + if ( $subpage === 0 ) { |
1163 | 1163 | # throw an error page when no subpage was given |
1164 | 1164 | throw new ErrorPageError( 'nopagetitle', 'nopagetext' ); |
1165 | 1165 | } |