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 v1 #17

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 6, 2024

Mend Renovate

This PR contains the following updates:

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

Release Notes

rectorphp/rector (rector/rector)

v1.0.5: Released Rector 1.0.5

Compare Source

New Features πŸ₯³

  • [TypeDeclarations] Add IncreaseDeclareStrictTypesRector to raise level of declare() coverage (#​5849)

Bugfixes πŸ›

  • ExplicitReturnNullRector should skip never return (#​5802), Thanks @​staabm!
  • Make Compatible with phpstan 1.11.x code (#​5804)
  • [CodeQuality] Skip Always return in try catch with finally on ExplicitReturnNullRector (#​5807)
  • [CodeQuality] Skip never type on default switch on ExplicitReturnNullRector (#​5808)
  • [CodeQuality] Skip while(true) always returned on ExplicitReturnNullRector (#​5810)
  • [TypeDeclaration] Skip maybe not returned on while on ReturnUnionTypeRector (#​5812)
  • [Php81] Skip on property and class const on FirstClassCallableRector (#​5813)
  • [Php81] Skip __invoke() usage from non-class code on FirstClassCallableRector (#​5816)
  • [Php81] Skip always string if else DomElement on NullToStrictStringFuncCallArgRector (#​5822)
  • [TypeDeclaration] Handle crash on @​mixin usage on ReturnTypeFromStrictTypedCallRector (#​5823)
  • [Php81] Skip mixed type on ArrayDimFetch on NullToStrictStringFuncCallArgRector (#​5826)
  • Fix original quotes in PregReplaceEModifierRector (#​5827)
  • [CodeQuality] Skip $counter variable exists on ForRepeatedCountToOwnVariableRector (#​5828)
  • [Php81] Use PHPStan ParametersAcceptor to detect allowed argument types on NullToStrictStringFuncCallArgRector (#​5829)
  • [Renaming] Skip func call name on RenameClassRector (#​5833)
  • Support NullSafeMethod calls in unused-code analysis (#​5838), Thanks @​staabm!
  • Support NullSafeProperty fetches in unused-code analysis (#​5839), Thanks @​staabm!
  • Ignore phpdoc type in RecastingRemovalRector (#​5841), Thanks @​staabm!
  • [Naming] Skip DateTime as individual in name resolver (#​5842)
  • [Experiment] Rework child classes detection on DynamicSourceLocatorProvider (#​5735)
  • [Printer] Handle Strip left spaces from opening tags on namespaced PHP + HTML content (#​5851)
  • [CodeQuality] Fix tautology transformation on identical check on SimplifyTautologyTernaryRector (#​5854)
  • [CodeQuality] Skip dynamic second arg or has uppercase second arg on SimplifyStrposLowerRector (#​5855)
  • [NodeTypeResolver] Use existing DefaultReflector::reflectAllClasses() method on DynamicSourceLocatorProvider (#​5856)
  • [EarlyReturn] Skip with AssignOp on PreparedValueToEarlyReturnRector (#​5857)
  • [TypeDeclaration] Handle array with index assigned on TypedPropertyFromAssignsRector (#​5861)
  • [TypeDeclaration] Handle return by array shape type on AddArrowFunctionReturnTypeRector (#​5815)
  • [CodeQuality] Add Function_ and FuncCall support on OptionalParametersAfterRequiredRector (#​5835)
  • [Php83] Handle default native constant on AddTypeToConstRector (#​5843)
  • [PHP 7.2] Add error suppres support to each() rule (#​5844)
  • [TypeDeclaration] Skip more detailed type on AddMethodCallBasedStrictParamTypeRector (#​5866)
  • [DeadCode] Skip $this instanceof in Trait on RemoveAlwaysTrueIfConditionRector (#​5817)
  • [DeadCode] Skip $this in trait on RemoveDeadInstanceOfRector (#​5818)

v1.0.4: Released Rector 1.0.4

Compare Source

New Features and Changes πŸ₯³


Bugfixes πŸ›

  • [php84] Clean up contains null check type on ExplicitNullableParamTypeRector (#​5726)
  • Fixes for ArrayDimFetchToMethodCallRector (#​5727), Thanks @​peterfox!
  • Update ArrayDimFetchToMethodCall to use ObjectType (#​5728), Thanks @​peterfox!
  • [Configuration] Do not sets, skip, rules on empty array on RectorConfigBuilder (#​5731)
  • [Php81] Skip $this::class on trait on NullToStrictStringFuncCallArgRector (#​5732)
  • [Dep] Temporary pin to use nikic/php-parser 4.18.0 (#​5733)
  • Handle readonly class with attrs (#​5736), Thanks @​tugmaks!
  • [Scoper] Handle use nette/utils on php < 7.4 on 6th param on preg_replace_callback() (rectorphp/rector-src@fd9e172)
  • [Renaming][AutoImport] Handle after change annotation to attribute with rename on AnnotationToAttributeRector + RenameClassRector with auto import (#​5741)
  • [Php80] Skip var property usage on ClassPropertyAssignToConstructorPromotionRector (#​5744)
  • [Php80] Use identical compare on PromotedPropertyCandidateResolver (#​5745)
  • Fix ChildDoctrineRepositoryClassTypeRector for generic type (#​5746)
  • [DeadCode] Skip From docblock on ReduceAlwaysFalseIfOrRector (rectorphp/rector-src@f32dff3)
  • [CodeQuality] Skip if else return on ExplicitReturnNullRector (#​5755)
  • [CodeQuality] No need to re-update doc when already union null doc on ExplicitReturnNullRector (#​5757)
  • [CodeQuality] Skip __construct() method on ExplicitReturnNullRector (#​5758)
  • [CodeQuality] Move Yield_ and YieldFrom check to SilentVoidResolver (#​5759)
  • [CodeQuality] Skip do { } while always returned on ExplicitReturnNullRector (rectorphp/rector-src@cae0691)
  • [CodeQuality] Allow transform return; to return null; when there is other return with Expr on ExplicitReturnNullRector (#​5761)
  • [AutoImport] Allow auto import same namespace with sub use with docblock short name (rectorphp/rector-src@e3e741e)
  • [CodeQuality] Handle do { } while maybe returned on ExplicitReturnNullRector (#​5766)
  • More fixture on Do_ maybe returned (#​5767)
  • [DeadCode] Fix array callable with constructor args (#​5770), Thanks @​hogejiro!
  • [TypeDeclaration] Ensure always return with Expr on maybe continued in next stmt on SilentVoidResolver (#​5771)
  • [Scope] Fix resolve Scope from fluent call (#​5743)
  • Clean up scope skip scope check on ExprScopeFromStmtNodeVisitor (#​5776)
  • [NodeCollector] Fix non-string value on ArrayCallableMethodMatcher::resolveClassContextType() (#​5780)
  • [Printer] Apply configurable multiline on Fluent Method Call on print after method call created/re-printed (#​5779)
  • [TypeDeclaration] Handle initialized on getter on ReturnTypeFromStrictTypedPropertyRector (#​5784)
  • [TypeDeclaration] Handle in inner function on ReturnTypeFromStrictTernaryRector (#​5785)
  • [TypeDeclaration] Do not use Required::class reference on AutowiredClassMethodOrPropertyAnalyzer (#​5788)
  • [Performance][Php81] Early property promotion and readonly param check before changeable check on ReadOnlyPropertyRector (#​5791)
  • Fix removal of useless @​param tag when string|null insteadof ?string is used. (#​5684), Thanks @​arjenschol
  • [DeadCode] Clean up TypeHasher on Union Type (#​5792)
  • [NodeTypeResolver] Move UnionType doc vs FullyQualified native type as not equal to TypeComparator (#​5793)
  • Support @​immutable phpdoc in RestoreDefaultNullToNullableTypePropertyRector(#​5795), Thanks @​staabm
  • [CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#​5800)
  • [CodeQuality] Handle Switch maybe return on ExplicitReturnNullRector (#​5801)
  • [DeadCode] Skip use docblock on BooleanAnd check on RemoveDeadInstanceOfRector (#​5751)
  • [DeadCode] Skip isset() from property fetch from docblock on RemoveAlwaysTrueIfConditionRector (#​5754)

Removed πŸ’€

  • [code-quality] Remove intval/strval from sets, as no clear difference and personal preference (#​5721)
  • [CodeQuality] Remove BoolvalToTypeCastRector and FloatvalToTypeCastRector as well from code-quality set (#​5722)
  • [CodingStyle] Remove usage of Reflection::expandClassName() from nette/utils 4.0 as cause bug on downgrade (#​5740)
  • [DeadCode] Skip implements interface on RemoveUnusedConstructorParamRector (#​5778)
  • [DeadCode] Skip Array Callable dynamic method using CLASS with constructor (no default args) on RemoveUnusedPrivateMethodRector (#​5774), Thanks @​hogejiro
  • [Php81] Remove @​readonly doc on transformation to native readonly on ReadOnlyPropertyRector (#​5789)
  • [DeadCode] Remove union with interface on RemoveUselessParamTagRector to make it consistent (#​5794)
  • [DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector (#​5796)
  • [DeadCode] Skip @​param true on native bool type on RemoveUselessParamTagRector (#​5798)
  • ArgumentRemoverRectorTest: replace symfony\yaml reference with dummy (#​5799), Thanks @​janedbal!

v1.0.3: Released Rector 1.0.3

Compare Source

New Features and Improvements πŸ₯³

  • [TypeDeclaration] Add ChildDoctrineRepositoryClassTypeRector (#​5695)
  • [TypeDeclaration] No need check parent method when method is private on AddVoidReturnTypeWhereNoReturnRector (#​5690)
  • [Php83] Add support +/- value on constant on AddTypeToConstRector (#​5694)
  • Add dump_node() helper function (#​5696)
  • [CodeQuality] Add Equal and NotEqual support on SimplifyIfReturnBoolRector (#​5697)
  • [CodeQuality] Add support for compare $this::class compare with string on UseIdenticalOverEqualWithSameTypeRector (#​5698)

Bugfixes πŸ›

  • [Configuration] Fix parallel config always replaced by next config per-default true (#​5683)
  • [CodingStyle] Skip anonymous class on MakeInheritedMethodVisibilitySameAsParentRector (#​5688)
  • [Php80] Fix typo class name: DoctrineCoverterterAttributeDecorator -> DoctrineConverterAttributeDecorator (#​5689)
  • [Php81] Handle with attribute on ReadOnlyPropertyRector on property promotion (#​5692)
  • [Php72][TypeDeclaration] Fix infinite loop on ParseStrWithResultArgumentRector+DeclareStrictTypesRector (#​5699)
  • [CodeQuality] Skip sort/ksort on TernaryFalseExpressionToIfRector (#​5703)
  • fix: Strip left spaces from opening tags when comparing output for changes (#​5701), Thanks @​stilliard!
  • [CodingStyle] Skip implements interface on MakeInheritedMethodVisibilitySameAsParentRector (#​5707)
  • [CodeQuality] Skip throw after foreach with return in loop on SimplifyForeachToCoalescingRector (#​5714)
  • Skip mixed in ParamTypeByMethodCallTypeRector as not specific (#​5715)
  • [CodeQuality] Skip compare string with stringable object on UseIdenticalOverEqualWithSameTypeRector (#​5718)
  • [Php80] Skip ObjectType on ChangeSwitchToMatchRector (#​5719)

v1.0.2: Released Rector 1.0.2

Compare Source

New Features and changes πŸ₯³


Bugfixes πŸ›

  • [Php83] Early check private method in child before check parent on AddOverrideAttributeToOverriddenMethodsRector (#​5622)
  • RectorConfigBuilder: skip and rules can be called multiple times (#​5623), Thanks @​integer!
  • [CodeQuality] Skip not autoloaded parent class on CompleteDynamicPropertiesRector (#​5636)
  • [Transform] Allow transform ruleWithConfiguration() to withConfiguredRule() on RectorConfigBuilderRector (#​5637)
  • [Rector] Allow transform sets() to withSets() on RectorConfigBuilderRector (#​5638)
  • [Transform] Allow transform disableParallel() to withoutParallel() on RectorConfigBuilderRector (#​5640)
  • [Transform] Allow transform fileExtensions() to withFileExtensions() (#​5641)
  • [Performance] [VendorLocker] Early allow change return type on private method on ClassMethodReturnTypeOverrideGuard::shouldSkipClassMethod() (#​5642)
  • [VendorLocker] Early return false on private method on ParentClassMethodTypeOverrideGuard::hasParentClassMethod() (#​5644)
  • [Renaming] Handle crash on RenameFunctionRector with die() and $_SESSION usage (#​5646)
  • Cleanup scope check on UnreachableStatementNodeVisitor (#​5648)
  • Keep comments in annotations when converting them to attributes (#​5650), Thanks @​carlos-granados!
  • [Util] Make consistent new line splitter to Util (#​5651)
  • [TypeDeclaration] Fix abs() returns on ReturnTypeFromStrictTypedCallRector (#​5652)
  • [TypeDeclaration] Allow abs() to return int when pass int arg on ReturnTypeFromStrictTypedCallRector (#​5653)
  • [TypeDeclaration] Skip possible returns false on ReturnTypeFromStrictNewArrayRector (#​5654)
  • [TypeDeclaration] Include MockObject&ClassName docblock with IntersectionTypeNode on TypedPropertyFromStrictSetUpRector (#​5655)
  • [Renaming] New Rule: RenameFunctionLikeParamWithinCallLikeArgRector (#​5554), Thanks @​peterfox!
  • [PHPStanStaticTypeMapper] Avoid double \ prefix on IntersectionTypeMapper (#​5656)
  • [BetterPhpDocParser] Clean up unnecessary create new ConstFetchNode() on ArrayItemClassNameDecorator (#​5658)
  • [Php71] Skip re-assign as string on AssignArrayToStringRector (#​5659)
  • [Privatization] Skip with suffix "TestCase" on FinalizeTestCaseClassRector (#​5660)
  • [Php71] Skip re-assign as string on AssignArrayToStringRector part 2 (#​5661)
  • [DeadCode] Fix infinite loop on RemoveDeadStmtRector + RemoveUnusedVariableAssignRector (#​5666)
  • [Php81] Skip execution operator on NullToStrictStringFuncCallArgRector (#​5667)
  • [Naming] Handle crash with numeric-string doc on RenamePropertyToMatchTypeRector (#​5670)
  • [CodeQuality] Handle crash on named arg on deep closure on OptionalParametersAfterRequiredRector (#​5671)
  • chore: bump min version of github actions (fix deprecations) (#​5675), Thanks @​Chris53897!
  • [PHP 8.0] Fix case insenstive false positive replacement for str_ends_with (#​5677)
  • [Transform] Allow transform phpVersion() to withPhpVersion() on RectorConfigBuilderRector (#​5678)
  • Fix duplicated fixture class name on StaticToSelfStaticMethodCallOnFinalClassRector test (#​5679)
  • [CodeQuality] Skip nested array on InlineArrayReturnAssignRector (#​5680)
  • [CodeQuality] Skip combine var with property fetch on InlineArrayReturnAssignRector (#​5681)
  • [CodeQuality] Handle array destructuring of unpack on ArrayMergeOfNonArraysToSimpleArrayRector (#​5682)
  • Update README to use the new config syntax (#​5674), Thanks @​carlos-granados!
  • [PostRector] Skip remove use statement on used in annotation on removeUnusedImports() (#​5657)
  • [DeadCode] Skip implements interface __construct() on RemoveUnusedPromotedPropertyRector (#​5669)
  • [Performance] [DeadCode] Early check no params in __construct() on RemoveUnusedPromotedPropertyRector (#​5672)

v1.0.1: Released Rector 1.0.1

Compare Source

New Features πŸ₯³

  • [Custom] Add "detect-node" command to help with writing custom rules (#​5576)
  • [Config] Add registerService() method to allow container extension (#​5591)
  • [TypeDeclaration] Add AddTestsVoidReturnTypeWhereNoReturnRector (#​5611)
  • [PHP 8.0] Add always class to AnnotationToAttribute to include string to ::class reference conversion (#​5619)
  • [CodeQuality] Add StaticToSelfStaticMethodCallOnFinalClassRector (#​5621)

Bugfixes πŸ›

  • ExplicitBoolCompareRector: skip phpdoc (#​5567), Thanks @​staabm!
  • Fix ArrayTypeMapper to handle arrays with UnionType items (#​8225) (#​5568), Thanks @​pkvach!
  • [Configuration] Fix detect /vendor on root project on vendor analyzed on VendorMissAnalyseGuard (#​5569)
  • Fix missing / suffix on VendorMissAnalyseGuard (#​5571)
  • [PHP81] Skip after is_string on object call on NullToStrictStringFuncCallArgRector (#​5572)
  • [Config] Make sure only one of type-declaration/dead-code or with*Level() is used to avoid duplicates (#​5578)
  • Fix undefined MHASH_* constant on running downgrade from php 8.0 (#​5585)
  • [NodeTypeResolver] Ignore PHPStan internal error on PHPStanNodeScopeResolver on NodeScopeResolver::processNodes() (#​5586)
  • [Php81] Skip possible array on NullToStrictStringFuncCallArgRector (#​5587)
  • [Php81] Skip another possible cast array to string on NullToStrictStringFuncCallArgRector (#​5589)
  • [Transform] Allow class const fetch value on rules() on RectorConfigBuilderRector (#​5596)
  • [Performance] Use strlen() early before loop on VendorMissAnalyseGuard (#​5597)
  • Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#​8438) (#​5603), Thanks @​pkvach!
  • config method must be static, to avoid creating rule before loading related ctor services (#​5606)
  • fix config for configured rule (rectorphp/rector-src@5edb023)
  • [PHP 8.0] Fix annotation to attribute in case of FQN class without () (#​5609)
  • [Php80] Support windows new line line DoctrineAnnotationDecorator::LONG_ANNOTATION_REGEX (#​5610)
  • [Php81] Handle after open parentheses on AnnotationToAttributeRector (#​5613)
  • [BetterPhpDocParser] Move split new line with @​\ to regex to support windows new line (#​5615)
  • [Php81] Handle nested Fqcn UniqueConstraint on NestedAnnotationToAttributeRector (#​5614)
  • [DX] Accept Y/y for confirmation of init config (#​5616)
  • [CodeQuality] Skip private static call from static:: on LocallyCalledStaticMethodToNonStaticRector (#​5620)
  • [PostRector] Skip remove unused imports on used in multiple docs in single node (#​5604)
  • [DeadCode] Skip sub type false => bool on RemoveUselessVarTagRector (#​5588)

Removed πŸ’€

  • [DeadCode] Skip with magic __get() on RemoveUnusedPromotedPropertyRector (#​5573)
  • [DX] Remove phpstan strict rules to ease contributing (#​5579)
  • [DX] Remove type covarege, as handled by phpstan itself (#​5583)
  • [DeadCode] Handle used in assign return on RemoveUnusedPrivatePropertyRector (#​5608)

v1.0.0: Released Rector 1.0.0 πŸŽ‰πŸŽ‰πŸŽ‰

Compare Source

The stable Rector version is here. It was about time and we've done all planned changes by the end of 2023.


What could be better time and place to release a stable Rector than live on stage during talk πŸŽ‰


While this release brings stable API, it will be easier to stay up to date as well. The 1.x versioning behaves as expected with composer update (compared to special 0.x).

Our main focus is on improving developers experience. This release brings new features that help with custom rules writing, adding Rector to CI and adding Rector to any legacy project in general.


Some features are partially available in previous version, but we'd like to highligh them because since 1.0 you can use them all together.


Zen Config with Autocomplete

If you run Rector for the first time, it will create a rector.php config with your project paths for you. In past we used various class constants references to add commonly used rule sets. This required knowledge about these classes and was often missed.

We've changed this to work with single configuration class. It provides autocomplete for available sets, including attributes:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPreparedSets(codeQuality: true, codingStyle: true)
    ->withAttributesSets(symfony: true, doctrine: true)
    ->withPaths([
        __DIR__ . '/src',
        __DIR__ . '/tests',
    ])
    ->withRootFiles();

PHP Sets Automated

To keep up to date with you PHP, now you can use single method:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPhpSets();

It learns about PHP version from your composer.json and will always keep sync with your required PHP version. No need to double check rector.php configuration anymore.


Streamline Integration to Projects

We're also adding 2 experimental methods, that make Rector integration to new projects easier. Before, you could run whole type declaration or read code set, see 1000 changed files and rather close it being overwhelmed. Instead, we want to take it slow, as we do with our custom upgrades as well:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
     ->withTypeCoverageLevel(10)
     ->withDeadCodeLevel(10)

Now you can improve your code base one rule at a time. The rules are sorted from the easiest to integrate, e.g. add void to closure, to more complex one. That way you can improve your code base in your own pace. We're collecting feedback on rule order, so the levels will likely change.


New and Improved Commands

  • We added a new command to generate bare custom rule files and structure for you:
vendor/bin/rector custom-rule

Call the command, type the rule name and rule, its test and composer autoload is generated for you. So you can focus on the contents of refactor() method.


  • We improve the command, that generates Github and Gitlab CI setup files, so you can let Rector work for you:
vendor/bin/rector setup-ci

The command handles generic setup for you and then guides you to register needed access.

v0.19.8: Released Rector 0.19.8

Compare Source

New Features πŸ₯³

  • [experimental] Add withTypeCoverageLevel() method to streamline Rector integration to new projects (#​5553)

Bugfixes πŸ›

  • Cache null result on ProjectComposerJsonPhpVersionResolver (#​5559)
  • Real fix paths The given paths do not match any files on RectorConfigBuilder (#​5561)

v0.19.7: Released Rector 0.19.7

Compare Source

Bugfixes πŸ›

  • [TypeDeclaration] Skip assign in construct with method call property same name on RestoreDefaultNullToNullableTypePropertyRector (#​5556)
  • [Privatization] Fix reprint with attribute on FinalizeTestCaseClassRector (#​5557)
  • [DX] Fix missing Rector\RectorGenerator\Exception\ConfigurationException (#​5558)
  • Fix platform version resolution, use require first (#​5555)
  • bump template version (rectorphp/rector-src@02a088c)

v0.19.6: Released Rector 0.19.6

Compare Source

New Features and Changes πŸ₯³

  • [EarlyReturn] Improve RemoveAlwaysElseRector to handle multiple ElseIfs (#​8178) (#​5521), Thanks @​pkvach!
  • [Privatization] Add FinalizeTestCaseClassRector (#​5539)
  • Add support for YieldFrom into places where Yield_ is checked (#​5499), Thanks @​integer!
  • [Transform] Add RectorConfigBuilderRector (#​5551)
  • [DX] Warn about run on /vendor directory (#​5525)
  • [DX] PHP sets should not disable all other version-based rules (#​5527)
  • [stabilize] Deprecate FinalizeClassesWithoutChildrenRector as causing bugs without full context (#​5535)

Bugfixes πŸ›

  • Fix xdebug handling (#​5544), Thanks @​staabm!
  • Added 4 methods into RectorConfigBuilder (#​5524), Thanks @​Perf!
  • Fix AddMethodCallBasedStrictParamTypeRector if already has a type (#​5530)
  • [CodingStyle] Return null on no change on StrictArraySearchRector (#​5528)
  • [Php81] Allow nullable union on NullToStrictStringFuncCallArgRector (#​5532)
  • [stabilize] Deprecate FinalizePublicClassConstantRector as not reliable and causes uncontroller changed (#​5534)
  • [TypeDeclaration] Change bool to false or true docblock when union has false/true standalone type on ReturnUnionTypeRector (#​5543)
  • [EarlyReturn] Skip append variable in PreparedValueToEarlyReturnRector (#​8390) (#​5545), Thanks @​pkvach!
  • Fix make ReadOnlyPropertyRector skip if traits are used, as not reliable (#​5548)
  • Kick off basic rector.php with simpler and more practical rule (#​5552)

Removed πŸ’€

  • Exclude finalize rule from private set, to keep safer (#​5523)
  • [Performance] Remove CollectedData on ProcessResult (#​5520)
  • [stabilize] Remove family tree check from ClassMethodParamVendorLockResolver as not reliable (#​5536)
  • [stabilize] Remove child classes from MixedTypeRector as not reliable (#​5537)
  • [stabilize] Remove last children method checks (#​5538)

v0.19.5: Released Rector 0.19.5

Compare Source

New Features πŸŽ‰

  • [Autoloading] Allow to define bootstrapFiles([DIR . '/some.phar']) on BootstrapFilesIncluder (#​5518)
  • add withPhpSets() methods (#​5519)

v0.19.4: Released Rector 0.19.4

Compare Source

Bugfixes πŸ›

v0.19.3: Released Rector 0.19.3

Compare Source

New Features ahd Changes πŸ₯³

  • [Config] Add RectorConfigBuilder (#​5503)
  • Add gitlab to "setup-ci" command (#​5497)
  • Add "custom-rule" command to make creating rules easy (#​5498)
  • [Windows] Rework add windows support on tests CI (#​5504)
  • make literal separator optional, as rather coding style and not always desired (#​5505)

Bugfixes πŸ›

  • [Php70] Skip inside Encapsed on ThisCallOnStaticMethodToStaticCallRector (#​5481)
  • [Performance] Cache PHP version features on reading composer.json on PhpVersionProvider (#​5484)
  • Fix phpstan (#​5489)
  • [Config] Restore default values for RectorConfig->parallel() config similar to original <=0.18.x version (#​5472)
  • [Performance][PhpParser] Deprecate InlineCodeParser::parse(), extract into parseFile() and parseString() (#​5482)
  • [CodeQuality] Skip surplus open square bracket on SimplifyRegexPatternRector (#​5494)
  • [AutoImport] Skip start with <?= short open tag on auto import (#​5496)
  • [Testing] Deprecate FileInfoParser, use existing TestingParser instead (#​5501)
  • custom copy path fix (#​5502)
  • [DX] Allow Arg in value resolver, as often used and intuitive (#​5512)
  • [Windows] Support replace \r\n on DocBlockInliner (#​5513)
  • [Php83] add string type to concat constant (#​5516), Thanks @​jdohuutin!

Removed πŸ’€

  • [Renaming] Remove namespace renames in ClassRename, as it should only rename references, not move to new namespace (#​5487)
  • [Renaming] Remove rename class name (#​5488)

v0.19.2: Released Rector 0.19.2

Compare Source

New features and Changes πŸŽ‰

  • [DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets (#​5477)
  • Remove collectors, as performance very costly and not practically useful (#​5470)

Bugfixes πŸ›


Removed πŸ’€

  • [Performance] Remove unused AttributeKey::ARGUMENT_POSITION (#​5469)
  • [Autoload] Remove src/core_namespace_aliases.php (#​5476)

v0.19.1

Compare Source

v0.19.0: Released Rector 0.19.0

Compare Source

In this release we merged 2 directories into /src to speed up class loading and make work with code easier. This leads to BC change in namespace for your custom rules:

-use Rector\Core\
+use Rector\

That's it!

New Features πŸ₯³

  • [psr-4] Move /packages directory to /src under single Rector\ namespace (#​5414)
  • [Arguments] Allow no default value on ArgumentAdderRector (#​5382)
  • Add related polyfill interface to other PHP 8.0/7.3 rules (#​5389)
  • [CodingStyle] Add RemoveUselessAliasInUseStatementRector (#​5394)
  • [Php83] Add CombineHostPortLdapUriRector (#​5397)
  • [TypeDeclaration] optionally only add types for hard coded return values in ReturnTypeFromStrictScalarReturnExprRector (#​5364), Thanks @​RobertMe!
  • Add phpstan native cond types for getName() for nodes that always return a string (#​5413)
  • [Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector (#​5428)
  • [Php83] Add implements interface support on AddOverrideAttributeToOverriddenMethodsRector (#​5429)
  • [cs] Make use of new ECS config (#​5445)

Bugfixes πŸ›

  • [TypeDeclaration] Add false and true in union support on ReturnUnionTypeRector (#​5355)
  • Skip classes without final and exception as possibly invoke child implement in AddVoidReturnTypeWhereNoReturnRector (#​5381)
  • Skip non-final class method with no content in AddVoidReturnTypeWhereNoReturnRector (#​5386)
  • [TypeDeclaration] Allow add void return type on magic __invoke() method on AddVoidReturnTypeWhereNoReturnRector (#​5376)
  • Add ReturnTypeFromStrictBoolReturnExprRector support for if/else returns (#​5384)
  • Skip void without final keyword in ReturnNeverTypeRector as could be implemented with more precise children (#​5379)
  • Fix StrictArrayParamDimFetchRector for string access (#​5383)
  • Fix variable to property fetch update in ClassPropertyAssignToConstructorPromotionRector (#​5385)
  • [Php] Fix filter cache on PolyfillPackagesProvider (#​5390)
  • [Parallel] Fix missing --xdebug in WorkerCommand line on WorkerCommandLineFactory when --xdebug provided (#​5398)
  • Bump phpstan to 1.10.50 (#​5399)
  • [Php83] Handle dynamic host and port values on CombineHostPortLdapUriRector (#​5401)
  • [config] Extract RectorConfigValidator and handle config validation there (#​5404)
  • [psr-4] Update Rector core test reference (#​5410)
  • [cleanup] Decouple changelog generator (#​5412)
  • [Strict] Handle may be unitialized property on DisallowedEmptyRuleFixerRector (#​5409)
  • Bump min. version to PHP 8.2 - readonly classes (#​5415)
  • Decouple LongAndDependentComplexRectorRule to cognitive-complexity package (#​5427)
  • [TypeDeclaration] Skip with empty() check on StrictArrayParamDimFetchRector (#​5432)
  • [TypeDeclaration] Allow both integer and string index array on StrictArrayParamDimFetchRector (#​5433)
  • [TypeDeclaration] Skip re-assign with call and use as arg on StrictArrayParamDimFetchRector (#​5434)
  • [CodeQuality] Handle crash with call inside loop on SimplifyForeachToCoalescingRector (#​5436)
  • [TypeDeclaration] Handle with default null on ParamTypeByMethodCallTypeRector (#​5437)
  • [NodeTypeResolver] Handle crash PHPStan\File\CouldNotReadFileException: Could not read file on IntermediateSourceLocator (#​5438)
  • Allows to convert Spatie enum names to snake upper case (#​5435), Thanks @​JoolsMcFly!
  • fix: RenameMethodRector should handle NullsafeMethodCall (#​5444), Thanks @​nikophil!
  • [Php80][CodeQuality] Handle crash on ChangeSwitchToMatchRector + TernaryFalseExpressionToIfRector on under if else (#​5446)
  • Skip cond with side effect in RemoveDeadConditionAboveReturnRector (#​5424)
  • [DeadCode] Skip nullable array on RemoveUnusedNonEmptyArrayBeforeForeachRector (#​5375)
  • Keep called method in RemoveEmptyClassMethodRector (#​5425)

Removed πŸ’€

  • [DeadCode] Remove RemoveJustPropertyFetchForAssignRector as tailored for single case of private project, not practical for generic use (#​5418)
  • remove array spread from coding style, as often part of personal preference (rectorphp/rector-src@a326b85)

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 has been generated by Mend Renovate. View repository job log here.

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.

None yet

0 participants