X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fmedia%2FImageHandler.php;h=1eefddbd4fb962e0b78c900e3aefbb0d7359f97e;hp=c2870c25ea6271518f5041b4bb699dbc8b55ac1d;hb=3df3b575c6617df64ec98533cc7141bd2314e274;hpb=4618f70793d1178ca4c646ef397cf17b1cc70b44 diff --git a/includes/media/ImageHandler.php b/includes/media/ImageHandler.php index c2870c25ea..1eefddbd4f 100644 --- a/includes/media/ImageHandler.php +++ b/includes/media/ImageHandler.php @@ -31,16 +31,16 @@ abstract class ImageHandler extends MediaHandler { * @param File $file * @return bool */ - function canRender( $file ) { + public function canRender( $file ) { return ( $file->getWidth() && $file->getHeight() ); } - function getParamMap() { - return array( 'img_width' => 'width' ); + public function getParamMap() { + return [ 'img_width' => 'width' ]; } - function validateParam( $name, $value ) { - if ( in_array( $name, array( 'width', 'height' ) ) ) { + public function validateParam( $name, $value ) { + if ( in_array( $name, [ 'width', 'height' ] ) ) { if ( $value <= 0 ) { return false; } else { @@ -51,7 +51,7 @@ abstract class ImageHandler extends MediaHandler { } } - function makeParamString( $params ) { + public function makeParamString( $params ) { if ( isset( $params['physicalWidth'] ) ) { $width = $params['physicalWidth']; } elseif ( isset( $params['width'] ) ) { @@ -65,22 +65,22 @@ abstract class ImageHandler extends MediaHandler { return "{$width}px"; } - function parseParamString( $str ) { + public function parseParamString( $str ) { $m = false; if ( preg_match( '/^(\d+)px$/', $str, $m ) ) { - return array( 'width' => $m[1] ); + return [ 'width' => $m[1] ]; } else { return false; } } function getScriptParams( $params ) { - return array( 'width' => $params['width'] ); + return [ 'width' => $params['width'] ]; } /** * @param File $image - * @param array $params + * @param array &$params * @return bool */ function normaliseParams( $image, &$params ) { @@ -152,8 +152,8 @@ abstract class ImageHandler extends MediaHandler { /** * Validate thumbnail parameters and fill in the correct height * - * @param int $width Specified width (input/output) - * @param int $height Height (output only) + * @param int &$width Specified width (input/output) + * @param int &$height Height (output only) * @param int $srcWidth Width of the source image * @param int $srcHeight Height of the source image * @param string $mimeType Unused