Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | class WordTag extends AbstractTag |
||
15 | { |
||
16 | /** |
||
17 | * Default value if no value is given for tag |
||
18 | * @var string|bool |
||
19 | */ |
||
20 | protected $default; |
||
21 | |||
22 | /** |
||
23 | * WordTag constructor. |
||
24 | * |
||
25 | * @param string $name |
||
26 | * @param string|bool $default |
||
27 | */ |
||
28 | 8 | public function __construct(string $name, $default = '') |
|
29 | { |
||
30 | 8 | parent::__construct($name); |
|
31 | |||
32 | 8 | expect_type($default, ['string', 'bool']); |
|
33 | 8 | $this->default = $default; |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * Return default if no value is specified |
||
38 | * |
||
39 | * @return string|bool |
||
40 | */ |
||
41 | 2 | public function getDefault() |
|
44 | } |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Process a notation. |
||
49 | * |
||
50 | * @param array $notations |
||
51 | * @param string $value |
||
52 | * @return array |
||
53 | */ |
||
54 | 5 | public function process(array $notations, string $value): array |
|
69 | } |
||
70 | } |
||
71 |