summaryrefslogtreecommitdiff
path: root/modules/purifier/lib/HTMLPurifier/HTMLPurifier/Strategy/Composite.php
blob: 590274dce4cc83e0e1adfed12a39652d7647ffcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php defined("SYSPATH") or die("No direct script access.");

/**
 * Composite strategy that runs multiple strategies on tokens.
 */
abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
{

    /**
     * List of strategies to run tokens through.
     */
    protected $strategies = array();

    abstract public function __construct();

    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