# simpleanalytics/1.33/src/Support/SvgIcon.php

Simple Analytics, version 1.33. 30 lines.

- Page: https://pluginprobe.com/plugins/simpleanalytics/1.33/code/src/Support/SvgIcon.php
- Raw: https://pluginprobe.com/plugins/simpleanalytics/1.33/raw/src/Support/SvgIcon.php
- Modified: 2024-09-13T11:41:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/simpleanalytics/1.33/code/src/Support/SvgIcon.php#L10-L20`.

```php
<?php

namespace SimpleAnalytics\Support;

class SvgIcon
{
    /**
     * @var string
     */
    protected $icon;
    /**
     * @var mixed[]
     */
    protected $attributes = [];
    public function __construct(string $icon)
    {
        $this->icon = $icon;
    }
    public function class(string $class): self
    {
        $this->attributes['class'] = $class;

        return $this;
    }
    public function __toString(): string
    {
        return str_replace('<svg', '<svg ' . Str::htmlAttributes($this->attributes), $this->icon);
    }
}

```
