Skip to content

Commit

Permalink
Refactor ChoiceInterface to extend InputInterface. (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jan 5, 2024
1 parent 4064320 commit 917ce4a
Showing 1 changed file with 1 addition and 77 deletions.
78 changes: 1 addition & 77 deletions src/Input/ChoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,8 @@
/**
* Provide methods for handling HTML choice input-related attributes and properties.
*/
interface ChoiceInterface extends ElementInterface
interface ChoiceInterface extends ElementInterface, InputInterface
{
/**
* Set the aria-describedby attribute, which identifies the element(s) that describes the current element.
*
* The aria-describedby attribute is used in WAI-ARIA to provide a relationship between an element and its
* descriptive elements. This helps screen readers and other assistive technologies provide additional context
* about the element.
*
* @param bool|string $value IDs of the descriptive element(s) separated by spaces.
*
* @return static A new instance or clone of the current object with the aria-describedby attribute set.
*
* @link https://www.w3.org/TR/wai-aria-1.1/#aria-describedby
*/
public function ariaDescribedBy(string|bool $value = true): static;

/**
* Set the `HTML` attributes.
*
* @param array $values Attribute values indexed by attribute names.
*
* @return static A new instance of the current class with the specified attributes.
*/
public function attributes(array $values): static;

/**
* Set the `CSS` `HTML` class attribute.
*
* @param string $value The `CSS` attribute of the widget.
* @param bool $override If `true` the value will be overridden.
*
* @return static A new instance of the current class with the specified class value.
*
* @link https://html.spec.whatwg.org/#classes
*/
public function class(string $value, bool $override = false): static;

/**
* Set the current instance as being enclosed by a label.
*
Expand All @@ -56,24 +20,6 @@ public function class(string $value, bool $override = false): static;
*/
public function enclosedByLabel(bool $value): static;

/**
* Get the ID of the widget.
*
* @return string|null The ID of the widget.
*/
public function getId(): string|null;

/**
* Set the ID of the widget.
*
* @param string|null $value The ID of the widget.
*
* @return static A new instance of the current class with the specified ID value.
*
* @link https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute
*/
public function id(string|null $value): static;

/**
* Determine if the label is disabled or not.
*
Expand Down Expand Up @@ -118,32 +64,10 @@ public function labelContent(string|ElementInterface ...$values): static;
*/
public function labelFor(string|null $value): static;

/**
* Set the name part of the name/value pair associated with this element for the purposes of form submission.
*
* @param string|null $value The name of the widget.
*
* @return static A new instance of the current class with the specified name.
*
* @link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name
*/
public function name(string|null $value): static;

/**
* Disable the label rendering.
*
* @return static A new instance of the current class with the label disabled.
*/
public function notLabel(): static;

/**
* set the value content attribute gives the default value of the field.
*
* @param mixed $value The value of the widget.
*
* @return static A new instance of the current class with the specified value.
*
* @link https://html.spec.whatwg.org/multipage/input.html#attr-input-value
*/
public function value(mixed $value): static;
}

0 comments on commit 917ce4a

Please sign in to comment.