src/FontAwesome/FontAwesome.php
protected function getStackIconElement($key, $value, $index)
    {
        $element = $value;

        if (is_string($key))
        {
            $element = $this->icon($key)->addClass($value);
        }
        else if (is_string($value))
        {
            $element = $this->icon($value);
        }

        if ( !is_a($element, FontAwesomeIcon::class))
        {
            throw new \InvalidArgumentException('Invalid icon passed to stack');
        }

        return $element->addClass("fa-stack-{$index}x");
    }
protected function getStackIconElement($key, $value, $index)
    {
        $element = $value;

        if (is_string($key))
        {
            $element = $this->icon($key)->addClass($value);
        }
        else if (is_string($value))
        {
            $element = $this->icon($value);
        }

        if ( !is_a($element, FontAwesomeIcon::class))
        {
            throw new \InvalidArgumentException('Invalid icon passed to stack');
        }

        return $element->addClass("fa-stack-{$index}x");
    }
Sanitize an element passed to the FA stack

@param int|string                                                   $key
@param string|\MarvinLabs\Html\FontAwesome\Elements\FontAwesomeIcon $value
@param int                                                          $index Starting at 1

@return \MarvinLabs\Html\FontAwesome\Elements\FontAwesomeIcon
@throws \InvalidArgumentException