From 6ad58d9cfc09ea03233f809aefc9546d1c46b7f4 Mon Sep 17 00:00:00 2001 From: Brabli <67018167+Brabli@users.noreply.github.com> Date: Wed, 31 May 2023 12:19:55 +0100 Subject: [PATCH] Change method name --- src/Twig/Runtime/IconRuntime.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Twig/Runtime/IconRuntime.php b/src/Twig/Runtime/IconRuntime.php index 170bacf..9d5baa3 100644 --- a/src/Twig/Runtime/IconRuntime.php +++ b/src/Twig/Runtime/IconRuntime.php @@ -39,7 +39,7 @@ final class IconRuntime implements RuntimeExtensionInterface */ public function renderIcon(array $userOptions): string { - $options = $this->getMergedOptions($userOptions); + $options = $this->mergeWithDefaultOptions($userOptions); $svg = $this->getSanitisedIconSvg($options['icon']); @@ -58,7 +58,7 @@ final class IconRuntime implements RuntimeExtensionInterface return implode(' ', $extraClasses); } - private function getMergedOptions(array $userOptions): array + private function mergeWithDefaultOptions(array $userOptions): array { $this->throwIfUnrecognisedOptionExists($userOptions); return $this->mergeUserOptionsWithDefaults($userOptions); @@ -187,6 +187,7 @@ final class IconRuntime implements RuntimeExtensionInterface private function setSvgHeightAndWidth(string $content, int $size): string { $this->throwIfSizeIsNegative($size); + $svgAsXmlElement = new \SimpleXMLElement($content); $svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'width', $size); $svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'height', $size);