summaryrefslogtreecommitdiff
path: root/platform/www/inc/Parsing/Handler/AbstractRewriter.php
blob: d9becbf4baea2c0aa58b1db5eb95d17c6744a6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

namespace dokuwiki\Parsing\Handler;

/**
 * Basic implementation of the rewriter interface to be specialized by children
 */
abstract class AbstractRewriter implements ReWriterInterface
{
    /** @var CallWriterInterface original CallWriter */
    protected $callWriter;

    /** @var array[] list of calls */
    public $calls = array();

    /** @inheritdoc */
    public function __construct(CallWriterInterface $callWriter)
    {
        $this->callWriter = $callWriter;
    }

    /** @inheritdoc */
    public function writeCall($call)
    {
        $this->calls[] = $call;
    }

    /** * @inheritdoc */
    public function writeCalls($calls)
    {
        $this->calls = array_merge($this->calls, $calls);
    }

    /** @inheritDoc */
    public function getCallWriter()
    {
        return $this->callWriter;
    }
}