src/Nodes/SVGNode.php
public function getIdAndClassPattern()
    {
        $id = $this->getAttribute('id');
        $class = $this->getAttribute('class');

        $pattern = '';
        if (!empty($id)) {
            $pattern = '#'.$id.'|#'.$id;
        }
        if (!empty($class)) {
            if (!empty($pattern)) {
                $pattern .= '.'.$class.'|';
            }
            $pattern .= '.'.$class;
        }

        return empty($pattern) ? null : '/('.$pattern.')/';
    }
public function getIdAndClassPattern()
    {
        $id = $this->getAttribute('id');
        $class = $this->getAttribute('class');

        $pattern = '';
        if (!empty($id)) {
            $pattern = '#'.$id.'|#'.$id;
        }
        if (!empty($class)) {
            if (!empty($pattern)) {
                $pattern .= '.'.$class.'|';
            }
            $pattern .= '.'.$class;
        }

        return empty($pattern) ? null : '/('.$pattern.')/';
    }
public function getIdAndClassPattern ( ) { $ id = $ this -> getAttribute ( 'id' ) ; $ class = $ this -> getAttribute ( 'class' ) ; $ pattern = '' ; if ( ! empty ( $ id ) ) { $ pattern = '#' . $ id . '|#' . $ id ; } if ( ! empty ( $ class ) ) { if ( ! empty ( $ pattern ) ) { $ pattern .= '.' . $ class . '|' ; } $ pattern .= '.' . $ class ; } return empty ( $ pattern ) ? null : '/(' . $ pattern . ')/' ; }
Constructs a regex pattern to use as the key to retrieve styles for this
node from its container.

@return string|null The generated pattern.
Constructs a regex pattern to use as the key to retrieve styles for this node from its container .