Change method name
This commit is contained in:
@@ -39,7 +39,7 @@ final class IconRuntime implements RuntimeExtensionInterface
|
|||||||
*/
|
*/
|
||||||
public function renderIcon(array $userOptions): string
|
public function renderIcon(array $userOptions): string
|
||||||
{
|
{
|
||||||
$options = $this->getMergedOptions($userOptions);
|
$options = $this->mergeWithDefaultOptions($userOptions);
|
||||||
|
|
||||||
$svg = $this->getSanitisedIconSvg($options['icon']);
|
$svg = $this->getSanitisedIconSvg($options['icon']);
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ final class IconRuntime implements RuntimeExtensionInterface
|
|||||||
return implode(' ', $extraClasses);
|
return implode(' ', $extraClasses);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getMergedOptions(array $userOptions): array
|
private function mergeWithDefaultOptions(array $userOptions): array
|
||||||
{
|
{
|
||||||
$this->throwIfUnrecognisedOptionExists($userOptions);
|
$this->throwIfUnrecognisedOptionExists($userOptions);
|
||||||
return $this->mergeUserOptionsWithDefaults($userOptions);
|
return $this->mergeUserOptionsWithDefaults($userOptions);
|
||||||
@@ -187,6 +187,7 @@ final class IconRuntime implements RuntimeExtensionInterface
|
|||||||
private function setSvgHeightAndWidth(string $content, int $size): string
|
private function setSvgHeightAndWidth(string $content, int $size): string
|
||||||
{
|
{
|
||||||
$this->throwIfSizeIsNegative($size);
|
$this->throwIfSizeIsNegative($size);
|
||||||
|
|
||||||
$svgAsXmlElement = new \SimpleXMLElement($content);
|
$svgAsXmlElement = new \SimpleXMLElement($content);
|
||||||
$svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'width', $size);
|
$svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'width', $size);
|
||||||
$svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'height', $size);
|
$svgAsXmlElement = $this->addAttributeToXmlElement($svgAsXmlElement, 'height', $size);
|
||||||
|
|||||||
Reference in New Issue
Block a user