Merge "Fix return type hints in media related classes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 30 Jul 2019 20:26:36 +0000 (20:26 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 30 Jul 2019 20:26:36 +0000 (20:26 +0000)
1  2 
includes/media/SvgHandler.php

@@@ -381,7 -381,7 +381,7 @@@ class SvgHandler extends ImageHandler 
         * @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 ) {
         */
        public function getMetadata( $file, $filename ) {
                $metadata = [ 'version' => self::SVG_METADATA_VERSION ];
 +
                try {
 -                      $metadata += SVGMetadataExtractor::getMetadata( $filename );
 +                      $svgReader = new SVGReader( $filename );
 +                      $metadata += $svgReader->getMetadata();
                } catch ( Exception $e ) { // @todo SVG specific exceptions
                        // File not found, broken, etc.
                        $metadata['error'] = [