Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | abstract class Replacer |
||
6 | { |
||
7 | abstract public function getReplacePatternData(): array; |
||
8 | |||
9 | public function process(string $buffer): string |
||
10 | { |
||
11 | if (\strlen($buffer) === 0) { |
||
12 | return ''; |
||
13 | } |
||
14 | |||
15 | return $this->replace( |
||
16 | $this->getReplacePatternData(), |
||
17 | $buffer |
||
18 | ); |
||
19 | } |
||
20 | |||
21 | public function replace(array $replace, string $buffer): string |
||
30 | } |
||
31 | } |
||
32 |