Merge "Revert "Use display name in category page subheadings if provided""
[lhc/web/wiklou.git] / includes / media / SVGMetadataExtractor.php
index 1ec2f81..6a974c7 100644 (file)
@@ -53,9 +53,9 @@ class SVGReader {
        private $mDebug = false;
 
        /** @var array */
-       private $metadata = array();
-       private $languages = array();
-       private $languagePrefixes = array();
+       private $metadata = [];
+       private $languages = [];
+       private $languagePrefixes = [];
 
        /**
         * Constructor
@@ -229,7 +229,7 @@ class SVGReader {
                }
                // @todo Find and store type of xml snippet. metadata['metadataType'] = "rdf"
                if ( method_exists( $this->reader, 'readInnerXML' ) ) {
-                       $this->metadata[$metafield] = trim( $this->reader->readInnerXML() );
+                       $this->metadata[$metafield] = trim( $this->reader->readInnerXml() );
                } else {
                        throw new MWException( "The PHP XMLReader extension does not come " .
                                "with readInnerXML() method. Your libxml is probably out of " .
@@ -264,7 +264,7 @@ class SVGReader {
                        ) {
                                $sysLang = $this->reader->getAttribute( 'systemLanguage' );
                                if ( !is_null( $sysLang ) && $sysLang !== '' ) {
-                                       // See http://www.w3.org/TR/SVG/struct.html#SystemLanguageAttribute
+                                       // See https://www.w3.org/TR/SVG/struct.html#SystemLanguageAttribute
                                        $langList = explode( ',', $sysLang );
                                        foreach ( $langList as $langItem ) {
                                                $langItem = trim( $langItem );
@@ -369,14 +369,14 @@ class SVGReader {
 
        /**
         * Return a rounded pixel equivalent for a labeled CSS/SVG length.
-        * http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers
+        * https://www.w3.org/TR/SVG11/coords.html#Units
         *
         * @param string $length CSS/SVG length.
         * @param float|int $viewportSize Optional scale for percentage units...
         * @return float Length in pixels
         */
        static function scaleSVGUnit( $length, $viewportSize = 512 ) {
-               static $unitLength = array(
+               static $unitLength = [
                        'px' => 1.0,
                        'pt' => 1.25,
                        'pc' => 15.0,
@@ -386,8 +386,8 @@ class SVGReader {
                        'em' => 16.0, // fake it?
                        'ex' => 12.0, // fake it?
                        '' => 1.0, // "User units" pixels by default
-               );
-               $matches = array();
+               ];
+               $matches = [];
                if ( preg_match( '/^\s*(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)\s*$/', $length, $matches ) ) {
                        $length = floatval( $matches[1] );
                        $unit = $matches[2];