AbstractRewriter.php 836 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace dokuwiki\Parsing\Handler;
  3. /**
  4. * Basic implementation of the rewriter interface to be specialized by children
  5. */
  6. abstract class AbstractRewriter implements ReWriterInterface
  7. {
  8. /** @var CallWriterInterface original CallWriter */
  9. protected $callWriter;
  10. /** @var array[] list of calls */
  11. public $calls = array();
  12. /** @inheritdoc */
  13. public function __construct(CallWriterInterface $callWriter)
  14. {
  15. $this->callWriter = $callWriter;
  16. }
  17. /** @inheritdoc */
  18. public function writeCall($call)
  19. {
  20. $this->calls[] = $call;
  21. }
  22. /** * @inheritdoc */
  23. public function writeCalls($calls)
  24. {
  25. $this->calls = array_merge($this->calls, $calls);
  26. }
  27. /** @inheritDoc */
  28. public function getCallWriter()
  29. {
  30. return $this->callWriter;
  31. }
  32. }