1 | <?php |
||
7 | abstract class Parser |
||
8 | { |
||
9 | /** |
||
10 | * An array of the currently applied codes |
||
11 | * |
||
12 | * @var array $current; |
||
13 | */ |
||
14 | protected $current = []; |
||
15 | |||
16 | /** |
||
17 | * An array of the tags that should be searched for |
||
18 | * and their corresponding replacements |
||
19 | * |
||
20 | * @var \League\CLImate\Decorator\Tags $tags |
||
21 | */ |
||
22 | public $tags; |
||
23 | |||
24 | 580 | public function __construct(array $current, Tags $tags) |
|
25 | { |
||
26 | 580 | $this->current = $current; |
|
27 | 580 | $this->tags = $tags; |
|
28 | 580 | } |
|
29 | |||
30 | /** |
||
31 | * Wrap the string in the current style |
||
32 | * |
||
33 | * @param string $str |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | abstract public function apply($str); |
||
38 | } |
||
39 |