protected function processDeclaration($node, $parent) {
        $rules = [];

        foreach ($node->getRules() as $key => $rule) {
            $name = $rule->getRule();
            $seen[$name] = true;

            if (!isset(self::$rules[$name])) {
                $rules[] = $rule;
                continue;
            }

            foreach (self::$rules[$name] as $prefix) {
                $newname = $prefix . $name;
                if (isset($seen[$newname])) {
                    continue;
                }
                $newrule = clone $rule;
                $newrule->setRule($newname);
                $rules[] = $newrule;
            }

            $rules[] = $rule;
        }

        $node->setRules($this->manipulateRuleValues($rules));

        if ($node instanceof DeclarationBlock) {
            $selectors = $node->getSelectors();
            foreach ($selectors as $key => $selector) {

                $matches = [];
                if (preg_match($this->pseudosregex, $selector->getSelector(), $matches)) {

                    $newnode = clone $node;
                    foreach (self::$pseudos[$matches[1]] as $newpseudo) {
                        $newselector = new Selector(str_replace($matches[1], $newpseudo, $selector->getSelector()));
                        $selectors[$key] = $newselector;
                        $newnode = clone $node;
                        $newnode->setSelectors($selectors);
                        $parent->insert($newnode, $node);
                    }

                    // We're only expecting one affected pseudo class per block.
                    break;
                }
            }
        }
    }
protected function processDeclaration($node, $parent) {
        $rules = [];

        foreach ($node->getRules() as $key => $rule) {
            $name = $rule->getRule();
            $seen[$name] = true;

            if (!isset(self::$rules[$name])) {
                $rules[] = $rule;
                continue;
            }

            foreach (self::$rules[$name] as $prefix) {
                $newname = $prefix . $name;
                if (isset($seen[$newname])) {
                    continue;
                }
                $newrule = clone $rule;
                $newrule->setRule($newname);
                $rules[] = $newrule;
            }

            $rules[] = $rule;
        }

        $node->setRules($this->manipulateRuleValues($rules));

        if ($node instanceof DeclarationBlock) {
            $selectors = $node->getSelectors();
            foreach ($selectors as $key => $selector) {

                $matches = [];
                if (preg_match($this->pseudosregex, $selector->getSelector(), $matches)) {

                    $newnode = clone $node;
                    foreach (self::$pseudos[$matches[1]] as $newpseudo) {
                        $newselector = new Selector(str_replace($matches[1], $newpseudo, $selector->getSelector()));
                        $selectors[$key] = $newselector;
                        $newnode = clone $node;
                        $newnode->setSelectors($selectors);
                        $parent->insert($newnode, $node);
                    }

                    // We're only expecting one affected pseudo class per block.
                    break;
                }
            }
        }
    }
protected function processDeclaration ( $ node , $ parent ) { $ rules = [ ] ; foreach ( $ node -> getRules ( ) as $ key => $ rule ) { $ name = $ rule -> getRule ( ) ; $ seen [ $ name ] = true ; if ( ! isset ( self :: $ rules [ $ name ] ) ) { $ rules [ ] = $ rule ; continue ; } foreach ( self :: $ rules [ $ name ] as $ prefix ) { $ newname = $ prefix . $ name ; if ( isset ( $ seen [ $ newname ] ) ) { continue ; } $ newrule = clone $ rule ; $ newrule -> setRule ( $ newname ) ; $ rules [ ] = $ newrule ; } $ rules [ ] = $ rule ; } $ node -> setRules ( $ this -> manipulateRuleValues ( $ rules ) ) ; if ( $ node instanceof DeclarationBlock ) { $ selectors = $ node -> getSelectors ( ) ; foreach ( $ selectors as $ key => $ selector ) { $ matches = [ ] ; if ( preg_match ( $ this -> pseudosregex , $ selector -> getSelector ( ) , $ matches ) ) { $ newnode = clone $ node ; foreach ( self :: $ pseudos [ $ matches [ 1 ] ] as $ newpseudo ) { $ newselector = new Selector ( str_replace ( $ matches [ 1 ] , $ newpseudo , $ selector -> getSelector ( ) ) ) ; $ selectors [ $ key ] = $ newselector ; $ newnode = clone $ node ; $ newnode -> setSelectors ( $ selectors ) ; $ parent -> insert ( $ newnode , $ node ) ; } // We're only expecting one affected pseudo class per block. break ; } } } }
Process declaration.

@param object $node The declaration block.
@param object $parent The parent.
Process declaration .