1<?php 2 3namespace dokuwiki\Parsing\Handler; 4 5use dokuwiki\Parsing\Handler; 6 7class CallWriter implements CallWriterInterface 8{ 9 /** @var Handler $Handler */ 10 protected $Handler; 11 12 /** 13 * @param Handler $Handler 14 */ 15 public function __construct(Handler $Handler) 16 { 17 $this->Handler = $Handler; 18 } 19 20 /** @inheritdoc */ 21 public function writeCall($call) 22 { 23 $this->Handler->calls[] = $call; 24 } 25 26 /** @inheritdoc */ 27 public function writeCalls($calls) 28 { 29 $this->Handler->calls = array_merge($this->Handler->calls, $calls); 30 } 31 32 /** 33 * @inheritdoc 34 * function is required, but since this call writer is first/highest in 35 * the chain it is not required to do anything 36 */ 37 public function finalise() 38 { 39 unset($this->Handler); 40 } 41} 42