Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 6590756..0258433 100644 (file)
@@ -227,15 +227,13 @@ class SpecialVersion extends SpecialPage {
                $software = [];
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
                if ( wfIsHHVM() ) {
-                       $software['[http://hhvm.com/ HHVM]'] = HHVM_VERSION . " (" . PHP_SAPI . ")";
+                       $software['[https://hhvm.com/ HHVM]'] = HHVM_VERSION . " (" . PHP_SAPI . ")";
                } else {
                        $software['[https://php.net/ PHP]'] = PHP_VERSION . " (" . PHP_SAPI . ")";
                }
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
-               if ( IcuCollation::getICUVersion() ) {
-                       $software['[http://site.icu-project.org/ ICU]'] = IcuCollation::getICUVersion();
-               }
+               $software['[http://site.icu-project.org/ ICU]'] = INTL_ICU_VERSION;
 
                // Allow a hook to add/remove items.
                Hooks::run( 'SoftwareInfo', [ &$software ] );
@@ -396,7 +394,7 @@ class SpecialVersion extends SpecialPage {
        public static function getExtensionTypeName( $type ) {
                $types = self::getExtensionTypes();
 
-               return isset( $types[$type] ) ? $types[$type] : $types['other'];
+               return $types[$type] ?? $types['other'];
        }
 
        /**
@@ -658,13 +656,7 @@ class SpecialVersion extends SpecialPage {
         * @return int
         */
        public function compare( $a, $b ) {
-               if ( $a['name'] === $b['name'] ) {
-                       return 0;
-               } else {
-                       return $this->getLanguage()->lc( $a['name'] ) > $this->getLanguage()->lc( $b['name'] )
-                               ? 1
-                               : -1;
-               }
+               return $this->getLanguage()->lc( $a['name'] ) <=> $this->getLanguage()->lc( $b['name'] );
        }
 
        /**
@@ -838,7 +830,7 @@ class SpecialVersion extends SpecialPage {
                $description = $out->parseInline( $description );
 
                // ... now get the authors for this extension
-               $authors = isset( $extension['author'] ) ? $extension['author'] : [];
+               $authors = $extension['author'] ?? [];
                $authors = $this->listAuthors( $authors, $extension['name'], $extensionPath );
 
                // Finally! Create the table