Change method name

This commit is contained in:
Brabli
2023-05-31 12:19:55 +01:00
parent 850ba765a2
commit 6ad58d9cfc

View File

@@ -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);