private function CssToRule($selector, $index) { $rule = new \stdclass(); $xPath = new CssToXpath($selector, $this->prefix); $rule->query = $xPath->getXpath(); $rule->pseudo = $xPath->getPseudo(); $rule->depth = $xPath->getDepth(); $rule->index = $index++; return $rule; }
private function CssToRules($selector, $index, $properties) { $parts = explode(',', $selector); $rules = []; foreach ($parts as $part) { $xPath = new CssToXpath($part, $this->valueParser, $this->prefix); $rules[$part] = new \Transphporm\Rule($xPath->getXpath(), $xPath->getPseudo(), $xPath->getDepth(), $index++); $rules[$part]->properties = $properties; } return $rules; }
private function CssToRule($selector, $index) { $xPath = new CssToXpath($selector, $this->prefix); $rule = new Rule($xPath->getXpath(), $xPath->getPseudo(), $xPath->getDepth(), $index++); return $rule; }