From c779404d0ac742e890fef569b46d2db50af201ca Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Wed, 29 Nov 2023 14:33:26 -0600 Subject: [PATCH] Make Svg::sanitize() a public method --- src/Support/Svg.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Support/Svg.php b/src/Support/Svg.php index be9c232ce..32536f946 100644 --- a/src/Support/Svg.php +++ b/src/Support/Svg.php @@ -16,12 +16,9 @@ class Svg /** * Extracts and sanitizes SVG code from a given file. * - * @param string $path The path to the SVG file. - * @param boolean $minify Whether to minify the extracted SVG code. - * @return string * @throws ApplicationException If no file, or a malformed SVG, is found at the given path. */ - public static function extract($path, $minify = true) + public static function extract(string $path, bool $minify = true): string { if (!is_file($path)) { throw new ApplicationException(sprintf('No SVG file found at path "%s"', $path)); @@ -40,12 +37,8 @@ public static function extract($path, $minify = true) * Sanitizes SVG code. * * See https://github.com/darylldoyle/svg-sanitizer for usage of the underlying sanitization library. - * - * @param string $svg SVG code. - * @param boolean $minify Whether to minify the given SVG code. - * @return string */ - protected static function sanitize($svg, $minify = true) + public static function sanitize(string $svg, bool $minify = true): string { $sanitizer = new Sanitizer(); $sanitizer->removeRemoteReferences(true);