<?php
/**
- * Class encapsulating an image used in a ResourceLoaderImageModule.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
/**
* Class encapsulating an image used in a ResourceLoaderImageModule.
*
+ * @ingroup ResourceLoader
* @since 1.25
*/
class ResourceLoaderImage {
// Reattach all direct children of the `<svg>` root node to the `<g>` wrapper
while ( $root->firstChild ) {
$node = $root->firstChild;
+ // @phan-suppress-next-line PhanUndeclaredProperty False positive
if ( !$titleNode && $node->nodeType === XML_ELEMENT_NODE && $node->tagName === 'title' ) {
// Remember the first encountered `<title>` node
$titleNode = $node;
file_put_contents( $tempFilenameSvg, $svg );
- $metadata = SVGMetadataExtractor::getMetadata( $tempFilenameSvg );
+ $svgReader = new SVGReader( $tempFilenameSvg );
+ $metadata = $svgReader->getMetadata();
if ( !isset( $metadata['width'] ) || !isset( $metadata['height'] ) ) {
unlink( $tempFilenameSvg );
return false;