feat(attribute): Add Autocomplete enum and update AutocompleteProvider for add test data.#77
Conversation
…ider` for add test data.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new PHP enum Changes
Sequence Diagram(s)(Skipped — changes are small and do not introduce complex multi-component control flow requiring visualization.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 50: Change the grammar in the changelog entry referencing the
Autocomplete enum and AutocompleteProvider: replace "for add test data" with a
correct phrase such as "to add test data" or "with test data" so the line reads
e.g. "Enh `#77`: Add `Autocomplete` enum and update `AutocompleteProvider` to add
test data (`@terabytesoftw`)"; ensure both `Autocomplete` and
`AutocompleteProvider` remain exactly named.
In `@src/Values/Autocomplete.php`:
- Around line 17-25: The docblock for the Autocomplete enum case OFF is
incorrect; update the comment for case OFF to state that the browser is
instructed not to automatically complete, autofill, or suggest values (i.e.,
autocomplete is disabled), and ensure the docblock for case ON clearly states
the browser is allowed to automatically complete or fill the field; locate the
enum cases OFF and ON in the Autocomplete enum and replace the misleading
description for OFF with one that indicates disabling autocomplete and adjust
ON's comment if needed.
In `@tests/Form/HasAutocompleteTest.php`:
- Line 24: The docblock claim in HasAutocompleteTest that invalid `autocomplete`
values throw InvalidArgumentException is not covered by tests; either add a
dedicated test method (e.g.,
testThrowInvalidArgumentExceptionWhenSettingAutocompleteValue) that uses an
invalid-values provider (or explicitly supplies invalid strings) and asserts an
InvalidArgumentException when calling the class/method under test that sets the
autocomplete attribute, or remove/adjust the docblock to avoid the false claim;
locate HasAutocompleteTest, the existing testSetAutocompleteAttributeValue and
AutocompleteProvider::values() to add the invalid-value case or a new data
provider and assertion.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.mdsrc/Values/Autocomplete.phptests/Form/HasAutocompleteTest.phptests/Provider/Form/AutocompleteProvider.php
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-09T16:05:15.502Z
Learnt from: terabytesoftw
Repo: ui-awesome/html-attribute PR: 18
File: tests/Support/Provider/Global/ContentEditableProvider.php:32-33
Timestamp: 2026-01-09T16:05:15.502Z
Learning: Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories (e.g., from ui-awesome/html-core to ui-awesome/html-attribute). Do not update the header year to the current year; keep the original creation year as stated in the header. This applies to all PHP files throughout the repo that are moved between packages.
Applied to files:
src/Values/Autocomplete.phptests/Form/HasAutocompleteTest.phptests/Provider/Form/AutocompleteProvider.php
🪛 PHPMD (2.15.0)
tests/Provider/Form/AutocompleteProvider.php
[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)
(StaticAccess)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: phpunit / PHP 8.2-windows-2022
- GitHub Check: phpunit / PHP 8.1-ubuntu-latest
- GitHub Check: phpunit / PHP 8.3-ubuntu-latest
- GitHub Check: phpunit / PHP 8.1-windows-2022
- GitHub Check: phpunit / PHP 8.4-windows-2022
- GitHub Check: phpunit / PHP 8.3-windows-2022
- GitHub Check: phpunit / PHP 8.5-windows-2022
- GitHub Check: phpunit / PHP 8.5-ubuntu-latest
- GitHub Check: phpunit / PHP 8.4-ubuntu-latest
- GitHub Check: mutation / PHP 8.5-ubuntu-latest
- GitHub Check: linter / Super Linter
- GitHub Check: linter / Super Linter
🔇 Additional comments (2)
tests/Provider/Form/AutocompleteProvider.php (2)
30-31: LGTM!The use of
EnumDataProvider::attributeCases()to dynamically generate test cases from theAutocompleteenum is a clean approach that reduces duplication and ensures test coverage stays in sync with enum values.The PHPMD
StaticAccesswarning is a false positive here—EnumDataProvideris a utility class fromphp-forge/supportdesigned to be used statically for data provider generation.
83-84: Clean merge of test case sources.The spread operator correctly combines enum-derived and static test cases. The distinct key naming between enum cases and static cases ensures no unintended overwrites.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Pull Request