Fix return type hints in media related classes
authorUmherirrender <umherirrender_de.wp@web.de>
Tue, 18 Jun 2019 20:11:10 +0000 (22:11 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 18 Jun 2019 20:11:10 +0000 (22:11 +0200)
Change-Id: Id326fb2a54aac62cb27aa7045082924b5cd84940

includes/media/BitmapHandler.php
includes/media/BmpHandler.php
includes/media/DjVuImage.php
includes/media/ExifBitmapHandler.php
includes/media/MediaHandler.php
includes/media/SvgHandler.php
includes/media/XCFHandler.php

index e07b166..f7fc46f 100644 (file)
@@ -131,7 +131,7 @@ class BitmapHandler extends TransformationalImageHandler {
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
-        * @return MediaTransformError|bool Error object if error occurred, false (=no error) otherwise
+        * @return MediaTransformError|false Error object if error occurred, false (=no error) otherwise
         */
        protected function transformImageMagick( $image, $params ) {
                # use ImageMagick
         */
        protected function transformImageMagick( $image, $params ) {
                # use ImageMagick
@@ -275,7 +275,7 @@ class BitmapHandler extends TransformationalImageHandler {
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
-        * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise
+        * @return MediaTransformError|false Error object if error occurred, false (=no error) otherwise
         */
        protected function transformImageMagickExt( $image, $params ) {
                global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea,
         */
        protected function transformImageMagickExt( $image, $params ) {
                global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea,
@@ -368,7 +368,7 @@ class BitmapHandler extends TransformationalImageHandler {
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
         * @param File $image File associated with this thumbnail
         * @param array $params Array with scaler params
         *
-        * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise
+        * @return MediaTransformError|false Error object if error occurred, false (=no error) otherwise
         */
        protected function transformCustom( $image, $params ) {
                # Use a custom convert command
         */
        protected function transformCustom( $image, $params ) {
                # Use a custom convert command
index 9a9c0a6..2f5fa90 100644 (file)
@@ -53,7 +53,7 @@ class BmpHandler extends BitmapHandler {
         *
         * @param File|FSFile $image
         * @param string $filename
         *
         * @param File|FSFile $image
         * @param string $filename
-        * @return array
+        * @return array|false
         */
        function getImageSize( $image, $filename ) {
                $f = fopen( $filename, 'rb' );
         */
        function getImageSize( $image, $filename ) {
                $f = fopen( $filename, 'rb' );
index 13a39ed..92fad52 100644 (file)
@@ -61,7 +61,7 @@ class DjVuImage {
 
        /**
         * Return data in the style of getimagesize()
 
        /**
         * Return data in the style of getimagesize()
-        * @return array|bool Array or false on failure
+        * @return array|false Array or false on failure
         */
        public function getImageSize() {
                $data = $this->getInfo();
         */
        public function getImageSize() {
                $data = $this->getInfo();
index 1760eb8..fa9e1dc 100644 (file)
@@ -166,7 +166,7 @@ class ExifBitmapHandler extends BitmapHandler {
         *
         * @param File|FSFile $image
         * @param string $path
         *
         * @param File|FSFile $image
         * @param string $path
-        * @return array
+        * @return array|false
         */
        function getImageSize( $image, $path ) {
                $gis = parent::getImageSize( $image, $path );
         */
        function getImageSize( $image, $path ) {
                $gis = parent::getImageSize( $image, $path );
index 7dd0491..3abc6b7 100644 (file)
@@ -103,7 +103,7 @@ abstract class MediaHandler {
         * @param File|FSFile $image The image object, or false if there isn't one.
         *   Warning, FSFile::getPropsFromPath might pass an FSFile instead of File (!)
         * @param string $path The filename
         * @param File|FSFile $image The image object, or false if there isn't one.
         *   Warning, FSFile::getPropsFromPath might pass an FSFile instead of File (!)
         * @param string $path The filename
-        * @return array|bool Follow the format of PHP getimagesize() internal function.
+        * @return array|false Follow the format of PHP getimagesize() internal function.
         *   See https://www.php.net/getimagesize. MediaWiki will only ever use the
         *   first two array keys (the width and height), and the 'bits' associative
         *   key. All other array keys are ignored. Returning a 'bits' key is optional
         *   See https://www.php.net/getimagesize. MediaWiki will only ever use the
         *   first two array keys (the width and height), and the 'bits' associative
         *   key. All other array keys are ignored. Returning a 'bits' key is optional
index bdda674..e12f596 100644 (file)
@@ -381,7 +381,7 @@ class SvgHandler extends ImageHandler {
         * @param File|FSFile $file
         * @param string $path Unused
         * @param bool|array $metadata
         * @param File|FSFile $file
         * @param string $path Unused
         * @param bool|array $metadata
-        * @return array
+        * @return array|false
         */
        function getImageSize( $file, $path, $metadata = false ) {
                if ( $metadata === false && $file instanceof File ) {
         */
        function getImageSize( $file, $path, $metadata = false ) {
                if ( $metadata === false && $file instanceof File ) {
index e2cc1b2..5294530 100644 (file)
@@ -58,7 +58,7 @@ class XCFHandler extends BitmapHandler {
         *
         * @param File|FSFile $image
         * @param string $filename
         *
         * @param File|FSFile $image
         * @param string $filename
-        * @return array
+        * @return array|false
         */
        function getImageSize( $image, $filename ) {
                $header = self::getXCFMetaData( $filename );
         */
        function getImageSize( $image, $filename ) {
                $header = self::getXCFMetaData( $filename );