$aResult * * @return void */ protected function allDeclarationBlocks(array &$aResult) { foreach ($this->aContents as $mContent) { if ($mContent instanceof DeclarationBlock) { $aResult[] = $mContent; } elseif ($mContent instanceof CSSBlockList) { $mContent->allDeclarationBlocks($aResult); } } } /** * @param array $aResult * * @return void */ protected function allRuleSets(array &$aResult) { foreach ($this->aContents as $mContent) { if ($mContent instanceof RuleSet) { $aResult[] = $mContent; } elseif ($mContent instanceof CSSBlockList) { $mContent->allRuleSets($aResult); } } } /** * @param CSSList|Rule|RuleSet|Value $oElement * @param array $aResult * @param string|null $sSearchString * @param bool $bSearchInFunctionArguments * * @return void */ protected function allValues($oElement, array &$aResult, $sSearchString = null, $bSearchInFunctionArguments = false) { if ($oElement instanceof CSSBlockList) { foreach ($oElement->getContents() as $oContent) { $this->allValues($oContent, $aResult, $sSearchString, $bSearchInFunctionArguments); } } elseif ($oElement instanceof RuleSet) { foreach ($oElement->getRules($sSearchString) as $oRule) { $this->allValues($oRule, $aResult, $sSearchString, $bSearchInFunctionArguments); } } elseif ($oElement instanceof Rule) { $this->allValues($oElement->getValue(), $aResult, $sSearchString, $bSearchInFunctionArguments); } elseif ($oElement instanceof ValueList) { if ($bSearchInFunctionArguments || !($oElement instanceof CSSFunction)) { foreach ($oElement->getListComponents() as $mComponent) { $this->allValues($mComponent, $aResult, $sSearchString, $bSearchInFunctionArguments); } } } else { // Non-List `Value` or `CSSString` (CSS identifier) $aResult[] = $oElement; } } /** * @param array $aResult * @param string|null $sSpecificitySearch * * @return void */ protected function allSelectors(array &$aResult, $sSpecificitySearch = null) { /** @var array $aDeclarationBlocks */ $aDeclarationBlocks = []; $this->allDeclarationBlocks($aDeclarationBlocks); foreach ($aDeclarationBlocks as $oBlock) { foreach ($oBlock->getSelectors() as $oSelector) { if ($sSpecificitySearch === null) { $aResult[] = $oSelector; } else { $sComparator = '==='; $aSpecificitySearch = explode(' ', $sSpecificitySearch); $iTargetSpecificity = $aSpecificitySearch[0]; if (count($aSpecificitySearch) > 1) { $sComparator = $aSpecificitySearch[0]; $iTargetSpecificity = $aSpecificitySearch[1]; } $iTargetSpecificity = (int)$iTargetSpecificity; $iSelectorSpecificity = $oSelector->getSpecificity(); $bMatches = false; switch ($sComparator) { case '<=': $bMatches = $iSelectorSpecificity <= $iTargetSpecificity; break; case '<': $bMatches = $iSelectorSpecificity < $iTargetSpecificity; break; case '>=': $bMatches = $iSelectorSpecificity >= $iTargetSpecificity; break; case '>': $bMatches = $iSelectorSpecificity > $iTargetSpecificity; break; default: $bMatches = $iSelectorSpecificity === $iTargetSpecificity; break; } if ($bMatches) { $aResult[] = $oSelector; } } } } } } __halt_compiler();----SIGNATURE:----u7bfNBXUFua8U6r9VcFNMh6n6pML6uAKzOzWFi+s98PWEr9Qwg3ptZi1OQW579vkwOye4AopQwBapmutD08QOIkYSN8ZZ7Uu6GuMOPFqRLdRtO5vaycHaw8qj8x5+yQN2vhhhuBjTkfRGDHZJHYzOO3dKZgALCHYheBLkBcQaGokntdqrHCZ/2rbfhYeQDgZZ6V8vvUU64i0J68iXc8NZU8oAoagS5ATLu8xvysqmPYgsFvYmjp4GH2OuiAAPIZNeY9VbHpu6qorPO56jdcrUe2A5MqQit/SvxDDSgreOVx6PjiMf6isVxD0Qy7YO7tu6A8pX/TKbHVgzh+kNP1xtzNpd9R2jaIayhd/Y+PForHipJVYdwgl12v9QzYWc1oEHNKx/I/KPkV9subc25MS710DVkoPCTQG0NwQ94z8VNkRfTBpkRsnQvHvwoehFfGQtsRlzILeRAgKVnReinY4c+4j9C17kIGsNzlE7gi4G/CZ5SWk9imZEDqNF9/lBaOmko2eCKSqi151eXDpNEFyVI04VUywwsdO/YEf6kR5H020supGNe8vIuFW9Hqnn6cwtmSpBDdIuNUhYvczHCWKZm2xCSK+UNj83kez5kKgOJptE4gRmNF8Kirh0KaGgrmsdLam+3qU2sEZHtCGeN/S7YRd6UEYzqZIEq7VAI3Cllk=----ATTACHMENT:----MzgwOTg5NzkwODM5MDEyMiAzOTgzNDI2NTYwMTQ0OTIgMjM1MDEzMTczNDgwMDkyNw==