Parser::apply()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace League\CLImate\Decorator\Parser;
4
5
use League\CLImate\Decorator\Tags;
6
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