| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 1 | public function __invoke(string $href, array $attributes = []) |
|
| 31 | { |
||
| 32 | 1 | if (!empty($href)) { |
|
| 33 | 1 | $overrides = ["href" => $href]; |
|
| 34 | } else { |
||
| 35 | 1 | $overrides = []; |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Avoid duplicate "href" and ignore it if it is passed in the attributes |
||
| 40 | */ |
||
| 41 | 1 | unset($attributes["href"]); |
|
| 42 | |||
| 43 | 1 | $overrides = array_merge($overrides, $attributes); |
|
| 44 | |||
| 45 | 1 | return $this->renderElement("base", $overrides); |
|
| 46 | } |
||
| 48 |