Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList

CSSBlockList::allValuesprotectedWC 1.0

Method of the class: CSSBlockList{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->allValues( $oElement, $aResult, $sSearchString, $bSearchInFunctionArguments );
$oElement(CSSElement|string) (required)
.
$aResult(array) (required)
.
$sSearchString(string|null)
.
Default: null
$bSearchInFunctionArguments(true|false)
.
Default: false

CSSBlockList::allValues() code WC 10.5.0

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;
    }
}