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 #23

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.15 -> ^1.0 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

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)

v0.18.13: Released Rector 0.18.13

Compare Source

New Features πŸ₯³

  • [DeadCode] Add Function_ support on RemoveUselessReturnTagRector (#​5325)
  • [TypeDeclaration] Add MergeDateTimePropertyTypeDeclarationRector (#​5327)
  • [DeadCode] Add Function_ support on RemoveUselessParamTagRector (#​5331)
  • [DeadCode] Add RemoveNullTagValueNodeRector (#​5352)

Bugfixes πŸ›

  • [Php83] Fix const from applying incorrect types (#​5326), Thanks @​peterfox!
  • [TypeDeclaration] Fix missing change type to DateTimeInterface on MergeDateTimePropertyTypeDeclarationRector (#​5329)
  • [TypeDeclaration] Handle DateTimeInterface from use statement on MergeDateTimePropertyTypeDeclarationRector (#​5330)
  • [TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector (#​5333)
  • Fix array type if property is used in TypedPropertyFromStrictConstructorRector (#​5339)
  • [Naming] Skip DateTimeImmutable on RenamePropertyToMatchTypeRector (#​5340)
  • [PHP 7.4] Skip typed properties in the set, as standalone set now available (#​5342)
  • [TypeDeclaration] Skip has child return different type on ReturnNeverTypeRector (#​5343)
  • [Experiment][TypeDeclaration] Allow change abstract class methods with body on ReturnType*Rector (#​5344)
  • [Php55] Make StringClassNameToClassConstantRector configurable to keep first pre-backslash string configurable (#​5354)
  • [TypeDeclaration] Skip casted to (array) on StrictArrayParamDimFetchRector (#​5356)
  • [TypeDeclaration] Return new static from different object on ReturnTypeFromStrictTypedCallRector (#​5357)
  • [TypeDeclaration] Allow return static from under function on ReturnTypeFromStrictTypedCallRector (#​5358)
  • [Naming] Skip $this in RenameForeachValueVariableToMatchExprVariableRector (#​5360), Thanks @​sreichel!
  • [Transform] Do not create a new node if the existing node is already the correct one on AttributeKeyToClassConstFetchRector (#​5328), Thanks @​SerethiX!
  • Bump to php parser 4.18 (#​5362)
  • [CodeQuality] Skip Superglobals variable on SimplifyEmptyCheckOnEmptyArrayRector (#​5369)
  • [Php55] Handle crash after exit() on GetCalledClassToSelfClassRector (#​5372)
  • [CodeQuality] Skip method call on else on TernaryFalseExpressionToIfRector (#​5373)
  • Remove return type in case of never in RemoveUselessReturnTagRector (#​5323), Thanks @​staabm!
  • [DeadCode] Remove unused @​return mixed on RemoveUselessReturnTagRector (#​5332)
  • [DeadCode] Skip has parent class with __call() magic method on RemoveParentCallWithoutParentRector (#​5336)
  • [PHP 5.5] Remove extra preslash in class reference, as in practice removal manually (#​5338)
  • [DeadCode] Remove null as never used param type in RemoveUselessParamTagRector (#​5348)
  • Remove json throw on error rule from PHP 7.3 set, as changed behavior and must be applied on purpose (#​5349)
  • [Testing] Remove unnecessary set Parameter Source on TestingParser (#​5371)

v0.18.12: Released Rector 0.18.12

Compare Source

New Features πŸ₯³


Bugfixes πŸ›

  • [TypeDeclaration] Skip iterable already there in AddReturnTypeDeclarationFromYieldsRector (#​5291)
  • [TypeDeclaration] Remove ParamTypeFromStrictTypedPropertyRector as seems similar feature with AddParamTypeFromPropertyTypeRector (#​5293)
  • [CodingStyle] Remove AddArrayDefaultToArrayPropertyRector as based on docblock types and public contract, better use type declaration set instad (#​5298)
  • [TypeDeclaration] Skip return void in abstract empty class in AddVoidReturnTypeWhereNoReturnRector (#​5311)
  • [Php80] Skip PDO::query() on AddParamBasedOnParentClassMethodRector (#​5313)
  • [TypeDeclaration] Add If else assign support on TypedPropertyFromAssignsRector (#​5314)
  • [CodeQuality] Make CommonNotEqualRector skip if not <> (#​5292)
  • [Naming] Skip singularize "cms" on RenameForeachValueVariableToMatchExprVariableRector (#​5294)
  • [TypeDeclaration][Performance] Check typed param already early on ParamTypeByMethodCallTypeRector (#​5295)
  • [Strict] Fix DisallowedEmptyRuleFixerRector empty() allow string '0' check (#​5296)
  • [EarlyReturn] Skip duplicating complex expression in ChangeAndIfToEarlyReturnRector (#​5301)
  • [Scoped] Exclude symfony/console/Debug/CliRequest.php from parallel-lint PHP 7.2 syntax check (#​5304)
  • Skip RenameMethodRector in never (#​5305), Thanks @​staabm!
  • [CodeQuality] Skip with else on SimplifyForeachToCoalescingRector (#​5307)
  • [Doc] Typo fix on sample code documentation on SimplifyForeachToCoalescingRector (#​5308)
  • [Privatization] Skip call non-private method on non-final class on PrivatizeLocalGetterToPropertyRector (#​5309)
  • [Privatization] Fix first class callable in PrivatizeLocalGetterToPropertyRector (#​5310)
  • [TypeDeclaration] Keep constant false return type from strict native call (#​5223), Thanks @​tomi85!
  • [PHP 7.0] Skip mt_rand() replacement as not valuable (#​5315)
  • [Strict] Allow check '0' empty zero on BooleanInTernaryOperatorRuleFixerRector on string type (#​5297)
  • Fix annotation to attribute parsing string (#​5317)
  • [Instanceof] Fix combination of dead instance and compare (#​5319)
  • Remove isPositiveInteger() check for third argument to strpos() (#​5257), Thanks @​ikari7789!
  • Remove return type in case of void in RemoveUselessReturnTagRector (#​5318)
  • [DeadCode] Skip @​return never with void on RemoveUselessReturnTagRector (#​5320)
  • [DeadCode] Remove useless nullable @​return doc on RemoveUselessReturnTagRector (#​5321)

v0.18.11: Released Rector 0.18.11

Compare Source

Bugfixes πŸ›

  • [DeadCode] Skip multi no stmts on RemoveDuplicatedCaseInSwitchRector (#​5258)
  • [Performance][Renaming] Remove unnecessary array_reverse() on RenameClassRector (#​5266)
  • [TypeDeclaration] Skip default not array type on StrictArrayParamDimFetchRector (#​5259)
  • [TypeDeclaration] Skip echo-ed on StrictArrayParamDimFetchRector (#​5260)
  • [Php71] Skip re-assigned as array on AssignArrayToStringRector (#​5261)
  • [Php71] Ensure re-assign after definition on AssignArrayToStringRector (#​5262)
  • [Renaming] Handle Rename no namespace to namespaced class with existing use statements (#​5264)
  • [Renaming][Performance] Re-structure check namespace only on renamed node got Namespace_ (#​5265)
  • [Php81] Skip increment/decrement on ReadOnlyPropertyRector (#​5267)
  • [TypeDeclaration] Deprecate TypedPropertyFromStrictGetterMethodReturnTypeRector as depends on missing context and creates invalid code (#​5269)
  • [AutoImport] Fixing auto import on multiple @​\ usage (#​5271)
  • [Performance][Renaming] Use FullyQualified on RenameClassRector (#​5272)
  • [AutoImport] Handle complex usage of multiple @​\ combined with other doc (#​5273)
  • [AutoImport] Handle multi @​\ usage on multiline description (#​5274)
  • [Php80] Handle FQCN @​\ usage on AnnotationToAttributeRector (#​5240)
  • [BetterPhpDocParser] Handle nested doctrine annotation with single quote content (#​5281)
  • [Privatization] Skip method with parent call (#​5283)
  • [BetterPhpDocParser] Use ORIG_NODE attribute on DoctrineAnnotationDecorator on handle @​\ after generic (#​5285)
  • [Php80] Allow subnamespace from use statements support on AnnotationToAttributeRector (#​5287)

Removed πŸ’€

v0.18.10: Released Rector 0.18.10

Compare Source

Bugfixes πŸ›

  • [Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector (#​5256)

v0.18.9: Released Rector 0.18.9

Compare Source

New Features πŸ₯³

  • [DeadCode]: Support functions in RemoveUnusedVariableAssignRector (#​5249
  • [Performance][PostRector] Only process FullyQualified on import Node name on NameImportingPostRector (#​5255)

Bugfixes πŸ›

  • [AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector (#​5251)
  • [Naming] Fix dotted name on generics bug in RenameVariableToMatchMethodCallReturnTypeRector (#​5250)
  • [Php73] Handle crash on JsonThrowOnErrorRector + SensitiveConstantNameRector (#​5253)
  • [CodingStyle] Refactor UseImportsAdder to return [FileWithoutNamespace] code on no namespaced code (#​5254)

v0.18.8: Released Rector 0.18.8

Compare Source

Bugfixes πŸ›

  • Bump to reactphp/event-loop ^1.5 (#​5246)
  • [AutoImport] Skip auto import on no namespace used class on auto import enabled (#​5247)
  • [AutoImport][Renaming] Handle same last name no namespace just renamed auto import (#​5248)

v0.18.7: Released Rector 0.18.7

Compare Source

New Features πŸ₯³


Bugfixes πŸ›

  • BinaryOpBetweenNumberAndStringRector don't trust phpdoc (#​5199), Thanks @​staabm!
  • [CodeQuality][Php70] Handle LocallyCalledStaticMethodToNonStaticRector + ThisCallOnStaticMethodToStaticCallRector must change both method and caller (#​5196)
  • CountArrayToEmptyArrayComparisonRector: don't trust phpdoc (#​5203), Thanks @​staabm!
  • [TypeDeclaration] Skip union false on NumericReturnTypeFromStrictScalarReturnsRector (#​5204)
  • [CodeQuality] Handle negated isset on IssetOnPropertyObjectToPropertyExistsRector on property not exists (#​5206)
  • [CodeQuality] Handle crash no scope on ThrowWithPreviousExceptionRector+OptionalParametersAfterRequiredRector (#​5207)
  • [NodeTypeResolver] Clean up TryCatch_ Scope filling (#​5208)
  • [PHPStanStaticTypeMapper] Clean up tweak false and bool check on UnionTypeMapper (#​5209)
  • [TypeDeclaration] Skip default numeric string on param int on ParamTypeByMethodCallTypeRector (#​5210)
  • [AutoImport] Handle AnnotationToAttributeRector + RenameClassRector then enable auto import (#​5213)
  • [Php80] Keep single quoted Argument Attribute on AnnotationToAttributeRector (#​5214)
  • [Php80] Keep single quoted key: 'value' on AnnotationToAttributeRector (#​5215)
  • [AutoImport] Ensure change to FullyQualified for Attribute on just changed from annotation (#​5216)
  • [Php52][Php70] Handle ContinueToBreakInSwitchRector + BreakNotInLoopOrSwitchToReturnRector (#​5217)
  • [Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined (#​5219)
  • [Testing] In case of failed test using multiple rules, show applied Rector rules to make easy to find them (#​5222)
  • [NodeTypeResolver] Handle nullable extended class on ->isObjectType() on DowngradeReflectionGetAttributesRector (#​5224)
  • NullableCompareToNullRector: Don't trust phpdocs (#​5225), Thanks @​staabm!
  • [CodingStyle] Move ArraySpreadInsteadOfArrayMergeRector from php74 to codingstyle sets list (#​5230)
  • [PostRector] Ensure old classes in use statements cleaned up after rename attribuet on ClassRenamingPostRector (#​5231)
  • RestoreDefaultNullToNullableTypePropertyRector: skip @readonly phpdoc (#​5233), Thanks @​staabm!
  • [AutoImport] Handle DeclareStrictTypesRector on importNames() enabled on no namespace (#​5241)
  • [AutoImport] Allow auto import just renamed @​var only docblock on RenameClassRector without removeUnusedImports() enabled (#​5220)
  • Remove rule DataProviderArrayItemsNewlinedRector.php (#​5227), Thanks @​eerison!
  • Remove ArraySpreadInsteadOfArrayMergeRector from LevelSetList::UP_TO_PHP_74 (#​5228), Thanks @​staabm!
  • [DeadCode] Allow indirect duplicated grouping on RemoveDuplicatedCaseInSwitchRector (#​5234)
  • [DeadCode] Reduce double loop on RemoveDuplicatedCaseInSwitchRector (#​5235)
  • [DeadCode] Handle different indirect duplicated on RemoveDuplicatedCaseInSwitchRector (#​5236)
  • [DeadCode] Ensure change hasChanged flag on RemoveDuplicatedCaseInSwitchRector (#​5237)
  • [DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicatedCaseInSwitchRector (#​5239)
  • Rename parameter variable to nextCase on RemoveDuplicatedCaseInSwitchRector (#​5244)

v0.18.6: Released Rector 0.18.6

Compare Source

New Features and Changes πŸ₯³
  • [CodeQuality] Add CompleteMissingIfElseBracketRector (#​5121)
  • [CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector (#​5124)
  • [TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector (#​5156)
  • [DeadCode] Add RemoveUselessReturnExprInConstructRector (#​5158)
  • Improve UnaryPlus and UnaryMinus support in isDynamicExpr (#​5177), Thanks @​JulianCBC!

Bugfixes πŸ›
  • [CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector (#​5122)
  • [CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector (#​5125)
  • [CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector (#​5126)
  • [CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector (#​5127)
  • [CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector ([#​5129](https://togithub.com/rectorphp/rector-src/pu

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