fix(attribute): Move HTML attribute traits to Form namespace and update related imports accordingly.#71
Conversation
…date related imports accordingly.
📝 WalkthroughSummary by CodeRabbit
WalkthroughRelocates many form-related attribute traits from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-01-09T16:05:15.502ZApplied to files:
🧬 Code graph analysis (1)tests/HasNameTest.php (2)
🪛 PHPMD (2.15.0)src/Form/HasMinlength.php[error] 67-67: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'minlength'. (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)
🔇 Additional comments (6)
✏️ Tip: You can disable this entire section by setting 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/Form/HasSize.php (1)
67-79:⚠️ Potential issue | 🟠 MajorAdd validation to reject negative
sizevalues matching the error message'value >= 0'.The validation currently only checks
Validator::intLike(), which accepts negative values. However, the error message claims'value >= 0'. Similar attributesmaxlengthandminlengthexplicitly validate against negative values in their test suites (rejecting-1and'-1'), butsizedoes not. This inconsistency allows negative values to pass validation, contradicting the documented constraint.Suggested fix
if ($value !== null && Validator::intLike($value) === false) { throw new InvalidArgumentException( Message::ATTRIBUTE_INVALID_VALUE->getMessage( (string) $value, Attribute::SIZE->value, 'value >= 0', ), ); } + + if ($value !== null && (int) (string) $value < 0) { + throw new InvalidArgumentException( + Message::ATTRIBUTE_INVALID_VALUE->getMessage( + (string) $value, + Attribute::SIZE->value, + 'value >= 0', + ), + ); + }tests/Form/HasMinlengthTest.php (1)
69-105: 🛠️ Refactor suggestion | 🟠 MajorPass unnormalized enum to the trait to test its
UnitEnumhandling path.The current test normalizes
$minlengthbefore calling the trait'sminlength()method, which bypasses the trait's ownUnitEnumnormalization at line 66 ofHasMinlength.php. This skips code coverage for the enum branch in the method under test. Pass the unnormalized enum tominlength()to exercise the trait's handling, and use a normalized copy only for the exception message assertion.♻️ Suggested adjustment
if ($minlength instanceof UnitEnum) { $minlength = Enum::normalizeValue($minlength); } + $normalized = $minlength instanceof UnitEnum + ? Enum::normalizeValue($minlength) + : $minlength; + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage( + Message::ATTRIBUTE_INVALID_VALUE->getMessage( + (string) $normalized,tests/Form/HasMaxlengthTest.php (1)
103-116:⚠️ Potential issue | 🟡 MinorTest normalizes
UnitEnumbefore passing to the method under test, which alters what is actually being tested.The normalization at lines 103-105 converts the
UnitEnumto a string before callingmaxlength(). This means the test no longer verifies thatHasMaxlength::maxlength()correctly handlesUnitEnuminputs for invalid values—it only tests string handling.If the trait is supposed to handle
UnitEnumnormalization internally (as indicated by the expanded type signature acceptingUnitEnum), the test should pass theUnitEnumdirectly and let the trait normalize it.🔧 Proposed fix to test UnitEnum handling directly
- if ($maxlength instanceof UnitEnum) { - $maxlength = Enum::normalizeValue($maxlength); - } - $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( Message::ATTRIBUTE_INVALID_VALUE->getMessage( - (string) $maxlength, + $maxlength instanceof UnitEnum ? Enum::normalizeValue($maxlength) : (string) $maxlength, Attribute::MAXLENGTH->value, 'value >= 0', ), ); $instance->maxlength($maxlength);
🤖 Fix all issues with AI agents
In `@src/Form/HasMinlength.php`:
- Around line 21-26: Update the docblock for the HasMinlength trait/method to
reflect the expanded parameter types: document that the minlength setter accepts
int|string|\Stringable|\UnitEnum|null (not just int|null), keep notes that it is
designed for form controls (<input>, <textarea>), is immutable, and handles the
HTML minlength attribute; reference the method/trait name HasMinlength and the
minlength setter (e.g., setMinlength or withMinlength) so the doc matches the
actual signature.
In `@tests/HasNameTest.php`:
- Around line 66-72: The union type order on the testSetNameAttributeValue
method's first parameter should match the source trait for readability; update
the parameter type from string|UnitEnum|Stringable|null to
string|Stringable|UnitEnum|null in the testSetNameAttributeValue function
signature so it aligns with the source trait's ordering.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (58)
CHANGELOG.mdsrc/Form/HasAccept.phpsrc/Form/HasAutocomplete.phpsrc/Form/HasChecked.phpsrc/Form/HasDirname.phpsrc/Form/HasDisabled.phpsrc/Form/HasForm.phpsrc/Form/HasList.phpsrc/Form/HasMax.phpsrc/Form/HasMaxlength.phpsrc/Form/HasMin.phpsrc/Form/HasMinlength.phpsrc/Form/HasMultiple.phpsrc/Form/HasPattern.phpsrc/Form/HasPlaceholder.phpsrc/Form/HasReadonly.phpsrc/Form/HasRequired.phpsrc/Form/HasSize.phpsrc/Form/HasStep.phpsrc/HasName.phptests/Form/HasAcceptTest.phptests/Form/HasAutocompleteTest.phptests/Form/HasCheckedTest.phptests/Form/HasDirnameTest.phptests/Form/HasDisabledTest.phptests/Form/HasFormTest.phptests/Form/HasListTest.phptests/Form/HasMaxTest.phptests/Form/HasMaxlengthTest.phptests/Form/HasMinTest.phptests/Form/HasMinlengthTest.phptests/Form/HasMultipleTest.phptests/Form/HasPatternTest.phptests/Form/HasPlaceholderTest.phptests/Form/HasReadonlyTest.phptests/Form/HasRequiredTest.phptests/Form/HasSizeTest.phptests/Form/HasStepTest.phptests/HasNameTest.phptests/Provider/Form/AcceptProvider.phptests/Provider/Form/AutocompleteProvider.phptests/Provider/Form/CheckedProvider.phptests/Provider/Form/DirnameProvider.phptests/Provider/Form/DisabledProvider.phptests/Provider/Form/FormProvider.phptests/Provider/Form/ListProvider.phptests/Provider/Form/MaxProvider.phptests/Provider/Form/MaxlengthProvider.phptests/Provider/Form/MinProvider.phptests/Provider/Form/MinlengthProvider.phptests/Provider/Form/MultipleProvider.phptests/Provider/Form/PatternProvider.phptests/Provider/Form/PlaceholderProvider.phptests/Provider/Form/ReadonlyProvider.phptests/Provider/Form/RequiredProvider.phptests/Provider/Form/SizeProvider.phptests/Provider/Form/StepProvider.phptests/Provider/NameProvider.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:
tests/Form/HasDisabledTest.phpsrc/Form/HasMaxlength.phptests/Form/HasFormTest.phptests/Form/HasRequiredTest.phpsrc/Form/HasChecked.phptests/Form/HasListTest.phpsrc/Form/HasMultiple.phptests/Provider/Form/DirnameProvider.phpsrc/Form/HasDisabled.phptests/Provider/Form/CheckedProvider.phpsrc/Form/HasMin.phptests/Provider/Form/PatternProvider.phptests/Form/HasMaxTest.phptests/Form/HasPatternTest.phptests/Provider/Form/StepProvider.phptests/Form/HasStepTest.phptests/Provider/Form/MultipleProvider.phpsrc/Form/HasDirname.phptests/Form/HasMultipleTest.phpsrc/Form/HasList.phpsrc/Form/HasSize.phpsrc/Form/HasForm.phptests/Form/HasReadonlyTest.phptests/Provider/Form/DisabledProvider.phptests/Form/HasDirnameTest.phpsrc/Form/HasReadonly.phptests/Provider/Form/RequiredProvider.phptests/Provider/Form/PlaceholderProvider.phptests/Form/HasPlaceholderTest.phpsrc/Form/HasStep.phptests/Form/HasAcceptTest.phptests/Provider/Form/SizeProvider.phptests/Form/HasMinlengthTest.phpsrc/Form/HasMinlength.phptests/HasNameTest.phpsrc/Form/HasAutocomplete.phptests/Provider/Form/ReadonlyProvider.phptests/Form/HasCheckedTest.phptests/Form/HasMinTest.phptests/Form/HasSizeTest.phptests/Form/HasAutocompleteTest.phptests/Provider/Form/MinlengthProvider.phpsrc/Form/HasRequired.phptests/Provider/Form/AcceptProvider.phpsrc/Form/HasMax.phptests/Provider/Form/AutocompleteProvider.phpsrc/Form/HasPlaceholder.phptests/Provider/Form/MaxlengthProvider.phptests/Provider/NameProvider.phpsrc/Form/HasAccept.phptests/Provider/Form/ListProvider.phptests/Provider/Form/MaxProvider.phptests/Form/HasMaxlengthTest.phptests/Provider/Form/MinProvider.phpsrc/Form/HasPattern.phpsrc/HasName.phptests/Provider/Form/FormProvider.php
🧬 Code graph analysis (21)
tests/Form/HasDisabledTest.php (1)
tests/Provider/Form/DisabledProvider.php (1)
DisabledProvider(15-60)
tests/Form/HasFormTest.php (1)
tests/Provider/Form/FormProvider.php (1)
FormProvider(19-95)
tests/Form/HasRequiredTest.php (1)
tests/Provider/Form/RequiredProvider.php (1)
RequiredProvider(15-60)
tests/Form/HasListTest.php (1)
tests/Provider/Form/ListProvider.php (1)
ListProvider(19-95)
tests/Form/HasMaxTest.php (1)
src/Form/HasMax.php (1)
max(62-65)
tests/Form/HasPatternTest.php (1)
tests/Provider/Form/PatternProvider.php (1)
PatternProvider(19-95)
tests/Form/HasStepTest.php (1)
src/Form/HasStep.php (1)
step(67-70)
tests/Form/HasMultipleTest.php (1)
tests/Provider/Form/MultipleProvider.php (1)
MultipleProvider(15-60)
tests/Form/HasReadonlyTest.php (1)
tests/Provider/Form/ReadonlyProvider.php (1)
ReadonlyProvider(15-60)
tests/Form/HasAcceptTest.php (1)
tests/Provider/Form/AcceptProvider.php (1)
AcceptProvider(19-95)
tests/Form/HasMinlengthTest.php (1)
src/Form/HasMinlength.php (1)
minlength(64-81)
tests/HasNameTest.php (2)
tests/Provider/NameProvider.php (1)
NameProvider(20-86)src/HasName.php (1)
name(54-57)
tests/Form/HasCheckedTest.php (1)
tests/Provider/Form/CheckedProvider.php (1)
CheckedProvider(15-60)
tests/Form/HasMinTest.php (2)
tests/Provider/Form/MinProvider.php (1)
MinProvider(19-109)src/Form/HasMin.php (1)
min(68-71)
tests/Form/HasSizeTest.php (1)
tests/Provider/Form/SizeProvider.php (1)
SizeProvider(19-88)
tests/Form/HasAutocompleteTest.php (1)
tests/Provider/Form/AutocompleteProvider.php (1)
AutocompleteProvider(19-95)
tests/Provider/Form/MinlengthProvider.php (1)
tests/Provider/Form/MaxlengthProvider.php (1)
invalidValues(24-51)
tests/Provider/Form/MaxlengthProvider.php (1)
tests/Provider/Form/MinlengthProvider.php (1)
invalidValues(24-51)
tests/Provider/NameProvider.php (4)
tests/Provider/Form/FormProvider.php (2)
values(27-94)__toString(30-33)tests/Provider/Form/PatternProvider.php (2)
values(27-94)__toString(30-33)src/Global/HasClass.php (1)
class(68-79)tests/Provider/Form/SizeProvider.php (1)
__toString(30-33)
tests/Provider/Form/MinProvider.php (4)
tests/Provider/Form/FormProvider.php (2)
values(27-94)__toString(30-33)tests/Provider/Form/SizeProvider.php (2)
values(27-87)__toString(30-33)tests/Provider/Form/StepProvider.php (1)
__toString(30-33)tests/Provider/NameProvider.php (1)
__toString(33-36)
src/HasName.php (1)
src/HasValue.php (1)
value(60-63)
🪛 PHPMD (2.15.0)
src/Form/HasMaxlength.php
[error] 68-68: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'maxlength'. (undefined)
(StaticAccess)
tests/Form/HasMinlengthTest.php
[error] 104-104: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'testThrowInvalidArgumentExceptionForSettingInvalidMinlengthAttribute'. (undefined)
(StaticAccess)
src/Form/HasMinlength.php
[error] 67-67: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'minlength'. (undefined)
(StaticAccess)
tests/Provider/NameProvider.php
[error] 30-30: Avoid using static access to class '\PHPForge\Support\EnumDataProvider' in method 'values'. (undefined)
(StaticAccess)
tests/Form/HasMaxlengthTest.php
[error] 104-104: Avoid using static access to class '\UIAwesome\Html\Helper\Enum' in method 'testThrowInvalidArgumentExceptionForSettingInvalidMaxlengthAttribute'. (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). (7)
- GitHub Check: phpunit / PHP 8.2-ubuntu-latest
- 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: phpunit / PHP 8.2-windows-2022
- GitHub Check: linter / Super Linter
- GitHub Check: linter / Super Linter
🔇 Additional comments (70)
tests/HasNameTest.php (2)
9-14: Imports align with updated trait and provider structure.The added imports for
Stringable,Attribute, andAttributescorrectly support the expanded type signatures and attribute rendering verification.
78-89: Test assertions correctly validate both attribute storage and rendering.The dual assertions verify that the attribute is stored with the expected value and renders correctly, providing comprehensive coverage for the expanded
Stringabletype support.src/HasName.php (4)
7-9: Imports are correctly structured for the expanded type support.Adding
Stringableimport aligns with the pattern used inHasValue.phpand other similar traits in the codebase.
54-57: Method signature expansion follows established codebase patterns.The addition of
Stringableto the union type is consistent withHasValue::value()(which acceptsfloat|int|string|Stringable|UnitEnum|null) and provides flexibility for objects implementing__toString().
11-23: Documentation comprehensively covers the trait's expanded scope.The docblock accurately describes:
- All supported HTML elements that use the
nameattribute- The expanded type flexibility with
Stringablesupport- Immutability contract
45-45: No action required —MetaNameenum reference is valid.The
MetaNameenum exists at the documented namespace pathUIAwesome\Html\Attribute\Values\MetaName(defined insrc/Values/MetaName.php). The@seeannotation is accurate and the enum is actively used in the codebase without any namespace issues.CHANGELOG.md (1)
44-44: Changelog entry aligns with PR scope.src/Form/HasAccept.php (1)
5-22: Namespace relocation and doc updates look good.src/Form/HasList.php (1)
5-45: Doc clarifications and namespace move are consistent.src/Form/HasDisabled.php (1)
5-46: Namespace move and expanded documentation look solid.tests/Provider/Form/SizeProvider.php (1)
5-12: Provider namespace update matches the new Form structure.src/Form/HasDirname.php (1)
5-45: Namespace relocation and clarified dirname behavior are fine.tests/Provider/Form/ReadonlyProvider.php (1)
5-8: No action needed—copyright year is correct.The file
tests/Provider/Form/ReadonlyProvider.phpwas originally created in this repository in February 2026 (commit 296b742), not moved fromui-awesome/html-coreor another package. The 2026 copyright year accurately reflects the original creation year and should remain unchanged. The subsequent namespace move (commit 61af491) within the same repository does not alter the copyright date appropriateness.Likely an incorrect or invalid review comment.
tests/Provider/Form/MultipleProvider.php (1)
5-14: LGTM!The namespace relocation to
UIAwesome\Html\Attribute\Tests\Provider\Formand the updated docblock reference toForm\HasMultipleTestcorrectly align with the Form namespace restructuring.src/Form/HasMultiple.php (1)
5-59: LGTM!The namespace relocation to
UIAwesome\Html\Attribute\Formand the enhanced documentation clarifying usage for form control elements (<input type="email">,<input type="file">, and<select>) are well-executed. The immutable API and method implementation remain correct.tests/Form/HasMultipleTest.php (1)
5-11: LGTM!The namespace and import updates correctly align with the Form namespace restructuring. The test class properly imports
HasMultiplefromUIAwesome\Html\Attribute\FormandMultipleProviderfromUIAwesome\Html\Attribute\Tests\Provider\Form.tests/Provider/Form/StepProvider.php (2)
5-12: LGTM!The namespace relocation and updated imports correctly align with the Form namespace restructuring. The new imports for
BackedInteger,BackedString, andUnitfromPHPForge\Support\Stubenable comprehensive enum-backed value testing.
44-64: LGTM!The new enum test cases comprehensively cover
UnitEnumsupport:
BackedInteger::VALUEtests integer-backed enumsBackedString::VALUEtests string-backed enumsUnit::valuetests unit enumsThe expected rendered outputs correctly reflect the enum values.
tests/Provider/NameProvider.php (3)
5-10: LGTM!The namespace update and addition of
Stringableimport align with the broader type expansion pattern seen across the PR.
22-37: LGTM!The expanded PHPStan return type correctly includes
Stringablein the tuple, and the inlineStringableimplementation follows the established pattern used in other providers (e.g.,FormProvider,PatternProvider).
61-74: LGTM!The renamed 'string' test case and new 'stringable' test case properly validate
Stringableinput handling, consistent with the pattern established in other Form providers.src/Form/HasChecked.php (1)
5-57: LGTM!The namespace relocation to
UIAwesome\Html\Attribute\Formand enhanced documentation for checkbox/radio elements are well-executed. The clarified behavior description for form control elements improves the trait's documentation quality.tests/Form/HasListTest.php (1)
5-14: LGTM!The namespace and import updates correctly align with the Form namespace restructuring. The test class properly imports
HasListfromUIAwesome\Html\Attribute\FormandListProviderfromUIAwesome\Html\Attribute\Tests\Provider\Form.tests/Form/HasDisabledTest.php (1)
5-11: Namespace/import updates look consistent with the Form move.src/Form/HasReadonly.php (1)
5-60: Doc/namespace updates are consistent and safe.tests/Form/HasReadonlyTest.php (1)
5-11: Namespace/import updates look consistent with the Form move.src/Form/HasAutocomplete.php (1)
5-64: Doc/namespace updates are consistent and safe.src/Form/HasMax.php (1)
5-65: Doc/namespace updates are consistent and safe.src/Form/HasMinlength.php (1)
11-70: Verify Enum/Validator compatibility with external dependency ui-awesome/html-helper.The
minlength()method now acceptsUnitEnumandStringabletypes, but these rely on external helpers fromui-awesome/html-helper(^0.6). Ensure that:
Enum::normalizeValue()properly handles the normalized value type for downstream validation.Validator::intLike()acceptsStringableinputs, or add normalization:if ($value instanceof Stringable) { $value = (string) $value; }before the validation call.Check the ui-awesome/html-helper package documentation or source code to confirm compatibility.
tests/Provider/Form/DisabledProvider.php (1)
5-13: No changes needed. The copyright year 2026 in the file header is correct and matches the original creation date (January 30, 2026) when the file was first added to the repository.src/Form/HasMin.php (1)
5-53: LGTM — namespace move and doc refinements are consistent.Also applies to: 68-70
src/Form/HasPattern.php (1)
5-50: LGTM — Form namespace alignment and doc clarifications read well.Also applies to: 64-66
tests/Provider/Form/ListProvider.php (1)
5-43: LGTM — provider namespace move and added empty-string case are clear.tests/Provider/Form/AutocompleteProvider.php (1)
5-47: LGTM — Form provider updates look consistent with enum-backed test data.Also applies to: 77-77
tests/Form/HasAutocompleteTest.php (1)
5-11: LGTM — test namespace/import updates are coherent.src/Form/HasSize.php (1)
5-48: LGTM — namespace move and doc refinements are consistent.Also applies to: 83-84
tests/Form/HasSizeTest.php (1)
5-11: LGTM — Form namespace/import updates are consistent.src/Form/HasForm.php (2)
5-6: Verify original copyright year preserved after the namespace move.Since this trait was moved into the
Formnamespace, please confirm the file header keeps its original creation year rather than being updated to the current year.
Based on learnings: 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.
18-23: Doc updates look good.The expanded element list and type support clarification are consistent with the move to the Form namespace.
src/Form/HasPlaceholder.php (1)
19-25: Documentation refresh is solid.The form-control scope and placeholder behavior notes are clearer and consistent.
tests/Provider/Form/PlaceholderProvider.php (1)
5-13: Namespace alignment looks correct.Provider now matches the Form test namespace and reference.
tests/Form/HasPlaceholderTest.php (1)
5-12: Test imports updated correctly.The Form trait and provider references are consistent with the new namespaces.
src/Form/HasStep.php (1)
19-52: Doc clarification is helpful.The step semantics and supported input types are clearer without changing behavior.
src/Form/HasRequired.php (1)
17-46: Documentation updates look good.The element support and validation rules are clearer and consistent.
src/Form/HasMaxlength.php (1)
11-69: No action required.Enum::normalizeValue()is properly declared in the ui-awesome/html-helper v0.6.x dependency (as per composer.json constraint) and is correctly imported at line 11. The method exists, is static, and is consistently used throughout the codebase (HasMaxlength, HasMinlength, HasSize traits and tests).tests/Provider/Form/RequiredProvider.php (1)
5-8: Form provider namespace + docblock update is consistent.
Aligns the provider with the Form test namespace without changing behavior.tests/Form/HasRequiredTest.php (1)
5-10: Form namespace/import alignment looks good.
HasRequired and RequiredProvider now resolve to the Form paths as intended.tests/Form/HasStepTest.php (2)
5-16: Form namespace + imports are aligned.
The test now targets the Form trait/provider paths.
67-69: The PHP version constraint in composer.json is^8.1, which fully supports the use ofUnitEnumin the method signature. No version compatibility issues exist.tests/Form/HasMinTest.php (2)
5-16: Form namespace/import updates look consistent.
HasMin and MinProvider now reference the Form namespace as expected.
67-69: PHP version constraint is correctly configured. Thecomposer.jsonalready requires"php": "^8.1", which fully supportsUnitEnumin type hints. No changes needed.tests/Form/HasMinlengthTest.php (1)
5-17: Form namespace/import updates look consistent.
Trait/provider paths and helper imports are aligned with the Form namespace.tests/Provider/Form/MinlengthProvider.php (1)
5-75: Minlength provider enum coverage looks consistent.
BackedInteger/BackedStringfromphp-forge/supportare available inrequire-devas^0.3, so the test suite has the stub enums needed for these test cases.tests/Provider/Form/MinProvider.php (1)
5-99: Dependency verified and code looks good.The
php-forge/supportpackage is present inrequire-dev(^0.3), correctly supporting the newBackedStringandUnitenum-backed test cases used in this provider.tests/Form/HasAcceptTest.php (1)
5-11: LGTM!Namespace and import updates are correctly aligned with the Form sub-namespace relocation. The test structure maintains consistency with the provider's data types and the relocated
HasAccepttrait.tests/Provider/Form/PatternProvider.php (1)
5-12: LGTM!Namespace updated correctly to
Provider\Form, and the docblock reference properly points to the relocatedForm\HasPatternTest. The data provider structure is well-organized with comprehensive test cases for pattern attribute handling.tests/Form/HasDirnameTest.php (1)
5-11: LGTM!Namespace and imports are correctly updated to reference the Form sub-namespace. The test structure is consistent with other Form attribute tests in this PR.
tests/Form/HasFormTest.php (1)
5-11: LGTM!Namespace and imports correctly relocated to the Form sub-namespace. Test structure maintains consistency with the broader Form attribute test suite.
tests/Provider/Form/CheckedProvider.php (1)
5-8: LGTM!Namespace and docblock reference correctly updated to the Form sub-namespace. The data provider appropriately handles boolean attribute semantics with proper test coverage for
true,false,null, replacement, and unset scenarios.tests/Form/HasMaxTest.php (2)
5-15: LGTM!Namespace and imports are correctly updated. The addition of
StringableandUnitEnumimports properly supports the expanded type signatures in the test method parameters, aligning with theHasMaxtrait's method signature.
66-72: LGTM!The expanded type hints
float|int|string|Stringable|UnitEnum|nullcorrectly match both theHasMax::max()method signature and theMaxProvider::values()return type, ensuring comprehensive test coverage for all supported input types.tests/Provider/Form/AcceptProvider.php (2)
5-12: LGTM!Namespace and imports are correctly updated. The switch to
PHPForge\Support\Stub\BackedStringand the docblock reference toForm\HasAcceptTestproperly align with the Form namespace relocation.
44-49: LGTM!The data key rename from
'enum backed'to'enum backed string'improves clarity and maintains consistency with other providers in this PR (e.g.,PatternProvider). TheBackedString::VALUEusage is correct.tests/Provider/Form/DirnameProvider.php (1)
5-12: LGTM!Namespace and docblock reference correctly updated to align with the Form namespace migration.
tests/Form/HasPatternTest.php (1)
5-11: LGTM!Namespace and imports correctly updated to reference the Form namespace. The type signatures in test methods properly align with the expanded
PatternProviderreturn types.tests/Form/HasCheckedTest.php (1)
5-10: LGTM!Namespace and imports correctly updated to reference the Form namespace. The test structure and type signatures properly align with the
CheckedProviderdata structure.tests/Provider/Form/FormProvider.php (1)
5-7: LGTM!Namespace correctly updated to Form namespace. The new enum test cases (
enum backed stringandenum unit) follow the established pattern and provide proper coverage forUnitEnuminput handling.Also applies to: 44-57
tests/Provider/Form/MaxProvider.php (1)
5-9: LGTM!Namespace correctly updated to Form namespace. The expanded PHPStan type annotations and new test cases (
enum backed string,enum unit,stringable) provide comprehensive coverage forStringableandUnitEnuminputs.Also applies to: 22-25, 44-99
tests/Form/HasMaxlengthTest.php (1)
5-17: LGTM!Namespace and imports correctly updated to reference the Form namespace with proper
UnitEnumsupport.tests/Provider/Form/MaxlengthProvider.php (1)
5-9: LGTM!Namespace correctly updated to Form namespace. The expanded type annotations and new test cases properly cover
UnitEnumhandling:
invalidValues()correctly includesBackedString::VALUEas an invalid case (non-numeric enum value).values()correctly includesBackedInteger::VALUEas a valid case resolving to integer1.This aligns with the parallel
MinlengthProviderstructure.Also applies to: 22-29, 53-75
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Pull Request