You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 line
727B

  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. * @type HTMLPurifier_Strategy[]
  10. */
  11. protected $strategies = array();
  12. /**
  13. * @param HTMLPurifier_Token[] $tokens
  14. * @param HTMLPurifier_Config $config
  15. * @param HTMLPurifier_Context $context
  16. * @return HTMLPurifier_Token[]
  17. */
  18. public function execute($tokens, $config, $context)
  19. {
  20. foreach ($this->strategies as $strategy) {
  21. $tokens = $strategy->execute($tokens, $config, $context);
  22. }
  23. return $tokens;
  24. }
  25. }
  26. // vim: et sw=4 sts=4