Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency rector/rector to v2 #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 12, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
rector/rector (source) ~1.2.7 -> ~2.0.0 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

v2.0.6

Compare Source

v2.0.5: Released: Rector 2.0.5

Compare Source

This release support PHP-Parser 5.4.0 and PHPStan 2.1.0

Feature

  • Bump to PHP-Parser ^5.4.0 with use patches fix-patch-php-parser-54 patches (#​6637)
  • Bump to PHPStan ^2.1.0 (#​6639)
  • [DeadCode] Allow remove useless @​ var on typed class constant as well on RemoveUselessVarTagRector (#​6633)

Removed 💀

  • Remove unused AssignVariableNameResolverInterface instances (#​6631)

Bugfixes 🐛

  • [DX] Warn about ->withPhpSets() called multiple times, to avoid invalid set mix (#​6632)
  • [CodeQuality] Skip fopen() or die() on LogicalToBooleanRector on assign (#​6635)
  • use vendor-patches main branch that already include php-parser 5.4.0 patch (#​6638)

v2.0.4: Released Rector 2.0.4

Compare Source

New Features 🥳

  • [PHP 8.0] Add lcfirst annotation to attribute support (#​6577)
  • Add multiline comment fixture (#​6580)
  • [TypeDeclaration] Add param type to array map closure (#​6377), Thanks @​peterfox!
  • [deprecation] Add message about deprecated MixedTypeRector rule, Remove deprecated SetListInterface as no longer used (#​6590)
  • [Php81][php82] Add AttributeGroupNewLiner to make new line based on token on ReadOnlyPropertyRector and ReadOnlyClassRector (#​6618)
  • [Php84] Add rule for RoundingMode enum (#​6369), Thanks @​jorgsowa!

Bugfixes 🐛

  • [dx] polyfill sets is running out of the box in php sets (#​6591)
  • [phpstan] Fix var assumed ignored errors (#​6571)
  • [phpstan] fix next ingored errors (#​6572)
  • [CodeQuality] Handle crash on property hook on OptionalParametersAfterRequiredRector (#​6575)
  • [PHP 8.0] Make AnnotationToAttributeRector return after 1st newline without slash (#​6578)
  • [Php80] Fix end slash regex on AttributeValueResolver (#​6579)
  • Fix annotation on doctrine one (#​6582)
  • [Comments] Move left over clean empty doc handling to DocBlockUpdater (#​6584)
  • fix: replace getKey method for name property (#​6583), Thanks @​carlosvinicius!
  • fix: replace getKey/getValue methods when enum is a variable (#​6585), Thanks @​carlosvinicius!
  • [Php80] Handle comment multi line on AttributeValueResolver (#​6586)
  • [Php80] Use more proper check for doc comment multi lines on AttributeValueResolver (#​6587)
  • [Php80] Handle value as argument with keep description as comment on AttributeValueResolver (#​6589)
  • withRootFiles now apply rector for dotfiles too (#​6592), Thanks @​andrew-demb!
  • 📦 Ignore .phpstorm.meta.php because this is not PHP file (#​6594), Thanks @​andrew-demb!
  • [Php81] Skip reassign on array destruct on ReadOnlyPropertyRector (#​6596)
  • [Php80] Handle crash on multi next stmts on ChangeSwitchToMatchRector (#​6597)
  • [CodingStyle] Handle crash on pass args on CallUserFuncToMethodCallRector (#​6598)
  • [Php81] Skip with next required on NewInInitializerRector (#​6599)
  • Move FunctionLike reindex under StmtsAwareInterface on NodeAttributeReIndexer (#​6605)
  • [DeadCode] Skip value variable used in throw stmts in catch on UnusedForeachValueToArrayKeysRector (#​6607)
  • Revert "[Php80] Keep numeric string as is on StringAnnotationToAttributeMappe…" (#​6609)
  • [Php54] Use token base replace on LongArrayToShortArrayRector (#​6616)
  • [Performance] Only register WrappedNodeRestoringNodeVisitor() when there is found AlwaysRememberedExpr or Match_ node on processNodes() (#​6620)
  • [Fix] Renamed gzwrites (undefined function) to gzwrite (#​6622), Thanks @​Vqcheslav!
  • [FunctionLike] Skip return by ref with switch on SimplifyUselessVariableRector (#​6623)
  • Rollback SimpleCallableNodeTraverser usage on ByRefReturnNodeVisitor (#​6624)
  • [TypeDeclaration] Skip assign on while cond on WhileNullableToInstanceofRector (#​6628)
  • [TypeDeclaration] Skip assign in if condition on BinaryOpNullableToInstanceofRector (#​6629)
  • Clean up ignore phpstan errors (#​6630)
  • [DeadCode] Skip @​return positive-int|0 on RemoveUselessReturnTagRector (#​6576)
  • [DeadCode] Skip key variable used in throw stmts in catch on RemoveUnusedForeachKeyRector (#​6606)

Removed 💀

  • Remove TypeNormalizer as type comparison is handled well by PHPStan (#​6570)
  • Removed unused method ClassChildAnalyzer-> hasParentClassMethod() (#​6595), Thanks @​staabm!
  • [Experiment] Remove WrappedNodeRestoringNodeVisitor (#​6626)

v2.0.3

Compare Source

v2.0.2

Compare Source

v2.0.1

Compare Source

v2.0.0: Released Rector 2.0

Compare Source

Rector 2.0 is here 🥳

The main purpose of this release is performance improvements, thanks to modern dependencies:

  • php-parser 4.x to 5.0
  • PHPStan 1.x to 2.0
  • and min PHP version 7.2 to 7.4 because of dependencies above

We've managed to fit in couple cool features: 5 New Features in Rector 2.0


For custom rules writers, see upgrading guide. The rest of upgrade is straighforward 🎉


To celebrate the upgrade, we're also modernized our logo! 🤩


New Features and Improvements 🎉

  • Add "--only" option to process only a single rule (#​6441), Thanks @​cweiske!
  • [DX] Add version-based set loading based on installed package version (#​6428)
  • [dx] enable polyfills by default when PHP is on, to make config simpler (#​6433)
  • [dx] enable all attributes, if none are selected to streamline config (#​6451)
  • feat: add the option to use the annotation value as an argument to the attribute (#​6468), Thanks @​carlos-granados!
  • feat: add Behat annotations to attributes set (#​6510), Thanks @​carlos-granados!

Deprecated and Removed 💀

  • [deprecation] Deprecate AbstractScopeAwareRector in favor of single AbstractRector (#​6425)
  • [deprecation] Deprecate MixedTypeRector, to avoid mixed type filled blindly, use type declaration set instead (#​6434)
  • [docs] getRuleDefinition() no longer required for custom rules (#​6440)
  • [deprecation] Remove deprecated PublicConstantVisibilityRector, cleanup deprecated SetListInterface (#​6424)
  • [deprecated] Remove deprecated AbstractTestCase (#​6426)

Bugfixes 🐛

  • [Php80] Returns null on no change on ClassPropertyAssignToConstructorPromotionRector (#​6418)
  • [attributes] Make sure the target attribute class exists (#​6454)
  • [TypeDeclaration] Skip test methods with exception in ReturnNeverTypeRector, [php74] Skip conditinal assign in RestoreDefaultNullToNullableTypePropertyRector as most likely desired to assign or fail (#​6430)
  • Support php-64bit as required in composer.json (#​6432), Thanks @​hans-thomas!
  • [dx] Allow external rules without getRuleDefinition() to make them easier to write (#​6438)
  • [fix] class phpdoc generic method (#​6439), Thanks @​lammafish!
  • Fix RemoveDoubleAssignRector in case of method call (#​6442)
  • Upgrade to PHPParser 5 and PHPStan 2 (#​6431)
  • [CodeQuality] Handle crash on return array constant on ExplicitReturnNullRector (#​6458)
  • [Php80] Handle crash single quoted doctrine on AnnotationToAttributeRector (#​6459)
  • [Php71] Skip already array destruct on ListToArrayDestructRector (#​6460)
  • [TypeDeclaration] Skip mixed as on right of and on ParamTypeByMethodCallTypeRector (#​6401)
  • [Renaming] Fix space on union docblock during rename on RenameClassRector (#​6463)
  • [CodeQuality] Skip used by array callable on LocallyCalledStaticMethodToNonStaticRector (#​6473)
  • [CodeQuality] Skip compare nullable object on UseIdenticalOverEqualWithSameTypeRector (#​6474)
  • Use Type->getIterableValueType() over ArrayType-> getItemType() (#​6479), Thanks @​staabm!
  • [DeadCode] Allow remove assign variable with next method call on RemoveDoubleAssignRector (#​6443)
  • [DeadCode] Handle InterpolatedStringPart crash on RemoveUnusedForeachKeyRector (#​6457)
  • [DeadCode] Skip used by get_object_vars() when implements JsonSerializable on RemoveUnusedPromotedPropertyRector (#​6472)
  • [DeadCode] Handle crash on valid conditional type on RemoveUselessReturnTagRector (#​6475)
  • Use Type->getIterableKeyType() over ArrayType->getKeyType() (#​6480), Thanks @​staabm!
  • Update developing with docker: Fix php version to 8.2. (#​6490), Thanks @​uncaught!
  • [Renaming] Handle docblock aliased rename on RenameClassR* [Php81] Allow not readonly property on API Platform api resource (#​6531), Thanks @​alexndlm!
    ector (#​6498)
  • [CodeQuality][Renaming] Handle DynamicDocBlockPropertyToNativePropertyRector+RenameClassRector with aliased name (#​6506)
  • [TypeDeclaration] Skip with default value and assigned mixed on TypedPropertyFromAssignsRector (#​6514)
  • [Php80] Mirror comments on assign on ChangeSwitchToMatchRector (#​6516)
  • [Php70] Handle parent method call on Php4ConstructorRector (#​6519)
  • [Php70] Do not replace if method call if method exists in current class on call same method with parent on Php4ConstructorRector (#​6520)
  • [PostRector] Keep first comment before first Use_ on UnusedImportRemovingPostRector (#​6522)
  • [Php81] Allow not readonly property on API Platform api resource (#​6531), Thanks @​alexndlm!
  • [Php81] Skip by ref param on ReadOnlyPropertyRector (#​6532)
  • [Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBracesRector (#​6533)
  • Fix fixture end ] fixture on NestedAnnotationToAttributeRector (#​6537)
  • [Php80] Handle mix quote single and double on AnnotationToAttributeRector (#​6538)
  • [CodeQuality] Handle crash on yield from on OptionalParametersAfterRequiredRector (#​6545)
  • Fix str_contains() never returns 0 (#​6546)
  • [CodeQuality] Handle crash on unary minums on OptionalParametersAfterRequiredRector (#​6547)
  • [CodeQuality] Handle crash on assign ref on OptionalParametersAfterRequiredRector (#​6551)
  • [Attributes] Cover slash newline in AnnotationToAttributeRector with values (#​6557)
  • [TypedPropertyFromAssignsRector] Handle parse_url() native function with second arg on TypedPropertyFromAssignsRector (#​6562)
  • [TypeDeclaration] Handle default value with contant type on TypedPropertyFromAssignsRector (#​6563)
  • [NodeTypeResolver] Handle namespaced function call name on NodeTypeResolver (#​6564)

rectorphp/rector-symfony 🎵

  • Fill listener method name, based on kernel.x event name in EventListenerToEventSubscriberRectory (#​694)
  • [scoped] Fix scoped prefixed UrlGeneratorInterface on RedirectToRouteRector (#​692)
  • [DependencyInjection] Add GetBySymfonyStringToConstructorInjectionRector (#​688)
  • [DependencyInjection] Add TraitGetByTypeToInjectRector (#​687)
  • [DependencyInjection] Extract CommandGetByTypeToConstructorInjectionRector to make migration smoother (#​686)
  • [DependencyInjection] Extract GetByTypeMethodCallToConstructorInjectionRector to make migration smoother (#​685)
  • [Symfony 7.2] Add SetList (#​684), Thanks @​alamirault
  • Upgrade deprecated ScopeAware to AbstractRector (#​680)
  • Fix twig 2.40 set to 2.4 (#​678)
  • [deprecation] Remove deprecated rules (#​677)
  • Remove deprecated set list marker (#​676)

rectorphp/rector-doctrine 🟠

  • [deprecation] Remove deprecated AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector, InitializeDefaultEntityCollectionRector, TypedPropertyFromDoctrineCollectionRector (#​347)

rectorphp/rector-phpunit 🟢

  • [PHPUnit] Support list in YieldDataProviderRector (#​418), Thanks @​staabm
  • [Phpunit] Avoid reprint doc for remove/replace when no @​return tag on YieldDataProviderRector (#​417)
  • [PHPUnit] Add missing DocblockUpdater usage on YieldDataProviderRector when removing @​return doc (#​416)
  • [PHPUnit] Change @​return array<> to @​return Iterator<> on YieldDataProviderRector (#​415)
  • [CodeQuality] Handle createMock as well in PreferPHPUnitThisCallRector (#​407)
  • [fix] Keep original message in AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector (#​406)
  • [PHPUnit 10] Remove AssertIssetToAssertObjectHasPropertyRector (#​405)
  • [CodeQuality] Skip possible data provider method called and used as array on YieldDataProviderRector (#​404)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants