| 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); |
||
| 10 | public function render(array $parameters, HTMLNode $previous): HTMLNode |
||
| 11 | { |
||
| 12 | $node = new HTMLNode('button'); |
||
| 13 | |||
| 14 | $node->setAttributes([ |
||
| 15 | 'type' => 'submit', // TODO |
||
| 16 | 'class' => '', |
||
| 17 | ]); |
||
| 18 | |||
| 19 | $node->setContent($parameters[self::LABEL] ?? ''); |
||
| 20 | |||
| 21 | foreach ([static::DISABLED, static::READONLY] as $v) { |
||
| 22 | if ($parameters[$v] ?? false) { |
||
| 23 | $node->setAttribute($v, $v); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | return $node; |
||
| 28 | } |
||
| 30 |