Composite.php 551 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Composite strategy that runs multiple strategies on tokens.
  4. */
  5. abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
  6. {
  7. /**
  8. * List of strategies to run tokens through.
  9. */
  10. protected $strategies = array();
  11. abstract public function __construct();
  12. public function execute($tokens, $config, $context) {
  13. foreach ($this->strategies as $strategy) {
  14. $tokens = $strategy->execute($tokens, $config, $context);
  15. }
  16. return $tokens;
  17. }
  18. }
  19. // vim: et sw=4 sts=4