| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types=1); |
||
| 22 | public function render(array $parameters, HTMLNode $previous): HTMLNode |
||
| 23 | { |
||
| 24 | $node = new HTMLNode('button'); |
||
| 25 | |||
| 26 | $node->setAttributes([ |
||
| 27 | 'type' => $parameters[self::TYPE] ?? 'button', |
||
| 28 | 'class' => '', |
||
| 29 | ]); |
||
| 30 | |||
| 31 | $node->setContent($parameters[self::LABEL] ?? ''); |
||
| 32 | |||
| 33 | foreach ([static::DISABLED, static::READONLY] as $v) { |
||
| 34 | if ($parameters[$v] ?? false) { |
||
| 35 | $node->setAttribute($v, $v); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | return $node; |
||
| 40 | } |
||
| 67 |