Merge "resourceloader: Clarify operator precedence"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 6 Oct 2017 23:21:59 +0000 (23:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 6 Oct 2017 23:21:59 +0000 (23:21 +0000)
includes/resourceloader/ResourceLoaderImageModule.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php

index 8b54959..71a0fa2 100644 (file)
@@ -249,7 +249,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                                $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] ) ) {
index aea2776..838d2c0 100644 (file)
@@ -15,8 +15,8 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
        protected function getTestImage( $name ) {
                $options = ResourceLoaderImageModuleTest::$commonImageData[$name];
                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
-               $allowedVariants = is_array( $options ) &&
-                       isset( $options['variants'] ) ? $options['variants'] : [];
+               $allowedVariants = ( is_array( $options ) && isset( $options['variants'] ) ) ?
+                       $options['variants'] : [];
                $variants = array_fill_keys( $allowedVariants, [ 'color' => 'red' ] );
                return new ResourceLoaderImageTestable(
                        $name,