r69659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69658‎ | r69659 | r69660 >
Date:09:34, 21 July 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Doc and style improvements
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -2,10 +2,18 @@
33
44 class WebInstaller extends Installer {
55
6 - /** WebRequest object */
 6+ /**
 7+ * WebRequest object.
 8+ *
 9+ * @var WebRequest
 10+ */
711 public $request;
812
9 - /** Cached session array */
 13+ /**
 14+ * Cached session array.
 15+ *
 16+ * @var array
 17+ */
1018 public $session;
1119
1220 /** Captured PHP error text. Temporary.
@@ -65,8 +73,12 @@
6674
6775 public $currentPageName;
6876
69 - /** Constructor */
70 - public function __construct( $request ) {
 77+ /**
 78+ * Constructor.
 79+ *
 80+ * @param WebRequest $request
 81+ */
 82+ public function __construct( WebRequest $request ) {
7183 parent::__construct();
7284 $this->output = new WebInstallerOutput( $this );
7385 $this->request = $request;
@@ -79,7 +91,7 @@
8092 *
8193 * @return Array: new session array
8294 */
83 - public function execute( $session ) {
 95+ public function execute( array $session ) {
8496 $this->session = $session;
8597
8698 if ( isset( $session['settings'] ) ) {
@@ -311,17 +323,23 @@
312324
313325 /**
314326 * Clean up from execute()
 327+ *
 328+ * @return array
315329 */
316330 public function finish() {
317331 $this->output->output();
 332+
318333 $this->session['happyPages'] = $this->happyPages;
319334 $this->session['skippedPages'] = $this->skippedPages;
320335 $this->session['settings'] = $this->settings;
 336+
321337 return $this->session;
322338 }
323339
324340 /**
325341 * Get a URL for submission back to the same script.
 342+ *
 343+ * @param $query: Array
326344 */
327345 public function getUrl( $query = array() ) {
328346 $url = $this->request->getRequestURL();
@@ -337,6 +355,10 @@
338356
339357 /**
340358 * Get a WebInstallerPage from the main sequence, by ID.
 359+ *
 360+ * @param $id Integer
 361+ *
 362+ * @return WebInstallerPage
341363 */
342364 public function getPageById( $id ) {
343365 return $this->getPageByName( $this->pageSequence[$id] );
@@ -344,6 +366,10 @@
345367
346368 /**
347369 * Get a WebInstallerPage by name.
 370+ *
 371+ * @param $pageName String
 372+ *
 373+ * @return WebInstallerPage
348374 */
349375 public function getPageByName( $pageName ) {
350376 // Totally lame way to force autoload of WebInstallerPage.php
@@ -356,6 +382,9 @@
357383
358384 /**
359385 * Get a session variable.
 386+ *
 387+ * @param $name String
 388+ * @param $default
360389 */
361390 public function getSession( $name, $default = null ) {
362391 if ( !isset( $this->session[$name] ) ) {
@@ -384,6 +413,7 @@
385414 */
386415 public function setupLanguage() {
387416 global $wgLang, $wgContLang, $wgLanguageCode;
 417+
388418 if ( $this->getSession( 'test' ) === null && !$this->request->wasPosted() ) {
389419 $wgLanguageCode = $this->getAcceptLanguage();
390420 $wgLang = $wgContLang = Language::factory( $wgLanguageCode );
@@ -398,6 +428,8 @@
399429
400430 /**
401431 * Retrieves MediaWiki language from Accept-Language HTTP header.
 432+ *
 433+ * @return string
402434 */
403435 public function getAcceptLanguage() {
404436 global $wgLanguageCode;
@@ -430,6 +462,8 @@
431463
432464 /**
433465 * Called by execute() before page output starts, to show a page list.
 466+ *
 467+ * @param $currentPageName String
434468 */
435469 public function startPageWrapper( $currentPageName ) {
436470 $s = "<div class=\"config-page-wrapper\">\n" .
@@ -462,6 +496,12 @@
463497
464498 /**
465499 * Get a list item for the page list.
 500+ *
 501+ * @param $pageName String
 502+ * @param $enabled Boolean
 503+ * @param $currentPageName String
 504+ *
 505+ * @return string
466506 */
467507 public function getPageListItem( $pageName, $enabled, $currentPageName ) {
468508 $s = "<li class=\"config-page-list-item\">";
@@ -500,6 +540,7 @@
501541 }
502542
503543 $s .= "</li>\n";
 544+
504545 return $s;
505546 }
506547
@@ -565,6 +606,7 @@
566607 $args = func_get_args();
567608 array_shift( $args );
568609 $args = array_map( 'htmlspecialchars', $args );
 610+
569611 $text = wfMsgReal( $msg, $args, false, false, false );
570612 $html = $this->parse( $text, true );
571613 $id = $this->helpId++;

Status & tagging log