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