Completed
Push — stable ( b83837...3c8749 )
by
unknown
08:20 queued 05:46
created

AbstractRewriter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A writeCall() 0 4 1
A writeCalls() 0 4 1
A getCallWriter() 0 4 1
1
<?php
2
3
namespace dokuwiki\Parsing\Handler;
4
5
/**
6
 * Basic implementation of the rewriter interface to be specialized by children
7
 */
8
abstract class AbstractRewriter implements ReWriterInterface
9
{
10
    /** @var CallWriterInterface original CallWriter */
11
    protected $callWriter;
12
13
    /** @var array[] list of calls */
14
    public $calls = array();
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