Unsuppress another phan issue (part 7)
[lhc/web/wiklou.git] / includes / installer / WebInstaller.php
index 82c1a69..b6e90a9 100644 (file)
@@ -145,10 +145,6 @@ class WebInstaller extends Installer {
                parent::__construct();
                $this->output = new WebInstallerOutput( $this );
                $this->request = $request;
-
-               // Add parser hooks
-               $parser = MediaWikiServices::getInstance()->getParser();
-               $parser->setHook( 'doclink', [ $this, 'docLink' ] );
        }
 
        /**
@@ -192,7 +188,9 @@ class WebInstaller extends Installer {
 
                # Special case for Creative Commons partner chooser box.
                if ( $this->request->getVal( 'SubmitCC' ) ) {
+                       /** @var WebInstallerOptions $page */
                        $page = $this->getPageByName( 'Options' );
+                       '@phan-var WebInstallerOptions $page';
                        $this->output->useShortHeader();
                        $this->output->allowFrames();
                        $page->submitCC();
@@ -201,7 +199,9 @@ class WebInstaller extends Installer {
                }
 
                if ( $this->request->getVal( 'ShowCC' ) ) {
+                       /** @var WebInstallerOptions $page */
                        $page = $this->getPageByName( 'Options' );
+                       '@phan-var WebInstallerOptions $page';
                        $this->output->useShortHeader();
                        $this->output->allowFrames();
                        $this->output->addHTML( $page->getCCDoneBox() );
@@ -1090,13 +1090,13 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * Helper for Installer::docLink()
+        * Helper for WebInstallerOutput
         *
+        * @internal For use by WebInstallerOutput
         * @param string $page
-        *
         * @return string
         */
-       protected function getDocUrl( $page ) {
+       public function getDocUrl( $page ) {
                $query = [ 'page' => $page ];
 
                if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
@@ -1107,18 +1107,17 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * Extension tag hook for a documentation link.
+        * Helper for sidebar links.
         *
+        * @internal For use in WebInstallerOutput class
+        * @param string $url
         * @param string $linkText
-        * @param string[] $attribs
-        * @param Parser $parser Unused
-        *
-        * @return string
+        * @return string HTML
         */
-       public function docLink( $linkText, $attribs, $parser ) {
-               $url = $this->getDocUrl( $attribs['href'] );
-
-               return Html::element( 'a', [ 'href' => $url ], $linkText );
+       public function makeLinkItem( $url, $linkText ) {
+               return Html::rawElement( 'li', [],
+                       Html::element( 'a', [ 'href' => $url ], $linkText )
+               );
        }
 
        /**