| Total Complexity | 7 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 57.14% |
| 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 | 2 | public function alt(?string $value): self |
|
| 24 | { |
||
| 25 | 2 | $new = clone $this; |
|
| 26 | 2 | $new->inputTagAttributes['alt'] = $value; |
|
| 27 | 2 | 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 | 2 | public function src(?string $url): self |
|
| 52 | } |
||
| 53 | |||
| 54 | 3 | public function disabled(?bool $disabled = true): self |
|
| 55 | { |
||
| 56 | 3 | $new = clone $this; |
|
| 57 | 3 | $new->inputTagAttributes['disabled'] = $disabled; |
|
| 58 | 3 | return $new; |
|
| 59 | } |
||
| 60 | |||
| 61 | public function inputTagAttributes(array $attributes): self |
||
| 62 | { |
||
| 63 | $new = clone $this; |
||
| 64 | $new->inputTagAttributes = $attributes; |
||
| 65 | return $new; |
||
| 66 | } |
||
| 67 | |||
| 68 | 5 | protected function generateInput(): string |
|
| 74 | } |
||
| 75 | } |
||
| 76 |