r90861 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90860‎ | r90861 | r90862 >
Date:23:25, 26 June 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Comment shuffling, also fixing r86347 CR.
Modified paths:
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -267,7 +267,7 @@
268268 }
269269
270270 /**
271 - * Add a page to a certain display group for Special:SpecialPages
 271+ * Get the group that the special page belongs in on Special:SpecialPage
272272 *
273273 * @param $page SpecialPage
274274 */
Index: trunk/phase3/includes/SpecialPage.php
@@ -121,6 +121,7 @@
122122 *
123123 * @param $page Mixed: SpecialPage or string
124124 * @param $group String
 125+ * @return null
125126 * @deprecated since 1.18 call SpecialPageFactory method directly
126127 */
127128 static function setGroup( $page, $group ) {
@@ -128,9 +129,10 @@
129130 }
130131
131132 /**
132 - * Add a page to a certain display group for Special:SpecialPages
 133+ * Get the group that the special page belongs in on Special:SpecialPage
133134 *
134135 * @param $page SpecialPage
 136+ * @return null
135137 * @deprecated since 1.18 call SpecialPageFactory method directly
136138 */
137139 static function getGroup( &$page ) {
@@ -142,6 +144,8 @@
143145 * Formerly used to disable expensive or dangerous special pages. The
144146 * preferred method is now to add a SpecialPage_initList hook.
145147 * @deprecated since 1.18
 148+ *
 149+ * @param $name String the page to remove
146150 */
147151 static function removePage( $name ) {
148152 unset( SpecialPageFactory::getList()->$name );
@@ -173,6 +177,7 @@
174178 * Get a special page with a given localised name, or NULL if there
175179 * is no such special page.
176180 *
 181+ * @param $alias String
177182 * @return SpecialPage object or null if the page doesn't exist
178183 * @deprecated since 1.18 call SpecialPageFactory method directly
179184 */
@@ -223,6 +228,7 @@
224229 * @param $title Title object
225230 * @param $context RequestContext
226231 * @param $including Bool output is being captured for use in {{special:whatever}}
 232+ * @return Bool
227233 * @deprecated since 1.18 call SpecialPageFactory method directly
228234 */
229235 public static function executePath( &$title, RequestContext &$context, $including = false ) {
@@ -234,6 +240,7 @@
235241 * Returns false if there was no such special page, or a title object if it was
236242 * a redirect.
237243 *
 244+ * @param $title Title
238245 * @return String: HTML fragment
239246 * @deprecated since 1.18 call SpecialPageFactory method directly
240247 */
@@ -257,6 +264,8 @@
258265 /**
259266 * Get a localised Title object for a specified special page name
260267 *
 268+ * @param $name String
 269+ * @param $subpage String|Bool subpage string, or false to not use a subpage
261270 * @return Title object
262271 */
263272 public static function getTitleFor( $name, $subpage = false ) {
@@ -271,6 +280,8 @@
272281 /**
273282 * Get a localised Title object for a page name with a possibly unvalidated subpage
274283 *
 284+ * @param $name String
 285+ * @param $subpage String|Bool subpage string, or false to not use a subpage
275286 * @return Title object or null if the page doesn't exist
276287 */
277288 public static function getSafeTitleFor( $name, $subpage = false ) {
@@ -285,6 +296,7 @@
286297 /**
287298 * Get a title for a given alias
288299 *
 300+ * @param $alias String
289301 * @return Title or null if there is no such alias
290302 * @deprecated since 1.18 call SpecialPageFactory method directly
291303 */
@@ -304,10 +316,10 @@
305317 *
306318 * @param $name String: name of the special page, as seen in links and URLs
307319 * @param $restriction String: user right required, e.g. "block" or "delete"
308 - * @param $listed Boolean: whether the page is listed in Special:Specialpages
309 - * @param $function Callback: function called by execute(). By default it is constructed from $name
 320+ * @param $listed Bool: whether the page is listed in Special:Specialpages
 321+ * @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
310322 * @param $file String: file which is included by execute(). It is also constructed from $name by default
311 - * @param $includable Boolean: whether the page can be included in normal pages
 323+ * @param $includable Bool: whether the page can be included in normal pages
312324 */
313325 public function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
314326 $this->init( $name, $restriction, $listed, $function, $file, $includable );
@@ -316,7 +328,12 @@
317329 /**
318330 * Do the real work for the constructor, mainly so __call() can intercept
319331 * calls to SpecialPage()
320 - * @see __construct() for param docs
 332+ * @param $name String: name of the special page, as seen in links and URLs
 333+ * @param $restriction String: user right required, e.g. "block" or "delete"
 334+ * @param $listed Bool: whether the page is listed in Special:Specialpages
 335+ * @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
 336+ * @param $file String: file which is included by execute(). It is also constructed from $name by default
 337+ * @param $includable Bool: whether the page can be included in normal pages
321338 */
322339 private function init( $name, $restriction, $listed, $function, $file, $includable ) {
323340 $this->mName = $name;
@@ -401,6 +418,7 @@
402419 /**
403420 * Set whether this page is listed in Special:Specialpages, at run-time
404421 * @since r3583 (v1.3)
 422+ * @param $listed Bool
405423 * @return Bool
406424 */
407425 function setListed( $listed ) {
@@ -409,6 +427,7 @@
410428 /**
411429 * Get or set whether this special page is listed in Special:SpecialPages
412430 * @since r11308 (v1.6)
 431+ * @param $x Bool
413432 * @return Bool
414433 */
415434 function listed( $x = null) {
@@ -426,6 +445,8 @@
427446 /**
428447 * These mutators are very evil, as the relevant variables should not mutate. So
429448 * don't use them.
 449+ * @param $x Mixed
 450+ * @return Mixed
430451 * @deprecated since 1.18
431452 */
432453 function name( $x = null ) { return wfSetVar( $this->mName, $x ); }
@@ -436,6 +457,7 @@
437458
438459 /**
439460 * Whether the special page is being evaluated via transclusion
 461+ * @param $x Bool
440462 * @return Bool
441463 */
442464 function including( $x = null ) {
@@ -511,6 +533,8 @@
512534 * Checks user permissions, calls the function given in mFunction
513535 *
514536 * This must be overridden by subclasses; it will be made abstract in a future version
 537+ *
 538+ * @param $par String subpage string, if one was specified
515539 */
516540 function execute( $par ) {
517541 $this->setHeaders();
@@ -567,6 +591,7 @@
568592 /**
569593 * Get a self-referential title object
570594 *
 595+ * @param $subpage String|Bool
571596 * @return Title object
572597 */
573598 function getTitle( $subpage = false ) {
@@ -662,6 +687,7 @@
663688 * Wrapper around wfMessage that sets the current context. Currently this
664689 * is only the title.
665690 *
 691+ * @return Message
666692 * @see wfMessage
667693 */
668694 public function msg( /* $args */ ) {
@@ -756,6 +782,8 @@
757783
758784 /**
759785 * Basic SpecialPage workflow: get a form, send it to the user; get some data back,
 786+ *
 787+ * @param $par String Subpage string if one was specified
760788 */
761789 public function execute( $par ) {
762790 $this->setParameter( $par );
@@ -782,6 +810,7 @@
783811 * must throw subclasses of ErrorPageError
784812 *
785813 * @param $user User: the user to check, or null to use the context user
 814+ * @return Bool true
786815 * @throws ErrorPageError
787816 */
788817 public function userCanExecute( User $user ) {
@@ -886,6 +915,7 @@
887916 * If the special page is a redirect, then get the Title object it redirects to.
888917 * False otherwise.
889918 *
 919+ * @param $par String Subpage string
890920 * @return Title|false
891921 */
892922 abstract public function getRedirect( $par );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86347Cleanup in SpecialPage.php:...happy-melon21:25, 18 April 2011

Status & tagging log