X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FWebInstaller.php;h=2d12e62de8cc22b57e0fb0be7513a3de974da1ac;hp=d8281b015e55bce9caa9eb518787ada36be88600;hb=c13fee87d42bdd6fdf6764edb6f6475c14c27749;hpb=1504dea1127a5f7960dcdc4eed5a044f6a962deb diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index d8281b015e..2d12e62de8 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -140,9 +140,9 @@ class WebInstaller extends Installer { $this->request = $request; // Add parser hooks - global $wgParser; - $wgParser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] ); - $wgParser->setHook( 'doclink', [ $this, 'docLink' ] ); + $parser = MediaWikiServices::getInstance()->getParser(); + $parser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] ); + $parser->setHook( 'doclink', [ $this, 'docLink' ] ); } /** @@ -178,17 +178,9 @@ class WebInstaller extends Installer { return $this->session; } - if ( isset( $session['happyPages'] ) ) { - $this->happyPages = $session['happyPages']; - } else { - $this->happyPages = []; - } + $this->happyPages = $session['happyPages'] ?? []; - if ( isset( $session['skippedPages'] ) ) { - $this->skippedPages = $session['skippedPages']; - } else { - $this->skippedPages = []; - } + $this->skippedPages = $session['skippedPages'] ?? []; $lowestUnhappy = $this->getLowestUnhappy(); @@ -468,11 +460,7 @@ class WebInstaller extends Installer { * @return array */ public function getSession( $name, $default = null ) { - if ( !isset( $this->session[$name] ) ) { - return $default; - } else { - return $this->session[$name]; - } + return $this->session[$name] ?? $default; } /** @@ -932,11 +920,7 @@ class WebInstaller extends Installer { if ( !isset( $params['labelAttribs'] ) ) { $params['labelAttribs'] = []; } - if ( isset( $params['rawtext'] ) ) { - $labelText = $params['rawtext']; - } else { - $labelText = $this->parse( wfMessage( $params['label'] )->text() ); - } + $labelText = $params['rawtext'] ?? $this->parse( wfMessage( $params['label'] )->plain() ); return "