Skip to content

feat(attribute): Add Autocomplete enum and update AutocompleteProvider for add test data.#77

Merged
terabytesoftw merged 3 commits into
mainfrom
fix_mini_27
Feb 5, 2026
Merged

feat(attribute): Add Autocomplete enum and update AutocompleteProvider for add test data.#77
terabytesoftw merged 3 commits into
mainfrom
fix_mini_27

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

Pull Request

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@terabytesoftw terabytesoftw added the enhancement New feature or request label Feb 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 5, 2026

Warning

Rate limit exceeded

@terabytesoftw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between ef5c428 and 07ee0ca.

📒 Files selected for processing (1)
  • src/Values/Autocomplete.php
📝 Walkthrough

Walkthrough

Adds a new PHP enum Autocomplete (cases OFF/ON), updates test provider to generate enum-driven cases via EnumDataProvider::attributeCases(), and records the change in CHANGELOG.md.

Changes

Cohort / File(s) Summary
Enum Definition
src/Values/Autocomplete.php
Adds new PHP 8.1+ Autocomplete enum with OFF = 'off' and ON = 'on'.
Test Files / Providers
tests/Form/HasAutocompleteTest.php, tests/Provider/Form/AutocompleteProvider.php
Updates test provider to use EnumDataProvider::attributeCases(Autocomplete::class, Attribute::AUTOCOMPLETE) and combines enum-derived cases with existing static test cases; test docblock updated to note invalid-value test scenario.
Changelog
CHANGELOG.md
Adds v0.5.3 entry documenting the new Autocomplete enum and provider test data update.

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

🐇 I nibble keys and hop along,
Off or On — I hum this song.
Tests now dance with enum delight,
Providers peep through morning light,
A little rabbit cheers the sight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an Autocomplete enum and updating AutocompleteProvider with test data, matching the changeset content.
Description check ✅ Passed The description clearly identifies this as a new feature related to the Autocomplete enum, which aligns with the changeset modifications across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_mini_27

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 302c992 and 7d40b5c.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/Values/Autocomplete.php
  • tests/Form/HasAutocompleteTest.php
  • tests/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.php
  • tests/Form/HasAutocompleteTest.php
  • tests/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 the Autocomplete enum is a clean approach that reduces duplication and ensures test coverage stays in sync with enum values.

The PHPMD StaticAccess warning is a false positive here—EnumDataProvider is a utility class from php-forge/support designed 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.

Comment thread CHANGELOG.md Outdated
Comment thread src/Values/Autocomplete.php
Comment thread tests/Form/HasAutocompleteTest.php Outdated
@terabytesoftw terabytesoftw merged commit 06bbbdb into main Feb 5, 2026
47 checks passed
@terabytesoftw terabytesoftw deleted the fix_mini_27 branch February 5, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant