Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / registration / ExtensionProcessor.php
index 14d4a17..a803e3a 100644 (file)
@@ -298,7 +298,7 @@ class ExtensionProcessor implements Processor {
        }
 
        public function getRequirements( array $info ) {
-               return isset( $info['requires'] ) ? $info['requires'] : [];
+               return $info['requires'] ?? [];
        }
 
        protected function extractHooks( array $info ) {
@@ -359,9 +359,7 @@ class ExtensionProcessor implements Processor {
        }
 
        protected function extractResourceLoaderModules( $dir, array $info ) {
-               $defaultPaths = isset( $info['ResourceFileModulePaths'] )
-                       ? $info['ResourceFileModulePaths']
-                       : false;
+               $defaultPaths = $info['ResourceFileModulePaths'] ?? false;
                if ( isset( $defaultPaths['localBasePath'] ) ) {
                        if ( $defaultPaths['localBasePath'] === '' ) {
                                // Avoid double slashes (e.g. /extensions/Example//path)
@@ -426,7 +424,7 @@ class ExtensionProcessor implements Processor {
        protected function extractCredits( $path, array $info ) {
                $credits = [
                        'path' => $path,
-                       'type' => isset( $info['type'] ) ? $info['type'] : 'other',
+                       'type' => $info['type'] ?? 'other',
                ];
                foreach ( self::$creditsAttributes as $attr ) {
                        if ( isset( $info[$attr] ) ) {