Merge "clientpool: refactor Redis authentication error handling"
[lhc/web/wiklou.git] / includes / media / MediaTransformOutput.php
index 5366c4f..4aeaac4 100644 (file)
@@ -47,13 +47,13 @@ abstract class MediaTransformOutput {
        /** @var bool|string */
        protected $page;
 
-       /** @var bool|string Filesystem path to the thumb  */
+       /** @var bool|string Filesystem path to the thumb */
        protected $path;
 
        /** @var bool|string Language code, false if not set */
        protected $lang;
 
-       /** @var bool|string Permanent storage path  */
+       /** @var bool|string Permanent storage path */
        protected $storagePath = false;
 
        /**
@@ -360,9 +360,9 @@ class ThumbnailImage extends MediaTransformOutput {
                        throw new MWException( __METHOD__ . ' called in the old style' );
                }
 
-               $alt = isset( $options['alt'] ) ? $options['alt'] : '';
+               $alt = $options['alt'] ?? '';
 
-               $query = isset( $options['desc-query'] ) ? $options['desc-query'] : '';
+               $query = $options['desc-query'] ?? '';
 
                $attribs = [
                        'alt' => $alt,
@@ -487,8 +487,8 @@ class MediaTransformError extends MediaTransformOutput {
 class TransformParameterError extends MediaTransformError {
        function __construct( $params ) {
                parent::__construct( 'thumbnail_error',
-                       max( isset( $params['width'] ) ? $params['width'] : 0, 120 ),
-                       max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
+                       max( $params['width'] ?? 0, 120 ),
+                       max( $params['height'] ?? 0, 120 ),
                        wfMessage( 'thumbnail_invalid_params' )
                );
        }
@@ -512,8 +512,8 @@ class TransformTooBigImageAreaError extends MediaTransformError {
                );
 
                parent::__construct( 'thumbnail_error',
-                       max( isset( $params['width'] ) ? $params['width'] : 0, 120 ),
-                       max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
+                       max( $params['width'] ?? 0, 120 ),
+                       max( $params['height'] ?? 0, 120 ),
                        $msg
                );
        }