Skip to content

Commit

Permalink
🎨 Change return type to HtmlString for the render method and helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Jul 16, 2024
1 parent cf4865f commit f01ce5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SageSvg.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(protected Filesystem $files)
/**
* Render the SVG as HTML
*/
public function render(string $image, string|array $class = '', array $attrs = [], array $options = []): string
public function render(string $image, string|array $class = '', array $attrs = [], array $options = []): HtmlString
{
$options = collect([
'idPrefix' => null,
Expand Down
5 changes: 2 additions & 3 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* Sage SVG Helpers
*/

use Illuminate\Support\HtmlString;
use Log1x\SageSvg\SageSvg;

use function Roots\app;

/**
* Render the specified SVG image if it exists.
*/
if (! function_exists('get_svg')) {
function get_svg(string $image, string|array $class = '', array $attrs = [], array $options = []): ?string
function get_svg(string $image, string|array $class = '', array $attrs = [], array $options = []): HtmlString
{
return app(SageSvg::class)->render($image, $class, $attrs, $options);
}
Expand Down

0 comments on commit f01ce5b

Please sign in to comment.