Conditions | 4 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | 181 | protected function run(): string |
|
55 | { |
||
56 | 181 | $new = clone $this; |
|
57 | |||
58 | 181 | if ($new->tag === '') { |
|
59 | 3 | throw new InvalidArgumentException('Tag name cannot be empty.'); |
|
60 | } |
||
61 | |||
62 | 178 | if ($new->hint === '') { |
|
63 | 171 | $new->hint = HtmlForm::getAttributeHint($new->getFormModel(), $new->getAttribute()); |
|
64 | } |
||
65 | |||
66 | 178 | return (!empty($new->hint)) |
|
67 | 85 | ? CustomTag::name($new->tag) |
|
68 | 85 | ->attributes($new->attributes) |
|
69 | 85 | ->content($new->hint) |
|
70 | 85 | ->encode($new->getEncode()) |
|
71 | 85 | ->render() |
|
72 | 178 | : ''; |
|
73 | } |
||
75 |