Skip to content

Commit

Permalink
LWB-264 Fixing doc blocks for AutocompleteAttribute Trait
Browse files Browse the repository at this point in the history
  • Loading branch information
t73biz committed Jul 18, 2024
1 parent ca6ff34 commit 027807d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Components/AttributeTraits/AutocompleteAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ public function setAutocompleteAttribute(AttributeCollection &$specificAttribute
{
/**
* Possible Values:
* - off: The browser is not allowed to automatically complete the input. Note: It can't prevent a password manager from asking the user if they want to save username and password information.
* - on: The browser is allowed to automatically complete the input with no guidance as to the type of data expected.
* - off: The browser is not allowed to automatically complete the input. Note: It can't prevent a password
* manager from asking the user if they want to save username and password information.
* - on: The browser is allowed to automatically complete the input with no guidance as to the type of data
* expected.
* - <token-list>: An ordered set of space-separated tokens consisting of autofill detail tokens.
*
* If the autocomplete attribute is <token-list>, each token is the string "section-", case-insensitive,
Expand Down Expand Up @@ -102,7 +104,9 @@ public function setAutocompleteAttribute(AttributeCollection &$specificAttribute

foreach ($valueParts as $key => $valuePart) {
if (str_starts_with($valuePart, 'section-') && $key !== 0) {
throw new InvalidAttributeException('The autocomplete attribute value is invalid. The section token must be the first token.');
throw new InvalidAttributeException(
'The autocomplete attribute value is invalid. The section token must be the first token.'
);
} elseif (! in_array($valuePart, $allowedValues) && ! str_starts_with($valuePart, 'section-')) {
throw new InvalidAttributeException('The autocomplete attribute value is invalid.');
}
Expand Down

0 comments on commit 027807d

Please sign in to comment.