Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Update dependency rector/rector to ^0.17.0 #714

Merged
merged 1 commit into from
Jun 3, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 3, 2023

Mend Renovate

This PR contains the following updates:

Package Type Update Change
rector/rector (source) require-dev minor ^0.16.0 -> ^0.17.0

Release Notes

rectorphp/rector

v0.17.0: Released Rector 0.17

Compare Source

Preparing for Rector 1.0

In this release, we focus on architecture improvements before reaching Rector 1.0. We want to lower the memory usage and make Rector run faster.

This include removing next/previous nodes - this will most likely not affect you, as Rector rules were upgraded, but if you do you use them, switch to StmtsAwareInterface instead

We follow PHPStan 1.6 move from April 2022, where you can learn more: https://phpstan.org/blog/preprocessing-ast-for-custom-rules

  • Replace NodeConnectingVisitor with ParentConnectingVisitor (#​3900)

To see how to refactor to StmtsAwareInterface, check these PRs:

  • Remove NEXT_NODE dependency in ChangeAndIfToEarlyReturnRector, narrow to only closed scope function likes (#​3913)
  • Remove NEXT_NODE from SimplifyIfReturnBoolRector (#​3915)
  • [DeadCode] Remove next attribute on RemoveUnusedVariableAssignRector ([#​3917](https://github.com/rectorphp/
  • [CodingStyle] Refactor CatchExceptionNameMatchingTypeRector to use StmtsAwareInterface (#​3788)

Add/remove nodes directly 👍

The next improvement focuses on explicit node adding/removal. Thanks to StmtsAwareInterface we can add nodes directly. This makes Rector refactor() method contain all the code you need.

  • Cleanup usage of NodesToAddCollector, return nodes directly instead (#​4003)
  • Cleanup removeNodeFromStatements(), removeArg(), removeParam(), removeStmt() methods and remove nodes directly (#​4012)
  • Remove unused addNodeAfterNode(), return nodes instead (#​4023)
  • Remove unused method addNodesBeforeNode() (#​4024)

New Features 🥳

  • [PHP 7.0] Add IfIssetToCoalescingRector (#​3878)
  • Support attributes in RemoveFinalFromEntityRector (#​3727), Thanks @​alexndlm!
  • Add SwapMethodCallArgumentsRector (#​3726), Thanks @​gaydamakha!
  • [CodeQuality] Add CleanupUnneededNullsafeOperatorRector (#​3767)
  • Make ReturnNeverTypeRector work with type declaration, add it to PHP 8.1 set (#​3852)
  • [TypeDeclaration] Add BoolReturnTypeFromStrictScalarReturnsRector (#​3898)
  • Make ChangeGlobalVariablesToPropertiesRector add properties directly, remove Nette inject methods (#​3957)
  • Utilize MinPhpVersionInterface in more rules (#​3752), Thanks @​staabm!
  • Dump dependency container and re-use it - 35% faster test-suite (#​3809), Thanks @​staabm!
  • Defer type-resolving in RemoveJustPropertyFetchRector (#​3761), Thanks @​staabm!

Bugfixes 🐛

  • [TypeDeclaration] Skip Arg unpack on AddMethodCallBasedStrictParamTypeRector (#​3787)
  • [CodeQuality] Add typed property support to IssetOnPropertyObjectToPropertyExistsRector (#​3876)
  • [CodeQuality] Skip non-array type on SimplifyForeachToArrayFilterRector (#​3738)
  • Fix ShortenedObjectType not resolving to correct class reflection (#​3397), Thanks @​jackbentley!
  • Extend code-quality set (#​3773)
  • Don't neon-decode phpstan configs over and over again (#​3796), Thanks @​staabm!
  • [Console] Allow https url instead of git:// on SetupCICommand (#​3799)
  • Fix integer range phpdoc types being treated as useless (#​3825), Thanks @​jlherren!
  • Fix nullable param in ClassPropertyAssignToConstructorPromotionRector (#​3842)
  • Fix PrivatesAccessor: use selectFromArgs() instead (#​3923), Thanks @​staabm!

Removed rules 💀

We've also remove bunch of rules, that were added in early days of Rector for demo purposes. They were not used as of any set for non-reliable cases. PHPStan and coding standards replace some of those.

  • [CodeQuality] Remove ForToForeachRector, as overly deatiled and not reliable (#​3747)
  • [CodeQuality] Remove SimplifyIfExactValueReturnValueRector, as overly defensive + InlineSimplePropertyAnnotationRector as purely coding standard area (#​3764)
  • [CodingStyle] Remove RemoveDoubleUnderscoreInMethodNameRector, as naming is not handled for breaking reasons (#​3765)
  • Remove RemoveUnusedVariableAssignRector, as could be breaking code in order of excution and hard to do reliable (#​3793)
  • [CodingStyle] Remove ConsistentPregDelimiterRector as not much practical, importance of regex is a testing it matches expectationg, area of static analysis (#​3797)
  • Remove ToStringToMethodCallRector as not practical and only for demo, FalseReturnClassMethodToNullableRector, as requires detailed custom refactoring (#​3854)
  • Remove ChangeOrIfReturnToEarlyReturnRector as makes code harder to read by duplication, rather use PHSPtan and extract method (#​3916)
  • [DeadCode] Remove RemoveDuplicatedIfReturnRector as can lead to unexpeced consequences, better use static analysis and contextual handling (#​3926)
  • [DeadCode] Remove RemoveDuplicatedInstanceOfRector as hardly practical (#​3936)
  • [CodeQuality] Remove ExplicitMethodCallOverMagicGetSetRector designed for nette smart object migration only, not useful for general projects (#​3948)
  • Remove GetAndSetToMethodCallRector, as not practical and used for single legacy job (#​3953)
  • Remove ChangeReadOnlyVariableWithDefaultValueToConstantRector overly complex and risky, better job for PHPStan (#​3954)
  • Remove IsObjectOnIncompleteClassRector as blindly turns all incomplete checks to negated, better examine manually (#​3969)
  • Remove ReservedObjectRector as requires explicit configuration and is handled by RenameClassRector already (#​3975)
  • Remove ChangeReadOnlyPropertyWithDefaultValueToConstantRector as overly detailed checks, better use PHPStan and refactor individually (#​4028)
  • Remove NewToMethodCallRector as unused core and no other extension, niche to use, better handle by PHPStorm (#​4029)
  • [CodingStyle] Remove AddFalseDefaultToBoolPropertyRector, as works with unrelaible docblocks (#​3856)
  • Remove UpdateFileNameByClassNameFileSystemRector niche rule that was added just for example sake (#​3849)
  • [Transform] Remove ArgumentFuncCallToMethodCallRector as never used (#​3774)
  • [Transform] Remove DimFetchAssignToMethodCallRector as unused (#​3775)
  • [Transform] Remove FileGetContentsAndJsonDecodeToStaticCallRector as only for demo purposes (#​3776)
  • [Transform] Remove MethodCallToAnotherMethodCallWithArgumentsRector as unused (#​3777)
  • [CodeQuality] Remove SimplifyUselessLastVariableAssignRector as overly complex and should be handled individually (#​3784)
  • Remove AddPregQuoteDelimiterRector as very narrow area and has not context awareness, better handle manually (#​3927)
  • Remove TokenGetAllToObjectRector, as rare to use and leaky to handle, better handle in controller manual way (#​4001)
  • Remove ChangeReflectionTypeToStringToGetNameRector as niche and overly detailed, better refactor reflectio na as a whole (#​3976)
  • Remove RenameNamespaceRector, better handle by IDE or explicit RenameClassRector (#​3979)
  • [CodeQuality] Deprecate NarrowUnionTypeDocRector as focused on docblocks, and moving to type declarations (#​3848)
  • Remove MakeTypedPropertyNullableIfCheckedRector as old fix of TypedPropertyRector rule, removed months ago (#​3851)
  • [PHP 8.0] Deprecate old UnionTypesRector that is dangerously moving docblocks, use type declaration rules instead (#​3846)
  • [CodingStyle] Remove OrderAttributesRector, as rather coding standard and does not have specific PSR example (#​3838)
  • Remove unused PregMatchTypeCorrector, the 3rd param in preg_match_* is now handled natively by PHPStan (#​3824)
  • [Restoration] Remove RemoveFinalFromEntityRector as used only to revert very old Rector bug (#​3847)

Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), 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 has been generated by Mend Renovate. View repository job log here.

@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (c9c0e09) 8.65% compared to head (be01099) 8.65%.

Additional details and impacted files
@@           Coverage Diff           @@
##              main    #714   +/-   ##
=======================================
  Coverage     8.65%   8.65%           
  Complexity      58      58           
=======================================
  Files           18      18           
  Lines          208     208           
=======================================
  Hits            18      18           
  Misses         190     190           
Flag Coverage Δ
unittests 8.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@renovate renovate bot force-pushed the renovate/rector-rector-0.x branch from 9012cb1 to be01099 Compare June 3, 2023 07:57
@gomzyakov gomzyakov merged commit c6bd2d0 into main Jun 3, 2023
@gomzyakov gomzyakov deleted the renovate/rector-rector-0.x branch June 3, 2023 08:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant