File indexing completed on 2024-05-19 06:02:36

0001 <?php
0002 
0003 /**
0004  * Composite strategy that runs multiple strategies on tokens.
0005  */
0006 abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
0007 {
0008 
0009     /**
0010      * List of strategies to run tokens through.
0011      * @type HTMLPurifier_Strategy[]
0012      */
0013     protected $strategies = array();
0014 
0015     /**
0016      * @param HTMLPurifier_Token[] $tokens
0017      * @param HTMLPurifier_Config $config
0018      * @param HTMLPurifier_Context $context
0019      * @return HTMLPurifier_Token[]
0020      */
0021     public function execute($tokens, $config, $context)
0022     {
0023         foreach ($this->strategies as $strategy) {
0024             $tokens = $strategy->execute($tokens, $config, $context);
0025         }
0026         return $tokens;
0027     }
0028 }
0029 
0030 // vim: et sw=4 sts=4