[ComposerBased] Add JMS attribute rules to set, bond three attribute rules to package versions - #1029
Merged
Merged
Conversation
…composer-based set Bond InvokableCommandInputAttributeRector to symfony/console >=7.3, AccessorAnnotationToAttributeRector and AccessTypeAnnotationToAttributeRector to jms/serializer >=3.14.
Still risky to run unattended; version bonding stays on the rule.
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.
Two JMS attribute-migration rules were missing from the composer-based Symfony set, and three attribute rules declared no
ComposerPackageConstraintInterfaceat all. This adds the bonding to all three, and registers the two JMS rules in the set.Versions were verified against the upstream tags, not guessed — see Version sources below.
AccessorAnnotationToAttributeRector—jms/serializer >=3.14use JMS\Serializer\Annotation\Accessor; class User { - /** - * @Accessor("getValue") - */ + #[Accessor(getter: 'getValue')] private $value; }AccessTypeAnnotationToAttributeRector—jms/serializer >=3.14InvokableCommandInputAttributeRector—symfony/console >=7.3, bonded but not registeredThis rule gets the version constraint, but is deliberately left out of the composer-based set — the transformation is still too risky to hand to everyone running the set unattended:
It stays opt-in via a direct
$rectorConfig->rule()call, and now correctly skips itself onsymfony/consolebelow 7.3.Version sources
symfony/console—Attribute/Argument.phpis absent at tagv7.2.0and present atv7.3.0.jms/serializer—Accessor.phpandAccessType.phpgain their#[\Attribute(...)]declaration between tags3.13.0and3.14.0, from Add PHP attributes support schmittjoh/serializer#1332 and #1337 (merged 1–5 Aug 2021, released in 3.14.0 on 6 Aug 2021).Notes
config/sets/jms/annotations-to-attributes.phpas well, so the standalone JMS set keeps working for non-Symfony users.config/composer.jsonplus aprovideComposerJsonFilePath()override, matching the existing bonded rules — neither package is inrequire-dev, so the version is read from the test's owncomposer.json. Verified the gate is live: dropping the JMS test constraint to^3.13makes both fixtures fail, as expected.