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,
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' )
);
}
);
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
);
}