protected function buildIconClasses($icon)
    {
        //Prepends the string "fa-" to any other class
        $icon = preg_replace('/(?<![^ ])(?=[^ ])(?!fa)/', 'fa-', $icon);
        $icon = !is_array($icon) ? preg_split('/\s+/', $icon, -1, PREG_SPLIT_NO_EMPTY) : $icon;

        //Adds the "fa" class, if no other "basic" class is present
        if (!count(array_intersect(['fa', 'fab', 'fal', 'far', 'fas'], $icon))) {
            array_unshift($icon, 'fas');
        }

        return implode(' ', array_unique($icon));
    }
protected function buildIconClasses($icon)
    {
        //Prepends the string "fa-" to any other class
        $icon = preg_replace('/(?<![^ ])(?=[^ ])(?!fa)/', 'fa-', $icon);
        $icon = !is_array($icon) ? preg_split('/\s+/', $icon, -1, PREG_SPLIT_NO_EMPTY) : $icon;

        //Adds the "fa" class, if no other "basic" class is present
        if (!count(array_intersect(['fa', 'fab', 'fal', 'far', 'fas'], $icon))) {
            array_unshift($icon, 'fas');
        }

        return implode(' ', array_unique($icon));
    }
protected function buildIconClasses ( $ icon ) { //Prepends the string "fa-" to any other class $ icon = preg_replace ( '/(?<![^ ])(?=[^ ])(?!fa)/' , 'fa-' , $ icon ) ; $ icon = ! is_array ( $ icon ) ? preg_split ( '/\s+/' , $ icon , - 1 , PREG_SPLIT_NO_EMPTY ) : $ icon ; //Adds the "fa" class, if no other "basic" class is present if ( ! count ( array_intersect ( [ 'fa' , 'fab' , 'fal' , 'far' , 'fas' ] , $ icon ) ) ) { array_unshift ( $ icon , 'fas' ) ; } return implode ( ' ' , array_unique ( $ icon ) ) ; }
Internal method to build icon classes
@param string|array $icon Icons
@return string
@since 2.16.2-beta
Internal method to build icon classes