Cleanup deprecation notices and clean up code inline with php8.1#63
Merged
frankdekker merged 15 commits intomasterfrom Dec 17, 2025
Merged
Conversation
frankdekker
commented
Nov 30, 2025
There was a problem hiding this comment.
Pull request overview
This PR modernizes the codebase to align with PHP 8.1+ standards and removes Symfony deprecation notices in preparation for Symfony 8 compatibility. The primary breaking change is the refactoring of InConstraint constructor to accept values as a direct parameter instead of through the options array.
Key changes include:
- Refactored
InConstraintto use a modern constructor signature compatible with Symfony 8 - Modernized PHP syntax using typed properties, constructor property promotion, union types, and match expressions
- Updated CI/CD matrix to test against PHP 8.4 and Symfony 8.0
- Removed obsolete type safety test that's now handled by PHP's type system
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Constraint/Type/InConstraint.php | Refactored constructor to accept $values as first parameter instead of options array, compatible with Symfony 8 |
| src/Constraint/Type/InConstraintValidator.php | Updated validate method signature with mixed type hint |
| src/Constraint/Type/IntegerNumberValidator.php | Updated validate method signature with mixed type hint |
| src/Constraint/Type/FloatNumberValidator.php | Updated validate method signature with mixed type hint |
| src/Constraint/Type/BooleanValueValidator.php | Updated validate method signature with mixed type hint |
| src/Constraint/ConstraintResolver.php | Updated InConstraint instantiation to use new constructor signature |
| src/Constraint/ConstraintMapItem.php | Modernized with constructor property promotion |
| src/Constraint/ConstraintMap.php | Added typed property declaration |
| src/Constraint/ConstraintCollectionBuilder.php | Added typed properties and return types |
| src/ConstraintFactory.php | Refactored with constructor property promotion using readonly properties |
| src/Rule/Rule.php | Modernized with constructor property promotion |
| src/Rule/RuleParser.php | Updated type hints, replaced switch with match expression, used str_contains() |
| src/Rule/RuleList.php | Added typed properties and modern union type hints |
| src/Utility/Arrays.php | Improved array type documentation with int|string keys |
| tests/Unit/Constraint/Type/InConstraintTest.php | Updated test to use new constructor signature |
| tests/Unit/Constraint/Type/InConstraintValidatorTest.php | Updated tests with typed properties and new constructor |
| tests/Unit/Constraint/Type/IntegerNumberValidatorTest.php | Modernized with typed properties and union type parameters |
| tests/Unit/Constraint/Type/FloatNumberValidatorTest.php | Modernized with typed properties and union type parameters |
| tests/Unit/Constraint/Type/BooleanValueValidatorTest.php | Modernized with typed properties, union types, and removed unused import |
| tests/Unit/Constraint/ConstraintResolverTest.php | Updated test expectations for new InConstraint constructor |
| tests/Unit/Constraint/ConstraintMapItemTest.php | Cleaned up by inlining boolean literal |
| tests/Unit/ConstraintFactoryTest.php | Removed unnecessary false parameter (uses default value) |
| tests/Unit/Rule/RuleParserTest.php | Removed obsolete type safety test, updated property types |
| tests/Unit/Utility/ArraysTest.php | Improved PHPDoc with explicit int|string array keys, fixed grammar |
| tests/Integration/FieldValidationTest.php | Modernized with typed properties and union type parameters |
| tests/Integration/AbstractIntegrationTestCase.php | Added typed properties and modern union types |
| .github/workflows/test.yml | Added PHP 8.4, 8.5 and Symfony 8.0 to test matrix |
| phpstan-baseline.neon | Updated baseline for improved array type specificity |
Comments suppressed due to low confidence (1)
.github/workflows/test.yml:56
- PHP 8.5 does not exist as of January 2025. The current PHP versions are 8.1, 8.2, 8.3, and 8.4. This will cause the coverage job to fail. Consider using PHP 8.4 instead.
steps:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frankdekker
commented
Dec 16, 2025
bram123
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change: yes
Fixes: #57
As of Symfony 8. the $options argument of Constraint is no longer used.
InConstrainthowever still uses this constructor to fill thevaluesargument.Changed
InConstraintconstructor to requirevaluesparameter.