<?php

/**
 * Composite strategy that runs multiple strategies on tokens.
 */
abstract class ROE_Vendor_HTMLPurifier_Strategy_Composite extends ROE_Vendor_HTMLPurifier_Strategy
{

    /**
     * List of strategies to run tokens through.
     * @type ROE_Vendor_HTMLPurifier_Strategy[]
     */
    protected $strategies = array();

    /**
     * @param ROE_Vendor_HTMLPurifier_Token[] $tokens
     * @param ROE_Vendor_HTMLPurifier_Config $config
     * @param ROE_Vendor_HTMLPurifier_Context $context
     * @return ROE_Vendor_HTMLPurifier_Token[]
     */
    public function execute($tokens, $config, $context)
    {
        foreach ($this->strategies as $strategy) {
            $tokens = $strategy->execute($tokens, $config, $context);
        }
        return $tokens;
    }
}

// vim: et sw=4 sts=4
