Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Update dependency rector/rector to v2 #81

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 14, 2024

This PR contains the following updates:

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

Release Notes

rectorphp/rector (rector/rector)

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

But we've few pretty cool features like composer-based sets and --only option as well. See release notes bellow.


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: Enabled.

Rebasing: Whenever PR is behind base branch, 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.

Copy link
Contributor Author

renovate bot commented Dec 14, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: composer update rector/rector:2.0.6 --with-dependencies --ignore-platform-req='ext-*' --ignore-platform-req='lib-*' --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins
Loading composer repositories with package information
Dependency phpstan/phpstan is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires rector/rector ^2.0.0 -> satisfiable by rector/rector[2.0.6].
    - rector/rector 2.0.6 requires phpstan/phpstan ^2.1.1 -> found phpstan/phpstan[2.1.1] but it conflicts with your root composer.json require (^1.10).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

@renovate renovate bot force-pushed the renovate/rector-rector-2.x branch 5 times, most recently from 35ca414 to 92514f0 Compare December 19, 2024 19:35
@renovate renovate bot force-pushed the renovate/rector-rector-2.x branch 5 times, most recently from 6d90452 to fd639a1 Compare December 31, 2024 12:35
@renovate renovate bot force-pushed the renovate/rector-rector-2.x branch from fd639a1 to 359f1f1 Compare January 6, 2025 05:21
@renovate renovate bot force-pushed the renovate/rector-rector-2.x branch 2 times, most recently from 21cdc51 to 342ffe8 Compare January 17, 2025 01:19
@renovate renovate bot force-pushed the renovate/rector-rector-2.x branch from 342ffe8 to 7ae1e58 Compare January 17, 2025 05:42
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.

0 participants