Merge "objectcache: make RedisBagOStuff pass all tests"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderImageModule.php
index 8b54959..e1bddcc 100644 (file)
@@ -224,7 +224,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
        public function getImage( $name, ResourceLoaderContext $context ) {
                $this->loadFromDefinition();
                $images = $this->getImages( $context );
-               return isset( $images[$name] ) ? $images[$name] : null;
+               return $images[$name] ?? null;
        }
 
        /**
@@ -241,15 +241,13 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                if ( !isset( $this->imageObjects[$skin] ) ) {
                        $this->imageObjects[$skin] = [];
                        if ( !isset( $this->images[$skin] ) ) {
-                               $this->images[$skin] = isset( $this->images['default'] ) ?
-                                       $this->images['default'] :
-                                       [];
+                               $this->images[$skin] = $this->images['default'] ?? [];
                        }
                        foreach ( $this->images[$skin] as $name => $options ) {
                                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
 
                                $allowedVariants = array_merge(
-                                       is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : [],
+                                       ( is_array( $options ) && isset( $options['variants'] ) ) ? $options['variants'] : [],
                                        $this->getGlobalVariants( $context )
                                );
                                if ( isset( $this->variants[$skin] ) ) {
@@ -290,9 +288,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                if ( !isset( $this->globalVariants[$skin] ) ) {
                        $this->globalVariants[$skin] = [];
                        if ( !isset( $this->variants[$skin] ) ) {
-                               $this->variants[$skin] = isset( $this->variants['default'] ) ?
-                                       $this->variants['default'] :
-                                       [];
+                               $this->variants[$skin] = $this->variants['default'] ?? [];
                        }
                        foreach ( $this->variants[$skin] as $name => $config ) {
                                if ( isset( $config['global'] ) && $config['global'] ) {
@@ -386,8 +382,6 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                return [
                        "background-image: $fallbackUrl;",
                        "background-image: linear-gradient(transparent, transparent), $primaryUrl;",
-                       // Do not serve SVG to Opera 12, bad rendering with border-radius or background-size (T87504)
-                       "background-image: -o-linear-gradient(transparent, transparent), $fallbackUrl;",
                ];
        }