| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class Image extends AbstractSimpleField |
||
| 15 | { |
||
| 16 | private array $inputTagAttributes = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Provides the textual label for the button for users and user agents who cannot use the image. |
||
| 20 | * |
||
| 21 | * @link https://html.spec.whatwg.org/multipage/input.html#attr-input-alt |
||
| 22 | */ |
||
| 23 | 1 | public function alt(?string $value): self |
|
| 24 | { |
||
| 25 | 1 | $new = clone $this; |
|
| 26 | 1 | $new->inputTagAttributes['alt'] = $value; |
|
| 27 | 1 | return $new; |
|
| 28 | } |
||
| 29 | |||
| 30 | public function width(int|string|Stringable|null $width): self |
||
| 31 | { |
||
| 32 | $new = clone $this; |
||
| 33 | $new->inputTagAttributes['width'] = $width; |
||
| 34 | return $new; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function height(int|string|Stringable|null $height): self |
||
| 38 | { |
||
| 39 | $new = clone $this; |
||
| 40 | $new->inputTagAttributes['height'] = $height; |
||
| 41 | return $new; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @link https://html.spec.whatwg.org/multipage/input.html#attr-input-src |
||
| 46 | */ |
||
| 47 | 1 | public function src(?string $url): self |
|
| 52 | } |
||
| 53 | |||
| 54 | public function inputTagAttributes(array $attributes): self |
||
| 55 | { |
||
| 56 | $new = clone $this; |
||
| 57 | $new->inputTagAttributes = $attributes; |
||
| 58 | return $new; |
||
| 59 | } |
||
| 60 | |||
| 61 | 1 | protected function generateInput(): string |
|
| 67 | } |
||
| 68 | } |
||
| 69 |