You are here

protected function SassRuleNode::getParentSelectors in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/tree/SassRuleNode.php \SassRuleNode::getParentSelectors()

* Returns the parent selector(s) for this node. * This in an empty array if there is no parent selector. *

Return value

array the parent selector for this node

2 calls to SassRuleNode::getParentSelectors()
SassRuleNode::resolveParentReferences in phamlp/sass/tree/SassRuleNode.php
* Resolves parent references in the selector *
SassRuleNode::resolveSelectors in phamlp/sass/tree/SassRuleNode.php
* Resolves selectors. * Interpolates SassScript in selectors and resolves any parent references or * appends the parent selectors. *

File

phamlp/sass/tree/SassRuleNode.php, line 230

Class

SassRuleNode
SassRuleNode class. Represents a CSS rule. @package PHamlP @subpackage Sass.tree

Code

protected function getParentSelectors($context) {
  $ancestor = $this->parent;
  while (!$ancestor instanceof SassRuleNode && $ancestor
    ->hasParent()) {
    $ancestor = $ancestor->parent;
  }
  if ($ancestor instanceof SassRuleNode) {
    return $ancestor
      ->resolveSelectors($context);
  }
  return array();
}