chore(deps): update dependency rector/rector to v2 #11

Open
renovate-bot wants to merge 1 commit from renovate/rector-rector-2.x into master
Collaborator

This PR contains the following updates:

Package Change Age Confidence
rector/rector (source) ^0.15.24^2.0.0 age confidence

Release Notes

rectorphp/rector (rector/rector)

v2.4.2: Released Rector 2.4.2

Compare Source

New Features 🥳

  • Add some symfony/polyfill support (#​7965), Thanks @​sreichel!
  • [DeadCode] Allow remove useless @​ var on aliased object on RemoveUselessVarTagRector (#​7967)

Bugfixes 🐛

  • [Php81] Handle crash on normal array with variadic inside class on ArrayToFirstClassCallableRector (#​7966)
  • [CodeQuality] Skip possibly undefined variable on CoalesceToTernaryRector (#​7968)
  • [Php70] Allow is_null() conversion on TernaryToNullCoalescingRector with parentheses handling (#​7969)
  • Bump to PHPStan ^2.1.47 (#​7970)
  • Bump to PHPStan ^2.1.48 (#​7971)

rectorphp/rector-symfony 🎵

  • Fix unit test due to new PHPStan release (#​931)

v2.4.1: Released Rector 2.4.1

Compare Source

New Features 🥳


Bugfixes 🐛

  • [CodeQuality] Skip with HTML on CompleteMissingIfElseBracketRector (#​7952)
  • [CodeQuality] Handle with assign on SimplifyIfElseToTernaryRector (#​7951)
  • [CodeQuality] Skip with HTML on TernaryFalseExpressionToIfRector (#​7954)
  • [automated] Apply Coding Standard (#​7955)
  • Make compatible with PHPStan 2.1.x-dev for ObjectType::equals() change behaviour (#​7956)
  • [AutoImport] Handle FQCN in/not in use on auto import + remove unused import as prefix = suffix (#​7957)
  • perf: use hash map for installed packages (#​7878), Thanks @​calebdw!
  • [ChangesReporting][Alternative] Collect changed_files on --no-diffs with json output with use of JsonOutputFactory (#​7821)
  • fix: OOM crash in RemoveUnusedVariableAssignRector (#​7964), Thanks @​calebdw!

Deprecations 💀

  • [Php81] Deprecate NewInInitializerRector as depends on context (#​7913)
  • [deprecation] deprecate file, use getFile() instead (#​7962)

v2.4.0: Released Rector 2.4.0

Compare Source

New Features 🥳


Bugfixes 🐛

  • [Php85] Do not convert to pipe on use directly of spread operator on NestedFuncCallsToPipeOperatorRector (#​7938)
  • [Console] Allow short command "p" on ProcessCommand (#​7931)
  • [Arguments] Skip self class const fetch inside this class target replacement on ReplaceArgumentDefaultValueRector (#​7940)
  • [CodeQuality] Hnadle with negation binary op previous if on CombineIfRector (#​7945)
  • [CodingStyle] Skip by reference required params on call inside on ArrowFunctionDelegatingCallToFirstClassCallableRector (#​7949)

Removed 💀

  • [DeadCode] Skip pipe operator on RemoveDeadStmtRector (#​7941)
  • [DeadCode] Handle crash on multi elseif on RemoveDeadIfBlockRector (#​7946)
  • [DeadCode] Skip with assign to call with target has #[NoDiscard] attribute on RemoveUnusedVariableAssignRector (#​7950)

rectorphp/rector-symfony 🎵

  • [CodeQuality] Handle different parameter type same name used on ControllerMethodInjectionToConstructorRector (#​929)
  • [CodeQuality] Skip used by static closure use on ControllerMethodInjectionToConstructorRector (#​928)
  • [Symfony61] Skip non static external class callable on MagicClosureTwigExtensionToNativeMethodsRector (#​927), Thanks @​wuchen90

rectorphp/rector-doctrine 🟠

  • Fix infinite loop check instanceof name check to use Name class (#​481)

rectorphp/rector-phpunit 🟢

  • [PHPunit 9] Move AssertRegExpRector to phpunit 90 set with refactor to use assertMatchesRegularExpression/assertDoesNotMatchRegularExpression (#​667)
  • [PHPUnit 9] Rename assertRegExp/assertNotRegExp to assertMatchesRegularExpression/assertDoesNotMatchRegularExpression on phpunit 90 set (#​666)
  • Fix assert PHPStan on ConfiguredMockEntityToSetterObjectRector (#​665)

v2.3.9: Released Rector 2.3.9

Compare Source

New Features 🥳

  • [CodingStyle] Add StrictInArrayRector (#​7921)

Bugfixes 🐛

  • [Php71] Handle crash on partial destruct on assign var on ListToArrayDestructRector (#​7909)
  • [CodeQuality] Skip no code parameter on custom Throwable instance on ThrowWithPreviousExceptionRector (#​7912)
  • Bump to PHPStan ^2.1.40 and utilize ClassConstantReflection->isFinalByKeyword() (#​7911)
  • [Php70] Handle keep right parentheses on ternary else is BinaryOp on TernaryToNullCoalescingRector (#​7916)
  • Properly build text node for junit output formatter (#​7917), Thanks @​brandonja991!
  • [CodeQuality] Skip with custom param in previous position on ThrowWithPreviousExceptionRector (#​7919)
  • [automated] Apply Coding Standard (#​7922)
  • [DX] Define list of allowed implicit commands on ConsoleApplication (#​7918)
  • [CodeQuality] Skip used by other property hooks on InlineConstructorDefaultToPropertyRector (#​7920)
  • [automated] Apply Coding Standard (#​7926)
  • [StrictStringParamConcatRector] Skip PHP version 5.6 or earlier (#​7927), Thanks @​ghostwriter!
  • [Php85] Skip single char literal string/int on OrdSingleByteRector (#​7928)

rectorphp/rector-symfony 🎵

  • [CodeQuality] Allow Doctrine EntityManagerInterface on ControllerMethodInjectionToConstructorRector (#​926)
  • [CodeQuality] Skip has conflicted param name different object on different method on ControllerMethodInjectionToConstructorRector (#​925)
  • [Symfony73] Handle with set allowExtraFields named argument on ConstraintOptionsToNamedArgumentsRector (#​924)
  • Skip classes with Symfony 7.1 Workflow listener attributes (#​923), Thanks @​dionisvl

rectorphp/rector-doctrine 🟠

  • [TypedCollections] Skip with string key already on CompleteReturnDocblockFromToManyRector (#​480)

rectorphp/rector-phpunit 🟢

  • [CodeQuality] Skip test method via #[Test] Attribute on DataProviderArrayItemsNewLinedRector (#​664)
  • skip conflicting return node and return type in TypeWillReturnCallableArrowFunctionRector! (#​663)
  • [Phpunit12] Skip as Argument with required MockObject Type on CreateStubOverCreateMockArgRector (#​662)
  • feat: add IntersectionType support to PropertyCreateMockToCreateStubRector (#​661), Thanks @​asumikam

v2.3.8: Released Rector 2.3.8

Compare Source

Bugfixes 🐛

  • [CodeQuality] Only allow from final class or constant is marked final on VariableConstFetchToClassConstFetchRector (#​7904)
  • [CodeQuality] Skip custom exception param order flipped on no namespace on ThrowWithPreviousExceptionRector (#​7906)
  • [DeadCode] Skip different default param not typed on RemoveParentDelegatingConstructorRector (#​7905)
  • [DeadCode] Skip non-literal 0 or 1 usage on RemoveDeadZeroAndOneOperationRector (#​7907)
  • [TypeDeclarationDocblocks] Typo fix RuleDefinition description on AddVarArrayDocblockFromDimFetchAssignRector (#​7902)
  • [Php83] Fix infinite add - remove #[Override] on tearDown() method on AddOverrideAttributeToOverriddenMethodsRector when combined with NoSetupWithParentCallOverrideRector (#​7903)

rectorphp/rector-symfony

  • [CodeQuality] Skip symfony UuidV4 on ControllerMethodInjectionToConstructorRector (#​922)

v2.3.7: Released Rector 2.3.7

Compare Source

New Features 🥳


Bugfixes 🐛

  • Skip ClosureToArrowFunctionRector when closure has @​ var docblock (#​7885), Thanks @​QDenka!
  • [Php80] Skip property hook with indirect set on ClassPropertyAssignToConstructorPromotionRector (#​7887)
  • [Php70] Keep right parentheses on TernaryToNullCoalescingRector (#​7889)
  • Bump nette/utils to ^4.1.3 (part 2) (#​7894)
  • [Php72] Handle crash on hex backreference on PregReplaceEModifierRector (#​7896)
  • Update code sample for SimplifyEmptyCheckOnEmptyArrayRector (#​7897), Thanks @​ramonrietdijk!
  • [Php80] Handle Behat transform annotation (#​7899), Thanks @​loic425!
  • fix: Skip attribute decorated parameters in RemoveParentDelegatingConstructorRector (#​7900), Thanks @​marcreichel!
  • [DeadCode] Handle only remove 1 @​ var on multi vars on RemoveUselessVarTagRector (#​7884)
  • Fix abstract declaration in fixture source (#​7901), Thanks @​Victor-Vechi!

rectorphp/rector-symfony 🎵

  • [CodeQuality] Skip DateTimeInterface instance on ControllerMethodInjectionToConstructorRector (#​921)
  • [Symfony73] Skip with @​ Translate docblock on ConstraintOptionsToNamedArgumentsRector (#​920)

rectorphp/rector-phpunit 🟢

  • [PhpUnit 8] Skip on possible return array on SpecificAssertContainsRector (#​660)
  • [CodeQuality] check class exists on BehatPHPUnitAssertToWebmozartRector (#​659)
  • [behat] Add BehatPHPUnitAssertToWebmozzartRector (#​658)
  • [code-quality] Add AddKeysExistsAssertForKeyUseRector (#​657)
  • [PHPUnit120] Skip non-mock object on AllowMockObjectsWithoutExpectationsAttributeRector (#​656)
  • [CodeQuality] Skip on non-mock object on DecorateWillReturnMapWithExpectsMockRector (#​655)
  • [CodeQuality] Skip first class callable on DecorateWillReturnMapWithExpectsMockRector (#​654)
  • improve DecorateWillReturnMapWithExpectsMockRector edge cases (#​653)
  • convert tearDown in NoSetupWithParentCallOverrideRector as well (#​652)
  • [config] split off 12.5 set, just to improve readability (#​651)

rectorphp/rector-downgrade-php ⬇️

  • [DowngradePhp82] Add DowngradeUnionIntersectionRector (#​363)
  • [DowngradePhp80] Fix combine DowngradeThrowExprRector + DowngradeNullsafeToTernaryOperatorRector (#​362)
  • [DowngradePhp80] Fix on Arg and return ternary on DowngradeThrowExprRector (#​361)

v2.3.6: Released Rector 2.3.6

Compare Source

New Features 🥳


Bugfixes 🐛

  • [Php83] Handle parent class consume trait on AddOverrideAttributeToOverriddenMethodsRector (#​7868)
  • Fix fixture source warning on AddOverrideAttributeToOverriddenMethodsRector (missing TestCase suffix) (#​7869)
  • add JSON_THROW_ON_ERROR even if there is already a flag (#​7867), Thanks @​Lenny4!
  • [DeadCode] No need additional parentheses () on multiply to function call (#​7883)
  • [Php80] Handle crash on empty name attribute field value on AnnotationToAttributeRector (#​7864)
  • Fix JsonValidateRector: remove associative argument not supported by json_validate (#​7865), Thanks @​carlos-granados!
  • Fix deep ArrayItem scope filling on Foreach_ value (#​7873)
  • Fix StaticCallOnNonStaticToInstanceCallRector for same-class calls (#​7876), Thanks @​carlos-granados!
  • Bump PHPStan to 2.1.38 (#​7879)
  • [DeadCode] Allow remove @​var on expression assign on RemoveUselessVarTagRector (#​7871)
  • [DeadCode] Handle multiply to parenthesized on RemoveDeadZeroAndOneOperationRector (#​7882)

rectorphp/rector-symfony 🎵


rectorphp/rector-phpunit 🟢

  • [phpunit 12] Add CreateStubInCoalesceArgRector (#​650)
  • [code-quality] Add DecorateWillReturnMapWithExpectsMockRector (#​649)
  • [code-quality] Add RemoveStandaloneCreateMockRector (#​648)
  • add class method (#​647)
  • improve check for used mock property (#​646)
  • skip if used in array (#​645)
  • [code-quality] Add RemoveNeverUsedMockPropertyRector (#​644)
  • [phpunit 12] Add AllowMockObjectsForDataProviderRector (#​643)
  • add to setUp with only variables (#​642)
  • [phpunit 12] Add AllowMockObjectsWhereParentClassRector (#​641)
  • improve AllowMockObjectsWithoutExpectationsAttributeRector (#​639)
  • add fixture (#​638)
  • handle in call likes as well (#​637)
  • [code-quality] Add InlineStubPropertyToCreateStubMethodCallRector (#​636)
  • skip property fetch in CreateStubOverCreateMockArgRector (#​635)
  • [phpunit 12] Add PropertyCreateMockToCreateStubRector (#​634)
  • add variable support to CreateStubOverCreateMockArgRector (#​633)
  • [CodeQuality] Add failing fixture crash on deep ArrayItem as Foreach_ value on DirectInstanceOverMockArgRector (#​632)
  • skip abstract entity and interface, as cannot be instantiated (#​630)
  • [code-quality] Add ConfiguredMockEntityToSetterObjectRector (#​629)
  • [code-quality] Add AssertThatToDirectAssertRector (#​627)
  • [phpunit 12] Add ExpressionCreateMockToCreateStubRector (#​626)
  • cover interfaces in BareCreateMockAssignToDirectUseRector (#​625)
  • [code-quality] Add SuffixMockObjectPropertyRector, not enabled (#​622)
  • [phpunit 12] Add ExplicitMockExpectsCallRector (#​621)

v2.3.5: Released Rector 2.3.5

Compare Source

New Features 🥳


Bugfixes 🐛

  • Fix ArrayItem scope filling on Foreach_ value (#​7858)
  • Fix use of deprecated Node\Expr\ArrayItem over Node\ArrayItem (#​7859)
  • make PropertyFetchFinder more generic (to be used in rector-phpunit) (#​7860)
  • Fix arrow function scope search in BetterNodeFinder (#​7861)

rectorphp/rector-symfony 🎵

  • Rename Annotation\Route attributes to Attribute\Route on Symfony 7.x (#​917), Thanks @​mickverm

rectorphp/rector-doctrine 🟠

  • [ODM 2.16] Rename 'Doctrine\ODM\MongoDB\Mapping\Annotations' namespace to 'Doctrine\ODM\MongoDB\Mapping\Attribute' (#​477), Thanks @​mickverm

rectorphp/rector-phpunit 🟢

  • [code-quality] Add NoSetupWithParentCallOverrideRector (#​617)
  • [code-quality] Add BareCreateMockAssignToDirectUseRector (#​611)
  • [code-quality] Add DirectInstanceOverMockArgRector (#​609)
  • [PHPUnit 12] Add CreateStubOverCreateMockArgRector (#​608)

v2.3.4: Released Rector 2.3.4

Compare Source

Bugfixes 🐛

  • Bump to PHPStan ^2.1.36 (#​7850)
  • [Php81] Exclude Doctrine ODM MongoDB 2.16 Document and EmbeddedDocument from ReadOnlyPropertyRector. (#​7848), Thanks @​mickverm!

v2.3.3: Released Rector 2.3.3

Compare Source

Bugfixes 🐛

v2.3.2: Released Rector 2.3.2

Compare Source

New Features 🥳

  • [dx] Rename DeprecatedAnnotationToDeprecatedAttributeRector for PHP 8.5 to explicit ConstAndTraitDeprecatedAttributeRector, add trait suport (#​7823)

Bugfixes 🐛

  • Bump to PHPStan 2.1.34 and fix compatible code (rectorphp/rector-src#7844)
  • [perf] optimize ParamTypeByMethodCallTypeRector for speed with early checks (#​7831)
  • make resolveClassReflection non-nullable as always passed a node (#​7833)
  • [Php74] Skip closure in attribute on ClosureToArrowFunctionRector (#​7834)
  • Manage named arguments when removing values (#​7835), Thanks @​carlos-granados!
  • bump to PHP 8.3 + update deps + allow it in CI (#​7838)
  • Support array_values in ArrayFirstLastRector (#​7830), Thanks @​Orest-Divintari!
  • [Php85] Skip as assigned var/op on ArrayFirstLastRector (#​7843)
  • Remove no longer needed tweak AlwaysRememberedExpr on Printer per PHPStan 2.1.34 (#​7770)

rectorphp/rector-phpunit 🟢

v2.3.1: Released Rector 2.3.1

Compare Source

New Features and Changes 🥳

  • [tdd] Add AddReturnDocblockForDimFetchArrayFromAssignsRector (#​7792)
  • [tdd] Add AddReturnDocblockFromMethodCallDocblockRector (#​7796)
  • [tdd] Add AddVarArrayDocblockFromDimFetchAssignRector (#​7801)
  • [DeadCode] Add RemoveDeadIfBlocksRector (#​7528), Thanks @​john-shaffer!
  • [dead-code] Add RemoveVoidDocblockFromMagicMethodRector (#​7822) - Thanks @​parijke!
  • [experiment] Remove leaveNode() method on AbstractRector and CallableNodeVisitor (#​7767)

Bugfixes 🐛

  • Skip Doctrine Connection calls in AddReturnDocblockFromMethodCallDocblockRector (#​7797)
  • add static all support to AddReturnDocblockFromMethodCallDocblockRector (#​7798)
  • add object support to DocblockReturnArrayFromDirectArrayInstanceRector (#​7795)
  • [TypeDeclarationDocblocks] Use FQCN return docblock for array of object types on AddReturnDocblockFromMethodCallDocblockRector (#​7800), Thanks @​guanguans!
  • [php 8.3] cover private abstract constants in AddTypeToConstRector (#​7804)
  • Add check for append in foreach items assignment (#​7815), Thanks @​solverat!
  • Static closure rule ignores arguments with $this binding (#​7721), Thanks @​peterfox!
  • fix: skip non-native methods (#​7747), Thanks @​calebdw!
  • [Php74] Fix indentation space on ClosureToArrowFunctionRector with comment inner closure (#​7779)
  • [DeadCode] Handle crash when parent does not has default param and child has (#​7782)
  • fix mixed[] override with empty array in DocblockReturnArrayFromDirectArrayInstanceRector (#​7793)
  • [ChangesReporting] Fix total changed result on JsonOutputFormatter (#​7807)
  • Manage named arguments when replacing a value (#​7784), Thanks @​carlos-granados!
  • [DeadCode] Register RemoveNextSameValueConditionRector in dead-code set (#​7790)
  • [DeadCode] Skip final and non-public __construct() on RemoveParentDelegatingConstructorRector (#​7806)
  • [DeadCode][Php80] Handle crash on mix ClassPropertyAssignToConstructorPromotionRector+RemoveParentDelegatingConstructorRector (#​7799)
  • [DeadCode] Skip with elseif/else on RemoveNextSameValueConditionRector (#​7809)
  • [DeadCode] Merge comment on RemoveNextSameValueConditionRector (#​7810)
  • skip marker attribute in RemoveEmptyClassMethodRector (#​7813)
  • [DeadCode] Skip private promoted property on RemoveParentDelegatingConstructorRector (#​7817)
  • Remove rector from rule definition title (#​7820), Thanks @​simonschaufi!
  • [experiment-next] Remove leaveNode() calls on AbstractImmutableNodeTraverser (#​7778)
  • [DeadCode] Handle multi vars on RemoveNonExistingVarAnnotationRector (#​7780)
  • [Php71] Try to handle no variants on RemoveExtraParametersRector (#​7803)

v2.3.0: Released Rector 2.3

Compare Source

New Features 🥳


Bugfixes 🐛

  • Manage named arguments in ArgumentAdderRector rule (#​7777), Thanks @​carlos-granados!
  • [compat] Add SymplifyQuoteEscapeRector deprecated rule for BC layer (#​7744)
  • [Php81] Skip on Param default on ArrayToFirstClassCallableRector (#​7749)
  • [CodeQuality] Handle ternary in identical left/right on UseIdenticalOverEqualWithSameTypeRector (#​7748)
  • fix: chained calls on static calls (#​7746), Thanks @​calebdw!
  • [code-quality] Extract standalone SortAttributeNamedArgsRector from SortNamedParamRector, to slightly different areas (#​7750)
  • [rename] Rename SortNamedParamRector to SortCallLikeNamedArgsRector to be more clear about the intent (#​7751)
  • [Php85] Skip under unset() on ArrayFirstLastRector (#​7752)
  • [Php81] ArrayToFirstClassCallableRector should not skip non-public methods from owning scope (#​7760), Thanks @​acoulton!
  • [fix] wrap ternary in parenthese on string casting, if only cond is casted (#​7745)
  • [internal] Fix inline replace block removal not removed on deep block for InlineIfToExplicitIfRector + ReplaceBlockToItsStmtsRector (#​7764)
  • [TypeDeclaration] Skip class not found on ObjectTypedPropertyFromJMSSerializerAttributeTypeRector (#​7774)
  • [Php85] Skip defined int or string on ArrayKeyExistsNullToEmptyStringRector (#​7758)

Removed 💀

  • [DeadCode] Skip trait on RemoveAlwaysTrueIfConditionRector (#​7759)
  • [internal] Remove duplicated enterNode() type check already handled in node traverser (#​7717)
  • [dx] warn about deprecated beforeTraverse() method once FileNode is ready (#​7768)
  • [DeadCode] Skip next assign expr has side effect inside try {} on RemoveDoubleAssignRector (#​7775)
  • [DeadCode] Skip with different default param value child vs parent on RemoveParentDelegatingConstructorRector (#​7776)

rectorphp/rector-symfony 🎵

  • bump (#​911)
  • [code-quality] Add ReturnDirectJsonResponseRector (#​910)
  • Fix scoped downgrade SymfonyClass (#​909)
  • cover is safe (#​908)
  • [twig] add explicit attribute name arg, to improve context (#​907)
  • [Symfony73] Fix named arg different position crash on InvokableCommandInputAttributeRector (#​905)
  • [CodeQuality] Skip UserInterface instance on ControllerMethodInjectionToConstructorRector (#​904)
  • create ClassMethod directly in InvokableCommandInputAttributeRector, to keep newline per attribute (#​903)
  • Remove InvokableCommandInputAttributeRector from set (#​901)
  • [Validator] use constants for Email (#​900), Thanks @​JohJohan

rectorphp/rector-doctrine 🟠


rectorphp/rector-phpunit 🟢

  • [AnnotationsToAttributes] Handle both annotation and attributes exists on DataProviderAnnotationToAttributeRector (#​603)
  • [fix] skip AddInstanceofAssertForNullableArgumentRector on assert call (#​602)
  • [code-quality] Add AddInstanceofAssertForNullableArgumentRector (#​601)
  • use FileNode in DeclareStrictTypesTestsRector (#​599)

v2.2.14: Released Rector 2.2.14

Compare Source

Bugfixes 🐛

  • [fix] warn early about deprecated skipped rules, as not neccessary to skip anymore + restore FirstClassCallableRector and mark as deprecated to keep BC (#​7742)

v2.2.13: Released Rector 2.2.13

Compare Source

Bugfixes 🐛

  • [fix] restore missing pInterpolatedStringPart(), cover with test (#​7741)

v2.2.12: Released Rector 2.2.12

Compare Source

Bugfixes 🐛

  • [cleanup] Make FirstClassCallableRector use attributes over node traverser hacks (#​7696)
  • [CodingStyle] Skip enum case on NewlineBetweenClassLikeStmtsRector (#​7698), Thanks @​parth391!
  • [fix] skip all-but standalone assign on SetTypeToCastRector (#​7699)
  • [fix] avoid changing generic interface in NarrowObjectReturnTypeRector, focus on objects as in definition (#​7700)
  • Remove direct NodeTravser::* where possible, use node visitor attribute key instead (#​7697)

Removed and Deprecated 💀

  • [dx] add stmts aware deprecation notice in `getNodeTypes()`` (#​7692)

rectorphp/rector-symfony 🎵

  • [Symfony 8.0] move RemoveEraseCredentialsRector from symfony 7.3 to symfony 8.0 (#​895), Thanks @​EJTJ3
  • [CodeQuality] Skip different service same name on ControllerMethodInjectionToConstructorRector (#​894)
  • [code-quality] Skip enum in ControllerMethodInjectionToConstructorRector (#​893)

v2.2.11: Released Rector 2.2.11

Compare Source

Bugfixes 🐛

  • [cleanup] Make FirstClassCallableRector use attributes over node traverser hacks (#​7696)
  • [CodingStyle] Skip enum case on NewlineBetweenClassLikeStmtsRector (#​7698), Thanks @​parth391!
  • [fix] skip all-but standalone assign on SetTypeToCastRector (#​7699)
  • [fix] avoid changing generic interface in NarrowObjectReturnTypeRector, focus on objects as in definition (#​7700)
  • [transform] tidy up array dim fetch to method call rector (#​7694)
  • Remove direct NodeTravser::* where possible, use node visitor attribute key instead (#​7697)

Removed and Deprecated 💀

  • [dx] add stmts aware deprecation notice in getNodeTypes() (#​7692)

rectorphp/rector-symfony

  • [Symfony 8.0] move RemoveEraseCredentialsRector from symfony 7.3 to symfony 8.0 (#​895), Thanks @​EJTJ3
  • [CodeQuality] Skip different service same name on ControllerMethodInjectionToConstructorRector (#​894)
  • [code-quality] Skip enum in ControllerMethodInjectionToConstructorRector (#​893)

v2.2.10: Released Rector 2.2.10

Compare Source

New Features and Improvements 🥳


Bugfixes 🐛

  • [PhpParser] Add Stmt\Block to NodeGroup::STMTS_AWARE (#​7689)
  • skip already dim fetch variable on OrdSingleByteRector (#​7681)
  • [Php85] Handle crash on no arg on OrdSingleByteRector (#​7682)
  • [Php70] Handle return ternary on IfIssetToCoalescingRector (#​7683)
  • [CodingStyle] Skip use trait on NewlineBetweenClassLikeStmtsRector (#​7685)
  • [CodingStyle] Handle use trait after property on NewlineBetweenClassLikeStmtsRector (#​7687)
  • [CodeQuality] Skip with HTML on ShortenElseIfRector (#​7686)
  • [Variables] Fetch list super global variable names from PHPStan Scope::SUPERGLOBAL_VARIABLES constant (#​7663)
  • Fix typo in rule definition message (#​7690), Thanks @​simonschaufi!

rectorphp/rector-symfony 🎵

  • [code-quality] Skip enum in ControllerMethodInjectionToConstructorRector (#​893)
  • [symfony 7.3] Add CommandDefaultNameAndDescriptionToAsCommandAttributeRector (#​892)
  • [symfony 7.x] update sets (#​890)
  • [CodeQuality] Skip parent method exists on ControllerMethodInjectionToConstructorRector (#​889)
  • skip params with attributes in ControllerMethodInjectionToConstructorRector (#​887)
  • [stmts-aware] Use NodeGroup::STMTS_AWARE over StmtsAwareInterface (#​886)

rectorphp/rector-phpunit 🟢

  • [fix] Improve AssertComparisonToSpecificMethodRector for assert false (#​594)

v2.2.9: Released Rector 2.2.9

Compare Source

New Features and Changes 🥳

  • [exp] Add RemoveReturnThisFromSetterClassMethodRector (#​7624)
  • [exp] Add FluentSettersToStandaloneCallMethodRector (#​7625)
  • [dead-code] Add RemoveNextSameValueConditionRector (#​7525)
  • Update PHP upgrade support to version 8.5 (#​7644), Thanks @​guilheb!
  • [stmts-aware] Deprecate StmtsAwareInterface interface and replace with meta-type + groups (#​7679) - How to upgrade?

Bugfixes 🐛

  • Improve parent call fixture in Php4ConstructorRector not to use KEY constant (#​7642)
  • Improve ClassPropertyAssignToConstructorPromotionRector not to use STMT_KEY attribute value (#​7645)
  • [TypeDeclaration] Handle crash on combine union types on AddClosureParamTypeForArrayReduceRector (#​7636)
  • [TypeDeclaration] Skip no key generic object return on NarrowObjectReturnTypeRector (#​7623)
  • [CodingStyle] Do not use FullyQualified on "self" on ClosureFromCallableToFirstClassCallableRector (#​7632), Thanks @​devnix!
  • [Php80] Handle mix still annotation and already attribute on AnnotationToAttributeRector (#​7639), Thanks @​acoulton!
  • cleanup RemoveUnsuedPrivateMethodRector (#​7643)
  • re-index changed nodes only (#​7651)
  • avoid spl_object_id() if no change in AbstractRector (#​7653)
  • Refine bug report template formatting (#​7655), Thanks @​u01jmg3!
  • [Php85] Skip inside expression assign on ArrayFirstLastRector (#​7657)
  • Rename SymplifyQuoteEscapeRector to SimplifyQuoteEscapeRector (#​7658), Thanks @​VincentLanglet!
  • docs: fix typos in deprecation notice (#​7666), Thanks @​sir-kain!
  • [Dep] Ignore unknown class error on build/config/config-downgrade.php on shipmonk/composer-dependency-analyser to 1.8.4 (#​7668)
  • [dx] Make registration of custom NodeVisitor is easier (#​7669)
  • raise deps (rectorphp/rector-src@440d6d7)
  • [Experiment][Printer] Move AlwaysRememberedExpr tweak logic to separate service after a Match_ found (#​7654)
  • Narrow object return type v2 (#​7618), Thanks @​Orest-Divintari!
  • [Php80] Handle OpenApi\Attributes\Property example to keep numeric string on AnnotationToAttributeRector (#​7677)
  • keep file without namespace implementing interface to alling with other nodes (#​7679)
  • [EarlyReturn] Handle If, elseIf, else all returned on RemoveAlwaysElseRector (#​7659)
  • [DeadCode] skip Ds\Map::get() on RemoveNullArgOnNullDefaultParamRector (#​7665)

Removed 💀

  • [DeadCode] Skip used from property fetch reference on loop on RemoveUnusedVariableAssignRector (#​7635)
  • [internal] Extract ImmutableNodeTraverser from vendor, to remove patch and keep using cache for node types (#​7634)
  • Deprecated STMT_KEY and remove its set attribute value (#​7647)
  • [attribute] Remove unused AttributeKey::REPRINT_RAW_VALUE (#​7664)



rectorphp/rector-symfony 🎵

  • [stmts-aware] Use NodeGroup::STMTS_AWARE over StmtsAwareInterface (#​886)
  • Fix rule when method is __invoke (#​884), Thanks @​wilfi00
  • [CodeQuality] Do not replace variable assign on ControllerMethodInjectionToConstructorRector (#​883)
  • Handle Doctrine constraints in ConstraintOptionsToNamedArgumentsRector (#​882), Thanks @​johndodev
  • [CodeQuality] Skip FOS\RestBundle ParamFetcher on ControllerMethodInjectionToConstructorRector (#​881)
  • [CodeQuality] Skip autowire() method via @​required and Required attribute (#​880)
  • Fix scoped \ cleared on single quote string on ControllerMethodInjectionToConstructorRector (#​879)
  • [CodeQuality] Skip Common Entity contains subnamespaces on ControllerMethodInjectionToConstructorRector (#​878)
  • [CodeQuality] Skip from route path /edit/{id} on ControllerMethodInjectionToConstructorRector (#​877)
  • handle use var (#​875)
  • Remove STMT_KEY from rules (#​874)
  • Remove stmt key from LogoutHandlerToLogoutEventSubscriberRector (#​870)
  • Fix build of prefixed SymfonyFunctionName::REF and SymfonyFunctionName::SERVICE usage (#​869)
  • [config] Fix couple config autowire rules (#​868)
  • Fix unit test (#​867)
  • skip constructor in ControllerMethodInjectionToConstructorRector (#​866)
  • [code-quality] Add ControllerMethodInjectionToConstructorRector (#​865)



rectorphp/rector-phpunit 🟢

  • [CodeQuality] Skip Generator on AssertCompareOnCountableWithMethodToAssertCountRector (#​591)
  • remove stmt key from ConstructClassMethodToSetUpTestCaseRector (#​590)
  • Remove stmt key from TestListenerToHooksRector (#​589)
  • fix phpunit covers default class with short covers methods (#​588), Thanks @​irosner
  • [CodeQuality] Do not use FullyQualified on "self" on WithCallbackIdenticalToStandaloneAssertsRector (#​587)
  • [phpunit 10] Improve PropertyExistsWithoutAssertRector coverage (#​586)
  • [depre] Deprecate AssertPropertyExistsRector as method was removed in PHPUnit 10 (#​585)
  • [depre] Deprecate RemoveDataProviderParamKeysRector as the keys can be useful to improve test readability (#​584), Thanks @​MacDada
  • [CodeQuality] Handle on without namespace on DeclareStrictTypesTestsRector (#​583)

v2.2.8: Released Rector 2.2.8

Compare Source

New Features 🥳

  • [type-declaration] Add return data provider array type from strict test method param (#​7605)
  • [coding-style] Add NestedTernaryToMatchRector (#​7572)
  • [TypeDeclaration] Register NarrowObjectReturnTypeRector to type declaration set (#​7615)

Bugfixes 🐛

  • [Diffs] Handle --no-diffs usage to show file have been changed if any with --dry-run + --no-diffs (#​7619)
  • [Php81] Skip callable variadic in array_all() on FunctionLikeToFirstClassCallableRector (#​7606)
  • fix a syntax error in the ArrayFirstLastRector rule documentation (#​7613), Thanks @​esnard!
  • Narrow object return type (#​7575), Thanks @​Orest-Divintari!
  • [type-declaration] Rename NarrowTooWideReturnType to NarrowWideUnionReturnTypeRector (#​7614)
  • [TypeDeclaration] Also update generic collection docblock on NarrowObjectReturnTypeRector (#​7616)
  • [TypeDeclaration] Do not change valid generic docblock on NarrowObjectReturnTypeRector (#​7617)
  • [Privatization] Do not remove readonly on promoted property on PrivatizeFinalClassPropertyRector (#​7611)

Removed 💀

  • [dx] help - omit explicit command name as no longer needed; remove verbosity option, use debug instead (#​7620)

rectorphp/rector-symfony 🎵

  • ensure reset args after loop (#​864)
  • Bump PHPStan to ^2.1.32 and fix test for InlineClassRoutePrefixRector (#​863)
  • [Symfony74] replace PropertyMetadata deprecated functions (#​862), Thanks @​MrYamous
  • [Symfony74] update WorkflowDumpCommand namespace (#​861), Thanks @​MrYamous
  • add property support to ErrorNamesPropertyToConstantRector (#​860)
  • Support converting all options to twig attributes (#​859), Thanks @​Spea

rectorphp/rector-phpunit 🟢

  • [CodeQuality] Skip in static method on AssertFuncCallToPHPUnitAssertRector (#​582)
  • add implicit method call support (#​581)
  • add multi callbacks support (#​580)
  • allow extra stmt (#​579)
  • add dynamic instanceof support (#​578)
  • [code-quality] Add SimplerWithIsInstanceOfRector (#​577)
  • add sole instanceof support (#​576)
  • add use var (#​575)
  • add return type or empty if nothing to add (#​574)
  • [code-quality] Add MergeWithCallableAndWillReturnRector (#​573)
  • handle solo identical as well, to get better message (#​572)
  • always return true, as required by contract (#​571)
  • add external variable use (#​570)
  • add isset support, revert order to respect original one (#​569)
  • [code-quality] Add WithCallbackIdenticalToStandaloneAssertsRector (#​568)

rectorphp/rector-downgrade-php ⬇️

  • Bump to PHPStan ^2.1.32 and ignore false positive instanceof in OR usage (#​344)

v2.2.7: Released Rector 2.2.7

Compare Source

New Features 🥳

  • [type-declaration] Add ReturnIteratorInDataProviderRector (#​7593)
  • [type-declarations] Add TypedStaticPropertyInBehatContextRector (#​7596)
  • [DeadCode] Register RemoveNullArgOnNullDefaultParamRector to dead code set (#​7597)
  • [php 8.5] Split of nested functions calls to pipe operator in a new standalone rule (#​7603)

Bugfixes 🐛

  • always add nullable on TypedPropertyFromJMSSerializerAttributeTypeRector as serializer does not use constructor (#​7599)
  • [Php81] Skip callable param union on FunctionLikeToFirstClassCallableRector (#​7589)
  • [CodeQuality] Skip ArrayDimFetch with BitwiseXor on CombinedAssignRector (#​7590)
  • [Php84] Skip variable extraction with return early on ForeachToArrayAllRector (#​7591)
  • [PHP 8.5] rename NestedToPipeOeratorRector to SequentialAssignmentsToPipeOperatorRector, handle only assigns, not nested calls (#​7588)
  • [Php81] Skip as Arg of non-native function call on FunctionLikeToFirstClassCallableRector (#​7592)
  • skip different args passed to call-like and required by arrow function in FunctionLikeToFirstClassCallableRector (#​7594)
  • handle public properties in TypedPropertyFromJMSSerializerAttributeTypeRector as nullable (#​7595)
  • skip to many in /TypedPropertyFromJMSSerializerAttributeTypeRector (#​7598)
  • skip refernce one as well in /TypedPropertyFromJMSSerializerAttributeTypeRector (rectorphp/rector-src@842aa94)
  • split TypedPropertyFromJMSSerializerAttributeTypeRector to scalar and object types (#​7602)
  • Don't require parentheses for short-ternaries (#​7604), Thanks @​martinstuecklschwaiger!

rectorphp/rector-symfony 🎵

  • [Configs] Skip first class callable on RemoveConstructorAutowireServiceRector (#​858)

rectorphp/rector-phpunit 🟢

  • [depre] Deprecate SetUpBeforeClassToSetUpRector as can break code easily (#​567)

v2.2.6: Released Rector 2.2.6

Compare Source

New Features 🥳

  • [PHP 8.5] Add NestedToPipeOperatorRector (#​7577)
  • [code-quality] Add DirnameDirConcatStringToDirectStringPathRector (#​7552)
  • [dead-code] Add RemoveNullArgOnNullDefaultParamRector (#​7562)
  • register AddClosureParamTypeFromIterableMethodCallRector to type declaration set (rectorphp/rector-src@4d78f41)
  • register AddParamArrayDocblockBasedOnCallableNativeFuncCallRector in type declaration docblocks (rectorphp/rector-src@80f7db8)

Bugfixes 🐛

  • Fix next catch missed variable rename in CatchExceptionNameMatchingTypeRector (#​7547)
  • [Php81] Fix first class callable should not have trailing comma on FunctionLikeToFirstClassCallableRector (#​7551)
  • [CodingStyle] Skip Method target not found or defined only via @​method on FunctionLikeToFirstClassCallableRector (#​7553)
  • [Php81][CodingStyle] Allow both exists in both @​method and native method on FunctionLikeToFirstClassCallableRector (#​7559)
  • [Php81][CodingStyle] Skip param used as invokable function multi args on FunctionLikeToFirstClassCallableRector (#​7563)
  • [Php81][CodingStyle] Skip Closure/ArrowFunction as assign expr on FunctionLikeToFirstClassCallableRector (#​7564)
  • finalize rules as well (#​7575), Thanks @​Orest-Divintari!
  • [Php85] Clean up dynamic expr check on NestedToPipeOperatorRector (#​7578)
  • [Php81] Skip Closure bindTo on FunctionLikeToFirstClassCallableRector (#​7581)
  • Remove trait support rom AddParamBasedOnParentClassMethodRector as depends on context; move to Class_ node hooking for efficiency (#​7587)
  • [Php85] Handle indent inside class method on NestedToPipeOperatorRector (#​7584)
  • make DeclareStrictTypesRector skip files without namespace, as very risky in files without PSR-4 autodiscovery (#​7585)
  • speedup - skip refleciton if all params are typed (rectorphp/rector-src@08f6dc3)
  • skip all-typed properties in TypedPropertyFromStrictConstructorRector (rectorphp/rector-src@c5d9fdf)
  • skip no-type params in RenameParamToMatchTypeRector (rectorphp/rector-src@cd7eb93)
  • optimize ParamTypeByParentCallTypeRector to handle only classes with parents and method without param type (rectorphp/rector-src@0ca4e91)
  • [DeadCode] Allow FuncCall on RemoveNullArgOnNullDefaultParamRector (#​7567)
  • [DeadCode] Handle with middle default not null on RemoveNullArgOnNullDefaultParamRector (#​7565)
  • [DeadCode] Allow remove named argument if position is match with param on RemoveNullArgOnNullDefaultParamRector (#​7566)
  • [comments] Remove attribute comments support as comments require standalone line before any doctrine annotation (#​7582)

Removed and Deprecated 💀

  • [depre] Deprecate ParentClassToTraitsRector as very narrow use case to be generic, create custom rule instead (#​7550)
  • [depre] Deprecate ReplaceParentCallByPropertyCallRector as not used since doctrine set service removed, not standalone rule (#​7554)
  • [depre] Deprecate MethodCallToNewRector as not used and based on assumptions (#​7555)
  • [depre] Deprecate MethodCallToPropertyFetchRector, as not practical/used and part of removed set (#​7556)
  • [depre] Deprecate MethodCallToPropertyFetchRector as not used and part of removed set (#​7557)
  • [depre] Deprecate PropertyFetchToMethodCallRector not used and as too generic, use custom rule instead (#​7558)
  • [depre] Deprecate PropertyAssignToMethodCallRector as too narrow use-case and never used (#​7561)
  • [depre] Deprecate ReturnTypeWillChangeRector as discourages from filling correct types, use type declaration set instead (#​7570)
  • [depre] Deprecate MultiDimensionalArrayToArrayDestructRector as not part of any set, can create less readable and harder to analyse code (#​7573)
  • [depre] Deprecate InlineVarDocTagToAssertRector as not par of any set, and create prod crashing code (#​7574)
  • [depre] Deprecate AddAllowDynamicPropertiesAttributeRector, as not in PHP sets and does not help by adding attribute everywhere (#​7568)
  • [depre] Deprecate AddLiteralSeparatorToNumberRector as cannot be automated and depends on context (#​7569)

rectorphp/rector-symfony 🎵

  • [Configs] Skip first class callable on RemoveConstructorAutowireServiceRector (#​858)
  • [config] Add FromServicePublicToDefaultsPublicRector (#​857)
  • cover 2nd arg class in RemoveConstructorAutowireServiceRector (#​856)
  • [config] Add RemoveConstructorAutowireServiceRector (#​855)
  • [Symfony73] Skip empty result of named arguments on ConstraintOptionsToNamedArgumentsRector (#​853)
  • [depre] Deprecate StringExtensionToConfigBuilderRector as deprecated in Symfony 7.4 (#​854)

rectorphp/rector-phpunit 🟢

  • [code-quality] Add DeclareStrictTypesTestsRector to code-quality test (#​566)
  • [depre] Deprecate AddParentSetupCallOnSetupRector as not generic to be automated, fill manually where needed (#​565)
  • [CodeQuality] Skip used inside static closure on AssertFuncCallToPHPUnitAssertRector (#​564)
  • register ReplaceAtMethodWithDesiredMatcherRector to code-quality (#​563)
  • [depre] Deprecate CreateMockToAnonymousClassRector as requires manual work, often value object setter can be better alternative (#​562)

v2.2.5: Released Rector 2.2.5

Compare Source

Rules Registered in sets 🥳

Couple long-existing rules were added to PHP 8.1, code quality and type declaration sets after optional community testing ✔️
If you'll experience any undersired changes, let us know 👍


Bugfixes 🐛

  • [fix] skip variadic param on ParamTypeByParentCallTypeRector (#​7532)
  • [Php81][CodingStyle] Skip multi params on FunctionLikeToFirstClassCallableRector (#​7537)
  • [Php81][CodingStyle] Skip callable param assign with signature multi params on FunctionLikeToFirstClassCallableRector (#​7538)
  • Fix NullToStrictStringFuncCallArgRector with probabilistic check for plural array passed to function where array allowed (#​7539)
  • [Php81][CodingStyle] Skip variadic not used on FunctionLikeToFirstClassCallableRector (#​7540)
  • [Php81] Keep nullable param on NewInInitializerRector (#​7545)
  • [php 8.1] skip nullable property without null default in NewInInitializerRector (#​7546)

Removed and deprecated 💀

  • [depre] Deprecate 3 configurable-only, never used closure param rules as too specific (#​7541)
  • [depre] Deprecate RenameFunctionLikeParamWithinCallLikeArgRector as never used, too narrow and better suits custom project (#​7544)
  • [depre] Deprecate AddTypeFromResourceDocblockRector as breaks code and does not solve any real problem (#​7542)
  • [Php81] Completely remove AttributeGroupNewLiner (#​7536)



rectorphp/rector-phpunit 🟢

  • [depre] Add never used AddCoversClassAttributeRector, as very opionated and requires very specific file location - use custom rule instead (#​561)
  • Fix implicit PHP and PHPUnit version in RequiresAnnotationWithValueToAttributeRector (#​560)
  • [code-quality] Add AssertArrayCastedObjectToAssertSameRector (#​559)

v2.2.4: Released Rector 2.2.4

Compare Source

New Features 🥳

  • [code-quality] Add RepeatedAndNotEqualToNotInArrayRector (#​7517)
  • [code-quality] Add ReplaceConstantBooleanNotRector (#​7527)
  • [code-quality] Add VariableConstFetchToClassConstFetchRector (#​7457)
  • [coding-style] Add BinaryOpStandaloneAssignsToDirectRector (#​7466)

Bugfixes 🐛

  • Fix autoload preload on PHPUnit 12+ on global installation (#​7468) (#​7472) (#​7475)
  • [TypeDeclaration] Skip override from parent method on AddParamStringTypeFromSprintfUseRector (#​7479)
  • Run PHPUnit 12 and PHPStan compatibilty check (#​7455)
  • [TypeDeclarationDocblocks] Handle repeated item type on DocblockReturnArrayFromDirectArrayInstanceRector (#​7459)
  • [BetterPhpDocParser] Unique handling string on BracketsAwareUnionTypeNode (#​7462)
  • [CodeQuality] Skip non-variable fetch on VariableConstFetchToClassConstFetchRector as may cause side effect (#​7464)
  • [CodingStyle] Skip any CallLike with args !== [] on BinaryOpStandaloneAssignsToDirectRector (#​7469)
  • [CodingStyle] Skip compare binary op on BinaryOpStandaloneAssignsToDirectRector (#​7470)
  • [CodingStyle] Skip by ref params on BinaryOpStandaloneAssignsToDirectRector (#​7471)

Removed and deprecated 💀

  • [deprecated] Deprecate strict-types rules as risky and not practical (#​7523)
  • [DeadCode] Skip vars exists in static vars on RemoveNonExistingVarAnnotationRector (#​7463)
  • [autoload] Remove PHPUnit version 12 check on preload.php load (#​7474)
  • [Removal] Remove --kaizen option, as it might jump right to risky rules, use levels instead (#​7478)

rectorphp/rector-phpunit

v2.2.3: Released Rector 2.2.3

Compare Source

New Features 🥳

  • [code-quality] Add VariableConstFetchToClassConstFetchRector (#​7457)
  • [coding-style] Add BinaryOpStandaloneAssignsToDirectRector (#​7466)
  • [type-declaration] Add AddParamStringTypeFromSprintfUseRector (#​7477)

Bugfixes 🐛

  • [TypeDeclaration] Skip override from parent method on AddParamStringTypeFromSprintfUseRector (#​7479)
  • [ci] Run PHPUnit 12 and PHPStan compatibilty check (#​7455)
  • [TypeDeclarationDocblocks] Handle repeated item type on DocblockReturnArrayFromDirectArrayInstanceRector (#​7459)
  • [BetterPhpDocParser] Unique handling string on BracketsAwareUnionTypeNode (#​7462)
  • [CodeQuality] Skip non-variable fetch on VariableConstFetchToClassConstFetchRector as may cause side effect (#​7464)
  • Fix autoload preload on PHPUnit 12+ on global installation (#​7468)
  • [DeadCode] Skip vars exists in static vars on RemoveNonExistingVarAnnotationRector (#​7463)

Removed 💀

v2.2.2: Released Rector 2.2.2

Compare Source

This release contains important fix for Rector custom rules running on PHPUnit 12.2+ ✔️

PHPUnit started to preload it's own php-parser version, that conflicts with Rector's one. Now we preload our side first again. Your tests shall run 👍 If not: let us know in: #​9416


New Features 🥳

  • [tdd] Add AddParamArrayDocblockBasedOnArrayMapRector (#​7435)
  • [Php85] Add ShellExecFunctionCallOverBackticksRector (#​7445)

Bugfixes 🐛

  • [Scoped] Load early preload.php on scoped bootstrap.php on phpunit 12+ running (#​7451)
  • [autoload] Fix phpstan + rector tests co-run to avoid duplicated php-parser loading error (#​7440)
  • [Php80] Skip inside by ref method on ChangeSwitchToMatchRector (#​7443)
  • [Renaming] Allow self/static on RenamePropertyRector (#​7444)
  • Directly check type of substr() on RecastingRemovalRector (#​7446)
  • [fix] Skip symfony config closures on FirstClassCallableRector as they do not support first class callables (#​7447)
  • [DeadCode] Skip ClassLikeNameClassNameImportSkipVoter for RecastingRemovalRector (#​7448)
  • [dead-code] Skip substr casting removal on PHP 7.x, as can return false|string (#​7449)
  • [Php74] Skip used in compact on ClosureArrowFunctionAnalyzer (#​7453)
  • [TypeDeclarationDocblocks] Fix missing backslash on class-string type on DocblockGetterReturnArrayFromPropertyDocblockVarRector (#​7454)

v2.2.1: Released Rector 2.2.1

Compare Source

Bugfixes 🐛

  • Fix php 7.4 regression on strtolower to false on ClassLikeNameClassNameImportSkipVoter (#​7436)
  • [CodeQuality] Handle property fetch and common nodes crash on InlineArrayReturnAssignRector (#​7437)

v2.2.0: Released Rector 2.2

Compare Source

This release includes dozens of fixes, new PHP and Type Declaration rules, many Symfony Console rules improvements...

...and one brand new set: type coverage docblocks 🎉 🎉 🎉

Read the gist on our blog - Rector 2.2: New rules for Array Docblocks


New Features and Improvements 🚀

New rules for Type Coverage Docblocks:

  • Add AddReturnDocblockForCommonObjectDenominatorRector (#​7249)
  • Add AddParamArrayDocblockFromDimFetchAccessRector (#​7253)
  • Add AddParamArrayDocblockFromDataProviderRector (#​7257)
  • Add ClassMethodArrayDocblockParamFromLocalCallsRector (#​7259)
  • Add AddReturnDocblockDataProviderRector (#​7266)
  • Add fixture for data provider return options (#​7268)
  • Add AddReturnDocblockForArrayDimAssignedObjectRector (#​7302)
  • Add DocblockVarArrayFromPropertyDefaultsRector (#​7311)
  • Add DocblockVarArrayFromGetterReturnRector (#​7313)
  • Add AddReturnDocblockForJsonArrayRector (#​7320)
  • Add AddParamArrayDocblockFromAssignsParamToParamReferenceRector (#​7323)
  • [dx] add withTypeCoverageDocblockLevel() (#​7363)

  • [dead-code] Add RemoveUnusedVariableUseRector (#​7430)
  • [Php 8.5] Add WakeupToUnserializeRector (#​7242), Thanks @​arshidkv12!
  • [code-quality] Add RepeatedOrEqualToInArrayRector (#​7400)
  • [Php 8.1] Add NullToStrictIntPregSlitFuncCallLimitArgRector (#​7240)
  • feat: add greater and smaller support to StrlenZeroToIdenticalEmptyStringRector (#​7329), Thanks @​calebdw!
  • [TypeDeclaration] Allow empty array to native array on AddMethodCallBasedStrictParamTypeRector (#​7342)
  • [TypeDeclaration] Allow named arg on AddArrayFunctionClosureParamTypeRector (#​7397)
  • [type-declarations] Add KnownMagicClassMethodTypeRector (#​7419)
  • Add rector to migrate __sleep() to __serialize() (#​7212), Thanks @​arshidkv12!
  • [type-declaration] Add AddParamFromDimFetchKeyUseRector (#​7424)
  • Add first class callable support to CallUserFuncArrayToVariadicRector (#​7428)

Bugfixes 🐛

  • fix: remove empty construct when parent has no construct (#​7239), Thanks @​calebdw!
  • fix: overly strict ArraySpreadInsteadOfArrayMergeRector (#​7247), Thanks @​calebdw!
  • [CodingStyle] Skip non-native array type on PHP 7.4 for ArraySpreadInsteadOfArrayMergeRector (#​7248)
  • fix: FunctionLikeToFirstClassCallableRector (#​7265), Thanks @​calebdw!
  • fix: EnumCaseToPascalCaseRector skips existing pascal case (#​7264), Thanks @​calebdw!
  • [CodeQuality] Skip init not empty array on InlineArrayReturnAssignRector (#​7276)
  • fix: EnumCaseToPascalCaseRector bugs (#​7278), Thanks @​calebdw!
  • Avoid complex nesting in ConstantArrayTypeGeneralizer (#​7282)
  • [TypeDeclaration] Fix return by variable anonymous on ReturnTypeFromReturnNewRector (#​7292)
  • [Php84] Allow early return on ForeachToArrayAllRector (#​7316), Thanks @​Orest-Divintari!
  • [TypeDeclaration] Fix configurable on IncreaseDeclareStrictTypesRector to show on getrector.com (#​7327)
  • Skip nested array dim fetch assigns in InlineArrayReturnAssignRector (#​7380)
  • [CodeQuality] Fix escape character on SimplifyRegexPatternRector (#​7390)
  • Try use double quote on SimplifyRegexPatternRector (#​7392)
  • [type-declarations] Open isset check in StrictArrayParamDimFetchRectorTest, move to last position in type-declaration level (#​7388)
  • [CodeQuality] allow coalesce not on full variable, but dim fetch in StrictArrayParamDimFetchRector (#​7404)
  • [CodeQuality] Skip bool equal integer on UseIdenticalOverEqualWithSameTypeRector (#​7411)
  • update comment on fixtures (#​7413)
  • [CodeQuality] Use ->isBoolean() check on compare boolean and constant bool on UseIdenticalOverEqualWithSameTypeRector (#​7415)

Removed 💀

  • [Differ] Remove ConsoleDiffer, use DefaultDiffer that utilize ColorConsoleDiffFormatter instead to avoid double diffing process (#​7309)

Rector Symfony 🎵

  • [Symfony61] Handle already exists attributes name on CommandConfigureToAttributeRector (#​849)
  • [Symfony 6.2] Move symfony/security-core to security-http and security-bundle as target class/contant exists there (#​848)
  • [Symfony73] Remove extends AbstractExtension after apply change on GetFunctionsToAsTwigFunctionAttributeRector (#​846)
  • [code-quality] keep attribute in InlineClassRoutePrefixRector if it contains other metadata (#​845)
  • [console] [7.3] Add implicit boolean type in InputOption::VALUE_NONE option (#​844)
  • [console] [7.3] Add type declaration based on default value type in InvokableCommandInputAttributeRector (#​843)
  • [console] [7.3] add array argument support to /InvokableCommandInputAttributeRector (#​842)
  • [console] [7.3] Add support for default values in InvokableCommandInputAttributeRector (#​841)
  • [console] [7.3] Add const names in InvokableCommandInputAttributeRector + fix -_ naming to camel case (#​840)
  • [console] [7.3] Fix missing options in InvokableCommandInputAttributeRector (#​839)
  • [console] [7.3] Replace input/output with symfony style if used in InvokableCommandInputAttributeRector (#​838)

Rector Doctrine 🟠

  • [dbal] [4.0] remove constant rename, as will be turned into enum right away and required manaul upgrade (#​467)
  • Fix PHPStan notice on PHPStan 2.1.23 (#​466)

Rector PHPUnit 🟢

  • [CodeQuality] Ensure verify ClassReflection->hasConstructor() on MethodParametersAndReturnTypesResolver (#​550)
  • [CodeQuality] Skip not match position named argument part 2 (#​548)
  • [code-quality] add New_ support to ScalarArgumentToExpectedParamTypeRector (#​547)
  • [phpunit] [9.0] resolve WithConsecutiveRector naming ad-hoc to PHPUnit real code (#​546)

v2.1.7: Released Rector 2.1.7

Compare Source

New Features 🥳


Bugfixes 🐛

  • fix: skip privatizing Laravel Model attributes and scopes (#​7218), Thanks @​calebdw!
  • [CodeQuality] Change behaviour of OptionalParametersAfterRequiredRector to fill null default value when previous param is optional (#​7222)
  • [CodeQuality] Handle intersection on OptionalParametersAfterRequiredRector (#​7223)
  • [CodeQuality] Fill reasonable default value on OptionalParametersAfterRequiredRector (#​7226)
  • Support Param nodes in makeNonFinal() (#​7228), Thanks @​arshidkv12!
  • [CodeQuality] Add Closure support on OptionalParametersAfterRequiredRector (#​7224)



rectorphp/rector-symfony 🎵

  • [console] [7.3] add array argument support to /InvokableCommandInputAttributeRector (#​842)
  • [console] [7.3] Add support for default values in InvokableCommandInputAttributeRector (#​841)
  • [console] [7.3] Add const names in InvokableCommandInputAttributeRector + fix -_ naming to camel case (#​840)
  • [console] [7.3] Fix missing options in InvokableCommandInputAttributeRector (#​839)
  • [console] [7.3] Replace input/output with symfony style if used in InvokableCommandInputAttributeRector (#​838)

rectorphp/rector-doctrine 🟠

  • add target document support to CompletePropertyDocblockFromToManyRector (#​465)
  • add support for multiple items (#​464)
  • [typed-collections] Add CollectionDocblockGenericTypeRector (#​463)
  • fix document service repository class (#​462)
  • [code-quality] add document repository support to AddAnnotationToRepositoryRector (#​461)

rectorphp/rector-phpunit 🟢

  • [code-quality] add local call support to ScalarArgumentToExpectedParamTypeRector (#​543)
  • cover scalar argument in behat as well (#​542)
  • [CodeQuality] Skip not match position named argument on ScalarArgumentToExpectedParamTypeRector (#​540)
  • add float support to scalar argument rule (#​539)
  • Add nullable support to ScalarArgumentToExpectedParamTypeRector (#​538)
  • [CodeQuality] Handle crash on no @​depends on AddParamTypeFromDependsRector (#​537)

v2.1.6: Released Rector 2.1.6

Compare Source

rectorphp/rector-phpunit

  • [code-quality] add with() + callback() support to TypeWillReturnCallableArrowFunctionRector (#​535)
  • [CodeQuality] Handle crash on no @​ depends on AddParamTypeFromDependsRector (#​537)

v2.1.5: Released Rector 2.1.5

Compare Source

New Features 🥳


Bugfixes 🐛

  • [TypeDeclaration] Skip integer index on string on AddArrowFunctionParamArrayWhereDimFetchRector (#​7178)
  • [TypeDeclaration] Skip Valid type from return doc and typed param on AddMethodCallBasedStrictParamTypeRector (#​7172)
  • [Renaming] Keep parentheses on RenameCastRector (#​7153)
  • [CodeQuality] Skip next inside array_filter() on SimplifyEmptyArrayCheckRector (#​7154)
  • Clean up ternary on ColonAfterSwitchCaseRector (#​7158)
  • fix: convert static::* to self::* for all constant access in final classes (#​7159), Thanks @​calebdw!
  • fix: static to self static method call on final class (#​7160), Thanks @​calebdw!
  • fix multi-line error message format (#​7164), Thanks @​FeBe95!
  • [CodeQuality] Skip @​final doc with public property on ConvertStaticToSelfRector (#​7168)
  • [CodeQuality] Skip @​final doc with public class constant on ConvertStaticToSelfRector (#​7170)
  • Ensure native ReflectionClassConstant->isFinal() exists by check real php version (#​7171)
  • Fix RemoveDuplicatedCaseInSwitchRector behavior (#​7173), Thanks @​max-s-lab!
  • replace PHP_EOL with \n when used with symfony console (#​7174), Thanks @​FeBe95!
  • [CodeQuality] Handle parentheses inner if with assign on CombineIfRector (#​7179)
  • [DeadCode] Fix merge comments on RemoveAlwaysTrueIfConditionRector (#​7181)
  • [Naming] Skip rename override method from /vendor/ on RenameParamToMatchTypeRector (#​7182)
  • [Php84] Handle named key argument with flipped position on ArrayKeyExistsNullToEmptyStringRector (#​7186)
  • skip constructor param hook on ReadOnlyPropertyRector (#​7192), Thanks @​tandev!
  • [Php84] Skip value extraction on ForeachToArray* rules (#​7193)
  • [Scope] Handle Scope refreshing on Attribute on print string with NOWDOC (#​7194)
  • [Transform] Fix example config on FuncCallToNewRector (#​7196)
  • [Composer] Make InstalledPackageResolver::resolvedInstalledPackages nullable to verify cached package lists (#​7210)
  • [AutoImport] Do not rename different namespaced function on auto import + RenameFunctionRector (#​7214)
  • Rectify (#​7216)
  • [DeadCode] Skip non-public __clone() method on RemoveEmptyClassMethodRector (#​7187)

Removed and reprecated 💀

  • Throw Deprecatation on StaticToSelfStaticMethodCallOnFinalClassRector and ConvertStaticPrivateConstantToSelfRector (#​7165)
  • [Php85] Remove calls to deprecated no-op functions (#​7128), Thanks @​mttsch!
  • [8.4][DeprecatedAnnotationToDeprecatedAttributeRector] Remove invalid example (#​7202), Thanks @​DanielEScherzer!
  • Remove removed "Rector\Symfony\Set\FOSRestSetList/JMSSetList/SensiolabsSetList" usage (#​7204)



rectorphp/rector-symfony 🎵

  • restore SymfonyInternalSetList to allow relative paths to sets, use internally only (#​837)
  • [code-quality] add filter_var() support to ParameterBagTypedGetMethodCallRector (#​836)
  • [CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector (#​835)
  • [code-quality] Add ParameterBagTypedGetMethodCallRector (#​834)
  • [config] add symfony cache pool support to StringExtensionToConfigBuilderRector (#​832)
  • [doctrine] add mapping type support to StringExtensionToConfigBuilderRector (#​831)
  • [config] Add query/result cache doctrine support in StringExtensionToConfigBuilderRector (#​830)
  • [config] Add monolog and dbal fixes to StringExtensionToConfigBuilderRector (#​829)
  • [SYMFONY 7.4] replace function call routing (#​828), Thanks @​JohJohan

rectorphp/rector-phpunit 🟢

  • [code-quality] Add ScalarArgumentToExpectedParamTypeRector (#​533)
  • [CodeQuality] Fix assertGreater/Less apply on AssertComparisonToSpecificMethodRector (#​532)
  • [CodeQuality] Skip docblock based type on AddReturnTypeToDependedRector (#​530)
  • Remove unused check return with expr as already covered on ReturnAnalyzer (#​529)
  • [code-quality] Add AddReturnTypeToDependedRector (#​528)
  • [code-quality] Add AddParamTypeFromDependsRector (#​525)
  • Fix target method on dataProvider on DataProviderAnnotationToAttributeRector (#​524)
  • [AnnotationToAttribute] Handle already in use on DataProviderAnnotationToAttributeRector (#​523)
  • [CodeQuality] Skip already has return type on TypeWillReturnCallableArrowFunctionRector (#​518)
  • Drop MatchAssertEqualsExpectedTypeRector (#​517)
  • [CodeQuality] Handle crash on native "object" type on TypeWillReturnCallableArrowFunctionRector (#​516)
  • [CodeQuality] Skip return createMock() on TypeWillReturnCallableArrowFunctionRector (#​515)
  • [CodeQuality] Rename MatchAssertSameExpectedTypeRector to MatchAssertEqualsExpectedTypeRector to only apply on assertEquals (#​514)
  • [code-quality] Add MatchAssertSameExpectedTypeRector (#​510)
  • add GetMockBuilderGetMockToCreateMockRector to code quality set (#​509)

rectorphp/rector-downgrade-php

  • [DowngradePhp83] Add DowngradeJsonValidateRector (#​313)
  • [DowngradePhp81] Handle parent is void on DowngradeNeverTypeDeclarationRector (#​311)
  • [DowngradePhp81] Skip check version_compare with if on DowngradeHashAlgorithmXxHashRector (part 3) (#​309)
  • [DowngradePhp81] Skip check version_compare with ternary on DowngradeHashAlgorithmXxHashRector (part 2) (#​308)
  • [DowngradePhp81] Skip check php version with ternary on DowngradeHashAlgorithmXxHashRector (part 1) (#​307)
  • [DowngradePhp81] Add PHP_VERSION_ID < 80100 check on DowngradeSetAccessibleReflectionPropertyRector (#​306)

v2.1.4: Released Rector 2.1.4

Compare Source

Bugfixes 🐛

v2.1.3: Released: Rector 2.1.3

Compare Source

New Features 🥳

  • Add ClosureFromCallableToFirstClassCallableRector rule (#​7071), Thanks @​devnix!
  • [Php81] added RemoveReflectionSetAccessibleCallsRector (#​7085), Thanks @​NickSdot!
  • [type-declaration] Add AddReturnTypeFromTryCatchTypeRector (#​7099)
  • Add check phpstan if phpstan is running on preload.php (#​7040)
  • [type-coverage] Add support for same returned object in ReturnTypeFromReturnNewRector (#​7096)
  • feat: add support for set, isset, and unset operations in ArrayDimFetchToMethodCallRector (#​7095), Thanks @​calebdw!
  • [TypeDeclaration] Skip try catch finally different type on AddReturnTypeFromTryCatchTypeRector (#​7101)
  • [type-declaration] Add AddArrayFilterClosureParamTypeRector (#​7111)
  • [type-coverage] Improve AddArrowFunctionParamArrayWhereDimFetchRector to handle multiple functions (#​7112)
  • add list<...> support to AddArrayFunctionClosureParamTypeRector (#​7116)
  • feat: add RemoveReadonlyPropertyVisibilityOnReadonlyClassRector (#​7115), Thanks @​calebdw!
  • feat: add laravel to RectorConfigBuilder::withComposerBased (#​7110), Thanks @​calebdw!
  • [Renaming] Add RenameCastRector (#​7117), Thanks @​mttsch!
  • [type-declarations] Add TypedPropertyFromDocblockSetUpDefinedRector (#​7135)
PHP 8.5 🚀

Bugfixes 🐛

  • [TypeDeclaration] Handle crash on direct callable without params on AddArrayFunctionClosureParamTypeRector (#​7131)
  • [TypeDeclaration] Skip ArrayAccess as array item type on AddArrowFunctionParamArrayWhereDimFetchRector (#​7113)
  • [Renaming] Allow rename attribute on Param on RenameAttributeRector (#​7072)
  • [CodeQuality] Mirror comment on InlineConstructorDefaultToPropertyRector (#​7074)
  • [CodeQuality] Move logic directly for merge comments on InlineConstructorDefaultToPropertyRector (#​7075)
  • [CodingStyle] Fix variable in the middle on WrapEncapsedVariableInCurlyBracesRector (#​7076)
  • [CodeQuality] Skip Never type by @​return docblock on ExplicitReturnNullRector (#​7078)
  • [Naming] Skip var used after switch on RenameForeachValueVariableToMatchExprVariableRector (#​7080)
  • [Naming] Use ScopeFetcher::fetch() near its usage on RenameForeachValueVariableToMatchExprVariableRector (#​7081)
  • [AutoImport] Handle auto import short name on global namespace (#​7086)
  • [TypeDeclaration] Skip ArrayAccess on StrictArrayParamDimFetchRector (#​7087)
  • [Php81] Handle on ternary on NullToStrictStringFuncCallArgRector (#​7091)
  • fix: sorting of named parameters in variadic functions (#​7090), Thanks @​calebdw!
  • fix: skip AssignOps in ArrayDimFetchToMethodCallRector (#​7100), Thanks @​calebdw!
  • Skip PhpdocTypesFixer of PhpCsFixer on Scalar node (#​7103)
  • fix: skip variable assignments in get_defined_vars (#​7106), Thanks @​calebdw!
  • [Php80] Skip not match property hook type with parameter type on ClassPropertyAssignToConstructorPromotionRector (#​7109)
  • [DeadCode] Early check GenericTypeNode is not dead code on DeadVar/ReturnParam Analyzer (#​7118)
  • [Config] Allow php85: true on withPhpSets() (#​7130)
  • [Php84] Allow on return on ForeachToArrayAnyRector (#​7119), Thanks @​Orest-Divintari!
  • [TypeDeclaration] Keep Generic type docblock on TypedPropertyFromDocblockSetUpDefinedRector (#​7140)
  • fix: allow more nodes to be passed to AttributeGroupNewLiner (#​7145), Thanks @​calebdw!
  • [DeadCode] Skip used in compact() on RemoveUnusedForeachKeyRector (#​7073)
  • [DeadCode] Handle assign on Arg on RemoveUnusedPrivatePropertyRector (#​7092)
  • [DeadCode] Skip Templated type on param and return on RemoveUselessParamTagRector and RemoveUselessReturnTagRector under IntersectionType (#​7093)
  • [DeadCode] Skip mixed fallback null on trait on RemoveAlwaysTrueIfConditionRector (#​7098)
  • [DeadCode] Skip with first class callable on RemoveUnusedPrivateMethodParameterRector (#​7104)
  • [DeadCode] Skip with get_defined_vars() on RemoveUnusedPrivateMethodParameterRector ([#​7105](rectorphp/rector-src#7105


rectorphp/rector-symfony 🎵

  • [CodeQuality] Skip got duplicated method after suffix removed on ActionSuffixRemoverRector (#​827)
  • Keep AsCommand in InvokableCommandInputAttributeRector documentation (#​824), Thanks @​bobvandevijver



rectorphp/rector-doctrine 🟠

  • [CodeQuality] Keep param/return doc with description on TypeNullableEntityFromDocblockRector (#​460)
  • [code-quality] Add TypeNullableEntityFromDocblockRector to add safe types to doctrine entities (#​459)



rectorphp/rector-phpunit 🟢

  • Cover array shape iterator for YieldDataProviderRector+RemoveUselessReturnTagRector. (#​505), Thanks @​biozshock

v2.1.2: Released Rector 2.1.2

Compare Source

Bugfixes 🐛

  • [Php82] Handle array dim fetch variable on VariableInStringInterpolationFixerRector (#​7060)
  • [Php82] Ensure ArrayDimFetch var is Variable to transform {$ on VariableInStringInterpolationFixerRector (#​7061)
  • Update LNumber and DNumber to Int_ and Float_ (#​7062)
  • [DeadCode] Handle crash on empty content on SimplifyIfElseWithSameContentRector (#​7063)
  • Fix return on SimplifyIfElseWithSameContentRector (#​7064)
  • [CodeQuality] Skip when class has __isset() method on IssetOnPropertyObjectToPropertyExistsRector (#​7067)
  • [ReplaceArgumentDefaultValueRector] handle multiple replace argument values (#​9256) (#​7068), Thanks @​JohJohan!

New Features 🥳

  • [Php56] Add parentheses on unary minus pow left on PowToExpRector (#​7065)

Removed 💀

  • [removal] Remove RectorConfigBuilderRector as not maintained and broken (#​7066)

rectorphp/rector-symfony

  • [SYMFONY 4.4] replace Link withRel and withoutRel argument values with constants (#​821), Thanks @​JohJohan
  • [SYMFONY 5.1] replace Cookie withSameSite argument values with constants (#​819), Thanks @​JohJohan
  • [SYMFONY 4.2] replace Cookie argument values with constants (#​818), Thanks @​JohJohan
  • [SYMFONY 3.2] replace Cookie argument values with constants (#​817), Thanks @​JohJohan
  • [SYMFONY 6.3] replace Link argument values with constants (#​816), Thanks @​JohJohan
  • [Symfony73] Handle nested array on ConstraintOptionsToNamedArgumentsRector (#​815)
  • [Symfony 74] Rename Application::add() to Application::addCommand() (#​813), Thanks @​mttsch
  • [SYMFONY 4.4] replace Link argument values with constants (#​812), Thanks @​JohJohan
  • [Symfony 74] Rename Application::add() to Application::addCommand() (#​809), Thanks @​mttsch

rectorphp/rector-doctrine

  • Update deprecated ArrayItem, Lnumber to use under Node, and Int_ instead (#​456)

rectorphp/rector-phpunit

  • Update to use ArrayItem under Node (#​504)

rectorphp/rector-downgrade-php

  • [DowngradePhp80] Handle not match @​return with native return type on DowngradeUnionTypeDeclarationRector (#​295)
  • Clean up origNode set on DowngradeArrayAllRector (#​294)
  • [DowngradePhp84] Add DowngradeArrayFindKeyRector (#​293)
  • [DowngradePhp84] Add DowngradeArrayFindRector (#​292)
  • [DowngradePhp84] Add DowngradeArrayAnyRector (#​291)
  • [DowngradePhp84] Add DowngradeArrayAllRector (#​290)

v2.1.1: Released Rector 2.1.1

Compare Source

New Features 🥳


Bugfixes 🐛

  • [CodeQuality] Properly handle Goto_ on ExplicitReturnNullRector (#​7018)
  • [Php84] Skip non-array on ForeachToArray* rules (#​7023)
  • [Console] Handle hidden "process" with --option without = on ConsoleApplication (#​7022)
  • [Php80] Handle with property hook on ClassPropertyAssignToConstructorPromotionRector (#​7024)
  • [Scoped] Exclude DateRangeError on Scoper for prefixing (#​7027)
  • [Php84] Handle multi lines text on DeprecatedAnnotationToDeprecatedAttributeRector (#​7028)
  • [Php55] Avoid $scope = ScopeFetcher::fetch($node); when not needed on GetCalledClassToStaticClassRector (#​7029)
  • Fix crash on ExactCompareFactory::createBooleanAnd/Or (#​7031)
  • Move ScopeFetcher::fetch() to near its usage (#​7032)
  • [CodeQuality][Php84] Handle crash on ForeachToArrayFindRector+OptionalParametersAfterRequiredRector (#​7033)
  • [Php84] Skip foreach value used after foreach on ForeachToArray* rules (#​7034)
  • [Php84] Handle key used on conditional on ForeachToArray* rules (#​7035)
  • [code-quality] Make ctor defined dynamic properties private, as most probably case (#​7036)
  • [PostRector] Keep first comment after declare(strict_types=1) on UnusedImportRemovingPostRector (#​7042)
  • [Php80] Make configurable to allow skip on model based classes on ClassPropertyAssignToConstructorPromotionRector (#​7043)
  • [Kaizen] Save kaizen applied rules into cache to make works on parallel (#​7046)
  • [Kaizen] No need filter unchanged files when --kaizen is used (#​7050)
  • [Kaizen] When no files changed, early return empty on FilesFinder, even on kaizen (#​7051)
  • [Kaizen] Enforce clear cache when there is files changed + kaizen enabled (#​7052)
  • Fix ambiguous variable name (#​7053)
  • [Php84] Handle with space on message like class name constant on DeprecatedAnnotationToDeprecatedAttributeRector (#​7056)
  • [CodeQuality] LogicalToBooleanRector should add parentheses on equal (#​7048)
  • [Kaizen] Remove unneeded clean kaizen cache since all cache cleared early when there are files to be changed + kaizen enabled (#​7054)



rectorphp/rector-symfony 🎵

  • Fix code style issues (#​810), Thanks @​mttsch
  • [Symfony 74] Rename Application::add() to Application::addCommand() (#​809), Thanks @​mttsch
  • Fix links to Symfony 7.2/7.3 upgrade documents (#​808), Thanks @​mttsch
  • [Symfony 7.3] Handle existing named array arguments in ConstraintOptionsToNamedArgumentsRector (#​807), Thanks @​gharlan
  • [Symfony 73] add ConstraintOptionsToNamedArgumentsRector (#​806), Thanks @​pedrocasado
  • Twig attributes: make methods public (#​805), Thanks @​gharlan
  • AddVoteArgumentToVoteOnAttributeRector (#​804), Thanks @​tugmaks
  • [CodeQuality] Skip first class callable on StringCastDebugResponseRector (#​803)
  • [code-quality] Add StringCastDebugResponseRector (#​802)
  • add casting to string to AssertSameResponseCodeWithDebugContentsRector as response can be null, and message requires string (#​801)

rectorphp/rector-doctrine 🟠


rectorphp/rector-phpunit 🟢

v2.1.0: Released Rector 2.1

Compare Source

This release comes with new PHP 8.4 rules and 2 new config options, that make rules more powerful 💪


New Features 🥳

In this release we also add 2 DX features to streamline upgrades:

  • [DX] Add ->withTreatClassesAsFinal() on so can be used in typed rules (#​6974)
    • this extends more conservative rules to apply on classes that are not final
  • [experimental] Add --kaizen option to apply only first X rules at a time (#​6876)
    • this option will apply first X rules; especially great to make upgrade steps small, but relevant - check the PR for more

Bugfixes 🐛

  • [Php80] Skip non-abstract method trait on AddParamBasedOnParentClassMethodRector (#​6992)
  • [Php81] Skip has JMS attribute on ReadOnlyPropertyRector (#​6979)
  • [TypeDeclaration] Move JMS class string definition constant to ClassName value object (#​6980)
  • [PhpAttribute] Ensure count($attributeGroups) before loop to avoid repetitive annotation product only single AttributeGroup (#​6985)
  • [code-quality] use direct instanceof instead of dummy null, if nullable object type is known (#​6987)
  • Fix object type in TypedPropertyFromJMSSerializerAttributeTypeRector (#​6989)
  • ExplicitReturnNullRector: skip on goto (#​6988), Thanks @​staabm!
  • fix invalid string property type without default in PropertyTypeFromStrictSetterGetterRector (#​6993)
  • [CodeQuality] Skip first class callable on TernaryImplodeToImplodeRector (#​6997)
  • Fix: Array Duplicated Key which is dynamic (#​6999), Thanks @​peterfox!
  • [Php83] Ensure class->isAbstract() on FeatureFlags::treatClassesAsFinal() check (#​7003)
  • [TypeDeclaration] Handle crash on generic iterable on TypedPropertyFromJMSSerializerAttributeTypeRector (#​7004)
  • [TypeDeclaration] Use common has < string for detect iterable types (#​7005)
  • Covers scenario where func_get_args used in constructor (#​7006), Thanks @​peterfox!
  • [DeadCode] Move Param used via variadic functions to ParamAnalyzer (#​7016)
  • [DeadCode] Skip used by unpack and named argument on RemoveUnusedPrivateMethodParameterRector (#​6976)
  • [DeadCode] Handle multiple default on RemoveArgumentFromDefaultParentCallRector (#​6978)
  • [DeadCode] Skip abstract method on RemoveUnusedPublicMethodParameterRector (#​7002)
  • [DeadCode] Allow named argument removal if argument position is equal with parameter position equal name on RemoveUnusedPrivateMethodParameterRector (#​6977)
  • [Php80] Skip used in finally on RemoveUnusedVariableInCatchRector (#​6982)
  • [DeadCode] Allow remove normal param that mix with property promotion on RemoveUnusedConstructorParamRector (#​7017)

rectorphp/rector-symfony 🎵

  • fix to type arg name (#​800)
  • [jms] Add AccessorAnnotationToAttributeRector (#​799)
  • [jms] Add custom AccessTypeAnnotationToAttributeRector to handle annotation flip to attribute correctly (#​798)

rectorphp/rector-doctrine 🟠

  • [typed-collections] Add RemoveNullFromInstantiatedArrayCollectionPropertyRector (#​452)
  • skip behats (#​451)
  • skip RemoveIfInstanceofCollectionRector in tests (#​450)
  • add generic union support (#​448)
  • add param / return test fixture (#​447)
  • add docblock support to NarrowArrayCollectionToCollectionRector (#​446)
  • initialize default array even for non-entity-property collections (#​445)
  • remover default null (#​444)
  • add local call setter support (#​443)
  • Add intersection support to NarrowPropertyUnionToCollectionRector (#​442)
  • remove nullable property type (#​441)
  • Add native return type declaration support to NarrowReturnUnionToCollectionRector (#​440)
  • add array-filter to ArrayMapOnCollectionToArrayRector (#​439)
  • [typed-collections] Add CurrentOnCollectionToArrayRector (#​438)
  • [typed-collections] Add RemoveUselessIsEmptyAssignRector (#​437)
  • add boolean and not null case (#​436)
  • skip it (#​435)
  • [typed-collections] Add RemoveIfCollectionIdenticalToNullRector (#​434)
  • add native property type support to NarrowPropertyUnionToCollectionRector (#​433)
  • add union null type support to RemoveNullFromNullableCollectionTypeRector (#​431)
  • add nullable property doclbock support to RemoveNullFromNullableCollectionTypeRector (#​430)
  • [typed-collections] Add ArrayOffsetSetToSetCollectionCallRector (#​429)
  • include message as well (#​428)
  • add static call support to AssertSameCountOnCollectionToAssertCountRector (#​427)
  • keep args in RemoveNullsafeOnCollectionRector (#​426)
  • [typed-collections] Add AssertSameCountOnCollectionToAssertCountRector (#​425)
  • [typed-collections] Add RemoveAssertNotNullOnCollectionRector (#​424)
  • [typed-collections] Add AssertNullOnCollectionToAssertEmptyRector (#​423)

v2.0.19

Compare Source

v2.0.18: Released: Rector 2.0.18

Compare Source

New Features 🥳

  • Bump to PHP-Parser ^5.5.0 (#​6946)
  • [DeadCode] Add RemoveArgumentFromDefaultParentCallRector (#​6949)
  • [DeadCode] Add RemoveDeadCatchRector rule (#​6939), Thanks @​P3gucka!

Bugfixes 🐛

  • [Php80] Add more exact Expr node that always bool for switch(true) usage on ChangeSwitchToMatchRector (#​6965)
  • [Php80] Prevent adding empty return when stringable always throws (#​6968), Thanks @​Mika-!
  • [php 8.0] Check if class is an attribute in AnnotationToAttributeRector, to avoid non-attribute bug (#​6954)
  • [Transform] Fix FQCN usage on new name on MergeInterfacesRector (#​6956)
  • Rectify (#​6957)
  • [Printer] Skip change new line as space on anonymous class on print (#​6958)
  • [Printer] Use regex string new space detection for anonymous class (#​6959)
  • [Php80] Handle dynamic bool expr on ChangeSwitchToMatchRector (#​6961)
  • [Php80] Do not change to match(true) on defined case cond on ChangeSwitchToMatchRector (#​6962)
  • [Php80] Do not change to match(true) on variable from param on case cond on ChangeSwitchToMatchRector (#​6963)
  • Fix fixture file name (#​6964)
  • [Renaming] [Symfony 7.0] Skip ClassConstFetch that rename its ->class to Interface that constant not exists in new interface (#​6966)
  • Fix stub (#​6967)
  • [DeadCode] Clean up useless union StmtsAwareInterface|ClassMethod on TerminatedNodeAnalyzer (#​6969)
  • [Php80] Handle has silent void on StringableForToStringRector (#​6970)
  • [PostRector] Clean up rename process on ClassRenamingPostRector (#​6971)
  • [DeadCode] Early check skip no extends on RemoveDefaultArgumentFromParentCallRector (#​6950)
  • [DeadCode] Allow remove createMock method call on RemoveUnusedVariableAssignRector (#​6951)
  • [DeadCode] Skip when next catch is parent class exception with special treatment over just throw on RemoveDeadCatchRector (#​6952)

rectorphp/rector-symfony 🎵

  • [Symfony 7.3] Handle commands without configure method in InvokableCommandInputAttributeRector (#​797), Thanks @​gharlan
  • [Symfony 7.3] Handle fluent call addArgument and addOption on InvokableCommandInputAttributeRector (#​795)
  • Twig attributes: add required first param (#​793), Thanks @​gharlan
  • Fix namespace of console Option attribute (#​792), Thanks @​gharlan
  • fix: Normalize variable names by replacing hyphens with underscores in Symfony73 command argument and option processing (#​790), Thanks @​antoniovj1
  • remove return tags in TemplateAnnotationToThisRenderRector as no longer needed (#​788)
  • return array if is array type in TemplateAnnotationToThisRenderRector (#​786)
  • Bump to php-parser 5.5.0 and update fixture attributes usage (#​784)

rectorphp/rector-doctrine 🟠

  • [typed-collections] Add RemoveNullsafeOnCollectionRector (#​420)
  • skip assign of New_ to CollectionParamTypeSetterToCollectionPropertyRector (#​419)
  • fix reprint of type in CollectionSetterParamNativeTypeRector (#​418)
  • Various improvements in typed-collections set (#​417)
  • Skip RemoveNullFromNullableCollectionTypeRector if not exactly 1 param or in tests (#​416)
  • [typed-collections] allow 2nd+ param to be nullable in CollectionSetterParamNativeTypeRector as most likely null can be passed as non-setter (#​415)
  • cleanup redundant fixtures, single rule (#​414)
  • [Dbal40] Skip different object on ExecuteQueryParamsToBindValueRector (#​413)
  • [dbal 4.0] Add ExecuteQueryParamsToBindValueRector (#​412)
  • [dbal 4.0] Add deprecated PDO class to enum like (#​411)
  • [dbal 4.2] Add AddArrayResultColumnNamesRector (#​410)

rectorphp/rector-downgrade-php ⬇️

  • [DowngradePhp73] Real patch for previous node token just swapped with trailing comma and named argument (take 2) (#​288)
  • [Test] Add more test fixture for downgrade named argument with trailing comma (#​287)
  • [Down to PHP 7.2] Handle download named argument with trailing comma (#​285)

v2.0.17: Released: Rector 2.0.17

Compare Source

New Features 🥳

  • [Php85] Add ArrayFirstLastRector (#​6900)
  • Use active voice and add markdown style for code blocks (#​6897), Thanks @​simonschaufi!
  • [Php83] Add ReadOnlyAnonymousClassRector (#​6916)
  • [Php83] Add DynamicClassConstFetchRector (#​6922)
  • [Test] Add test for crash after reprint Stmt (#​6924)
  • [Command] Fix to make additionalAutoloader->autoloadPaths() works on both parallel and non-parallel proccess (#​6927)
  • [Alternative] Add EnumCaseToPascalCaseRector with use of DynamicSourceLocatorProvider (#​6899)

Bugfixes 🐛

  • Directly use isNames() in rector rules (#​6896)
  • [StrContainsRector] also replace multibyte functions fro strpos and strstr (#​6901), Thanks @​JohJohan!
  • [DeadCode] IsClassMethodUsedAnalyzer needs to use Scope from Class_ level (#​6910)
  • [Php84] Skip with parentheses on class on NewMethodCallWithoutParenthesesRector (#​6911)
  • [CodeQuality] Skip Assign Op on ternary on SimplifyUselessVariableRector (#​6913)
  • Rectify to trigger latest build (#​6914)
  • [Php82] Handle implicit public readonly on ReadOnlyClassRector (#​6919)
  • Use dynamic check on last on ClassConstManipulator (#​6921)
  • bump (rectorphp/rector-src@695228f)
  • [Naming] Re-use repetitive DateTimeInterface object type check on services into PropertyNaming service (#​6926)
  • [AutoImport] Skip conflict aliased with docblock on auto import (#​6929)
  • [AutoImport] Skip reserved class names on auto import (#​6933)
  • [AutoImport] Fix empty uses on auto import + rename class on no namespaced file (#​6935)
  • [Php83] Fix invalid constant use READONLY_CLASS -> READONLY_ANONYMOUS_CLASS on ReadOnlyAnonymousClassRector (#​6936)
  • fix: RenameMethodRector does not rename trait methods (#​6928), Thanks @​LordSimal!
  • [CodeQuality] Skip late static binding use on CompleteDynamicPropertiesRector (#​6938)
  • [dx] report false skipped rules in more nicer way (#​6941)
  • [PHP84] Deprecated annotation to Deprecated attribute (#​6923), Thanks @​peterfox!
  • [Renaming] Allow rename method in trait itself on RenameMethodRector (#​6942)
  • [Renaming] Handle rename caller on trait on RenameMethodRector (#​6944)
  • [TypeDeclaration] Fix crash on already return static on AddReturnTypeDeclarationRector (#​6940)
  • [TypeDeclaration] Handle crash on return different over static on AddReturnTypeDeclarationRector-a (#​6943)

Removed 💀

  • Use active voice and remove note about PHPUnit (#​6907), Thanks @​simonschaufi!
  • [DeadCode] Skip used by Array callable on RemoveEmptyClassMethodRector (#​6908)
  • [DeadCode] Use IsClassMethodUsedAnalyzer service on RemoveEmptyClassMethodRector (#​6909)
  • [DeadCode] Handle called by static call on RemoveUnusedPrivateMethodParameterRector (#​6912)
  • [DeadCode] Skip used by $this on RemoveUnusedPrivateClassConstantRector (#​6920)



rectorphp/rector-symfony 🎵

  • Update to use ramsey/composer-install@​v2 (#​782)
  • [Symfony 7.3] Make __invoke() public in InvokableCommandInputAttributeRector (#​779), Thanks @​mickverm
  • Fix ClassConstFetch use on InvokableCommandInputAttributeRector (#​778)
  • [Symfony 7.3] handle name from constant on InvokableCommandInputAttributeRector (#​777)
  • [Symfony 7.3] Remove Argument argument: mode on InvokableCommandInputAttributeRector (#​776), Thanks @​mickverm
  • [Symfony 7.3] Make nullable argument param type on Optional InputArgument::OPTIONAL on InvokableCommandInputAttributeRector (#​775)
  • [Symfony 7.3] Keep $output param on InvokableCommandInputAttributeRector (#​774)
  • [Symfony 7.3] Add Argument arguments: name, mode, description on InvokableCommandInputAttributeRector (#​773)
  • [Symfony 7.3] Handle with #[\Override] on InvokableCommandInputAttributeRector (#​772)

rectorphp/rector-doctrine 🟠

  • skip default param array, to respect colleciton type (#​408)
  • Add array<> support to /NarrowParamUnionToCollectionRector (#​407)
  • [typed-collections] Add CollectionSetterParamNativeTypeRector (#​406)
  • only remove new array collection to a new property (#​405)
  • Update to use ramsey/composer-install@​v2 (#​404)
  • [typed-collections] Add embed many support InitializeCollectionInConstructorRector (#​403)
  • Add static call support to setter array collection wrap (#​402)
  • [typed-collections] Decouple RemoveIsArrayOnCollectionRector (#​401)
  • [typed-collections] Allow new array in tests for RemoveNewArrayCollectionOutsideConstructorRector (#​400)
  • [typed-collections] Allow new array in tests for RemoveNewArrayCollectionOutsideConstructorRector (#​399)
  • [typed-collections] Add nullable support to array wrapper rule (#​398)
  • [TypedCollections] Use directly param->type->type assign on RemoveNullFromNullableCollectionTypeRector (#​397)
  • [typed-collections] Add RemoveNullFromNullableCollectionTypeRector rule (#​396)
  • Typed collections fixes (#​395)
  • [typed-collections] remove DefaultNewArrayCollectionRector as duplicate of InitializeCollectionInConstructorRector (#​394)
  • Fix scoper Doctrine class in use statement prefixed with RectorPrefix (#​393)
  • [typed-collections] Add dozens of rules to handle doctrine collection types (#​392)
  • Rename ExplicitRelationCollectionRector to InitializeCollectionInConstructorRector (#​391)
  • [typed-collections] Make TypedPropertyFromToManyRelationTypeRector work only for native types, docblocks are handled in another rule (#​390)
  • [typed-collections] Decouple new namespace and move 4 rules there (#​389)
  • Directly use isName(s) and getName() on rector rules (#​388)
  • Add mapped superclass case to ToManyRelationPropertyTypeResolver (#​387)
  • Remove array on collection in TypedPropertyFromToManyRelationTypeRector (#​386)
  • Remove default null value in TypedPropertyFromToManyRelationTypeRector (#​384)

rectorphp/rector-phpunit 🟢

  • [code-quality] Add additional non-static methods to NonAssertNonStaticMethods (#​497), Thanks @​philiprabbett
  • [CodeQuality] Skip in static arrow function on PreferPHPUnitThisCallRector (#​496)
  • Update to use ramsey/composer-install@​v2 (#​495)
  • Only remove @​covers when target exists (#​494)
  • PHPUnit 10/11 Only set attribute when target attribute class exists on CoversAnnotationWithValueToAttributeRector (#​493)
  • [AnnotationsToAttributes] Apply to class level on @​uses on AnnotationWithValueToAttributeRector (#​492)
  • [PHPUnit 12] Add RemoveOverrideFinalConstructTestCaseRector (#​491)
  • [CodeQuality] Skip with if else condition result on AddInstanceofAssertForNullableInstanceRector (#​489)

v2.0.16: Released Rector 2.0.16

Compare Source

New Features 🥳

  • [dx] add symfonyRoute and symfonyValidator option to ->withAttributesSets() to ease upgrade (#​6882)
  • [nette/utils] [4.0] Add upgrade set to handle named args in Json class (#​6884)

Bugfixes 🐛

  • [TypeDeclaration] Skip __destruct() from add return type based on parent on AddReturnTypeDeclarationBasedOnParentClassMethodRector (#​6883)
  • [CodeQuality] Skip with init non empty dynamic array on ForeachItemsAssignToEmptyArrayToAssignRector (#​6881)
  • UseIdenticalOverEqualWithSameTypeRector should not trust phpdoc (#​6880), Thanks @​staabm!
  • [Php70] Handle class named Pool on Php4ConstructorRector (#​6887)
  • [Php73] Handle key() called multiple times on ArrayKeyFirstLastRector (#​6888)
  • Clean up repetitive recursive call and flag on ArrayKeyFirstLastRector (#​6889)
  • [Config] Handle config realpath() actually has asterisk, not pattern (#​6891)
  • [Php82] Handle implicit "public" on construtor promotion on ReadOnlyClassRector (#​6895)



rectorphp/rector-symfony 🎵

  • [Symfony73] Skip different object on GetFunctionsToAsTwigFunctionAttributeRector (#​767)
  • skip magic first class callable (#​766)
  • [symfony 7.2] AddPushRequestToRequestStackConstructorRector (#​765)
  • [Symfony 7.3] kick off GetFunctionsToAsTwigFunctionAttributeRector (#​764)
  • [Symfony 7.3] Handle first class callable on GetFiltersToAsTwigFilterAttributeRector (#​763)
  • Register symfony73-twig-bundle into Symfony7SetProvider (#​762)
  • [symfony 7.3] Add GetFiltersToAsTwigFilterAttributeRector to migrate #[TwigFilter] (#​761)
  • [code-quality] Improve TemplateAnnotationToThisRenderRector to keep ternary types (#​758)
  • Keep JsonResponse type (#​757)
  • Remove array shape return in TemplateAnnotationToThisRenderRector as no longer used (#​755)
  • Add attribute support to TemplateAnnotationToThisRenderRector (#​754)
  • [7.3] Update InvokableCommandRector to InvokableCommandInputAttributeRector to improve discoverability (#​743)

rectorphp/rector-doctrine 🟠

  • Remove array on collection in TypedPropertyFromToManyRelationTypeRector (#​386)
  • Remove default null value in TypedPropertyFromToManyRelationTypeRector (#​384)
  • [collection] Add embed many annotation support to TypedPropertyFromToManyRelationTypeRector (#​383)
  • Fix #[AsListener] attribute location to doctrine bundle 2.8, deprecate doctrine constants and refer to composer based sets (#​382)

rectorphp/rector-phpunit 🟢

  • Detect Test Attribute in TestsNodeAnalyzer::isTestClassMethod (#​486), Thanks @​Levivb
  • [code-quality] Skip ctor to setup in ConstructClassMethodToSetUpTestCaseRector for non-test classes, e.g. helpers (#​485)
  • [phpunit 10] Add ParentTestClassConstructorRector (#​484)

v2.0.15: Released Rector 2.0.15

Compare Source

New features and changes 🎉

  • [parallel] bump default threads from 16 to 32 to keep up with modern technology (#​6877)

Bugfixes 🐛

  • [TypeDeclaration] Reduce repetitive new ObjectType() on each properties on TypedPropertyFromCreateMockAssignRector (#​6869)
  • [CodeQuality] Handle with parentheses on SimplifyIfReturnBoolRector (#​6871)
  • [Naming] Skip protected property on non-final class on RenamePropertyToMatchTypeRector (#​6872)
  • [PHPStan 2.1.14] Fix resolve __toString() parent non builtin method without return type (#​6879)
  • [phpstan] prefer isName() from abstract class over protected service (#​6875)
  • [DeadCode] Skip value from docblock on RemoveFilterVarOnExactTypeRector (#​6873)



rectorphp/rector-symfony 🎵

  • [symfony 6.2] Fix attribute adding on abstract class in MessageHandlerInterfaceToAttributeRector (#​724)

rectorphp/rector-phpunit 🟢

  • [depre] Remove deprecated AssertCountWithZeroToAssertEmptyRector (#​483)
  • Ensure that rule PreferPHPUnitSelfCall refactor call only for static methods, not any (#​482), Thanks @​andrew-demb
  • [tests] add test fixture for double instanceof check (#​481)
  • [PhpUnit] Skip different object on PreferPHPUnit(This/Self)CallRector (#​480)

v2.0.14: Released Rector 2.0.14

Compare Source

Bugfixes 🐛

  • [EarlyReturn] Skip re-assign in loop on PreparedValueToEarlyReturnRector (#​6867)
  • [EarlyReturn] Only check on loop when initialAssign is set on PreparedValueToEarlyReturnRector (#​6868)

v2.0.13: Released Rector 2.0.13

Compare Source

Bugfixes 🐛

  • [naming] Skip public properties in RenamePropertyToMatchTypeRector to avoid external code conflicts (#​6860)
  • feat: handle edge cases of DateFuncCallToCarbonRector (#​6822), Thanks @​tony-stark-eth!
  • [CodeQuality] Skip ArrayDimFetch on IssetOnPropertyObjectToPropertyExistsRector (#​6862)
  • [type-declaration] Skip intersection type on TypedPropertyFromCreateMockAssignRector (#​6863)
  • [Configuration] Fix composer resolver with custom vendor-dir (#​6864), Thanks @​maxime-vf!
  • Ensure pass string on PathNormalizer::normalize() on InstalledPackageResolver (#​6865)

rectorphp/rector-symfony 🎵

  • [Symfony 7.3] add constant and test for 7.3 and test help to attribute #​718 (#​722), Thanks @​JohJohan
  • Update fixture on parent construct empty usage (#​719)

rectorphp/rector-doctrine 🟠

  • improve add generics annotation to repository to code quality doctrine set (#​380)

v2.0.12: Released Rector 2.0.12

Compare Source

New Features 🥳

  • [dx] [experimental] Prepend command name automatically if only paths are passed (#​6759)

# before
vendor/bin/rector process src

# now - default command is run, no need to write the sole main command manually
vendor/bin/rector src
  • [Configuration] [experimental] Add ability to specify file path without extension (#​6839)
  • [type-declaration] Add AddClosureParamArrayWhereDimFetchRector (#​6815)
  • [dx] add test to check that a rule is not applied if it does not change the code (#​6794), Thanks @​carlos-granados!
  • [renaming Add enum support to rename method (#​6832)
  • [Php83] Make configurable to allow add #[\Override] on override empty method on AddOverrideAttributeToOverriddenMethodsRector (#​6831)
  • [Transform] Follow parent construct before add new param on StaticCallToMethodCallRector (#​6854)

Bugfixes 🐛

  • Skip DateTime from property type to property renaming to keep code readable (#​6812)
  • Add a hint how to upgrade custom SetListInterface to Rector 2.0 (#​6816), Thanks @​alexander-schranz!
  • Return if var type has changed in PhpDocTypeChanger (#​6813), Thanks @​carlos-granados!
  • fix: RenamePropertyToMatchTypeRector renames DateTimeInterface (#​6814), Thanks @​tony-stark-eth!
  • [TypeDeclaration] ReturnTypeFromStrictNewArrayRector support list (#​6820), Thanks @​staabm!
  • [Php80] Handle null value on AnnotationToAttributeRector (#​6821)
  • [DeadCode] Handle crash on no stmts on ReplaceBlockToItsStmtsRector (#​6824)
  • [type-declaration] Override existing wrong type on TypedPropertyFromCreateMockAssignRector (#​6826)
  • [TypeDeclaration] Skip already typed with PHPUnit\Framework\MockObject\MockObject on TypedPropertyFromCreateMockAssignRector (#​6827)
  • [NodeTypeResolver] Pass null on 2nd arg on ReflectionProvider->getFunction() to ensure get correct function (#​6829)
  • [Php80] Handle aliased with multi properties on AnnotationToAttributeRector (#​6838)
  • [Configuration] Fix root standalone registered rules verify on RectorConfigBuilder (#​6840)
  • [Php73] Fix escaped single quote on RegexDashEscapeRector (#​6843)
  • [Php80] Handle crash on @​testdoc with rector-phpunit AnnotationWithValueToAttributeRector (#​6846)
  • Fix scoped error on ClassConstFetchAnnotationToAttributeMapper (#​6848)
  • [PhpAttribute] Handle multi double colon on AnnotationWithValueToAttributeRector (#​6851)
  • [Transform] Follow empty parent construct parameters on StaticCallToMethodCallRector (#​6855)
  • [TypeDeclaration] Skip with closure inside on AddArrowFunctionParamArrayWhereDimFetchRector (#​6817)
  • [Php71] Skip replaced native function on RemoveExtraParametersRector (#​6828)
  • [DeadCode] Skip switch break not unreachable on RemoveUnreachableStatementRector (#​6837)

rectorphp/rector-symfony 🎵

  • Clean up #[RunClassInSeparateProcess] tweak (#​721)
  • [CodeQuality] Handle crash on no extensions on StringExtensionToConfigBuilderRector (#​717)
  • add ampersand support (#​716)
  • [code-quality] Add SplitAndSecurityAttributeToIsGrantedRector (#​715)
  • [code-quality] Add SecurityAttributeToIsGrantedRector (#​714)
  • [code-quality] Add attribute-existance check to SecurityAttributeToIsGrantedAttributeRector, add to code-quality set (#​713)
  • Skip excluded tag in container (#​710), Thanks @​Myks92

rectorphp/rector-doctrine 🟠


rectorphp/rector-phpunit 🟢

  • [PHPUnit100] Skip already key = null on RemoveNamedArgsInDataProviderRector (#​475)
  • [PHPUnit90] Handle crash on different object without second arg on SpecificAssertContainsWithoutIdentityRector (#​474)
  • add test fixture (#​473)
  • Fix RemoveNamedArgsInDataProviderRector so that it is not applied if no change is made (#​472), Thanks @​carlos-granados
  • [CodeQuality] fix assertInstanceOf casing (#​471), Thanks @​staabm
  • [CodeQuality] Handle crash on multiple assert cause undefined variable on AddInstanceofAssertForNullableInstanceRector (#​470)

v2.0.11: Released Rector 2.0.11

Compare Source

New Features 🎉

  • [TypeDeclaration] Handle nested method crashes on AddParamTypeBasedOnPHPUnitDataProviderRector (#​6772)
  • [TypeDeclaration] Skip void return on callback docblock in AddArrowFunctionReturnTypeRector (#​6780)
  • [Php84] Add AddEscapeArgumentRector (#​6782)
    (#​6790)
  • [dead-code] Add RemoveFilterVarOnExactTypeRector (#​6792)
    @​carlos-granados!
  • [Php84] Add NewMethodCallWithoutParenthesesRector (#​6802)
  • [CodingStyle] Add FunctionLikeToFirstClassCallableRector (#​6667), Thanks @​peterfox!
  • [Rector Rule] Replace date, strtotime, and time calls with Carbon equivalents (#​6749), Thanks @​gollumeo!

Bugfixes 🐛


Removed & Deprecations 🗑️

  • [deprecation] Add explicit warning to deprecated withPhpPolyfill() method and error on withPhpSets() misuse on PHP 7.4- projects
  • [DeadCode] Skip used-by-property hook on RemoveUnusedPromotedPropertyRector (#​6765)
  • [DeadCode] Skip side-effect cases on RemoveDeadLoopRector (#​6770)
  • [deprecated] Remove deprecated AbstractScopeAwareRector (#​6791)



rectorphp/rector-symfony 🎵

  • [code-quality] Add RequestIsMainRector (#​708)
  • [symfony 7.3] Add InvokableCommandRector - kick off (#​707)
  • feat: Add Flysystem key support (#​705), Thanks @​dsdeboer
  • [CodeQuality] Enhance InlineClassRoutePrefixRector to concatenate name annotation/attribute (#​704)

rectorphp/rector-doctrine 🟠

  • [BUNDLE-230] Add AddAnnotationToRepositoryRector rule (#​375), Thanks @​JohJohan
  • [ORM-300] Add CastDoctrineExprToStringRector (#​372), Thanks @​JohJohan
  • [ORM-213] Add replace method call support (#​369), Thanks @​JohJohan
  • [deprecated] Remove deprecated MakeEntityDateTimePropertyDateTimeInterfaceRector (#​376)

rectorphp/rector-phpunit 🟢

  • [code-quality] Add RemoveDataProviderParamKeysRector (#​469)
  • [CodeQuality] Add AddInstanceofAssertForNullableInstanceRector (#​466)
  • [deprecated] Remove deprecated AssertCompareToSpecificMethodRector (#​468)
  • [deprecated] Deprecate AssertCountWithZeroToAssertEmptyRector for better readability with explicit methods (#​467)

v2.0.10: Released Rector 2.0.10

Compare Source

New Features 🥳


Bugfixes 🐛

  • [PhpParser] Re-add back get value from __DIR__ and __FILE__ on ValueResolver (#​6756)
  • [TypeDeclaration] Skip already typed param on AddClosureParamTypeForArrayReduceRector (#​6737)
  • [TypeDeclaration] Skip already typed param on AddClosureParamTypeForArrayMapRector (#​6738)
  • [Renaming] Handle crash on assign on for loop on RenameFunctionRector (#​6730)
  • [CodeQuality] Skip unused static methods in LocallyCalledStaticMethodToNonStaticRector, as should be handled by another rule (#​6731)
  • [Carbon] Fix refactor time to carbon to use ->getTimestamp() over ->timestamp (#​6733)
  • [TypeDeclaration] Unregister AddClosureParamTypeForArrayMapRector and AddClosureParamTypeForArrayReduceRector due to may read from docblock (#​6727)
  • [TypeDeclaration] Handle crash on union intersection on AddClosureParamTypeForArrayReduceRector (#​6729)
  • [Privatization] Skip magic method on PrivatizeFinalClassMethodRector (#​6734)
  • [Php74] Skip property hook on RestoreDefaultNullToNullableTypePropertyRector (#​6736)
  • [Php53] Handle parentheses in else on TernaryToElvisRector (#​6740)
  • [Php81] Handle crash Class parent was not found on MyCLabsMethodCallToEnumConstRector (#​6741)
  • [CodeQuality] Handle crash division by zero error on ForeachItemsAssignToEmptyArrayToAssignRector (#​6743)
  • fix(ValueObject): FileDiff first line number is below as expected (#​6746), Thanks @​neilime!
  • [naming] Skip variadic params in RenameParamToMatchTypeRector to avoid single naming for multiple types (#​6748)
  • Do not try to refresh attributes (#​6750), Thanks @​lyrixx!
  • [Php74] Skip with @​var doc with more specific type on ClosureToArrowFunctionRector (#​6753)
  • [Php81] Skip property hook on ReadOnlyPropertyRector (#​6758)
  • [code-quality] Skip complex new instance with args assigns in InlineArrayReturnAssignRector (#​6762)
  • [CodeQuality] Handle crash first class callable on InlineArrayReturnAssignRector (#​6763)
  • [dx] Remove 3 rules registered in both code quality and coding style levels, keep them in coding style level only (#​6757)



rectorphp/rector-symfony

  • [Symfony] Add attribute routing with mix other annotation (#​703)
  • [code-quality] Add InlineClassRoutePrefixRector (#​701)
  • Do not change method if name does not need to change (#​700), Thanks @​carlos-granados
  • [code-quality] Add attribute support (#​702)
  • [SYMFONY 5 & 6] Security add missing param (#​699), Thanks @​JohJohan



rectorphp/rector-doctrine

  • [code-quality] Add GetRepositoryServiceLocatorToRepositoryServiceInjectionRector (#​368)
  • [NodeAnalyzer] Ensure mix annotation and attribute lookup finder on AttrinationFinder::findManyBy* (#​367)
  • Add AttrinationFinder::findManyBy() (#​366)
  • Orm querybuilder set parameters to collection (#​326), Thanks @​marcelthole



rectorphp/rector-phpunit

  • add custom message support to AssertEmptyNullableObjectToAssertInstanceofRector (#​461)
  • [Attribute] Add CoversTrait support on CoversAnnotationWithValueToAttributeRector (#​460)
  • [CodeQuality] Skip union type on AssertCountWithZeroToAssertEmptyRector (#​459)

v2.0.9: Released Rector 2.0.9

Compare Source

Bugfixes 🐛

  • [Php81] Exclude Doctrine ODM MongoDB Document and EmbeddedDocument from ReadOnlyPropertyRector (#​6721), Thanks @​mickverm!
  • [PostRector] Handle with FQCN docblock on UnusedImportRemovingPostRector (#​6722)
  • Type hint array reduce closure (#​6725), Thanks @​peterfox!
  • [PHPStan 2.1.3] Add ReflectionAttribute and ReflectionIntersectionType stub for PHPStan 2.1.3 (#​6723)

v2.0.8: Released Rector 2.0.8

Compare Source

New Features 🥳


Bugfixes 🐛

  • [CodeQuality] Skip with comment inside on SimplifyIfElseToTernaryRector (#​6683)
  • [CodeQuality] Skip windows absolute path on AbsolutizeRequireAndIncludePathRector (#​6684)
  • [Strict] Handle in assign on BooleanInIfConditionRuleFixerRector (#​6685)
  • Replace ambiguous wrapped_with_brackets with existing attribute wrapped_in_parentheses (#​6691)
  • [NodeTypeResolver] Clean up wrap in parentheses check ReprintNodeVisitor (#​6692)
  • [Php80][TypeDeclaration] Fix crash on ClassPropertyAssignToConstructorPromotionRector + ReturnNeverTypeRector (#​6694)
  • CodeClimate output format (#​6697), Thanks @​VitalyArt!
  • Exclude node modules path (#​6702), Thanks @​vaishnavyogesh!
  • Fix str_getcsv() escape argument on PHP 8.4 (#​6704)
  • [Php74] Handle crash curly based array on trait on CurlyToSquareBracketArrayStringRector (#​6706)
  • [Php73] Handle infinite cast on StringifyStrNeedlesRector (#​6707)
  • Clean up unused use (#​6708)
  • fix: NewlineBeforeNewAssignSetRector variable as same name like property (#​6705), Thanks @​guideloince!
  • [TypeDeclaration] Skip override trait method on StrictStringParamConcatRector (#​6711)
  • [Test] Clean up test on WorkerCommandLineFactoryTest (#​6714)
  • [DX] Move isWindows() method from AbstractRectorTestCase to AbstractLazyTestCase (#​6715)
  • [Performance] Use exactly equal or append / file path check on RealpathMatcher (#​6716)
  • [TypeDeclaration] Allow union with closure type on property on TypedPropertyFromAssignsRector (#​6717)
  • [DeadCode] Skip union falsy mixed on trait on RecastingRemovalRector (#​6718)
  • Skip hexa chars in EncapsedStringsToSprintfRector (#​6719)
  • [CodingStyle] Rename method: containsASCIIChar to containsControlASCIIChar on EncapsedStringsToSprintfRector (#​6720)

v2.0.7: Released Rector 2.0.7

Compare Source

New Features 🥳


Bugfixes 🐛

  • [type-declaration] Add typed property, if traits do not duplicate the property (#​6663)
  • [removing] Add interface support to RemoveInterfaceRector (#​6681)
  • fix: add Symfony support as a composer-based option (#​6673), Thanks @​ayedbelsem!
  • [CodeQuality] Handle on assign on FlipTypeControlToUseExclusiveTypeRector (#​6653)
  • [Performance] Early return FullyQualifiedObjectType on FQCN on ObjectTypeSpecifier (#​6658)
  • [CodeQuality] Skip indirect return on SimplifyIfReturnBoolRector (#​6660)
  • [Php83] Handle concat in first argument on CombineHostPortLdapUriRector (#​6661)
  • [TypeDeclaration] Skip unset by trait on TypedPropertyFromStrictConstructorRector (#​6664)
  • [Renaming] Skip used by trait as property promotion on RenamePropertyToMatchTypeRector (#​6665)
  • [TypeDeclaration] Skip changed by ref from trait on TypedPropertyFromStrictConstructorRector (#​6666)
  • [CodeQuality] Handle with assign missing parentheses on ExplicitBoolCompareRector (#​6668)
  • use ->ignoreVCSIgnored() on RectorConfigBuilder::withRootFiles() over custom logic (#​6669)
  • [BetterPhpDocParser] Check for closing brace in text content (#​8977) (#​6670), Thanks @​andrewnicols!
  • [AutoImport] Handle FQCN with sub namespace (#​6672)
  • [BetterPhpDocParser] Use str_contains() for DoctrineAnnotationDecorator (#​6671) (#​6674), Thanks @​andrewnicols!
  • [AutoImport] Handle inner with sub namespace on auto import (#​6679)
  • [DeadCode] Skip dynamic name on RemoveParentCallWithoutParentRector (#​6659)



rectorphp/rector-symfony 🎵

  • Back to require-dev rector-src:dev-main (#​697)
  • Update GetBySymfonyStringToConstructorInjectionRector fixture test to cover rector-srv:tv-readonly-add-ctor (#​696)

rectorphp/rector-doctrine 🟠


rectorphp/rector-phpunit 🟢

v2.0.6: Released: Rector 2.0.6

Compare Source

New Features 🥳

  • [dx] Add --only-suffix to filter files by suffixes (#​6647)
  • [DeadCode] Add ReplaceBlockToItsStmtsRector (#​6641)
  • [DeadCode] Add RemoveUselessAssignFromPropertyPromotionRector (#​6643)
  • Add readonly by default on new promoted property (#​6650)
  • Use autowired method if exists in adding new dependency (#​6652)

Bugfixes 🐛

  • [CodeQuality] Handle crash inside block statement with unreachable statement on OptionalParametersAfterRequiredRector (#​6640)
  • [DX] Use Param->isPromoted() over param->flags !== 0 check on promotion property check (#​6646)
  • [Php80] Keep numeric string, string "true", "false" as is on StringAnnotationToAttributeMapper (#​6610)
  • [PHPStan ^2.1.1] Handle next unreachable statement via UnreachableStatementNode->getNextUnreachableStatements() (#​6642)

Removed 💀

  • [Parser] Remove SmartPhpParserFactory and SmartPhpParser (#​6651)

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)

v1.2.10: Released Rector 1.2.10

Compare Source

New Features 🥳

  • [PHP8.3] add new rectors for get_class()/get_parent_class() without arguments (#​6405), Thanks @​cabbey!

Bugfixes 🐛

  • Fix ClassDependencyManipulator to add dependency on right position (#​6413)
  • [Php81] Skip Doctrine Embeddable on ReadOnlyPropertyRector (#​6411)
  • [Privatization] Skip with parameter on PrivatizeLocalGetterToPropertyRector (#​6412)

Removed 💀

  • [DeadCode] Skip nullable @​ template on RemoveUselessReturnTagRector (#​6409)



rectorphp/rector-phpunit 🟢

  • [PHPUnit 10] Skip with Magic __get() on AssertIssetToAssertObjectHasPropertyRector (#​403)
  • [CodeQuality] Add CreateMockToDirectNewRector (#​402)
  • [CodeQuality] Add SingleMockPropertyTypeRector (#​401)
  • [CodeQuality] Skip used by trait and multiple props on NarrowUnusedSetUpDefinedPropertyRector (#​400)
  • Skip property with default value in NarrowUnusedSetUpDefinedPropertyRector (#​398)
  • [CodeQuality] Add FlipAssertRector (#​397)
  • Add count() support to AssertCompareOnCountableWithMethodToAssertCountRector (#​395)
  • Add enum/const fetch support to AssertEqualsToSameRector (#​394)
  • skip static property in NarrowUnusedSetUpDefinedPropertyRector (#​393)

v1.2.9: Released Rector 1.2.9

Compare Source

Bugfixes 🐛

  • [Strict] Using in_array() on CallLike instead of double call on Strict Rules (#​6388)
  • [CodeQuality] Handle If cond as assign on ExplicitBoolCompareRector (#​6389)
  • [CodeQuality] Skip append non empty array on ForeachItemsAssignToEmptyArrayToAssignRector (#​6390)
  • [Php80] Mirror return comment on ChangeSwitchToMatchRector (#​6394)
  • [TypeDeclaration] Skip union intersection types on php 8.1, allow on php 8.2+ (#​6395)
  • [Php80] Skip @​template T as mixed on MixedTypeRector (#​6399)
  • [DeadCode] Check TemplateType instance check on Dead*TagValueNodeAnalyzer (#​6400)
  • [CodeQuality] Skip multiple lines on JoinStringConcatRector (#​6404)
  • [CodingStyle] Skip equal modifier on direct parent method compatible on MakeInheritedMethodVisibilitySameAsParentRector (#​6406)

Removed 💀

  • [DeadCode] Handle consecutive equal case stmts on RemoveDuplicatedCaseInSwitchRector (#​6392)
  • [DeadCode] Handle handle consecutive equal with jump different case on RemoveDuplicatedCaseInSwitchRector (#​6393)
  • [DeadCode] Skip @​template tag on RemoveUselessVarTagRector (#​6396)
  • [DeadCode] Support multiple templates in RemoveUselessVarTagRector (#​6402), Thanks @​dragosprotung!



rectorphp/rector-symfony 🎵


rectorphp/rector-phpunit 🟢

  • [code-quality] Add NarrowUnusedSetUpDefinedPropertyRector (#​388)
  • Add enum/const fetch support to AssertEqualsToSameRector (#​394)
  • Add count() support to AssertCompareOnCountableWithMethodToAssertCountRector (#​395)
  • [AnnotationsToAttribute] Skip not in test on AnnotationWithValueToAttributeRector (#​387)
  • Add ReplaceTestFunctionPrefixWithAttributeRector (#​386), Thanks @​blackwolf12333

v1.2.8: Released Rector 1.2.8

Compare Source

Bugfixes 🐛

  • [UnusedImport] Fix removing multiple uses (#​6376), Thanks @​jorgsowa!
  • [PostRector] Clean up variables and conditional usage on UnusedImportRemovingPostRector (#​6378)
  • [PostRector] Reduce repetitive toString() on loop on UnusedImportRemovingPostRector (#​6379)
  • [CodeQuality] Skip no @​ property doc on DynamicDocBlockPropertyToNativePropertyRector (#​6380)
  • [CodeQuality] Handle with other attributes on DynamicDocBlockPropertyToNativePropertyRector (#​6381)
  • [CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector (#​6382)
  • Fix duplicated register ContinueToBreakInSwitchRector in php52.php and php73.php (#​6385)
  • [AutoImport] Fix missing @​ in deep annotation auto import (#​6386)
  • [DeadCode] Skip non FullyQualified property type on RemoveTypedPropertyNonMockDocblockRector (#​6383)

New Features 🥳

  • [CodeQuality] Add DynamicDocBlockPropertyToNativePropertyRector (#​5691)
  • [DX] [Experimental] Add withPhpLevel() to raise PHP level one rule at a time (#​6261)

v1.2.7: Released Rector 1.2.7

Compare Source

New Features 🥳


Bugfixes 🐛

  • Fixed --memory-limit=-1 option handling when used in parallel (#​6349), Thanks @​ddegasperi!
  • [Php70] Fix delimiter in the middle on EregToPregMatchRector (#​6356)
  • [Php70] More delimiter case in the middle fix on EregToPregMatchRector (#​6357)
  • [Php80] Cast string/int for int vs string condition and case condition on ChangeSwitchToMatchRector (#​6359)
  • [DeadCode] Skip from call with return docblock on ReduceAlwaysFalseIfOrRector (#​6361)
  • [TypeDeclaration] Closure Param Types from Iterator Source (#​6345), Thanks @​peterfox!
  • [Privatization] Allow privatize protected promoted property on PrivatizeFinalClassPropertyRector (#​6360)
  • [DeadCode] Skip with Else and ElseIf on SimplifyIfNotNullReturnRector (#​6365)
  • [Php70] Handle empty branch crash on unprintable char \x0C on EregToPregMatchRector (#​6368)
  • [UnusedImport] Different letter case for classes + optimization (#​6362), Thanks @​jorgsowa!
  • [CodeQuality] Skip else indirect return on SimplifyIfReturnBoolRector (#​6371)
  • [CodeQuality] Clean up else check on SimplifyIfReturnBoolRector (#​6372)
  • [TypeDeclaration] Fix deep nested array docblock with \ prefix on ReturnTypeFromStrictNewArrayRector (#​6373)
  • [EarlyReturn] Skip nested with OR in root if statement condition on ChangeNestedForeachIfsToEarlyContinueRector (#​6375)
  • [DeadCode] Skip RemoveUnusedPrivatePropertyRector in middle assign (#​6363)

Removed 💀

  • [NodeAnalyzer] Remove ClassAnalyzer::isAnonymousClassName() (#​6351)
  • [NodeAnalyzer] Remove unused AstResolver on VariadicAnalyzer (#​6353)
  • [DeadCode] Clean up double private method filtering on RemoveUnusedPrivateMethodRector (#​6364)
  • [DeadCode] Skip union docblock param with is_object() native type check on RemoveAlwaysTrueIfConditionRector (#​6370)



rectorphp/rector-symfony 🎵

  • [CodeQuality] Add AddTraitGetterReturnTypeBasedOnSetterRequiredRector (#​671)

rectorphp/rector-phpunit 🟢

  • [PHPUnit 10] Add ifs as default way for withConsecutive, as more readable and opens upgrade during PHPUnit 9 (#​382)
  • Use simple direct assert on consecutive in case of arrow function in callable (#​381)
  • Use more readable ifs on will return in WithConsecutiveRector (#​380)
  • add NarrowSingleWillReturnCallbackRector to code quality set (#​379)

v1.2.6: Released Rector 1.2.6

Compare Source

New Features 🥳

  • [TypeDeclaration] Add isset(), empty(), and negation support on BoolReturnTypeFromBooleanStrictReturnsRector (#​6339)
  • [TypeDeclaration] Add NativeMethodReflection support on ReturnStrictTypeAnalyzer (#​6344)
  • [DX] Show paths not match any file/directory on ProcessCommand when given path not exists (#​6307)

Bugfixes 🐛

  • [TypeDeclaration] Convert inline @​var tag to assert() (#​6300), Thanks @​carlos-granados!
  • Fix incorrect result after using RemoveByType in PhpDocInfo (#​6301), Thanks @​carlos-granados!
  • [TypeDeclaration] Skip nullable callable on TypedPropertyFromAssignsRector (#​6308)
  • Fix LocallyCalledStaticMethodToNonStaticRector when static function is called using the class name (#​6310), Thanks @​carlos-granados!
  • [Php81] Handle crash on ArrowFunction attribute on FirstClassCallableRector (#​6313)
  • [Performance] Reduce double traverse on StrictNativeFunctionReturnTypeAnalyzer (#​6320)
  • [PhpParser] Alternative PR for findInstancesOfScoped() to keep existing performance (#​6324)
  • [CodingStyle] Use double quote to escape quotes in EncapsedStringsToSprintfRector (#​6326)
  • [TypeDeclaration] Handle crash on func call not found on BoolReturnTypeFromBooleanStrictReturnsRector (#​6327)
  • Fix first class callable to use combineAcceptors() to avoid assert Arg instance error (#​6330)
  • [Php81] Allow used as assign expr on ReadOnlyPropertyRector (#​6331)
  • Skip arrow function in scoped search (#​6333)
  • [TypeDeclaration] Better approach for native type check on ReturnStrictTypeAnalyzer (#​6343)
  • [DeadCode] Skip extension load append variable on RemoveAlwaysTrueIfConditionRector (#​6332)
  • [TypeDeclaration] Remove only void type on ReturnedNodesReturnTypeInfererTypeInferer (#​6340)
  • [DeadCode] Skip indirect next line definition of @​var on RemoveNonExistingVarAnnotationRector (#​6348)

rectorphp/rector-symfony 🎵

  • Added return type declaration rules for FormTypeInterface (#​670), Thanks @​stollr

rectorphp/rector-phpunit 🟢

  • [CodeQuality] Add NarrowSingleWillReturnCallbackRector (#​374)
  • [CodeQuality] Add SingleWithConsecutiveToWithRector (#​370)
  • [CodeQuality] Add NarrowIdenticalWithConsecutiveRector (#​369)
  • [CodeQuality] Add AddParentSetupCallOnSetupRector (#​364)
  • Include match() to invoke counting in WithConsecutiveRector (#​362)
  • Move WithConsecutiveRector to its PHPUnit100 namespace, CreateMockToAnonymousClassRector + PreferPHPUnitSelfCallRector to CodeQuality (#​360)
  • Add existing willReturnCallback() support to WithConsecutiveRector (#​358)

v1.2.5: Released Rector 1.2.5

Compare Source

New Features and Improvements 🥳

  • 20-30 % Rector speedup - Optimise checking the node types allowed for each rule (#​6232), Thanks @​carlos-granados!
  • [docs] Add help on the default process command (#​6226), Thanks @​94noni!
  • [TypeDeclaration] Adds AddClosureParamTypeFromArgRector (#​6258)
  • Adds AddClosureParamTypeFromObjectRector (#​6265), Thanks @​peterfox!
  • [Config] Improve ComposerJsonPhpVersionResolver API, make use of explicit php set files (#​6273)
  • [FileSystem] Add data and writable to not include on InitFilePathsResolver (#​6285)
  • always make paths absolute before processing files (#​6293), Thanks @​Kanti!

Bugfixes 🐛

  • [CodeQuality] Handle crash on first class callable inside match on OptionalParametersAfterRequiredRector (#​6263)
  • [ReturnTypeInferer] Drop this/static docblock type check on ReturnTypeInferer (#​6270)

Removed 💀

  • [deprecated] Remove deprecated ChangeAndIfToEarlyReturnRector, CallableThisArrayToAnonymousFunctionRector + casting rules (#​6276)
  • [deprecations] Remove deprecated GetClassToInstanceOfRector, UseIncrementAssignRector, DetectNodeCommand (#​6278)
  • [deprecated] Remove deprecated closure return rules, return type from strict bool/scalar returns (#​6287)


rectorphp/rector-symfony 🎵

  • Add Class_ annotation support to TemplateAnnotationToThisRenderRector (#​666)

rectorphp/rector-doctrine 🟠

  • Refactor the OrderByKeyToClassConstRector to use the new enum only in Criteria::orderBy method calls (#​336), Thanks @​julienfastre

v1.2.4: Released Rector 1.2.4

Compare Source

Bugfixes 🐛

  • Fix PropertyTypeFromStrictSetterGetterRector for default null (#​6231)
  • [Php70] Fix with \r\n on EregToPregMatchRector (#​6246)
  • Optimise post rectors (#​6240), Thanks @​carlos-granados!
  • [Php84] Do not reprint node type on ExplicitNullableParamTypeRector (#​6250)
  • Skip Doctrine collections in TypedPropertyFromAssignsRector (#​6253)
  • Skip Columns from TypedPropertyFromAssignsRector, as handled better in doctrine rules (#​6254)
  • [AutoImport] Do not add cast on valid Integer type on Name Node on auto import enabled (#​6236)
  • [AutoImport] Do not add cast on valid Integer type on aliased Name Node on auto import enabled (#​6237)
  • [Performance] Cache should traverse for AddUseStatementGuard (#​6234)

New Features 🥳

  • Adds the ScalarValueToConstFetchRector rule (#​6195), Thanks @​peterfox!
  • [TypeDeclaration] Add AddParamArrayDocblockBasedOnCallableNativeFuncCallRector (#​6233)
  • [TypeDeclaration] Add AddReturnArrayDocblockBasedOnArrayMapRector (#​6235)

Deprecated 💀

  • Deprecate PublicConstantVisibilityRector, as adds public blindly everywhere; use scope-based approach instead (#​6238)

rectorphp/rector-symfony 🎵

  • [Symfony 6.1] Skip abstract class on CommandConfigureToAttributeRector (#​662)
  • [CodeQuality] skip array + non native response return on ResponseReturnTypeControllerActionRector (#​661)
  • [CodeQuality] Skip posible return array + response on ResponseReturnTypeControllerActionRector (#​660)
  • Do not convert to array Process->setInput() (#​647), Thanks @​refsz

rectorphp/rector-doctrine 🟠

  • [CodeQuality] Skip blob type on TypedPropertyFromColumnTypeRector (#​340)
  • Fix attribute support in ImproveDoctrineCollectionDocTypeInEntityRector (#​339)

rectorphp/rector-phpunit 🔵

v1.2.3: Released Rector 1.2.3

Compare Source

New Features 🥳


Bugfixes 🐛

  • Only import docblock if import name enabled on PostFileProcessor (#​6185)
  • fix issue #​8755 about wrong systemError location (#​6184), Thanks @​llaville!
  • Support more assign cases in PropertyFetchAssignManipulator (#​6192), Thanks @​andersonamuller!
  • Skip Symfony Response in ReturnTypeFromReturnNewRector (#​6202)
  • Skip only response inside controller class (#​6204)
  • [Php54] No need reprint when array is just created on LongArrayToShortArrayRector (#​6206)
  • [TypeDeclaration] Handle crash on nullable intersection on ClosureReturnTypeRector (#​6213)
  • [Php71] Allow multiple same catches on MultiExceptionCatchRector (#​6218)
  • [CodeQuality] Skip Generator on SimplifyForeachToCoalescingRector (#​6221)
  • [CodeQuality] Ensure check native array type on Foreach* rules (#​6222)
  • [TypeDeclaration] Skip isset and empty with index on param variable on StrictArrayParamDimFetchRector (#​6227)
  • [TypeDeclaration] Skip mixed in union on ClosureReturnTypeRector (#​6228)

Removed 💀




rectorphp/rector-symfony 🎵

  • Add the Symfony 7.0 set to SymfonySetList.php (#​659), Thanks @​pbowyer
  • [Config] Add ParameterBagToAutowireAttributeRector (#​654)
  • add void fixture (#​653)
  • [CodeQuality] Remove no returns check on ResponseReturnTypeControllerActionRector (#​652)
  • Add new Response() support to ResponseReturnTypeControllerActionRector (#​651)
  • [Configs] Add MergeServiceNameTypeRector (#​650)
  • Deprecate ServicesSetNameToSetTypeRector as it creates invalid code (#​649)

rectorphp/rector-doctrine 🟠

  • Add ODM support to TypedPropertyFromToManyRelationTypeRector (#​335)
  • Add next fixture (#​334)
  • Include ODM in description (#​333)
  • Add TYPED_COLLECTIONS set, to have rules deadling with collections together (#​332)
  • Merge AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector to single rule (#​331)
  • Add odm support to AddReturnDocBlockToCollectionPropertyGetterByToManyAnnotationRector (#​330)
  • Add ODM support to ExplicitRelationCollectionRector (#​329)

rectorphp/rector-phpunit 🔵

  • [PHPUnit100] Skip First class callable on RemoveSetMethodsMethodCallRector (#​352)
  • Add magic methods mocking to RemoveSetMethodsMethodCallRector (#​351)
  • [CodeQuality] SetUpBeforeClassToSetUpRector (#​350)

v1.2.2: Released Rector 1.2.2

Compare Source

New Features 🥳

  • [TypeDeclaration] Add ReturnTypeFromMockObjectRector (#​6166)
  • [TypeDeclaration] Add TypedPropertyFromCreateMockAssignRector (#​6177)

Bugfixes 🐛

  • Skip phpdoc types in NumericReturnTypeFromStrictReturnsRector (#​6153), Thanks @​staabm!
  • [TypeDeclaration] Fix union type by multiple method calls on ParamTypeByMethodCallTypeRector (#​6155)
  • [TypeDeclaration] Handle throw without new on on ParamTypeByMethodCallTypeRector (#​6156)
  • [TypeDeclaration] Refactor CallerParamMatcher to avoid ambigous returns usage (#​6157)
  • [TypeDeclaration] Prevent uncaught exception in ReturnTypeFromReturnNewRector (#​6159), Thanks @​staabm!
  • Prevent uncaught class-not-found exceptions (#​6160), Thanks @​staabm!
  • [TypeDeclaration] Skip variadic on StrictArrayParamDimFetchRector (#​6163)
  • [CodeQuality] Skip used in next stmt on UnusedForeachValueToArrayKeysRector (#​6164)
  • [Scoper] Fix prefixed MockObject on ReturnTypeFromMockObjectRector (#​6167)
  • [TypeDeclaration] Flip position between bool return and return tyep from strict constant on TypeDeclarationLevel (#​6168)
  • [TypeDeclaration] Skip possible void and return by docblock on ReturnTypeFromMockObjectRector (#​6170)
  • [TypeDeclaration] Update fixture and example method name (#​6171)
  • [NodeTypeResolver] Handle crash on variable variable with assign on FirstClassCallableRector (#​6173)
  • [NodeTypeResolver] Clean up re-fill scope on PHPStanNodeScopeResolver on variable variable (#​6174)
  • [NodeTypeResolver] Fill scope of dynamic variable variable (#​6175)
  • fix: Convert DateTime to Carbon properly when hours/minutes/seconds are used (#​6176), Thanks @​florisbosch!

v1.2.1: Released Rector 1.2.1

Compare Source

New Features 🥳

  • [type-declarations] Add ReturnNullableTypeRector (#​6110)
  • [type-declarations] Add StringsReturnTypeFromStrictScalarReturnsRector to complete the string returns (#​6111)
  • [PhpDoc] Add warning about missing PhpDocInfo name form tag value node (#​6134)
  • [TypeDeclaration] Introducing ClosureReturnTypeRector to handle closure types separately (#​6106)
  • [TypeDeclaration] Skip has named arg on AddMethodCallBasedStrictParamTypeRector (#​6137)
  • [e2e][Printer] Handle crash indentation on AddParamBasedOnParentClassMethodRector (#​6112)

Bugfixes 🐛

  • [TypeDeclaration] Skip variadic on AddParamTypeBasedOnPHPUnitDataProviderRector (#​6150)
  • [TypeDeclaration] Add ConstFetch support on ReturnTypeFromStrictConstantReturnRector (#​6151)
  • Refactor BooleanTypeMapper to handle value based on context (#​6095)
  • Check root return in ReturnTypeFromReturnNewRector (#​6102)
  • Make ReturnUnionTypeRector run on PHP 8.0+ (#​6103)
  • ReturnUnionTypeRector now return only non-nullable types, to prepare space for new nullable rule as off PHP 7.1+ (#​6105)
  • [TypeDeclaration] handle explicit if else new on ReturnTypeFromReturnNewRector (#​6104)
  • [Php70] Swap min is higher than max on RandomFunctionRector (#​6109)
  • Split StringReturnTypeFromStrictScalarReturnsRector into string, bool and numeric scalar + strict return type rules (#​6113)
  • [Php71] Handle not identical to Float for empty string should compare to 0.0 on BinaryOpBetweenNumberAndStringRector (#​6117)
  • [TypeDeclaration] Skip void on BoolReturnTypeFromBooleanStrictReturnsRector (#​6118)
  • [TypeDeclaration] Fix inline closure type on ClosureReturnTypeRector (#​6119)
  • [TypeDeclaration] Skip start with shebang on DeclareStrictTypesRector (#​6121)
  • [Php52] Handle deep if stmts on ContinueToBreakInSwitchRector (#​6122)
  • [Php52] Handle in deep else on ContinueToBreakInSwitchRector (#​6123)
  • [TypeDeclaration] Clean up ArrowFunction check on ReturnTypeInferer (#​6124)
  • [TypeDeclaration] Skip union with yield on NumericReturnTypeFromStrictScalarReturnsRector (#​6125)
  • [Php82] Handle has only readonly properties but not all promoted property on ReadOnlyClassRector (#​6129)
  • refactor: Move function first-class-callable to a standalone rule (#​6131), Thanks @​nikolicaleksa!
  • typo (rectorphp/rector-src@d102bd1)
  • Fix ArrayDimFetchToMethodCallRector (#​6138), Thanks @​peterfox!
  • [CodeQuality] Skip used in static Closure/ArrowFunction on LocallyCalledStaticMethodToNonStaticRector (#​6139)
  • [CodeQuality] Skip multiple new lines on JoinStringConcatRector (#​6141)
  • [CodeQuality] Allow change empty() to [] compare of other object property usage on SimplifyEmptyCheckOnEmptyArrayRector (#​6147)
  • [Php55] Skip parse error on no concat in left in left Concat on PregReplaceEModifierRector (#​6148)
  • [CodingStyle] Handle with trait use adaptations on SeparateMultiUseImportsRector (#​6149)
  • [DeadCode] Remove unused @​var on key after remove key on RemoveUnusedForeachKeyRector (#​6135)
  • [DeadCode] Handle same namespace param type on RemoveUselessParamTagRector (#​6133)

Removed and deprecated 💀

  • Add - number support, deprecate ReturnTypeFromStrictScalarReturnExprRector functionality, already split (#​6114)
  • Deprecate BoolReturnTypeFromStrictScalarReturnsRector, use BoolReturnTypeFromBooleanStrictReturnsRector instead (#​6115)
  • [DeadCode] Skip fluent no return type on RemoveUnusedPrivateMethodRector (#​6108)
  • [DeadCode] Skip fluent no return type on RemoveUnusedPrivateMethodRector take 2 (#​6116)
  • [Php80] Skip used in compact() on RemoveUnusedVariableInCatchRector (#​6152)



rectorphp/rector-symfony

  • Correct return type definition for DataTransformerInterface (#​645), Thanks @​bobvandevijver
  • [Symfony 6.1] Improve CommandPropertyToAttributeRector to work with freshly created AsCommand (#​644)
  • Add more complex names support to CommandPropertyToAttributeRector (#​643)
  • [Symfony 6.3] Add ParamAndEnvAttributeRector (#​641)
  • [Symfony 6.2] Improve SecurityAttributeToIsGrantedAttributeRector (#​640)
  • Add args() support to AutowireAttributeRector (#​639)
  • [Config] Add configurable AutowireAttributeRector to add #[Autowire(...)] to services (#​637)
  • feat: add api-platform/core config key (#​635), Thanks @​dsdeboer
  • feat: add nelmio/cors-bundle config key (#​634), Thanks @​dsdeboer
  • feat: two additional config (#​633), Thanks @​dsdeboer
  • Hybrid CommandConfigureToAttributeRector (#​632), Thanks @​ruudk

rectorphp/rector-doctrine


rectorphp/rector-phpunit

v1.2.0: Released Rector 1.2.0

Compare Source

New Rules 🚀

  • [Renaming] Add RenameAttributeRector (#​6009)
  • [TypeDeclaration] Add AddClosureUnionReturnTypeRector (#​6033)
  • [TypeDeclaration] Add AddClosureNeverReturnTypeRector (#​6039)
  • [Php71] Add MultiDimensionalArrayToArrayDestructRector (#​6031), Thanks @​nikolicaleksa!
  • [TypeDeclaration] Add AddClosureReturnTypeFromStrictParamRector (#​6044)
  • [TypeDeclaration] Add AddClosureReturnTypeFromReturnCastRector (#​6061)
  • [TypeDeclaration] Add AddClosureReturnTypeFromStrictNativeCallRector (#​6059)

New Features 🥳

  • [DX] Add withAttributes(all) option, add PHPUnit and Doctrine code quality sets to withPreparedSets() (#​6004)
  • [DX] Add symfony code quality preset (#​6008)
  • [DX] Add withDowngradeSets() to better target downgrades (#​6015)
  • Add always config for EncapsedStringsToSprintfRector (#​6050), Thanks @​ruudk!
  • Add only_direct_assign config for SimplifyUselessVariableRector (#​6034), Thanks @​ruudk!
  • Skip files with short <?= PHP tag as leads to invalid changes (#​6068), (#​6075)
  • [Bridge] Add SetRectorsResolver, SetProviderCollector for easier use in 3rd-party tools (#​6030)
  • [DX] Inform about deprecated rules in config (#​6047)
  • [Config] Exclude listed on .gitignore for withRootFiles() (#​6028)

Bugfixes 🐛

  • AddTypeToConstRector: apply if const references another class const (#​6017), Thanks @​tugmaks!
  • fix: Skip adding string casting to closure return when it returns str… (#​6018), Thanks @​nikolicaleksa!
  • fix: Add code as a named argument (#​6062), Thanks @​nikolicaleksa!
  • Fix message handler removal in RemoveUnusedPublicMethodParameterRector (#​6001)
  • fix: Skip refactoring when foreach if statement contains calls to met… (#​6019), Thanks @​nikolicaleksa!
  • fix: Use named arguments if they are already used (#​6022), Thanks @​nikolicaleksa!
  • [Naming] Handle used in arrow function param, then used again outer ArrowFunction on RenameParamToMatchTypeRector (#​6046)
  • Fix docker commands in CONTRIBUTING.md (#​6023), Thanks @​tugmaks!
  • fix: Skip static calls which are made using the class name (#​6024), Thanks @​nikolicaleksa!
  • feat: Support functions for first-class-callable (#​6027), Thanks @​nikolicaleksa!
  • [Cleanup] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions (#​6041)
  • fix: Convert DateTime to Carbon properly when negative days/months are used (#​6051), Thanks @​nikolicaleksa!
  • [Php81] Handle usage as arg by ref key on falsy ObjectType on ReadOnlyPropertyRector (#​6054)
  • fix: Skip remove always true condition on method calls (#​6063), Thanks @​nikolicaleksa!

Removed and Deprecated 💀

  • [TypeDeclaration] Remove ArrowFunction from ReturnTypeFromReturnDirectArrayRector and ReturnTypeFromReturnNewRector (#​6032)
  • [Cleanup] Remove @​changelog as no longer maintained/used, use RuleDefinition instead (#​6035)
  • [Cleanup] Remove FormatPerservingPrinter as only delegate method, use BetterStandardPrinter directly (#​6036)
  • Remove CurrentFileProvider from ValueResolver, let type resolver handle dir and filename (#​6069)
  • [Cleanup] Deprecate UseIncrementAssignRector as depends on context and might be intentional ([#​6042]
  • [CodeQuality] Deprecate GetClassToInstanceOfRector as can create invalid comparison (#​6005)
  • [Cleanup] Deprecate *ToTypeCastRector rules as no difference in performance, handle by cs instead (#​6043)
  • deprecate SetListInterface (rectorphp/rector-src@442bff7)
  • Unregister GetClassToInstanceOfRector from CodeQualityLevel.php (#​6006)
  • Split docblock name imports and name imports as different scope, skip for HTML nodes (#​6071)
  • [DX] Deprecate dump-node command, use more advanced https://getrector.com/ast instead (#​6040)

This is first release that includes news from other Rector core rules, so you know about all the hot stuff 😇

Symfony (rectorphp/rector-symfony)

New Rules and Improvements
  • Improve CommandConfigureToAttributeRector to allow merge with existing attribute (#​632), Thanks @​ruudk
  • feat: add web_profiler as config builder (#​631), Thanks @​dsdeboer
  • Add "hidden" support to CommandConfigureToAttributeRector (#​628)
  • [Symfony 7.0 and 7.1] Extend sets based on upgrade notes (#​627)
  • [Symfony 6.4] Add DataTransformerInterface return types (#​624)
  • [Symfony 6.4] Deprecate ChangeRouteAttributeFromAnnotationSubnamespaceRector, make use of RenameAttribute instead (#​623)
  • [Symfony 6.2] Add SecurityAttributeToIsGrantedAttributeRector (#​622)
  • [Symfony 6.1] Add CommandConfigureToAttributeRector (#​619)
  • [EventDispatcher] Skip EventListenerToEventSubscriberRector for classes with #[AsEventListener] attribute (#​616)
Deprecated
  • [Symfony 4.3] Deprecate WebTestCaseAssertSelectorTextContainsRector as does not create valid code (#​621)
  • [Symfony 4.0] Deprecate ProcessBuilderGetProcessRector, as change is not valid (#​620)
  • [CodeQuality] Deprecate MakeCommandLazyRector, as Symfony 6.1 introduces more reliable native attribute (#​618)
  • [Symfony 5.3] Deprecated CommandDescriptionToPropertyRector rule, as only middle step before 6.1 native attribute (#​617)

Doctrine - rectorphp/rector-doctrine

  • Add return doc block to Collection property's getter method by ToMany attribute (#​317), Thanks @​jszutkowski

PHPUnit - rectorphp/rector-phpunit

  • Add support for multiple dataProviders for a single test method (#​349), Thanks @​marcelthole
  • Remove NamedArgumentForDataProviderRector from the PHPUnit 11 set as optional upgrade path (#​348)
  • Fix prefixed scoped DataProvider class on NamedArgumentForDataProviderRector (#​347)
  • Make AddSeeTestAnnotationRector slightly more performant as very slow, keep existing see annotations (#​343)
  • [PHPUnit 10] Fix typo assertObjectHasNotProperty -> assertObjectNotHasProperty (#​340)
  • [PHPUnit 10] Rename assertObjectHasAttribute() to assertObjectHasProperty(), add AssertIssetToAssertObjectHasPropertyRector (#​338)
  • Fix AssertCompareToSpecificMethodRector to skip gettype checks, as will be deprecated in next PHPUnit version (#​337)

v1.1.1: Released Rector 1.1.1

Compare Source

[Performance] Fix huge performance hit by reverting children class detection (#​5995) - fixes #​8679, #​8638, #​8637


New Rules

  • [TypeDeclaration] Add ReturnTypeFromReturnCastRector (#​5905)
  • [TypeDeclaration] Add ReturnTypeFromSymfonySerializerRector (#​5908)
  • [TypeDeclaration] Add TypedPropertyFromJMSSerializerAttributeTypeRector (#​5909)
  • [TypeDeclaration] Add AddTypeFromResourceDocblockRector (#​5915)
  • [Php74] Add HebrevcToNl2brHebrevRector (#​5977)
  • [Php74] Add RestoreIncludePathToIniRestoreRector (#​5973)
  • [Carbon] Init set to migrate DateTime to Carbon (#​5868)
  • [Carbon] Add immutable support to other rules (#​5896)
  • Convert DateTimeImmutable to CarbonImmutable (#​5895)
  • Convert time() to Carbon::now()->timestamp (#​5901), Thanks @​kylekatarnls!

New Features and DX improvements 🥳

  • Add code quality levels (#​5910), Thanks @​carlos-granados!
  • [DX] Introduce set providers, to enable package + version based set registration (#​5976)
  • [DX] Report rules that registered in withSkip() but never registered in withRules() (#​5919)
  • [Set] Add new rector-preset set to have opiniated rector rules that can be enabled in rector-src and its extension (#​5924)
  • [DeadCode] Add RemoveUnusedPublicMethodParameterRector (#​5925)
  • [TypeDeclaration] Handle double declare(strict_types=1) addition on DeclareStrictTypesRector + IncreaseDeclareStrictTypesRector (#​5928)
  • [CodingStyle][Php80] Add join func call support on ConsistentImplodeRector (#​5958)
  • [CodeQuality] Add support for (), {}, [], <> delimiter on RegexPatternDetector (#​5957)
  • [TypeDeclaration] Add Static Call support on AddMethodCallBasedStrictParamTypeRector (#​5960)
  • [Config] Add withPhpPolyfill() method to load php polyfill set on RectorConfigBuilder (#​5983)
  • [DX] Add ->withPhpXSets() for PHP 7.4 and lower, improve ->withPreparedSets() (#​5984)
  • [config] Disable parallel on --debug (#​5904)
  • [Php80] Skip mixed doc with description and valid doc on MixedTypeRector (#​5906)
  • [DX] Add withPhpPolyfills() method to add polyfill rules (#​5981) rectorphp/rector-src#5983
  • [DX] Ommit static functions/closure from coding-style, as often ignored and depends on personal preference (#​5916)
  • [DX] Ommit post-inc to pre-inc rule from coding-style as too opinionated (#​5917)
  • [DX] Remove UseIncrementAssignRector from coding-style set, as often ignored (#​5920)

Bugfixes 🐛

  • [AutoImport] No need RenamedClassesDataCollector usage on UsesClassNameImportSkipVoter (#​5921)
  • [Php81] Skip private method from instantiated class on FirstClassCallableRector (#​5929)
  • [NodeTypeCorrector] Directly use StringType on Intersection of strings on AccessoryNonEmptyStringTypeCorrector (#​5933)
  • [CodeQuality] Allow check in current Class_ with multiple props on CompleteDynamicPropertiesRector (#​5938)
  • [Naming] Handle rename property with only comment, without @​var doc on RenamePropertyToMatchTypeRector (#​5945)
  • Remove the renaming of apache_request_headers (#​5943), Thanks @​rhuijts!
  • [Naming] Handle nullable object @​var docblock on RenamePropertyToMatchTypeRector (#​5946)
  • [Php81] Skip param variable used in next stmt after coalesce on NewInInitializerRector (#​5971)
  • [Php71] Skip call abstract method on RemoveExtraParametersRector (#​5930)
  • [TypeDeclaration] Do not remove docblock with description on MergeDateTimePropertyTypeDeclarationRector (#​5931)
  • [DeadCode] Remove param docblock on RemoveUnusedPromotedPropertyRector when exists (#​5936)
  • [Cleanup] Remove deprecated AttributeKey::PARENT_NODE, remove deprecated NodeNameResolver::isCaseSensitiveName() (#​5939)
  • [NodeTypeResolver] Remove Property->type instanceof Node check on NodeTypeResolver->getType() (#​5947)
  • [BetterPhpDocParser] Remove unnecessary PrivatesAccessor usage on BetterTokenIterator and TokenIteratorFactory (#​5950)
  • [DeadCode] Skip dynamic variable on RemoveUnusedVariableAssignRector (#​5964)
  • [DeadCode] Reduce loop for used in next stmt on RemoveUnusedVariableAssignRector (#​5969)

Removed and Deprecated 💀

  • Remove deprecated and empty FinalizeClassesWithoutChildrenRector + FinalizePublicClassConstantRector (#​5980)
  • [DX] Soft-deprecate CallableThisArrayToAnonymousFunctionRector, as FirstClassCallableRector handles the same case better (#​5918)

v1.1.0: Released Rector 1.1.0

Compare Source

New Features 🥳

  • [PHPStan] Bump to PHPStan 1.11 (#​5883)

Bugfixes 🐛

  • [CodeQuality] Skip increment variable on else on TernaryFalseExpressionToIfRector (#​5867)
  • [CodeQuality] Skip on property and class const on CallableThisArrayToAnonymousFunctionRector (#​5869)
  • [NodeTypeResolver] Using built int ->isArray()->yes() on ArrayTypeAnalyzer::isArrayType() (#​5870)
  • Fix "method x was not found in reflection of class" (#​5871), Thanks @​staabm!
  • [NodeTypeResolver] Clean up array check on NameTypeResolver (#​5872)
  • [NodeTypeResolver] Clean up "this" from NameTypeResolver, as not from Name node (#​5873)
  • [TypeDeclaration] Skip array by doc with different assign on ReturnTypeFromStrictNewArrayRector (#​5875)
  • [TypeDeclaration] Skip possible array on StrictStringParamConcatRector (#​5876)
  • [Performance] Ensure call $reflector->reflectAllClasses() once on Worker take 3 (#​5878)
  • [Performance] Call cached class names collection on FamilyRelationsAnalyzer (#​5879)
  • [NodeTypeResolver] Clean up resolve cache class name key (#​5880)
  • [NodeTypeResolver] No need json_decode/json_encode for cache class name collection (#​5881)
  • [TypeDeclaration] Handle crash on interface Mixin on ReturnTypeFromStrictConstantReturnRector (#​5884)
  • [PHPStan] Handle PHPStan internal ShouldNotHappenException on FamilyRelationsAnalyzer and PHPStanNodeScopeResolver (#​5885)
  • [NodeTypeResolver] No need to resolve class name on anonymous classes (#​5886)
  • [PHPStan] Fix missingType.generics notice on phpstan.neon on PHPStan 1.11 (#​5888)
  • [TypeDeclaration] Skip unitialized property on EmptyOnNullableObjectToInstanceOfRector (#​5889)
  • [Php80] Skip remove non-mixed type doc on MixedTypeRector (#​5874)
  • [TypeDeclaration] Add test for nullable object usage on AddReturnTypeDeclarationRector (#​5887)
  • [Configuration] Add missing LevelSetList::UP_TO_PHP_84 on PhpLevelSetResolver::resolveFromPhpVersion() (#​5890)

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 🥳

  • [Php84] Add ExplicitNullableParamTypeRector (#​5724)
  • [Transform] Adds ArrayDimFetchToMethodCallRector rule (#​5723), Thanks @​peterfox!
  • Add support for getOneOrNullResult() method in ChildDoctrineRepositoryClassTypeRector (#​5747)
  • Add boolean and support to RemoveDeadInstanceOfRector (#​5748)
  • [DeadCode] Add new rule - ReduceAlwaysFalseIfOrRector (rectorphp/rector-src@0dd1a43)
  • [CodeQuality] Add new rule - ExplicitReturnNullRector (#​5753)
  • [CodeQuality] Transform type|void docblock to type|null as well on ExplicitReturnNullRector after add return null (rectorphp/rector-src@576198c)
  • [CodeQuality] Add Function_ support on ExplicitReturnNullRector (#​5762)
  • [CodeQuality] Add Goto_ possible return null on SilentVoidResolver under Do_ (#​5773)
  • Add rector test suite to phpunit.xml or phpunit.xml.dist (#​5717), Thanks @​ghostwriter!
  • [Php82] Add VariableInStringInterpolationFixerRector (#​5781)
  • [DeadCode] Add RemoveUselessReadOnlyTagRector (rectorphp/rector-src@ef333de)

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 🥳

  • Add minimal memory limit for local run phpstan without result cache (#​5624), Thanks @​integer!
  • Add method RectorConfigBuilder::withSkipPath() (#​5626), Thanks @​integer!
  • Add basic validation for skipped path (#​5628), Thanks @​integer!
  • [Php80] Add DoctrineCoverterterAttributeDecorator to convert "false"/"true" string to false/true on nullable arg on Doctrine\ORM\Mapping\Column (#​5629)
  • Add const fetch to class const fetch rector. (#​5627), Thanks @​micaherne!
  • [DX] Add error message information for include full path to load internal phpstan bleedingEdge.neon config (#​5635)
  • [TypeDeclaration] Adds AddParamTypeForFunctionLikeWithinCallLikeArgDeclarationRector rule (#​5547), Thanks @​peterfox!
  • [Php83] Add type to final class constant (#​5662), Thanks @​philbates35!

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 🐛

  • Fix repeated timeouts on CI - #​8403, #​8396
  • Bump PHPStan to 1.10.56 (#​5471)
  • Remove collector interface and fix SpatieEnumClassToEnumRector already has underscore to double underscore (#​5473)
  • [DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets (#​5477)

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 🥳

  • [CodeQuality] Add RemoveUselessIsObjectCheckRector (#​5316)
  • [PHP83] Implements a rule to add types to class constants (#​5290), Thanks @​peterfox!

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 💀

  • Remove deprecated Rector rules (#​5270)

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 🥳

  • [CodeQuality] Add negated support on SingleInArrayToCompareRector (#​5205)
  • [Php83] Adds rule for adding Override attribute (#​5170), Thanks @​peterfox!

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)
  • [CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector (#​5132)
  • Skip __construct() in BoolReturnTypeFromStrictScalarReturnsRector (#​5133), Thanks @​staabm!
  • [CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector (#​5134)
  • [CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector (#​5135)
  • [CodeQuality] Use its start token pos on Else_ on CompleteMissingIfElseBracketRector as no cond (#​5136)
  • [PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() (#​5138)
  • [TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector (#​5144)
  • [TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector (#​5149)
  • [CodeQuality] Fix missing parentheses on CombineIfRector (#​5151)
  • [TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector (#​5155)
  • [CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector (#​5159)
  • [CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector (#​5161)
  • [CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector (#​5163)
  • [PostRector] Reduce loop on ClassRenamingPostRector (#​5174)
  • [PostRector] Fix ClassRenamingPostRector return when no auto import replacement (#​5175)
  • [Renaming] Skip nullable object object|null on RenameMethodRector (#​5181)
  • [Downgradephp81][DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector (#​5183)
  • [Naming] Skip DateTime from renaming, to keep convention of named dates (#​5184)
  • Skip new self in RenameVariableToMatchNewTypeRector (#​5185)
  • Skip DateTime in ExpectedNameResolver (#​5186)
  • [Naming] Skip all kinds of generators (#​5187)
  • [Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector (#​5188)
  • [Php70] Fix Php4 contructor not replaced with __construct() on php 7.4 environment (#​5189)
  • [Php74][Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled (#​5190)
  • [TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() (#​5191)
  • Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() (#​5193)
  • [PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper (#​5141)
  • [DeadCode] Remove UnionType check on RecastingRemovalRector (#​5142)
  • Remove src/constants.php for T_ENUM and T_NAME_RELATIVE (#​5143)
  • [PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper (#​5145)
  • [PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper (#​5146)
  • [DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector (#​5152)
  • [DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector (#​5153)
  • [DeadCode] Skip used in next For_/Foreach_ on RemoveDeadIfForeachForRector (#​5154)
  • [DeadCode] Handle file_get_contents() only remove variable on RemoveUnusedVariableAssignRector (#​5162)
  • [DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector (#​5160)
  • RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types (#​5169), Thanks @​staabm!
  • RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch (#​5166), Thanks @​staabm!
  • [DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector (#​5172)
  • [AutoImport] [Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import (#​5168)
  • [DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector (#​5195)

v0.18.5: Released Rector 0.18.5

Compare Source

New Features and Improvements 🥳

  • [build] Remove duplicated phpstan/phpstan from the build, as require by build package in composer.json already (rectorphp/rector-src@51ed7b6)
  • AddParamTypeBasedOnPHPUnitDataProviderRector: Check all data providers (#​5068), Thanks @​jlherren!
  • AddParamTypeBasedOnPHPUnitDataProviderRector: Enhance existing rule to handle PHPUnit 10+ DataProvider Attribute (#​4925), Thanks @​mcampbell508!
  • make PhpDocInfo::findByAnnotationClass() public to use in Symfony rules (#​5103)

Bugfixes 🐛

  • Feature/fix class annotation bad print (#​5081), Thanks @​etshy!
  • [Performance] Avoid ReflectionProvider check function exists on NameImportingPostRector (#​5083)
  • InlineConstructorDefaultToPropertyRector Readonly Class (#​5085), Thanks @​beschoenen!
  • [CodeQuality] Handle crash on variable variable on assign closure on OptionalParametersAfterRequiredRector (#​5089)
  • [NodeTypeResolver] Use isScalar()->yes() usage on StaticTypeAnalyzer and ScalarTypeComparator services (#​5099)
  • [ProcessAnalyzer] Ensure instanceof Stmt on check infinite loop on not yet has "created_by_rule" attribute (#​5100)
  • [DX] Rename shouldImportName() to shouldSkipName() on ClassNameImportSkipper (#​5107)
  • The ReturnTypeFromReturnNewRector must only handle new instances, to avoid leaking to everything (#​5115)
  • [Php80] Skip when already implements Stringable and has string return type on StringableForToStringRector (#​5120)

Removed and Deprecated 💀

  • [DX] Remove CurrentFileProvider dependency on ChangedNodeScopeRefresher (#​5087)
  • [DX] Remove DependencyClassMethodDecorator as not used anymore due to paralel nature (#​5094)
  • [PostRector] Remove CurrentFileProvider on PostFileProcessor (#​5097)
  • [Comments] Remove unused copy Node object on CommentRemover (#​5103)
  • [Performance][AutoImport] Remove just renamed check on ClassNameImportSkipper (#​5106)
  • Deprecate CountOnNullRector as depends on previous context and require manual adjustment of previous result (#​5101)

v0.18.4: Released Rector 0.18.4

Compare Source

New Features and Improvements 🥳

  • Introducing Collectors 🥳 - processing collected data + test case (#​4970)
  • Run tests on macos (#​5019), Thanks @​staabm!
  • Move betterNodeFinder, valueResolver, phpDocInfoFactory dependencies from AbstractRector into rules (#​5071)
  • DX: Validate paths in RectorConfig->paths() (#​5065), Thanks @​staabm!
  • [DX] Make PhpDocInfoFactory explicitly required in Rector rule constructor, if needed (#​5051)
  • [DX] Make ValueResolver explicitly required in Rector rules constructor if needed (#​5052)

Bugfixes 🐛

  • [DeadCode] RemoveDeadZeroAndOneOperationRector should not remove Constants (#​4910), Thanks @​TwanVermeulen!
  • [PostRector] Fix unused import not removed on empty generic class name exists (#​5012)
  • [Parallel] Handle Spaced root project main script on parallel process (#​4813)
  • Fix TypedPropertyFromStrictConstructor* order (#​5021), Thanks @​staabm!
  • [DX] Lower current node dependency - pass it directly to doc node parsing (#​5023)
  • [AutoImport] Fix conflict current namespace auto import (#​5024)
  • Simplify UseIdenticalOverEqualWithSameTypeRector (#​5029), Thanks @​staabm!
  • [Performance][Testing] Use str_contains instead of regex in FixtureSplitter (#​5030)
  • Fix ArrayKeyFirstLastRector: Skip exection when pointer is changed (#​5038), Thanks @​scyzoryck!
  • [TypeDeclaration] Handle fallback from param same type object on ReturnTypeFromReturnNewRector (#​5039)
  • [NodeTypeResolver] Use Scope->getType() on ArrayDimFetch on NodeTypeResolver::getNativeType() (#​5037)
  • [NodeTypeResolver] pull getType() on ArrayDimFetch when not mixed type from its variable native definition (#​5056)
  • [CodingStyle][EarlyReturn] Fix infinite if else on BinarySwitchToIfElseRector+RemoveAlwaysElseRector (#​5057)
  • [TypeDeclaration] Skip ArrayDimFetch for return and param types (#​5059), Thanks @​staabm!
  • [NodeTypeResolver] Handle optional array shape on native function like with ArrayDimFetch (#​5062)
  • [Php80] Mirror switch comment to match to ChangeSwitchToMatchRector (#​5072)
  • [AutoImport] Skip case insensitive conflict defined class name on $rectorConfig->importNames() (#​5076)
  • Docblock fix on ShortNameResolver (#​5077)
  • [TypeDeclaration] Add return static property support on ReturnTypeFromStrictTypedPropertyRector (#​5050)

Removed and Deprecated 💀

  • [Config] Remove asterisk support in import() for file, use explicit paths instead (#​5010)
  • [Performance] Remove regex check on open tag spaced check on FileProcessor (#​5073)
  • Deprecate TypedPropertyFromStrictConstructorReadonlyClassRector as based on docblock and public elements; use private elements and property promotion instead (#​5049)
  • Deprecate BinarySwitchToIfElseRector as opinionated to allow more suitable match() refactoring (#​5064)

v0.18.3: Released Rector 0.18.3

Compare Source

New Features and Changes 🥳

  • [BC] docblock changes in custom Rector rules now have to be reprinted directly in the rule - #​8201 (comment)
  • [TypeDeclaration] Add return empty string defined support on ReturnTypeFromStrictScalarReturnExprRector (#​4919)
  • [TypeDeclaration] Add fallback return direct array support on ReturnTypeFromStrictNewArrayRector (#​4928)
  • [TypeDeclaration] Add init assign method call support on ReturnTypeFromStrictNewArrayRector (#​4929)
  • [TypeDeclaration] Ensure ArrayType on ReturnTypeFromStrictNewArrayRector::shouldAddReturnArrayDocType() (#​4932)
  • [TypeDeclaration] Add test fixture return docblock on init method call assign as skipped on ReturnTypeFromStrictNewArrayRector (#​4933)
  • [TypeDeclaration] Add non native function return support on ReturnTypeFromStrictScalarReturnExprRector (#​4934)
  • BC: Separated regex matching in NodeNameResolver->isName() (#​4951), Thanks @​staabm!
  • Add support for Custom Skip Voters (#​5002), Thanks @​kaczenski!
  • Implement a max jobs per worker budget (#​4965), Thanks @​staabm!
  • Prevent unnecessary calls to spl_object_id() (#​4992), Thanks @​staabm!
  • Refactor use import resolving (#​4998), Thanks @​staabm!
  • NodeNameResolver: Throw exception in BC breaking path (#​4980), Thanks @​staabm!
  • [Internals] Decouple output from AbstractRector, narrow debugging output to file path (#​4976)
  • Update docblock only when changed, directly in rector rule (#​4986)

Bugfixes 🐛

  • AddVoidReturnTypeWhereNoReturnRector: fix never type handling (#​4918), Thanks @​staabm!
  • [TypeDeclaration] Skip return after return closure on AddVoidReturnTypeWhereNoReturnRector (#​4930)
  • [TypeDeclaration] Use $type->isScalar()->yes() on AlwaysStrictScalarExprAnalyzer (#​4920)
  • Refactor BetterNodeFinder::findFirstInFunctionLikeScoped() to work with SilentVoidResolver (#​4931)
  • [NodeTypeResolver] Handle isObjectType() on new $class dynamic variable should return false compare to Object FQCN (#​4936)
  • [Testing] Fix running unit test on macOS (#​4941)
  • Faster name resolving (#​4955), Thanks @​staabm!
  • UseImportsTraverser: don't deep traverse (#​4994), Thanks @​staabm!
  • [tests] Replace wildcard e2e test with unit one (#​5000)
  • [DocBlock] Update docblock contents right in the rule (#​4999)
  • [PhpParser] Fix crash read jetbrains/phpstorm-stubs included in phpstan.phar on PHP 8.0 and PHP 7.4 (#​5001)
  • RenameFunctionRector: prevent repeated isName() calls (#​5003), Thanks @​staabm!
  • Make PhpDocINfo::removeByType() return bool to inform about changed node (#​4979)

Removed 💀

  • [cleanup] Remove deprecated NonPhpRectorInterface, PseudoNamespaceToNamespaceRector and mysql to mysqli sets (#​4927)
  • Remove UnSpreadOperatorRector as not clear value and spread used on purpose (#​4949)
  • [Naming] Remove matchesStringName() check completely from NodeNameResolver, including endsWith() method - use getName() and compare directly instead (#​4954)
  • [Performance][Php55] Remove regex replace e on RegexMatcher (#​4974)
  • Remove CurrentRectorProvider and used for docblock changes report, return bool value and node directly in the rector rule instead (#​4982)
  • Deprecated PhpDocInfo::markAsChanged() to ensure doc block is changed directly in the Rector rule (#​4987)

v0.18.2: Released Rector 0.18.2

Compare Source

New Features and Changes 🥳

  • Add MyCLabs enum equals + keeping methods (#​4645), Thanks @​K0nias!
  • [TypeDeclaration] skip variadic constructor param of mixed type on AddParamTypeFromPropertyTypeRector (#​4887), Thanks @​Celebrate-Reinhard!
  • [TypeDeclaration] Do not add default value when assigned in __construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector (#​4886)
  • [TypeDeclaration] Add ReturnTypeFromStrictFluentReturnRector (#​4890)
  • Add single value concat support to EncapsedStringsToSprintfRector (#​4897)
  • Add number support to concat EncapsedStringsToSprintfRector (#​4898)
  • [DeadCode] Remove @​return void on return self on RemoveUselessReturnTagRector (#​4894)
  • Add test case for caching $rectorConfig->rules() changed (#​4903)
  • [CodeQuality] Add NumberCompareToMaxFuncCallRector (#​4914)
  • [TypeDeclaration] Add return self object support on ReturnTypeFromStrictFluentReturnRector (#​4915)
  • [TypeDeclaration] Add return static object support on ReturnTypeFromStrictFluentReturnRector (#​4916)

Bugfixes 🐛

  • [Caching] Add VersionResolver::PACKAGE_VERSION to FileHashComputer::compute() so cache cleared on composer update got new version (#​4904)
  • [TypeDeclaration] Using ClassMethodReturnTypeOverrideGuard on ReturnTypeFromStrictParamRector (#​4878)
  • [e2e] $rectorConfig->skip() should not skip inside different path over config (#​4882)
  • Fix missing default string in TypedPropertyFromStrictGetterMethodReturnTypeRector (#​4885)
  • Fix tests fixture updater (#​4892)
  • Fix union type check of object (#​4893)
  • Simplify isMatchingUnionType() (#​4895), Thanks @​staabm!
  • Skip identical to false in SimplifyBoolIdenticalTrueRector, as exact comparison is stronger than negated expression (#​4901)
  • Fix Rector invalidation in case of changes sets or rules (#​4902)
  • [TypeDeclaration] Skip mixing native + docblock union assign on TypedPropertyFromAssignsRector (#​4905)
  • StrictArrayParamDimFetchRector: Skip objects (#​4907), Thanks @​staabm!
  • FamilyRelationsAnalyzer: final classes can't have children (#​4913), Thanks @​staabm!
  • [Config] Remove $isBound usage as cause empty configuration on RectorConfig (#​4880)

v0.18.1: Released Rector 0.18.1

Compare Source

This release is accompanied by 2 posts that explains behind the scenes context:


New Features and Changes 🥳

  • [CI] Narrow tests to single job, as now takes 20 s 🚀 (#​4827)
  • [Config] Handle $rectorConfig->import() with wildcards * config (#​4832)
  • [DX] Display rule count in list-rules (#​4848)
  • Skip PHPDoc return type in AddReturnTypeDeclarationBasedOnParentClassMethodRector (#​4809), Thanks @​staabm!
  • AddReturnTypeDeclarationBasedOnParentClassMethodRector: don't trust phpdoc types (#​4810), Thanks @​staabm!
  • [DX] Add optional testdox/pest like output to get exact test metrics per unit test fixture (#​4821)
  • [TypeDeclaration] Add new array replaced with array on ReturnTypeFromStrictNewArrayRector (#​4825)
  • [DX] Merge PhpRectorInterface to RectorInterface as identical contract and separation no longer needed (#​4812)
  • [PHPStan] Avoid removing bleeding edge from phar include, let user handle own phpstan configuration (#​4840)

Bugfixes 🐛

  • [Php73][Php80] Handle empty long array syntax default value on SensitiveConstantNameRector+AddParamBasedOnParentClassMethodRector (#​4837)
  • [Config] Add merging of rules configuration, call configure() just once (#​4838)
  • Fix RenamePropertyToMatchTypeRector to skip Laravel collections and avoid accident rename (#​4811)
  • [BetterPhpDocParser] Enable textBetweenTagsBelongsToDescription on BetterPhpDocParser extends PhpDocParser (#​4817)
  • [PHPUnit] Fix extreemely slow PHPUnit run on data providers with objects (#​4823)
  • [AutoImport] Handle case insensitive name collide on auto import (#​4829)
  • [Traverser] Set explicitely nodeConnectingVisitorCompatibility: false config in config/phpstan/static-reflection.neon (#​4841)
  • replaces get_headers $associative with bool (#​4850), Thanks @​mvhirsch!
  • [Php55][Renaming] Handle rename string on combination StringClassNameToClassConstantRector+RenameStringRector (#​4869)
  • [Php80] Handle crash parent default empty array/string param on AddParamBasedOnParentClassMethodRector (#​4833)

Removed 💀

  • Remove deprecated FileProcessorInterface (#​4835)
  • Remove SwapFuncCallArgumentsRector as keeps swaping to infinity, use custom rule instead (#​4874)

v0.18.0: Released Rector 0.18.0 with Laravel container

Compare Source

New Features and Changes 🥳

  • [DI] Switch container to Laravel - final step 🥳 (#​4698)
    • do you use $rectorConfig->import('src/*'); with mask?
    • this is removed now, use explicit real paths instead
  • [DI] Remove symfony/dependency-injection dependency (#​4796)
  • [DI] Add symfony config BC warnings layer, to inform about an upgrade (#​4800)
  • Add possibility to add multiple phpstan configs (#​4798), Thanks @​alexander-schranz!
  • [DX] Make use of addParameter() (#​4801)
  • Add deprecation warning for FileProcessorInterface (#​4808)

Bugfixes 🐛

  • [DeadCode] Handle duplicated annotation on space before close parentheses on RemoveUselessParamTagRector (#​4795)
  • Fix skip() Rector class, make container forget it comleteely (#​4807)

v0.17.13: Released Rector 0.17.13

Compare Source

New Features and Changes 🥳

  • [TypeDeclaration] Skip in conditional on AddParamTypeFromPropertyTypeRector (#​4779)
  • [DX] Deprecate NonPhpRectorInterface, the only rule and its file processor, to make Rector handle exlusively PHP (#​4761)
  • Bump nikic/php-parser to 4.17 (#​4781)

Removed 💀

  • Remove SwapMethodCallArgumentsRector as could lead to infinite swapping, use custom rule with type/value check instead (#​4766)
  • [Php81] Remove IntersectionTypesRector as rely on docblock (#​4784)

Bugfixes 🐛

  • [DeadCode] Skip used by trait on RemoveUnusedPrivateMethodRector (#​4770)
  • [DeadCode] Skip used by trait inside Closure on RemoveUnusedPrivateMethodRector (#​4773)
  • [e2e] Handle $rectorConfig->paths() with wilcards * config (#​4765)
  • [Config] Move from magic loading of all PHPStan extensions, their bootstrap files etc. under control with explicit file listing (#​4769)
  • [TypeDeclaration] Handle crash on concat param append returned used on Arg on StrictStringParamConcatRector (#​4774)
  • [TypeDeclaration] Skip param re-assign on Strict Param rules (#​4775)
  • [TypeDeclaration] Skip param int on StrictStringParamConcatRector (#​4780)
  • [PHPStanStaticTypeMapper] Allow Closure type on ClosureTypeMapper based on PHP versions (#​4785)
  • [PHPStanStaticTypeMapper] Allow standalone null type on NullTypeMapper on php 8.2 (#​4783)
  • Make SimplifyUselessVariableRector run without scope (#​4791)
  • Make NullToStrictStringFuncCallArgRector run without scope (#​4792)

v0.17.12

Compare Source

v0.17.11: Released Rector 0.17.11

Compare Source

New Features and Improvements 🥳

  • [TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector (#​4636)
  • [TypeDeclaration] Add ReturnUnionTypeRector (#​4655)
  • [TypeDeclaration] Skip public method on AddMethodCallBasedStrictParamTypeRector (#​4659)
  • [CodeQuality][TypeDeclaration] Add string append support on ReturnTypeFromStrictScalarReturnExprRector (#​4657)
  • [TypeDeclaration] Handle anonymous class in union on AddArrowFunctionReturnTypeRector (#​4676)
  • [Types] Make AddVoidReturnTypeWhereNoReturnRector work only with type-declaration, as reliable (#​4720)
  • [TypeDeclaration] Allow change multiple methods on AddParamTypeDeclarationRector (#​4727)
  • [DX] Add ProcessConfigureDecorator to avoid superfluous composition (#​4734)
  • [Logging] Add RectorOutput logging service (#​4736)
  • [DX] Cache rector test config loading by file + class to avoid booting over and over per fixture (#​4718)
  • [DX] Validate rules no longer existing rules in $rectorConfig->skip() (#​4728)
  • [DX] Merge RectorOutputStyle, OutputStyleInterface to RectorStyle (#​4711)

Bugfixes 🐛

  • [TypeDeclaration] Do not change different type defualt value on StrictStringParamConcatRector (#​4635)
  • [Strict] Skip docblock on BooleanInTernaryOperatorRuleFixerRector (#​4638)
  • [Strict] Skip docblock on DisallowedShortTernaryRuleFixerRector (#​4639)
  • [Strict] Skip docblock on BooleanInBooleanNotRuleFixerRector (#​4640)
  • [TypeDeclaration] Using native type scope get on ReturnTypeInferer (#​4648)
  • [CodingStyle][Php80][Privatization] Handle SeparateMultiUseImportsRector+ClassPropertyAssignToConstructorPromotionRector+FinalizeClassesWithoutChildrenRector cause invalid removal (#​4649)
  • [DX] Cleanup ForRepeatedCountToOwnVariableRector counter (#​4651)
  • [DX] Make MoneyFormatToNumberFormatRector wrap func call directly to keep simple (#​4653)
  • Move ArrayManipulator to rector-symfony, where only used (#​4656)
  • [DX] Move FlipNegatedTernaryInstanceofRector to instanceof rules category (#​4663)
  • Resolve encapsed values as strings (#​4622), Thanks @​Bellardia!
  • [Privatization] Skip parent class unknown on PrivatizeFinalClassMethodRector (#​4671)
  • [TypeDeclaration] Skip anonymous class and other object on ReturnUnionTypeRector (#​4670)
  • [TypeDeclaration] Allow return anonymous class on ReturnTypeFromReturnNewRector (#​4669)
  • [TypeDeclaration][CodeQuality] Move ReturnTypeFromStrictScalarReturnExprRector from CodeQuality to TypeDeclaration set (#​4668)
  • [TypeDeclaration] Allow __invoke() method for return type changed on ClassMethodReturnTypeOverrideGuard (#​4667)
  • [NodeTypeResolver] Clean up anonymous class detection on NodeTypeResolver::getNativeType() (#​4673)
  • [NodeAnalyzer] Pass ReflectionProvider to __construct() on CallAnalyzer (#​4699)
  • Skip code changes on unresolvable/unknown classes (#​4619), Thanks @​staabm!
  • [TypeDeclaration] Use return bool for ParentClassMethodTypeOverrideGuard::hasParentClassMethod(), return ?MethodReflection for ParentClassMethodTypeOverrideGuard::getParentClassMethod() (#​4703)
  • [TypeDeclaration] Skip param setter method intersection docblock not autoload on ReturnNeverTypeRector (#​4721)
  • [TypeDeclaration] Skip non void or never already return typed on ReturnNeverTypeRector (#​4723)
  • Make relativeFilePathFromDirectory() private as used only locally (#​4735)
  • [DX] Avoid supporting edge-case multi-layered comments, must be covered in php-parser itself (#​4743)
  • [TypeDeclaration] Skip void type on caller on ReturnTypeFromStrictTypedCallRector (#​4751)
  • Use direct VoidType definition on Return_ expr is null on ReturnedNodesReturnTypeInfererTypeInferer (#​4752)
  • [Renaming] Deprecate PseudoNamespaceToNamespaceRector as too dynamic and unreliable, use the RenameClassRector instead (#​4755)

Removed 💀

Since Rector 0.15 we declare type stricness and avoid docblock changes, as unreliable and could lead to incorrect assumptions: getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations

Few rules work with unreliable docblocks, and were removed. Instead handle cases yourself with PHPStan help 👍

  • [DX] Remove deprecated RectorConfigProvider, use SimpleParameterProvider instead (#​4658)
  • [DX] Remove usage of deprecated symfony parameters (#​4674)
  • Remove deprecated ArrayShapeFromConstantArrayReturnRector (#​4662)
  • Remove RemoveParentRector as never used and only for demo purposes, handle custom way where needed (#​4679)
  • [DX] Remove *AnnotationIncorrectNullableRector rules as works with unreliable docblocks and can have 2 solutions (#​4719)
  • Remove appendArgs() method on AbstractRector (#​4732)
  • [Renaming] Remove callables from class renames to avoid missed rename bugs, better handle with PHSPtan and custom rule (#​4745)
  • [DX] Remove NullifyUnionNullableRector, let cs tools handle it (#​4660)
  • [DX] Remove RemoveJustPropertyFetchRector as used for one time job, not practical for general use (#​4661)
  • [TypeDeclaration] Remove AddClosureReturnTypeRector (#​4637)
  • [DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context (#​4729)

v0.17.10: Released Rector 0.17.10

Compare Source

New Features 🥳

  • [TypeDeclaration] Add Closure support on NumericReturnTypeFromStrictScalarReturnsRector (#​4631)
  • [TypeDeclaration] Add Closure support on StrictArrayParamDimFetchRector (#​4632)
  • [TypeDeclaration] Add Closure support on ReturnTypeFromStrictParamRector (#​4633)
  • [TypeDeclaration] Add Closure support on StrictStringParamConcatRector (#​4634)

Bugfixes 🐛

  • [Downgrade] [FIX] Fix infinite loop in DowngradeArrayFilterNullableCallbackRector (#​150)

v0.17.9: Released Rector 0.17.9

Compare Source

Bugfixes 🐛

v0.17.8: Released Rector 0.17.8

Compare Source

New Features 🥳

  • [TypeDeclaration] Add Closure support on BoolReturnTypeFromStrictScalarReturnsRector (#​4610)
  • AddMethodCallBasedStrictParamTypeRector: Support changing protected methods in final classes (#​4611), Thanks @​staabm!
  • [TypeDeclaration] Add StrictStringParamConcatRector (#​4624)

Bugfixes 🐛

  • [PHPStanStaticTypeMapper] FQCN for Closure type mapper (#​4584)
  • Fixed constant types handling in TypedPropertyFromStrictConstructorRector (#​4588), Thanks @​staabm!
  • [TypeDeclaration] Skip coalesce on StrictArrayParamDimFetchRector (#​4589)
  • Bump to phpdoc-parser 1.23 and fill construct() attributes (#​4590)
  • [TypeDeclaration] Skip override string on StrictArrayParamDimFetchRector (#​4591)
  • [Autoloading] Using SimpleParameterProvider on BootstrapFilesIncluder (#​4592)
  • [Php81] Fix regression skip call by ref on ReadOnlyPropertyRector (#​4593)
  • [PHPStanStaticTypeMapper] Make use of toPhpDocNode() on ObjectTypeMapper (#​4581)
  • [PHPStanStaticTypeMapper] Fix IntersectionTypeMapper to make ObjectType have FQCN (#​4598)
  • [Php81] Skip re-assign with AssignOp on ReadOnlyPropertyRector (#​4600)
  • Reduce ConstExprClassNameDecorator overhead (#​4603), Thanks @​staabm!
  • Resolve native return-type from native union-type in short ternary (#​4606), Thanks @​staabm!
  • [Strict] Skip from docblock @​return on DisallowedEmptyRuleFixerRector (#​4608)
  • [Strict] Skip @​return docblock on BooleanInIfConditionRuleFixerRector (#​4609)
  • [Php81] Fix regression skip call by ref on ReadOnlyPropertyRector on non __construct method (#​4614)
  • [CodeQuality][Strict] Handle infinite loop on SimplifyDeMorganBinaryRector+SimplifyIfReturnBoolRector+DisallowedEmptyRuleFixerRector (#​4615)
  • [CodingStyle][Namespace_] Support constant imports (#​4612), Thanks @​natepage!
  • [Php81] Skip property fetch from new static on ReadOnlyPropertyRector (#​4617)
  • [CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector (#​4618)
  • Fix string type on StrictArrayParamDimFetchRector (#​4623)
  • [PHPStanStaticTypeMapper] Handle crash on DowngradeMixedTypeDeclarationRector for PHPStan\Type\ConditionalType (#​4625)
  • [Php73] Handle crash Type Error on JsonThrowOnErrorRector (#​4626)
  • [Php81] Skip call by ref on ReadOnlyPropertyRector on FuncCall (#​4630)
  • [Printer] Fix printing PHPStan AlwaysRememberedExpr with add unwrapper inside BetterStandardPrinter::p (#​4629)
  • [TypeDeclaration] Skip has parent class method on AddParamTypeFromPropertyTypeRector (#​4627)

Removed 💀

  • [Printer] Remove has InlineHTML node check after apply changes on PhpFileProcessor (#​4601)

v0.17.7: Released Rector 0.17.7

Compare Source

New Features 🥳

  • [CodingStyle] Skip filled by construct on AddArrayDefaultToArrayPropertyRector (#​4549)
  • Add constuctor support to ReplaceArgumentDefaultValueRector (#​4554)
  • StaticMapper: added fast path for IdentifierTypeNode (#​4565), Thanks @​staabm!
  • Add ReturnTypeFromStrictParamRector (#​4501), Thanks @​staabm!
  • Add TypedPropertyFromStrictConstructorReadonlyClassRector (#​4552), Thanks @​staabm!
  • ReturnTypeFromStrictTernaryRector: Support complex ternaries (#​4515), Thanks @​staabm!

Bugfixes 🐛

  • Support final methods in ClassMethodReturnTypeOverrideGuard (#​4509), Thanks @​staabm!
  • Support literals in ReturnTypeFromStrictTypedCallRector (#​4511), Thanks @​staabm!
  • [TypeDeclaration] Null stmts check early on ReturnTypeFromStrictParamRector (#​4512)
  • [Performance] Use filtered filePaths from ApplicationFileProcessor::configurePHPStanNodeScopeResolver on WorkerRunner::run() (#​4513)
  • [DX] Show progress bar 100% on RectorConsoleOutputFormatter::report() (#​4516)
  • [ChangesReporting] Reuse defined errors vairable on ConsoleOutputFormatter (#​4517)
  • [ApplicationFileProcessor] Refactor ApplicationFileProcessor to filter file paths early before run both parallel and non-parallel (#​4519)
  • [DX] Fix hang on twice run after all files processed cached (#​4521)
  • [Application] Move filter files by config extensions to FileFactory (#​4522)
  • [Php81][Php82][Privatization] Handle extends non-readonly class on ReadOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector (#​4524)
  • Fix wrong results in RemoveAlwaysElseRector (#​4527), Thanks @​jlherren!
  • Support class-const-fetch in ReturnTypeFromStrictTypedCallRector (#​4520), Thanks @​staabm!
  • [EarlyReturn] Skip append variable on PreparedValueToEarlyReturnRector (#​4530)
  • Refactor MyCLabs\Enum\Enum::equals calls to comparisons (#​4532), Thanks @​rojtjo!
  • [Performance][NodeManipulator] Avoid loop on search first variable named on next sliced next stmts on StmtsManipulator (#​4537)
  • [Performance] [TypeDeclaration] Reduce resolve ClassReflection on each property on TypedPropertyFromStrictConstructorRector (#​4536)
  • [Performance][TypeDeclaration] Reduce resolve ClassReflection from Property on AllAssignNodePropertyTypeInferer (#​4539)
  • [Application] Merge process files on both parallel and non-parallel process (#​4523)
  • [PHPStan] Merge assert phpstan errors to one (#​4544)
  • [Performance] [Php74] Reduce ClassReflection lookup from property on PropertyTypeChangeGuard (#​4545)
  • Use instanceof check on ClassReflection resolve (#​4547)
  • [Reflection] Reduce Scope pulling on ReflectionResolver (#​4548)
  • [Strict] Skip empty() from param doc on DisallowedEmptyRuleFixerRector (#​4550)
  • Fix space in paths (#​4553)
  • Skip traits in CountOnNullRector (#​4556)
  • Make use of toPhpDocNode() - take #​2 (#​4555)
  • [Performance] [PostRector] Only check phpdocinfo on Stmt and Param on NameImportingPostRector (#​4558)
  • [CodeQuality] Skip pull property from inner class on CompleteDynamicPropertiesRector (#​4561)
  • Prevent unnecessary scope creation (#​4562), Thanks @​staabm!
  • NameImportingPhpDocNodeVisitor: Cheap checks first (#​4563), Thanks @​staabm!
  • [Performance][Renaming] No need PhpDocInfo refactor on Name node on ClassRenamer (#​4566)
  • [TypeDeclaration] Deprecate ArrayShapeFromConstantArrayReturnRector as uses docblocks that we move away from since 0.15 (#​4571)
  • Make ReturnTypeFromStrictNewArrayRector handle only single level arrays (#​4575)
  • Fix array mapping (#​4576)
  • [Performance] [PostRector] Reduce repetitive resolve uses statements on NameImportingPostRector (#​4579)
  • [EarlyReturn] Handle multiple statements in else in ChangeIfElseValueAssignToEarlyReturnRector (#​4580), Thanks @​dorrogeray!
  • [BUGFIX] Ensure proper reprint with attributes for finalized classes (#​4585), Thanks @​cngJo!

Removed 💀

  • [DX] Remove AllowEmptyConfigurableRectorInterface to ease interface tree, better handle on particular configure() method inside the rule (#​4540)
  • Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector (#​4551)
  • [Performance][PostRector] Remove alias exists check on NameImporter called from NameImportingPostRector (#​4564)
  • [Performance][BetterPhpDocParser] Remove unused ConstExprNode check on ConstExprClassNameDecorator (#​4578)
  • [PHPStanStaticTypeMapper] Remove manual type check on PHPStanStaticTypeMapper (#​4583)
  • [StaticTypeMapper] Remove standalone false handling on StaticTypeMapper (#​4582)

v0.17.6: Released Rector 0.17.6

Compare Source

In this release, we narrowed rules from PHPUit and Doctrine to their specific version category. We've detected few outdated and never used rules and cleaned them up to make Rector smaller and easier to use 👍

Be use to always use *SetList constants over specific rules to use the latest version:

use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->sets([
        \Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
    ]);
};

New Features 🥳

  • Add PHPUnit to sets (#​4495)
  • [CI] Add PHPUnit 10 to check rules and sets groups (#​4500)
  • [CI] Add doctrine rules in set check (#​4505)

Bugfixes 🐛

  • [Performance] Only set Attribute on context inside ArrayDimFetch and ArrayItem on specific node used (#​4493)
  • [Php52] Use instanceof check instead of compare object $newStmt === $caseStmt on ContinueToBreakInSwitchRector (#​4494)
  • Exclude the full docs folder from archives (#​4497), Thanks @​stof!
  • Cleanup RecastingRemovalRector tests (#​4498)
  • Move Rector order test to PHPUnit, as uses its rules (#​4499)
  • let phpunit handle its own empty method rule (#​4501), Thanks @​staabm!
  • Micro optimizations: cheap checks first (#​4510), Thanks @​staabm!
  • Skip coalsce assign in RemoveUnusedPrivatePropertyRector (#​4491)
  • [DeadCode] Skip append += assignment on RemoveUnusedPrivatePropertyRector (#​4506)
  • [AstResolver][Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() (#​4508)

Removed 💀

  • [NodeTypeResolver] Remove unused AttributeKey::INSIDE_ARRAY_ITEM on ContextNodeVisitor (#​4496)
  • [NodeTypeResolver] Remove AttributeKey::IS_RETURN_EXPR from ContextNodeVisitor (#​4502)
  • [NodeTypeResolver] Remove AttributeKey::IS_ISSET_VAR from ContextNodeVisitor (#​4503)
  • [NodeTypeResolver] Remove nestedChainMethodCallLimit() for deep method call counter check (#​4504)

v0.17.5: Released Rector 0.17.5

Compare Source

Removed 💀

  • [DeadCode] Skip property not exists on RemoveTypedPropertyDeadInstanceOfRector (#​4481)
  • [CodeQuality][Php80] Handle infite loop swap params on RemoveUnusedVariableInCatchRector + OptionalParametersAfterRequiredRector (#​4484)

Bugfixes 🐛

  • fix(rules): Skip readonly classes from restoring default null value. (#​4479), Thanks @​scyzoryck!
  • [Php80] Handle crash on ClassOnObjectRector + GetDebugTypeRector (#​4483)
  • [Strict] Fix DisallowedEmptyRuleFixerRector on empty string isset (#​4485)
  • Fix StrictArrayParamDimFetchRector on is_* calls (#​4486), Thanks @​staabm!
  • Fix trait rename in Php4ConsturctorRector (#​4487)
  • Fix StrictArrayParamDimFetchRector on same named property (#​4488), Thanks @​staabm!

v0.17.4: Released Rector 0.17.4

Compare Source

Bugfixes 🐛

  • [CodeQuality][EarlyReturn] Handle crash Replace Stmt to Expr on FlipTypeControlToUseExclusiveTypeRector+FlipTypeControlToUseExclusiveTypeRector+ReturnBinaryOrToEarlyReturnRector (#​4474)
  • Fix ReturnBinaryOrToEarlyReturnRector mixing up returned nodes of array, hook into StmtsAwareInterface instead to keep next Rector rules updated (#​4476)

Removed 💀

  • Remove duplicated version_compare ReplaceFuncCallArgumentDefaultValue rule (#​4473), Thanks @​alexander-schranz!
  • [EarlyReturn] Remove ReturnBinaryAndToEarlyReturnRector as creates code hard to read and flips condition (#​4478)

v0.17.3: Released Rector 0.17.3

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes removing last parent node connections, to lower node tree memory consumption 🥳🥳🥳

  • [EarlyReturn] Remove findFirstNext() on InvertedIfFactory (#​4399)
  • [DX] Remove findParentType() method (#​4438)
  • [DX] Remove parent node from AbstractRector (#​4465)

New Features 🥳

  • Add float mul integer type to NumericReturnTypeFromStrictScalarReturnsRector (#​4376)
  • [TypeDeclaration] Add Encapsed string support to AlwaysStrictScalarExprAnalyzer (#​4382)
  • [TypeDeclaration] Add StrictArrayParamDimFetchRector (#​4384)
  • [DX] Kick of SimpleParameterProvider (#​4405)

Bugfixes 🐛

  • [DeadCode] Skip non typed param numeric check on RecastingRemovalRector (#​4390)
  • [Renaming] Handle crash on catch Exception name on RenameClassRector (#​4401)
  • Fix NumericReturnTypeFromStrictScalarReturnsRector for non-natively-typed parameters (#​4380), Thanks @​staabm!
  • [Php82] Skip extends unknown class on ReadonlyClassRector (#​4408)
  • [TypeDeclaration] Handle crash on no namespace with + operation on DeclareStrictTypesRector (#​4414)
  • [NodeTypeResolver] Reduce duplicated Scope fill on FuncCall (#​4428)
  • Make JsonThrowOnErrorRector work with local scope to detect error_json methods (#​4451)
  • Deprecate resolveNextNode() to work only in current node tree context (#​4455)
  • [Naming] Skip used on next foreach on RenameForeachValueVariableToMatchExprVariableRector (#​4469)

Removed 💀

  • Remove duplicate ReturnNeverTypeRector rule (#​4381), Thanks @​buffcode!
  • [MysqlToMysqli] Deprecate set, as dangerous to use, better handle manually (#​4448)
  • [DX] Make use of SimpleParameterProvider directly, deprecate RectorConfigProvider (#​4460)
  • [Performance] Immediate remove UnreachableStatementNodeVisitor object after traverse to avoid re-use in next file (#​4417)
  • [NodeTypeResolver] Remove ArrayItem scope filling from Array_ and Name filling for Catch types on PHPStanNodeScopeResolver (#​4423)
  • [PHP 8] Resources object upgrade - remove 2 rules as the upgrade require wholesome manual work (#​4442)
  • [DeadCode] Remove RemoveJustVariableAssignRector as often done on purpose or with side effect (#​4450)
  • Remove deprecated resolveNextNode() to embrace local scope node (#​4456)
  • [DX] Remove node connecting traverser from AbstractRector (#​4463)
  • Remove NodeConnectingTraverser (#​4464)
  • [DX] Remove autowrapping of expr/stmt to make return values in the same type and reliable (#​4466)

v0.17.2: Released Rector 0.17.2

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes:

  • removing more parent node connections, to lower node tree memory consumption

New Features 🥳

  • Add sleep after processPool->quitAll() to give time for all child processes to terminate (#​4280), Thanks @​dorrogeray!
  • [TypeDeclaration] Add NumericReturnTypeFromStrictScalarReturnsRector (#​4296)
  • [Php71] Add Closure support on AssignArrayToStringRector (#​4303)
  • Introduces AddSensitiveParameterAttributeRector rule (#​4342), Thanks @​peterfox!
  • Bump nikic/php-parser to 4.16.0 (#​4343)
  • Show error when no files will be processed (#​4326), Thanks @​staabm!
  • Cache unchanged files on dry run v2 (#​4281), Thanks @​dorrogeray!

Bugfixes 🐛

  • [CodeQuality] Handle crash on variable variable on OptionalParametersAfterRequiredRector (#​4226)
  • Fix LocallyCalledStaticMethodToNonStaticRector with method args (#​4233), Thanks @​toastedghost!
  • Use FunctionLike contract instead of union of function-like concrete implementations (#​4241), Thanks @​Wirone!
  • [CodeQuality][Performance] Reduce repetitive NodeTypeResolver->getType() on ExprBoolCaster (#​4279)
  • Skip rewindable generator (#​4282)
  • [Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector (#​4283)
  • [Php55] Clean up FullyQualified assigned to FullyQualified on StringClassNameToClassConstantRector (#​4284)
  • [TypeDeclaration] Extend NumericReturnTypeFromStrictScalarReturnsRector (#​4297)
  • Skip divide in NumericReturnTypeFromStrictScalarReturnsRector (#​4298)
  • [TypeDeclaration] Skip once typed and else return array_map() on ReturnTypeFromStrictTypedCallRector (#​4312)
  • Fix command to configure rector (#​4314), Thanks @​bertramakers!
  • [Performance] [NodeTypeResolver] Reduce callable traverse usage on ContextNodeVisitor (#​4317)
  • [CodeQuality] Skip not regex on SimplifyRegexPatternRector (#​4322)
  • [TypeDeclaration] Handle crash on object shape on ArrayShapeFromConstantArrayReturnRector (#​4323)
  • [Php81] Skip named constructor on ReadOnlyPropertyRector (#​4359)
  • Skip argument if value equals default value (#​4368), Thanks @​stefantalen!
  • [MysqlToMysqli] Handle infinite loop on MysqlQueryMysqlErrorWithLinkRector when no connection instance on first dept stmt (#​4375)

Removed 💀

  • Remove removeNode() method from AbstractRector (#​4225)
  • Remove Kind from doc mapper, as used just once (#​4234)
  • Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namespace, to avoid dumping removed static set (#​4242)
  • Restore RemoveMethodCallParamRector as used (#​4244)
  • [Performance] Remove NODES_TO_MATCH constant on RemoveNonExistingVarAnnotationRector (#​4267)
  • Remove VarConstantCommentRector as using unreliable docblocks, better use upcoming PHP 8.3 strict type const (#​4307)
  • [Naming] Remove BreakingVariableRenameGuard::isUsedInIfAndOtherBranches() to remove previous by types (#​4319)
  • [Php81] Remove cast check on NullToStrictStringFuncCallArgRector (#​4320)
  • [PhpParser] Remove BetterNodeFinder::findFirstPreviousOfTypes() (#​4327)
  • Move AddMethodParentCallRector to Symfony Rector (#​4301)

v0.17.1: Released Rector 0.17.1

Compare Source

In this release we continue preparing for Rector 1.0 release #​7854

This includes:

  • removing more parent node connections, to lower node tree memory consumption
  • replacing removeNode() method with return NodeTraverser::REMOVE_NODE direct constant to make changes happen directly in the Rector rule
  • refactoring node adding from post-process to directly in the rule

New Features 🥳

  • [Docblock] Move DocBlockUpdater service usage from AbstractRector to PhpDocTypeChanger (#​4215)
  • Improve string support in Doctrine Annotations (#​3645), Thanks @​yguedidi!
  • [Php80] Fix add default nullable type on ClassPropertyAssignToConstructorPromotionRector (#​4091)
  • Add STRICT_BOOLEANS set (#​4116)

Changes

  • [FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor (#​4058)
  • Remove node adding collector (#​4095)
  • Remove propperty to add collector, add them directly or as a constructor dependency (#​4131)
  • Move ReturnArrayClassMethodToYieldRector to PHPUnit Rector (#​4213)

Bugfixes 🐛

  • [CodeQuality] Exclude first class callable from IntvalToTypeCastRector (#​7962) (#​4040), Thanks @​thbley!
  • [CodingStyle] Skip first class callable on UnSpreadOperatorRector (#​4041)
  • Skip StrvalToType for strval first class callable syntax (#​4046), Thanks @​NicoImparfait!
  • Ensure check isFirstClassCallable() before node->getArgs() on CallLike (#​4049)
  • [CodeQuality] Skip multiple assigns append before foreach on ForeachItemsAssignToEmptyArrayToAssignRector (#​4052)
  • [CodeQuality] Skip deep append in if foreach before on ForeachItemsAssignToEmptyArrayToAssignRector (#​4053)
  • [NodeTypeResolver] Handle crash after next exit() on no namespaced code after removal next attribute (#​4074)
  • [FileProcessor] Show warning on has InlineHTML node if file has changed on PhpFileProcessor (#​4079)
  • Make SimplifyRegexPatternRector work without parent nodes + deprecate BetterNodeFinder and findParent* methods (#​4105)
  • Fix StaticCallOnNonStaticToInstanceCallRector to skip parent's parent's method calls. (#​4098), Thanks @​klimslim!
  • [CodingStyle] Skip countable object on CountArrayToEmptyArrayComparisonRector (#​4108)
  • [DeadCode] Skip used on Closure use next stmt on RemoveUnusedVariableAssignRector (#​4042)
  • [CodeQuality] Handle throw after if on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector (#​4107)
  • [CodeQuality] Handle return new object and no return on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector (#​4112)
  • Make ConvertStaticPrivateConstantToSelfRector work for non-final classes, make part of code-quality set (#​4114)
  • StringClassNameToClassConstantRector: cheap checks first (#​4151), Thanks @​staabm!
  • Reduce memory-consumption by simpler skip-patterns (#​4152), Thanks @​staabm!
  • Skipping: Use plain string functions instead of regex matching (#​4153), Thanks @​staabm!
  • Split instance of check to 2 rules (#​4165)
  • Performance: Prevent sorting of files in PhpFilesFinder (#​4164), Thanks @​staabm!
  • Move PreferThisOrSelfMethodCallRector to PHPUnit rector package, to handle exact cases (#​4194)
  • [Renaming] Handle crash in trait use on RenameClassRector (#​4196)
  • [Php56] Handle infinite loop on big array method call on AddDefaultValueForUndefinedVariableRector (#​4142)
  • [Php56] Skip variable variable on AddDefaultValueForUndefinedVariableRector (#​4148)

Removed 💀

  • [DeadCode] Remove removeNode() from RemoveDeadReturnRector, merge RemoveLastReturnRector to RemoveDeadReturnRector (#​4085)
  • [PHP+HTML cleanup] Remove MixPhpHtmlDecorator (#​4054)
  • Remove HTML + PHP support, as must be handled in php-parser first (#​4051)
  • Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead (#​4117)
  • Remove NormalizeNamespaceByPSR4ComposerAutoloadRector as only moves files to namespaces, does not update any class referenes; better use IDE here (#​4057)
  • Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead (#​4117)
  • Remove AttributeCompatibleAnnotationRector, as only for one-time migration of private project, not suitable for general use (#​4064)
  • Remove RemoveAlwaysTrueConditionSetInConstructor, as overly specific and not practical; better handle with PHPStan (#​4065)
  • Remove deprecated UnionTypesRector and NarrowUnionTypeDocRector, use strict-based rules from TypeDeclaration set instead (#​4069)
  • Remove TargetRemoveClassMethodRector, as IDE specific (#​4076)
  • Remove ArrayKeysAndInArrayToArrayKeyExistsRector as narrow, does not check variable usage and might be on purpose (#​4084)
  • Remove ChangeGlobalVariablesToPropertiesRector as the scope might change after the variable is defined, better handle with PHPStan (#​4086)
  • Remove NewToConstructorInjectionRector as unused and only for demo purposes (#​4087)
  • [NodeTraverser] Remove double apply FileWithoutNamespace, remove recursive lookup stmts on BetterStandardPrinter (#​4097)
  • Remove ActionInjectionToConstructorInjectionRector as rather for demo purposes, not practical (#​4113)
  • Remove ConstantListClassToEnumRector as custom-made, not practical for enum upgrades (#​4115)
  • Remove RemoveMethodCallParamRector, as unused (#​4119)
  • Remove RemoveAllowDynamicPropertiesAttributeRector as attribute is a comment on lower PHP versions, also rather downgrade rule (#​4120)
  • Remove DoctrineAnnotationClassToAttributeRector as made for custom project, not useful for general use (#​4127)
  • Remove UnsetAndIssetToMethodCallRector as unused (#​4123)
  • Remove MethodCallToMethodCallRector as unused (#​4128)
  • Remove NewArgToMethodCallRector as unused (#​4130)
  • Remove RemoveDelegatingParentCallRector as overly complex and usually on purpose (#​4136)
  • Remove RemoveEmptyMethodCallRector as better handled by PHPStan (#​4161)
  • Remove BetterNodeFinder::findLastInstanceOf() as unused + make resolvePreviousNode() private, as used only locally (#​4195)
  • [DeadCode] Remove Assign and AssignRef as node types on RemoveNonExistingVarAnnotationRector (#​4209)

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)

v0.16.0: Released Rector 0.16.0

Compare Source

New Features 🥳

  • [TypeDeclaration] Add WhileNullableToInstanceofRector (#​3680)

Bugfixes 🐛

  • Fix SingleInArrayToCompareRector if array item is variadic (#​3640), Thanks @​raoz!
  • [Php80] Handle crash leaveNode() returned invalid value of type integer on TokenGetAllToObjectRector (#​3644)
  • [TypeDeclaration] Handle mix InlineHTML on FileWithoutNamespace (#​3648)
  • Simplify PhpFilesFinder (#​3649), Thanks @​staabm!
  • [Test] Rename fixture and refactor to solve random error (#​3677)
  • [TypeDeclaration] Refactor UnionTypeMapper::narrowBoolType() to allow bool|int|false converted to bool|int (#​3685)
  • Update phpdoc-parser to ^1.20.3 (#​3691)
  • [Privatization] Skip variable assign append on ChangeReadOnlyVariableWithDefaultValueToConstantRector (#​3687), Thanks @​mickeytodd!
  • [NodeManipulator] clean up multiple instanceof check on AssignManipulator (#​3695)
  • [CodeQuality] Using local variable $hasChanged on NarrowUnionTypeDocRector (#​3697)
  • Cache on successful file processing (#​3614), Thanks @​yguedidi!
  • [CodingStyle] Skip concat on first arg on ConsistentImplodeRector (#​3702), Thanks @​nerones!
  • Fix ExplicitMethodCallOverMagicGetSetRector with a protected method (#​3732), Thanks @​pierredup!
  • [TypeDeclaration] Handle infinite loop on array_reverse with index on AddMethodCallBasedStrictParamTypeRector on php8+ feature (#​3678)
  • [TypeDeclaration] Handle regression multiple params no longer working on AddMethodCallBasedStrictParamTypeRector (#​3681)
  • [TypeDeclaration] Add do { } while support on WhileNullableToInstanceofRector (#​3682)
  • [Php56][Php70][Php74] Handle infinite loop on AddDefaultValueForUndefinedVariableRector+IfToSpaceshipRector+ClosureToArrowFunctionRector (#​3701)

Performance Improvements 🚀

  • [Performance] Using findFirst() for cast to (bool) so no need search all found nodes (#​3642)
  • [Performance] Using cheap chekc first on UndefinedVariableResolver::shouldSkipVariable() (#​3643)
  • [CodeQuality] Improve SimplifyIfElseToTernaryRector performance (#​3721)
  • [Renaming] Prevent overly greed type resolving in RenamePropertyRector (#​3700), Thanks @​staabm!
  • Don't calculate diffs when --no-diffs is given (#​3710), Thanks @​staabm!
  • Calculate diff only once per file after refactoring (#​3711), Thanks @​staabm!
  • Improve PropertyFetchAnalyzer performance (#​3654), Thanks @​staabm!
  • Improve LocalMethodCallFinder performance (#​3651), Thanks @​staabm!
  • Improve LocalConstantFinder performance (#​3652), Thanks @​staabm!
  • Improve NodeComparator performance (#​3659), Thanks @​staabm!
  • Improve ReflectionResolver performance (#​3658), Thanks @​staabm!
  • Improve ParentClassMethodTypeOverrideGuard performance (#​3660), Thanks @​staabm!
  • [PHPStanStaticTypeMapper] Improve UnionTypeMapper performance (#​3686)
  • [PHPStanStaticTypeMapper] Improve UnionTypeMapper performance take 2 (rectorphp/rector-src@931e6e2)
  • [PHPStanStaticTypeMapper] Improve performance of UnionTypeMapper take 3 (#​3690)
  • [Renaming] Improve performance of RenameFunctionRector (#​3699)
  • Add e2e tests for consecutive changing runs (#​3666), Thanks @​yguedidi!
  • [Renaming] Improve performance of RenamePropertyRector (#​3698)
  • [Naming] Improve performance by using findFirst() for casted to (bool) on BreakingVariableRenameGuard (#​3703)
  • [PostRector] Improve performance NameImportingPostRector (#​3708)
  • [Ast] Improve AstResolver and ClassLikeAstResolver performance (#​3714)
  • [NodeManipulator] Improve IfManipulator::collectNestedIfsWithNonBreaking() performance (#​3720)
  • Prevent unnecessary IO in ChangedFilesDetector (#​3650), Thanks @​staabm!
  • [BetterPhpDocParser] Simplify BetterTokenIterator (#​3656), Thanks @​staabm!
  • [Skipper] Prevent unnecessary IO (#​3664), Thanks @​staabm!
  • NodeTypeResolver: prevent unncessary reflection calls (#​3647), Thanks @​staabm!

v0.15.25

Compare Source


Configuration

📅 Schedule: Branch creation - "after 3am every weekday,every weekend" in timezone Europe/Amsterdam, 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 Renovate Bot.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [rector/rector](https://getrector.com/) ([source](https://github.com/rectorphp/rector)) | `^0.15.24` → `^2.0.0` | ![age](https://developer.mend.io/api/mc/badges/age/packagist/rector%2frector/2.4.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/rector%2frector/0.15.24/2.4.2?slim=true) | --- ### Release Notes <details> <summary>rectorphp/rector (rector/rector)</summary> ### [`v2.4.2`](https://github.com/rectorphp/rector/releases/tag/2.4.2): Released Rector 2.4.2 [Compare Source](https://github.com/rectorphp/rector/compare/2.4.1...2.4.2) #### New Features :partying\_face: - Add some symfony/polyfill support ([#&#8203;7965](https://github.com/rectorphp/rector-src/pull/7965)), Thanks [@&#8203;sreichel](https://github.com/sreichel)! - \[DeadCode] Allow remove useless @&#8203; var on aliased object on RemoveUselessVarTagRector ([#&#8203;7967](https://github.com/rectorphp/rector-src/pull/7967)) <br> #### Bugfixes :bug: - \[Php81] Handle crash on normal array with variadic inside class on ArrayToFirstClassCallableRector ([#&#8203;7966](https://github.com/rectorphp/rector-src/pull/7966)) - \[CodeQuality] Skip possibly undefined variable on CoalesceToTernaryRector ([#&#8203;7968](https://github.com/rectorphp/rector-src/pull/7968)) - \[Php70] Allow is\_null() conversion on TernaryToNullCoalescingRector with parentheses handling ([#&#8203;7969](https://github.com/rectorphp/rector-src/pull/7969)) - Bump to PHPStan ^2.1.47 ([#&#8203;7970](https://github.com/rectorphp/rector-src/pull/7970)) - Bump to PHPStan ^2.1.48 ([#&#8203;7971](https://github.com/rectorphp/rector-src/pull/7971)) <br> #### rectorphp/rector-symfony :musical_note: - Fix unit test due to new PHPStan release ([#&#8203;931](https://github.com/rectorphp/rector-symfony/pull/931)) ### [`v2.4.1`](https://github.com/rectorphp/rector/releases/tag/2.4.1): Released Rector 2.4.1 [Compare Source](https://github.com/rectorphp/rector/compare/2.4.0...2.4.1) #### New Features :partying\_face: - \[DeadCode] Add `RemoveUselessTernaryRector` ([#&#8203;7961](https://github.com/rectorphp/rector-src/pull/7961)) - \[CodeQuality] Add `CoalesceToTernaryRector` ([#&#8203;7960](https://github.com/rectorphp/rector-src/pull/7960)) - Add `--rules-summary` option to display applied rules summary with count ([#&#8203;7874](https://github.com/rectorphp/rector-src/pull/7874)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Add support for adding the `#[Override]` attribute to methods implementing interfaces ([#&#8203;7934](https://github.com/rectorphp/rector-src/pull/7934)), Thanks [@&#8203;hockdudu](https://github.com/hockdudu)! - feat(printer): add per-node NEWLINE\_ON\_FLUENT\_CALL attribute to BetterStandardPrinter ([#&#8203;7910](https://github.com/rectorphp/rector-src/pull/7910)), Thanks [@&#8203;MrPunyapal](https://github.com/MrPunyapal)! - Show line numbers in diff output ([#&#8203;7875](https://github.com/rectorphp/rector-src/pull/7875)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Bugfixes :bug: - \[CodeQuality] Skip with HTML on CompleteMissingIfElseBracketRector ([#&#8203;7952](https://github.com/rectorphp/rector-src/pull/7952)) - \[CodeQuality] Handle with assign on SimplifyIfElseToTernaryRector ([#&#8203;7951](https://github.com/rectorphp/rector-src/pull/7951)) - \[CodeQuality] Skip with HTML on TernaryFalseExpressionToIfRector ([#&#8203;7954](https://github.com/rectorphp/rector-src/pull/7954)) - \[automated] Apply Coding Standard ([#&#8203;7955](https://github.com/rectorphp/rector-src/pull/7955)) - Make compatible with PHPStan 2.1.x-dev for ObjectType::equals() change behaviour ([#&#8203;7956](https://github.com/rectorphp/rector-src/pull/7956)) - \[AutoImport] Handle FQCN in/not in use on auto import + remove unused import as prefix = suffix ([#&#8203;7957](https://github.com/rectorphp/rector-src/pull/7957)) - perf: use hash map for installed packages ([#&#8203;7878](https://github.com/rectorphp/rector-src/pull/7878)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[ChangesReporting]\[Alternative] Collect changed\_files on --no-diffs with json output with use of JsonOutputFactory ([#&#8203;7821](https://github.com/rectorphp/rector-src/pull/7821)) - fix: OOM crash in RemoveUnusedVariableAssignRector ([#&#8203;7964](https://github.com/rectorphp/rector-src/pull/7964)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! <br> #### Deprecations :skull: - \[Php81] Deprecate `NewInInitializerRector` as depends on context ([#&#8203;7913](https://github.com/rectorphp/rector-src/pull/7913)) - \[deprecation] deprecate file, use getFile() instead ([#&#8203;7962](https://github.com/rectorphp/rector-src/pull/7962)) ### [`v2.4.0`](https://github.com/rectorphp/rector/releases/tag/2.4.0): Released Rector 2.4.0 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.9...2.4.0) #### New Features :partying\_face: - chore: add `SafeDeclareStrictTypesRector` to code quality set ([#&#8203;7935](https://github.com/rectorphp/rector-src/pull/7935)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[Caching] Add CacheMetaExtensionInterface for custom cache invalidation ([#&#8203;7933](https://github.com/rectorphp/rector-src/pull/7933)), Thanks [@&#8203;ruudk](https://github.com/ruudk)! - feat(php86): add min/max to clamp rector ([#&#8203;7942](https://github.com/rectorphp/rector-src/pull/7942)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! <br> #### Bugfixes :bug: - \[Php85] Do not convert to pipe on use directly of spread operator on NestedFuncCallsToPipeOperatorRector ([#&#8203;7938](https://github.com/rectorphp/rector-src/pull/7938)) - \[Console] Allow short command "p" on ProcessCommand ([#&#8203;7931](https://github.com/rectorphp/rector-src/pull/7931)) - \[Arguments] Skip self class const fetch inside this class target replacement on ReplaceArgumentDefaultValueRector ([#&#8203;7940](https://github.com/rectorphp/rector-src/pull/7940)) - \[CodeQuality] Hnadle with negation binary op previous if on CombineIfRector ([#&#8203;7945](https://github.com/rectorphp/rector-src/pull/7945)) - \[CodingStyle] Skip by reference required params on call inside on ArrowFunctionDelegatingCallToFirstClassCallableRector ([#&#8203;7949](https://github.com/rectorphp/rector-src/pull/7949)) <br> #### Removed :skull: - \[DeadCode] Skip pipe operator on RemoveDeadStmtRector ([#&#8203;7941](https://github.com/rectorphp/rector-src/pull/7941)) - \[DeadCode] Handle crash on multi elseif on RemoveDeadIfBlockRector ([#&#8203;7946](https://github.com/rectorphp/rector-src/pull/7946)) - \[DeadCode] Skip with assign to call with target has #\[NoDiscard] attribute on RemoveUnusedVariableAssignRector ([#&#8203;7950](https://github.com/rectorphp/rector-src/pull/7950)) <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Handle different parameter type same name used on ControllerMethodInjectionToConstructorRector ([#&#8203;929](https://github.com/rectorphp/rector-symfony/pull/929)) - \[CodeQuality] Skip used by static closure use on ControllerMethodInjectionToConstructorRector ([#&#8203;928](https://github.com/rectorphp/rector-symfony/pull/928)) - \[Symfony61] Skip non static external class callable on MagicClosureTwigExtensionToNativeMethodsRector ([#&#8203;927](https://github.com/rectorphp/rector-symfony/pull/927)), Thanks [@&#8203;wuchen90](https://github.com/wuchen90) <br> #### rectorphp/rector-doctrine :orange_circle: - Fix infinite loop check instanceof name check to use Name class ([#&#8203;481](https://github.com/rectorphp/rector-doctrine/pull/481)) <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPunit 9] Move AssertRegExpRector to phpunit 90 set with refactor to use assertMatchesRegularExpression/assertDoesNotMatchRegularExpression ([#&#8203;667](https://github.com/rectorphp/rector-phpunit/pull/667)) - \[PHPUnit 9] Rename assertRegExp/assertNotRegExp to assertMatchesRegularExpression/assertDoesNotMatchRegularExpression on phpunit 90 set ([#&#8203;666](https://github.com/rectorphp/rector-phpunit/pull/666)) - Fix assert PHPStan on ConfiguredMockEntityToSetterObjectRector ([#&#8203;665](https://github.com/rectorphp/rector-phpunit/pull/665)) ### [`v2.3.9`](https://github.com/rectorphp/rector/releases/tag/2.3.9): Released Rector 2.3.9 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.8...2.3.9) #### New Features :partying\_face: - \[CodingStyle] Add `StrictInArrayRector` ([#&#8203;7921](https://github.com/rectorphp/rector-src/pull/7921)) <br> #### Bugfixes :bug: - \[Php71] Handle crash on partial destruct on assign var on ListToArrayDestructRector ([#&#8203;7909](https://github.com/rectorphp/rector-src/pull/7909)) - \[CodeQuality] Skip no code parameter on custom Throwable instance on ThrowWithPreviousExceptionRector ([#&#8203;7912](https://github.com/rectorphp/rector-src/pull/7912)) - Bump to PHPStan ^2.1.40 and utilize ClassConstantReflection->isFinalByKeyword() ([#&#8203;7911](https://github.com/rectorphp/rector-src/pull/7911)) - \[Php70] Handle keep right parentheses on ternary else is BinaryOp on TernaryToNullCoalescingRector ([#&#8203;7916](https://github.com/rectorphp/rector-src/pull/7916)) - Properly build text node for junit output formatter ([#&#8203;7917](https://github.com/rectorphp/rector-src/pull/7917)), Thanks [@&#8203;brandonja991](https://github.com/brandonja991)! - \[CodeQuality] Skip with custom param in previous position on ThrowWithPreviousExceptionRector ([#&#8203;7919](https://github.com/rectorphp/rector-src/pull/7919)) - \[automated] Apply Coding Standard ([#&#8203;7922](https://github.com/rectorphp/rector-src/pull/7922)) - \[DX] Define list of allowed implicit commands on ConsoleApplication ([#&#8203;7918](https://github.com/rectorphp/rector-src/pull/7918)) - \[CodeQuality] Skip used by other property hooks on InlineConstructorDefaultToPropertyRector ([#&#8203;7920](https://github.com/rectorphp/rector-src/pull/7920)) - \[automated] Apply Coding Standard ([#&#8203;7926](https://github.com/rectorphp/rector-src/pull/7926)) - \[StrictStringParamConcatRector] Skip PHP version 5.6 or earlier ([#&#8203;7927](https://github.com/rectorphp/rector-src/pull/7927)), Thanks [@&#8203;ghostwriter](https://github.com/ghostwriter)! - \[Php85] Skip single char literal string/int on OrdSingleByteRector ([#&#8203;7928](https://github.com/rectorphp/rector-src/pull/7928)) <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Allow Doctrine EntityManagerInterface on ControllerMethodInjectionToConstructorRector ([#&#8203;926](https://github.com/rectorphp/rector-symfony/pull/926)) - \[CodeQuality] Skip has conflicted param name different object on different method on ControllerMethodInjectionToConstructorRector ([#&#8203;925](https://github.com/rectorphp/rector-symfony/pull/925)) - \[Symfony73] Handle with set allowExtraFields named argument on ConstraintOptionsToNamedArgumentsRector ([#&#8203;924](https://github.com/rectorphp/rector-symfony/pull/924)) - Skip classes with Symfony 7.1 Workflow listener attributes ([#&#8203;923](https://github.com/rectorphp/rector-symfony/pull/923)), Thanks [@&#8203;dionisvl](https://github.com/dionisvl) <br> #### rectorphp/rector-doctrine :orange_circle: - \[TypedCollections] Skip with string key already on CompleteReturnDocblockFromToManyRector ([#&#8203;480](https://github.com/rectorphp/rector-doctrine/pull/480)) <br> #### rectorphp/rector-phpunit :green_circle: - \[CodeQuality] Skip test method via #\[Test] Attribute on DataProviderArrayItemsNewLinedRector ([#&#8203;664](https://github.com/rectorphp/rector-phpunit/pull/664)) - skip conflicting return node and return type in TypeWillReturnCallableArrowFunctionRector! ([#&#8203;663](https://github.com/rectorphp/rector-phpunit/pull/663)) - \[Phpunit12] Skip as Argument with required MockObject Type on CreateStubOverCreateMockArgRector ([#&#8203;662](https://github.com/rectorphp/rector-phpunit/pull/662)) - feat: add IntersectionType support to PropertyCreateMockToCreateStubRector ([#&#8203;661](https://github.com/rectorphp/rector-phpunit/pull/661)), Thanks [@&#8203;asumikam](https://github.com/asumikam) ### [`v2.3.8`](https://github.com/rectorphp/rector/releases/tag/2.3.8): Released Rector 2.3.8 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.7...2.3.8) #### Bugfixes :bug: - \[CodeQuality] Only allow from final class or constant is marked final on VariableConstFetchToClassConstFetchRector ([#&#8203;7904](https://github.com/rectorphp/rector-src/pull/7904)) - \[CodeQuality] Skip custom exception param order flipped on no namespace on ThrowWithPreviousExceptionRector ([#&#8203;7906](https://github.com/rectorphp/rector-src/pull/7906)) - \[DeadCode] Skip different default param not typed on RemoveParentDelegatingConstructorRector ([#&#8203;7905](https://github.com/rectorphp/rector-src/pull/7905)) - \[DeadCode] Skip non-literal 0 or 1 usage on RemoveDeadZeroAndOneOperationRector ([#&#8203;7907](https://github.com/rectorphp/rector-src/pull/7907)) - \[TypeDeclarationDocblocks] Typo fix RuleDefinition description on AddVarArrayDocblockFromDimFetchAssignRector ([#&#8203;7902](https://github.com/rectorphp/rector-src/pull/7902)) - \[Php83] Fix infinite add - remove #\[Override] on tearDown() method on AddOverrideAttributeToOverriddenMethodsRector when combined with NoSetupWithParentCallOverrideRector ([#&#8203;7903](https://github.com/rectorphp/rector-src/pull/7903)) #### rectorphp/rector-symfony - \[CodeQuality] Skip symfony UuidV4 on ControllerMethodInjectionToConstructorRector ([#&#8203;922](https://github.com/rectorphp/rector-symfony/pull/922)) ### [`v2.3.7`](https://github.com/rectorphp/rector/releases/tag/2.3.7): Released Rector 2.3.7 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.6...2.3.7) #### New Features :partying\_face: - feat: add ComposerPackageConstraintInterface ([#&#8203;7877](https://github.com/rectorphp/rector-src/pull/7877)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - Add AddOverrideAttributeToOverriddenPropertiesRector for PHP 8.5 ([#&#8203;7880](https://github.com/rectorphp/rector-src/pull/7880)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Bugfixes :bug: - Skip ClosureToArrowFunctionRector when closure has @&#8203; var docblock ([#&#8203;7885](https://github.com/rectorphp/rector-src/pull/7885)), Thanks [@&#8203;QDenka](https://github.com/QDenka)! - \[Php80] Skip property hook with indirect set on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;7887](https://github.com/rectorphp/rector-src/pull/7887)) - \[Php70] Keep right parentheses on TernaryToNullCoalescingRector ([#&#8203;7889](https://github.com/rectorphp/rector-src/pull/7889)) - Bump nette/utils to ^4.1.3 (part 2) ([#&#8203;7894](https://github.com/rectorphp/rector-src/pull/7894)) - \[Php72] Handle crash on hex backreference on PregReplaceEModifierRector ([#&#8203;7896](https://github.com/rectorphp/rector-src/pull/7896)) - Update code sample for SimplifyEmptyCheckOnEmptyArrayRector ([#&#8203;7897](https://github.com/rectorphp/rector-src/pull/7897)), Thanks [@&#8203;ramonrietdijk](https://github.com/ramonrietdijk)! - \[Php80] Handle Behat transform annotation ([#&#8203;7899](https://github.com/rectorphp/rector-src/pull/7899)), Thanks [@&#8203;loic425](https://github.com/loic425)! - fix: Skip attribute decorated parameters in `RemoveParentDelegatingConstructorRector` ([#&#8203;7900](https://github.com/rectorphp/rector-src/pull/7900)), Thanks [@&#8203;marcreichel](https://github.com/marcreichel)! - \[DeadCode] Handle only remove 1 @&#8203; var on multi vars on RemoveUselessVarTagRector ([#&#8203;7884](https://github.com/rectorphp/rector-src/pull/7884)) - Fix abstract declaration in fixture source ([#&#8203;7901](https://github.com/rectorphp/rector-src/pull/7901)), Thanks [@&#8203;Victor-Vechi](https://github.com/Victor-Vechi)! <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Skip DateTimeInterface instance on ControllerMethodInjectionToConstructorRector ([#&#8203;921](https://github.com/rectorphp/rector-symfony/pull/921)) - \[Symfony73] Skip with @&#8203; Translate docblock on ConstraintOptionsToNamedArgumentsRector ([#&#8203;920](https://github.com/rectorphp/rector-symfony/pull/920)) <br> #### rectorphp/rector-phpunit :green_circle: - \[PhpUnit 8] Skip on possible return array on SpecificAssertContainsRector ([#&#8203;660](https://github.com/rectorphp/rector-phpunit/pull/660)) - \[CodeQuality] check class exists on BehatPHPUnitAssertToWebmozartRector ([#&#8203;659](https://github.com/rectorphp/rector-phpunit/pull/659)) - \[behat] Add `BehatPHPUnitAssertToWebmozzartRector` ([#&#8203;658](https://github.com/rectorphp/rector-phpunit/pull/658)) - \[code-quality] Add `AddKeysExistsAssertForKeyUseRector` ([#&#8203;657](https://github.com/rectorphp/rector-phpunit/pull/657)) - \[PHPUnit120] Skip non-mock object on AllowMockObjectsWithoutExpectationsAttributeRector ([#&#8203;656](https://github.com/rectorphp/rector-phpunit/pull/656)) - \[CodeQuality] Skip on non-mock object on DecorateWillReturnMapWithExpectsMockRector ([#&#8203;655](https://github.com/rectorphp/rector-phpunit/pull/655)) - \[CodeQuality] Skip first class callable on DecorateWillReturnMapWithExpectsMockRector ([#&#8203;654](https://github.com/rectorphp/rector-phpunit/pull/654)) - improve DecorateWillReturnMapWithExpectsMockRector edge cases ([#&#8203;653](https://github.com/rectorphp/rector-phpunit/pull/653)) - convert tearDown in NoSetupWithParentCallOverrideRector as well ([#&#8203;652](https://github.com/rectorphp/rector-phpunit/pull/652)) - \[config] split off 12.5 set, just to improve readability ([#&#8203;651](https://github.com/rectorphp/rector-phpunit/pull/651)) <br> #### rectorphp/rector-downgrade-php :arrow_down: - \[DowngradePhp82] Add `DowngradeUnionIntersectionRector` ([#&#8203;363](https://github.com/rectorphp/rector-downgrade-php/pull/363)) - \[DowngradePhp80] Fix combine DowngradeThrowExprRector + DowngradeNullsafeToTernaryOperatorRector ([#&#8203;362](https://github.com/rectorphp/rector-downgrade-php/pull/362)) - \[DowngradePhp80] Fix on Arg and return ternary on DowngradeThrowExprRector ([#&#8203;361](https://github.com/rectorphp/rector-downgrade-php/pull/361)) ### [`v2.3.6`](https://github.com/rectorphp/rector/releases/tag/2.3.6): Released Rector 2.3.6 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.5...2.3.6) #### New Features :partying\_face: - Allow using a canonical `rector.dist.php` dist file ([#&#8203;7845](https://github.com/rectorphp/rector-src/pull/7845)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Bugfixes :bug: - \[Php83] Handle parent class consume trait on AddOverrideAttributeToOverriddenMethodsRector ([#&#8203;7868](https://github.com/rectorphp/rector-src/pull/7868)) - Fix fixture source warning on AddOverrideAttributeToOverriddenMethodsRector (missing TestCase suffix) ([#&#8203;7869](https://github.com/rectorphp/rector-src/pull/7869)) - add JSON\_THROW\_ON\_ERROR even if there is already a flag ([#&#8203;7867](https://github.com/rectorphp/rector-src/pull/7867)), Thanks [@&#8203;Lenny4](https://github.com/Lenny4)! - \[DeadCode] No need additional parentheses () on multiply to function call ([#&#8203;7883](https://github.com/rectorphp/rector-src/pull/7883)) - \[Php80] Handle crash on empty name attribute field value on AnnotationToAttributeRector ([#&#8203;7864](https://github.com/rectorphp/rector-src/pull/7864)) - Fix JsonValidateRector: remove associative argument not supported by json\_validate ([#&#8203;7865](https://github.com/rectorphp/rector-src/pull/7865)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix deep ArrayItem scope filling on Foreach\_ value ([#&#8203;7873](https://github.com/rectorphp/rector-src/pull/7873)) - Fix StaticCallOnNonStaticToInstanceCallRector for same-class calls ([#&#8203;7876](https://github.com/rectorphp/rector-src/pull/7876)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Bump PHPStan to 2.1.38 ([#&#8203;7879](https://github.com/rectorphp/rector-src/pull/7879)) - \[DeadCode] Allow remove [@&#8203;var](https://github.com/var) on expression assign on RemoveUselessVarTagRector ([#&#8203;7871](https://github.com/rectorphp/rector-src/pull/7871)) - \[DeadCode] Handle multiply to parenthesized on RemoveDeadZeroAndOneOperationRector ([#&#8203;7882](https://github.com/rectorphp/rector-src/pull/7882)) <br> #### rectorphp/rector-symfony :musical_note: - Update set usage in readme ([#&#8203;919](https://github.com/rectorphp/rector-symfony/pull/919)), Thanks [@&#8203;MrYamous](https://github.com/MrYamous) <br> #### rectorphp/rector-phpunit :green_circle: - \[phpunit 12] Add CreateStubInCoalesceArgRector ([#&#8203;650](https://github.com/rectorphp/rector-phpunit/pull/650)) - \[code-quality] Add DecorateWillReturnMapWithExpectsMockRector ([#&#8203;649](https://github.com/rectorphp/rector-phpunit/pull/649)) - \[code-quality] Add RemoveStandaloneCreateMockRector ([#&#8203;648](https://github.com/rectorphp/rector-phpunit/pull/648)) - add class method ([#&#8203;647](https://github.com/rectorphp/rector-phpunit/pull/647)) - improve check for used mock property ([#&#8203;646](https://github.com/rectorphp/rector-phpunit/pull/646)) - skip if used in array ([#&#8203;645](https://github.com/rectorphp/rector-phpunit/pull/645)) - \[code-quality] Add RemoveNeverUsedMockPropertyRector ([#&#8203;644](https://github.com/rectorphp/rector-phpunit/pull/644)) - \[phpunit 12] Add AllowMockObjectsForDataProviderRector ([#&#8203;643](https://github.com/rectorphp/rector-phpunit/pull/643)) - add to setUp with only variables ([#&#8203;642](https://github.com/rectorphp/rector-phpunit/pull/642)) - \[phpunit 12] Add AllowMockObjectsWhereParentClassRector ([#&#8203;641](https://github.com/rectorphp/rector-phpunit/pull/641)) - improve AllowMockObjectsWithoutExpectationsAttributeRector ([#&#8203;639](https://github.com/rectorphp/rector-phpunit/pull/639)) - add fixture ([#&#8203;638](https://github.com/rectorphp/rector-phpunit/pull/638)) - handle in call likes as well ([#&#8203;637](https://github.com/rectorphp/rector-phpunit/pull/637)) - \[code-quality] Add InlineStubPropertyToCreateStubMethodCallRector ([#&#8203;636](https://github.com/rectorphp/rector-phpunit/pull/636)) - skip property fetch in CreateStubOverCreateMockArgRector ([#&#8203;635](https://github.com/rectorphp/rector-phpunit/pull/635)) - \[phpunit 12] Add PropertyCreateMockToCreateStubRector ([#&#8203;634](https://github.com/rectorphp/rector-phpunit/pull/634)) - add variable support to CreateStubOverCreateMockArgRector ([#&#8203;633](https://github.com/rectorphp/rector-phpunit/pull/633)) - \[CodeQuality] Add failing fixture crash on deep ArrayItem as Foreach\_ value on DirectInstanceOverMockArgRector ([#&#8203;632](https://github.com/rectorphp/rector-phpunit/pull/632)) - skip abstract entity and interface, as cannot be instantiated ([#&#8203;630](https://github.com/rectorphp/rector-phpunit/pull/630)) - \[code-quality] Add ConfiguredMockEntityToSetterObjectRector ([#&#8203;629](https://github.com/rectorphp/rector-phpunit/pull/629)) - \[code-quality] Add AssertThatToDirectAssertRector ([#&#8203;627](https://github.com/rectorphp/rector-phpunit/pull/627)) - \[phpunit 12] Add ExpressionCreateMockToCreateStubRector ([#&#8203;626](https://github.com/rectorphp/rector-phpunit/pull/626)) - cover interfaces in BareCreateMockAssignToDirectUseRector ([#&#8203;625](https://github.com/rectorphp/rector-phpunit/pull/625)) - \[code-quality] Add SuffixMockObjectPropertyRector, not enabled ([#&#8203;622](https://github.com/rectorphp/rector-phpunit/pull/622)) - \[phpunit 12] Add ExplicitMockExpectsCallRector ([#&#8203;621](https://github.com/rectorphp/rector-phpunit/pull/621)) ### [`v2.3.5`](https://github.com/rectorphp/rector/releases/tag/2.3.5): Released Rector 2.3.5 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.4...2.3.5) #### New Features :partying\_face: - feat: create new `SafeDeclareStrictTypesRector` ([#&#8203;7814](https://github.com/rectorphp/rector-src/pull/7814)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! <br> #### Bugfixes :bug: - Fix ArrayItem scope filling on Foreach\_ value ([#&#8203;7858](https://github.com/rectorphp/rector-src/pull/7858)) - Fix use of deprecated Node\Expr\ArrayItem over Node\ArrayItem ([#&#8203;7859](https://github.com/rectorphp/rector-src/pull/7859)) - make PropertyFetchFinder more generic (to be used in rector-phpunit) ([#&#8203;7860](https://github.com/rectorphp/rector-src/pull/7860)) - Fix arrow function scope search in BetterNodeFinder ([#&#8203;7861](https://github.com/rectorphp/rector-src/pull/7861)) <br> #### rectorphp/rector-symfony :musical_note: - Rename Annotation\Route attributes to Attribute\Route on Symfony 7.x ([#&#8203;917](https://github.com/rectorphp/rector-symfony/pull/917)), Thanks [@&#8203;mickverm](https://github.com/mickverm) <br> #### rectorphp/rector-doctrine :orange_circle: - \[ODM 2.16] Rename 'Doctrine\ODM\MongoDB\Mapping\Annotations' namespace to 'Doctrine\ODM\MongoDB\Mapping\Attribute' ([#&#8203;477](https://github.com/rectorphp/rector-doctrine/pull/477)), Thanks [@&#8203;mickverm](https://github.com/mickverm) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] Add `NoSetupWithParentCallOverrideRector` ([#&#8203;617](https://github.com/rectorphp/rector-phpunit/pull/617)) - \[code-quality] Add BareCreateMockAssignToDirectUseRector ([#&#8203;611](https://github.com/rectorphp/rector-phpunit/pull/611)) - \[code-quality] Add `DirectInstanceOverMockArgRector` ([#&#8203;609](https://github.com/rectorphp/rector-phpunit/pull/609)) - \[PHPUnit 12] Add `CreateStubOverCreateMockArgRector` ([#&#8203;608](https://github.com/rectorphp/rector-phpunit/pull/608)) ### [`v2.3.4`](https://github.com/rectorphp/rector/releases/tag/2.3.4): Released Rector 2.3.4 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.3...2.3.4) #### Bugfixes :bug: - **Bump to PHPStan ^2.1.36** ([#&#8203;7850](https://github.com/rectorphp/rector-src/pull/7850)) - \[Php81] Exclude Doctrine ODM MongoDB 2.16 Document and EmbeddedDocument from ReadOnlyPropertyRector. ([#&#8203;7848](https://github.com/rectorphp/rector-src/pull/7848)), Thanks [@&#8203;mickverm](https://github.com/mickverm)! ### [`v2.3.3`](https://github.com/rectorphp/rector/releases/tag/2.3.3): Released Rector 2.3.3 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.2...2.3.3) #### Bugfixes :bug: - [rectorphp/rector-src@`61f8719`](https://github.com/rectorphp/rector-src/commit/61f8719064d11d2a4ae9f6801d601446b35b51a4) Pin PHPStan 2.1.34, as 2.1.35 introduced a complex regression breaking Rector - see [rectorphp/rector-src#7847](https://github.com/rectorphp/rector-src/pull/7847) ### [`v2.3.2`](https://github.com/rectorphp/rector/releases/tag/2.3.2): Released Rector 2.3.2 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.1...2.3.2) #### New Features :partying\_face: - \[dx] Rename `DeprecatedAnnotationToDeprecatedAttributeRector` for PHP 8.5 to explicit ConstAndTraitDeprecatedAttributeRector, add trait suport ([#&#8203;7823](https://github.com/rectorphp/rector-src/pull/7823)) <br> #### Bugfixes :bug: - **Bump to PHPStan 2.1.34** and **fix compatible code** ([rectorphp/rector-src#7844](https://github.com/rectorphp/rector-src/pull/7844)) - \[perf] optimize ParamTypeByMethodCallTypeRector for speed with early checks ([#&#8203;7831](https://github.com/rectorphp/rector-src/pull/7831)) - make resolveClassReflection non-nullable as always passed a node ([#&#8203;7833](https://github.com/rectorphp/rector-src/pull/7833)) - \[Php74] Skip closure in attribute on ClosureToArrowFunctionRector ([#&#8203;7834](https://github.com/rectorphp/rector-src/pull/7834)) - Manage named arguments when removing values ([#&#8203;7835](https://github.com/rectorphp/rector-src/pull/7835)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - bump to PHP 8.3 + update deps + allow it in CI ([#&#8203;7838](https://github.com/rectorphp/rector-src/pull/7838)) - Support array\_values in ArrayFirstLastRector ([#&#8203;7830](https://github.com/rectorphp/rector-src/pull/7830)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[Php85] Skip as assigned var/op on ArrayFirstLastRector ([#&#8203;7843](https://github.com/rectorphp/rector-src/pull/7843)) - Remove no longer needed tweak AlwaysRememberedExpr on Printer per PHPStan 2.1.34 ([#&#8203;7770](https://github.com/rectorphp/rector-src/pull/7770)) <br> #### rectorphp/rector-phpunit :green_circle: - fix a class name that should be string ([#&#8203;607](https://github.com/rectorphp/rector-phpunit/pull/607)) - Support array\_values in ArrayFirstLastRector ([#&#8203;7830](https://github.com/rectorphp/rector-src/pull/7830)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[Php85] Skip as assigned var/op on ArrayFirstLastRector ([#&#8203;7843](https://github.com/rectorphp/rector-src/pull/7843)) ### [`v2.3.1`](https://github.com/rectorphp/rector/releases/tag/2.3.1): Released Rector 2.3.1 [Compare Source](https://github.com/rectorphp/rector/compare/2.3.0...2.3.1) #### New Features and Changes :partying\_face: - \[tdd] Add `AddReturnDocblockForDimFetchArrayFromAssignsRector` ([#&#8203;7792](https://github.com/rectorphp/rector-src/pull/7792)) - \[tdd] Add `AddReturnDocblockFromMethodCallDocblockRector` ([#&#8203;7796](https://github.com/rectorphp/rector-src/pull/7796)) - \[tdd] Add `AddVarArrayDocblockFromDimFetchAssignRector` ([#&#8203;7801](https://github.com/rectorphp/rector-src/pull/7801)) - \[DeadCode] Add `RemoveDeadIfBlocksRector` ([#&#8203;7528](https://github.com/rectorphp/rector-src/pull/7528)), Thanks [@&#8203;john-shaffer](https://github.com/john-shaffer)! - \[dead-code] Add `RemoveVoidDocblockFromMagicMethodRector` ([#&#8203;7822](https://github.com/rectorphp/rector-src/pull/7822)) - Thanks [@&#8203;parijke](https://github.com/parijke)! - \[experiment] Remove leaveNode() method on AbstractRector and CallableNodeVisitor ([#&#8203;7767](https://github.com/rectorphp/rector-src/pull/7767)) <br> #### Bugfixes :bug: - Skip Doctrine Connection calls in `AddReturnDocblockFromMethodCallDocblockRector` ([#&#8203;7797](https://github.com/rectorphp/rector-src/pull/7797)) - add static all support to `AddReturnDocblockFromMethodCallDocblockRector` ([#&#8203;7798](https://github.com/rectorphp/rector-src/pull/7798)) - add object support to `DocblockReturnArrayFromDirectArrayInstanceRector` ([#&#8203;7795](https://github.com/rectorphp/rector-src/pull/7795)) - \[TypeDeclarationDocblocks] Use FQCN return docblock for array of object types on AddReturnDocblockFromMethodCallDocblockRector ([#&#8203;7800](https://github.com/rectorphp/rector-src/pull/7800)), Thanks [@&#8203;guanguans](https://github.com/guanguans)! - \[php 8.3] cover private abstract constants in `AddTypeToConstRector` ([#&#8203;7804](https://github.com/rectorphp/rector-src/pull/7804)) - Add check for append in foreach items assignment ([#&#8203;7815](https://github.com/rectorphp/rector-src/pull/7815)), Thanks [@&#8203;solverat](https://github.com/solverat)! - Static closure rule ignores arguments with $this binding ([#&#8203;7721](https://github.com/rectorphp/rector-src/pull/7721)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - fix: skip non-native methods ([#&#8203;7747](https://github.com/rectorphp/rector-src/pull/7747)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[Php74] Fix indentation space on ClosureToArrowFunctionRector with comment inner closure ([#&#8203;7779](https://github.com/rectorphp/rector-src/pull/7779)) - \[DeadCode] Handle crash when parent does not has default param and child has ([#&#8203;7782](https://github.com/rectorphp/rector-src/pull/7782)) - fix mixed\[] override with empty array in DocblockReturnArrayFromDirectArrayInstanceRector ([#&#8203;7793](https://github.com/rectorphp/rector-src/pull/7793)) - \[ChangesReporting] Fix total changed result on JsonOutputFormatter ([#&#8203;7807](https://github.com/rectorphp/rector-src/pull/7807)) - Manage named arguments when replacing a value ([#&#8203;7784](https://github.com/rectorphp/rector-src/pull/7784)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[DeadCode] Register `RemoveNextSameValueConditionRector` in dead-code set ([#&#8203;7790](https://github.com/rectorphp/rector-src/pull/7790)) - \[DeadCode] Skip final and non-public \_\_construct() on RemoveParentDelegatingConstructorRector ([#&#8203;7806](https://github.com/rectorphp/rector-src/pull/7806)) - \[DeadCode]\[Php80] Handle crash on mix ClassPropertyAssignToConstructorPromotionRector+RemoveParentDelegatingConstructorRector ([#&#8203;7799](https://github.com/rectorphp/rector-src/pull/7799)) - \[DeadCode] Skip with elseif/else on RemoveNextSameValueConditionRector ([#&#8203;7809](https://github.com/rectorphp/rector-src/pull/7809)) - \[DeadCode] Merge comment on RemoveNextSameValueConditionRector ([#&#8203;7810](https://github.com/rectorphp/rector-src/pull/7810)) - skip marker attribute in RemoveEmptyClassMethodRector ([#&#8203;7813](https://github.com/rectorphp/rector-src/pull/7813)) - \[DeadCode] Skip private promoted property on RemoveParentDelegatingConstructorRector ([#&#8203;7817](https://github.com/rectorphp/rector-src/pull/7817)) - Remove rector from rule definition title ([#&#8203;7820](https://github.com/rectorphp/rector-src/pull/7820)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! - \[experiment-next] Remove leaveNode() calls on AbstractImmutableNodeTraverser ([#&#8203;7778](https://github.com/rectorphp/rector-src/pull/7778)) - \[DeadCode] Handle multi vars on RemoveNonExistingVarAnnotationRector ([#&#8203;7780](https://github.com/rectorphp/rector-src/pull/7780)) - \[Php71] Try to handle no variants on RemoveExtraParametersRector ([#&#8203;7803](https://github.com/rectorphp/rector-src/pull/7803)) ### [`v2.3.0`](https://github.com/rectorphp/rector/releases/tag/2.3.0): Released Rector 2.3 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.14...2.3.0) #### New Features :partying\_face: - **Introduce `FileNode` to handle file-level changes ([#&#8203;7728](https://github.com/rectorphp/rector-src/pull/7728))** to be used instead of `FileWithoutNamespace` node - see <https://github.com/rectorphp/rector-src/blob/main/UPGRADING.md> for the upgrade - Add `PrivatizeFinalClassConstantRector` ([#&#8203;7753](https://github.com/rectorphp/rector-src/pull/7753)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! - \[dead-code] Add `RemoveParentDelegatingConstructorRector` ([#&#8203;7769](https://github.com/rectorphp/rector-src/pull/7769)) <br> #### Bugfixes :bug: - Manage named arguments in ArgumentAdderRector rule ([#&#8203;7777](https://github.com/rectorphp/rector-src/pull/7777)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[compat] Add `SymplifyQuoteEscapeRector` deprecated rule for BC layer ([#&#8203;7744](https://github.com/rectorphp/rector-src/pull/7744)) - \[Php81] Skip on Param default on ArrayToFirstClassCallableRector ([#&#8203;7749](https://github.com/rectorphp/rector-src/pull/7749)) - \[CodeQuality] Handle ternary in identical left/right on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;7748](https://github.com/rectorphp/rector-src/pull/7748)) - fix: chained calls on static calls ([#&#8203;7746](https://github.com/rectorphp/rector-src/pull/7746)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[code-quality] Extract standalone SortAttributeNamedArgsRector from SortNamedParamRector, to slightly different areas ([#&#8203;7750](https://github.com/rectorphp/rector-src/pull/7750)) - \[rename] Rename `SortNamedParamRector` to `SortCallLikeNamedArgsRector` to be more clear about the intent ([#&#8203;7751](https://github.com/rectorphp/rector-src/pull/7751)) - \[Php85] Skip under unset() on ArrayFirstLastRector ([#&#8203;7752](https://github.com/rectorphp/rector-src/pull/7752)) - \[Php81] ArrayToFirstClassCallableRector should not skip non-public methods from owning scope ([#&#8203;7760](https://github.com/rectorphp/rector-src/pull/7760)), Thanks [@&#8203;acoulton](https://github.com/acoulton)! - \[fix] wrap ternary in parenthese on string casting, if only cond is casted ([#&#8203;7745](https://github.com/rectorphp/rector-src/pull/7745)) - \[internal] Fix inline replace block removal not removed on deep block for InlineIfToExplicitIfRector + ReplaceBlockToItsStmtsRector ([#&#8203;7764](https://github.com/rectorphp/rector-src/pull/7764)) - \[TypeDeclaration] Skip class not found on ObjectTypedPropertyFromJMSSerializerAttributeTypeRector ([#&#8203;7774](https://github.com/rectorphp/rector-src/pull/7774)) - \[Php85] Skip defined int or string on ArrayKeyExistsNullToEmptyStringRector ([#&#8203;7758](https://github.com/rectorphp/rector-src/pull/7758)) <br> #### Removed :skull: - \[DeadCode] Skip trait on RemoveAlwaysTrueIfConditionRector ([#&#8203;7759](https://github.com/rectorphp/rector-src/pull/7759)) - \[internal] Remove duplicated enterNode() type check already handled in node traverser ([#&#8203;7717](https://github.com/rectorphp/rector-src/pull/7717)) - \[dx] warn about deprecated beforeTraverse() method once FileNode is ready ([#&#8203;7768](https://github.com/rectorphp/rector-src/pull/7768)) - \[DeadCode] Skip next assign expr has side effect inside try {} on RemoveDoubleAssignRector ([#&#8203;7775](https://github.com/rectorphp/rector-src/pull/7775)) - \[DeadCode] Skip with different default param value child vs parent on RemoveParentDelegatingConstructorRector ([#&#8203;7776](https://github.com/rectorphp/rector-src/pull/7776)) <br> #### rectorphp/rector-symfony :musical_note: - bump ([#&#8203;911](https://github.com/rectorphp/rector-symfony/pull/911)) - \[code-quality] Add ReturnDirectJsonResponseRector ([#&#8203;910](https://github.com/rectorphp/rector-symfony/pull/910)) - Fix scoped downgrade SymfonyClass ([#&#8203;909](https://github.com/rectorphp/rector-symfony/pull/909)) - cover is safe ([#&#8203;908](https://github.com/rectorphp/rector-symfony/pull/908)) - \[twig] add explicit attribute name arg, to improve context ([#&#8203;907](https://github.com/rectorphp/rector-symfony/pull/907)) - \[Symfony73] Fix named arg different position crash on InvokableCommandInputAttributeRector ([#&#8203;905](https://github.com/rectorphp/rector-symfony/pull/905)) - \[CodeQuality] Skip UserInterface instance on ControllerMethodInjectionToConstructorRector ([#&#8203;904](https://github.com/rectorphp/rector-symfony/pull/904)) - create ClassMethod directly in InvokableCommandInputAttributeRector, to keep newline per attribute ([#&#8203;903](https://github.com/rectorphp/rector-symfony/pull/903)) - Remove InvokableCommandInputAttributeRector from set ([#&#8203;901](https://github.com/rectorphp/rector-symfony/pull/901)) - \[Validator] use constants for Email ([#&#8203;900](https://github.com/rectorphp/rector-symfony/pull/900)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) <br> #### rectorphp/rector-doctrine :orange_circle: - Make use of `FileNode` ([#&#8203;474](https://github.com/rectorphp/rector-doctrine/pull/474)) <br> #### rectorphp/rector-phpunit :green_circle: - \[AnnotationsToAttributes] Handle both annotation and attributes exists on DataProviderAnnotationToAttributeRector ([#&#8203;603](https://github.com/rectorphp/rector-phpunit/pull/603)) - \[fix] skip AddInstanceofAssertForNullableArgumentRector on assert call ([#&#8203;602](https://github.com/rectorphp/rector-phpunit/pull/602)) - \[code-quality] Add AddInstanceofAssertForNullableArgumentRector ([#&#8203;601](https://github.com/rectorphp/rector-phpunit/pull/601)) - use FileNode in DeclareStrictTypesTestsRector ([#&#8203;599](https://github.com/rectorphp/rector-phpunit/pull/599)) ### [`v2.2.14`](https://github.com/rectorphp/rector/releases/tag/2.2.14): Released Rector 2.2.14 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.13...2.2.14) #### Bugfixes :bug: - \[fix] warn early about deprecated skipped rules, as not neccessary to skip anymore + restore `FirstClassCallableRector` and mark as deprecated to keep BC ([#&#8203;7742](https://github.com/rectorphp/rector-src/pull/7742)) ### [`v2.2.13`](https://github.com/rectorphp/rector/releases/tag/2.2.13): Released Rector 2.2.13 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.12...2.2.13) #### Bugfixes :bug: - \[fix] restore missing pInterpolatedStringPart(), cover with test ([#&#8203;7741](https://github.com/rectorphp/rector-src/pull/7741)) ### [`v2.2.12`](https://github.com/rectorphp/rector/releases/tag/2.2.12): Released Rector 2.2.12 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.11...2.2.12) #### Bugfixes :bug: - \[cleanup] Make FirstClassCallableRector use attributes over node traverser hacks ([#&#8203;7696](https://github.com/rectorphp/rector-src/pull/7696)) - \[CodingStyle] Skip enum case on `NewlineBetweenClassLikeStmtsRector` ([#&#8203;7698](https://github.com/rectorphp/rector-src/pull/7698)), Thanks [@&#8203;parth391](https://github.com/parth391)! - \[fix] skip all-but standalone assign on `SetTypeToCastRector` ([#&#8203;7699](https://github.com/rectorphp/rector-src/pull/7699)) - \[fix] avoid changing generic interface in NarrowObjectReturnTypeRector, focus on objects as in definition ([#&#8203;7700](https://github.com/rectorphp/rector-src/pull/7700)) - Remove direct `NodeTravser::*` where possible, use node visitor attribute key instead ([#&#8203;7697](https://github.com/rectorphp/rector-src/pull/7697)) <br> #### Removed and Deprecated :skull: - \[dx] add stmts aware deprecation notice in \`getNodeTypes()\`\` ([#&#8203;7692](https://github.com/rectorphp/rector-src/pull/7692)) <br> #### rectorphp/rector-symfony :musical_note: - \[Symfony 8.0] move `RemoveEraseCredentialsRector` from symfony 7.3 to symfony 8.0 ([#&#8203;895](https://github.com/rectorphp/rector-symfony/pull/895)), Thanks [@&#8203;EJTJ3](https://github.com/EJTJ3) - \[CodeQuality] Skip different service same name on `ControllerMethodInjectionToConstructorRector` ([#&#8203;894](https://github.com/rectorphp/rector-symfony/pull/894)) - \[code-quality] Skip enum in `ControllerMethodInjectionToConstructorRector` ([#&#8203;893](https://github.com/rectorphp/rector-symfony/pull/893)) ### [`v2.2.11`](https://github.com/rectorphp/rector/releases/tag/2.2.11): Released Rector 2.2.11 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.10...2.2.11) #### Bugfixes :bug: - \[cleanup] Make FirstClassCallableRector use attributes over node traverser hacks ([#&#8203;7696](https://github.com/rectorphp/rector-src/pull/7696)) - \[CodingStyle] Skip enum case on NewlineBetweenClassLikeStmtsRector ([#&#8203;7698](https://github.com/rectorphp/rector-src/pull/7698)), Thanks [@&#8203;parth391](https://github.com/parth391)! - \[fix] skip all-but standalone assign on SetTypeToCastRector ([#&#8203;7699](https://github.com/rectorphp/rector-src/pull/7699)) - \[fix] avoid changing generic interface in NarrowObjectReturnTypeRector, focus on objects as in definition ([#&#8203;7700](https://github.com/rectorphp/rector-src/pull/7700)) - \[transform] tidy up array dim fetch to method call rector ([#&#8203;7694](https://github.com/rectorphp/rector-src/pull/7694)) - Remove direct NodeTravser::\* where possible, use node visitor attribute key instead ([#&#8203;7697](https://github.com/rectorphp/rector-src/pull/7697)) <br> #### Removed and Deprecated :skull: - \[dx] add stmts aware deprecation notice in getNodeTypes() ([#&#8203;7692](https://github.com/rectorphp/rector-src/pull/7692)) <br> #### rectorphp/rector-symfony - \[Symfony 8.0] move `RemoveEraseCredentialsRector` from symfony 7.3 to symfony 8.0 ([#&#8203;895](https://github.com/rectorphp/rector-symfony/pull/895)), Thanks [@&#8203;EJTJ3](https://github.com/EJTJ3) - \[CodeQuality] Skip different service same name on `ControllerMethodInjectionToConstructorRector` ([#&#8203;894](https://github.com/rectorphp/rector-symfony/pull/894)) - \[code-quality] Skip enum in `ControllerMethodInjectionToConstructorRector` ([#&#8203;893](https://github.com/rectorphp/rector-symfony/pull/893)) ### [`v2.2.10`](https://github.com/rectorphp/rector/releases/tag/2.2.10): Released Rector 2.2.10 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.9...2.2.10) #### New Features and Improvements :partying\_face: - Support Attribute in `SortNamedParamRector` ([#&#8203;7684](https://github.com/rectorphp/rector-src/pull/7684)), Thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! <br> #### Bugfixes :bug: - \[PhpParser] Add Stmt\Block to NodeGroup::STMTS\_AWARE ([#&#8203;7689](https://github.com/rectorphp/rector-src/pull/7689)) - skip already dim fetch variable on OrdSingleByteRector ([#&#8203;7681](https://github.com/rectorphp/rector-src/pull/7681)) - \[Php85] Handle crash on no arg on OrdSingleByteRector ([#&#8203;7682](https://github.com/rectorphp/rector-src/pull/7682)) - \[Php70] Handle return ternary on IfIssetToCoalescingRector ([#&#8203;7683](https://github.com/rectorphp/rector-src/pull/7683)) - \[CodingStyle] Skip use trait on NewlineBetweenClassLikeStmtsRector ([#&#8203;7685](https://github.com/rectorphp/rector-src/pull/7685)) - \[CodingStyle] Handle use trait after property on `NewlineBetweenClassLikeStmtsRector` ([#&#8203;7687](https://github.com/rectorphp/rector-src/pull/7687)) - \[CodeQuality] Skip with HTML on `ShortenElseIfRector` ([#&#8203;7686](https://github.com/rectorphp/rector-src/pull/7686)) - \[Variables] Fetch list super global variable names from PHPStan Scope::SUPERGLOBAL\_VARIABLES constant ([#&#8203;7663](https://github.com/rectorphp/rector-src/pull/7663)) - Fix typo in rule definition message ([#&#8203;7690](https://github.com/rectorphp/rector-src/pull/7690)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! <br> #### rectorphp/rector-symfony :musical_note: - \[code-quality] Skip enum in ControllerMethodInjectionToConstructorRector ([#&#8203;893](https://github.com/rectorphp/rector-symfony/pull/893)) - \[symfony 7.3] Add CommandDefaultNameAndDescriptionToAsCommandAttributeRector ([#&#8203;892](https://github.com/rectorphp/rector-symfony/pull/892)) - \[symfony 7.x] update sets ([#&#8203;890](https://github.com/rectorphp/rector-symfony/pull/890)) - \[CodeQuality] Skip parent method exists on ControllerMethodInjectionToConstructorRector ([#&#8203;889](https://github.com/rectorphp/rector-symfony/pull/889)) - skip params with attributes in ControllerMethodInjectionToConstructorRector ([#&#8203;887](https://github.com/rectorphp/rector-symfony/pull/887)) - \[stmts-aware] Use NodeGroup::STMTS\_AWARE over StmtsAwareInterface ([#&#8203;886](https://github.com/rectorphp/rector-symfony/pull/886)) <br> #### rectorphp/rector-phpunit :green_circle: - \[fix] Improve AssertComparisonToSpecificMethodRector for assert false ([#&#8203;594](https://github.com/rectorphp/rector-phpunit/pull/594)) ### [`v2.2.9`](https://github.com/rectorphp/rector/releases/tag/2.2.9): Released Rector 2.2.9 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.8...2.2.9) #### New Features and Changes :partying\_face: - \[exp] Add `RemoveReturnThisFromSetterClassMethodRector` ([#&#8203;7624](https://github.com/rectorphp/rector-src/pull/7624)) - \[exp] Add `FluentSettersToStandaloneCallMethodRector` ([#&#8203;7625](https://github.com/rectorphp/rector-src/pull/7625)) - \[dead-code] Add `RemoveNextSameValueConditionRector` ([#&#8203;7525](https://github.com/rectorphp/rector-src/pull/7525)) - Update PHP upgrade support to version 8.5 ([#&#8203;7644](https://github.com/rectorphp/rector-src/pull/7644)), Thanks [@&#8203;guilheb](https://github.com/guilheb)! - \[stmts-aware] Deprecate `StmtsAwareInterface` interface and replace with meta-type + groups ([#&#8203;7679](https://github.com/rectorphp/rector-src/pull/7679)) - **[How to upgrade?](https://github.com/rectorphp/rector-src/pull/7679)** <br> #### Bugfixes :bug: - Improve parent call fixture in Php4ConstructorRector not to use KEY constant ([#&#8203;7642](https://github.com/rectorphp/rector-src/pull/7642)) - Improve ClassPropertyAssignToConstructorPromotionRector not to use STMT\_KEY attribute value ([#&#8203;7645](https://github.com/rectorphp/rector-src/pull/7645)) - \[TypeDeclaration] Handle crash on combine union types on AddClosureParamTypeForArrayReduceRector ([#&#8203;7636](https://github.com/rectorphp/rector-src/pull/7636)) - \[TypeDeclaration] Skip no key generic object return on NarrowObjectReturnTypeRector ([#&#8203;7623](https://github.com/rectorphp/rector-src/pull/7623)) - \[CodingStyle] Do not use FullyQualified on "self" on `ClosureFromCallableToFirstClassCallableRector` ([#&#8203;7632](https://github.com/rectorphp/rector-src/pull/7632)), Thanks [@&#8203;devnix](https://github.com/devnix)! - \[Php80] Handle mix still annotation and already attribute on AnnotationToAttributeRector ([#&#8203;7639](https://github.com/rectorphp/rector-src/pull/7639)), Thanks [@&#8203;acoulton](https://github.com/acoulton)! - cleanup RemoveUnsuedPrivateMethodRector ([#&#8203;7643](https://github.com/rectorphp/rector-src/pull/7643)) - re-index changed nodes only ([#&#8203;7651](https://github.com/rectorphp/rector-src/pull/7651)) - avoid `spl_object_id()` if no change in AbstractRector ([#&#8203;7653](https://github.com/rectorphp/rector-src/pull/7653)) - Refine bug report template formatting ([#&#8203;7655](https://github.com/rectorphp/rector-src/pull/7655)), Thanks [@&#8203;u01jmg3](https://github.com/u01jmg3)! - \[Php85] Skip inside expression assign on ArrayFirstLastRector ([#&#8203;7657](https://github.com/rectorphp/rector-src/pull/7657)) - Rename SymplifyQuoteEscapeRector to SimplifyQuoteEscapeRector ([#&#8203;7658](https://github.com/rectorphp/rector-src/pull/7658)), Thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - docs: fix typos in deprecation notice ([#&#8203;7666](https://github.com/rectorphp/rector-src/pull/7666)), Thanks [@&#8203;sir-kain](https://github.com/sir-kain)! - \[Dep] Ignore unknown class error on build/config/config-downgrade.php on shipmonk/composer-dependency-analyser to 1.8.4 ([#&#8203;7668](https://github.com/rectorphp/rector-src/pull/7668)) - \[dx] Make registration of custom NodeVisitor is easier ([#&#8203;7669](https://github.com/rectorphp/rector-src/pull/7669)) - raise deps ([rectorphp/rector-src@`440d6d7`](https://github.com/rectorphp/rector-src/commit/440d6d76b6b513f8943aee715c5349496a035b44)) - \[Experiment]\[Printer] Move AlwaysRememberedExpr tweak logic to separate service after a Match\_ found ([#&#8203;7654](https://github.com/rectorphp/rector-src/pull/7654)) - Narrow object return type v2 ([#&#8203;7618](https://github.com/rectorphp/rector-src/pull/7618)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[Php80] Handle OpenApi\Attributes\Property example to keep numeric string on AnnotationToAttributeRector ([#&#8203;7677](https://github.com/rectorphp/rector-src/pull/7677)) - keep file without namespace implementing interface to alling with other nodes ([#&#8203;7679](https://github.com/rectorphp/rector-src/pull/7679)) - \[EarlyReturn] Handle If, elseIf, else all returned on RemoveAlwaysElseRector ([#&#8203;7659](https://github.com/rectorphp/rector-src/pull/7659)) - \[DeadCode] skip Ds\Map::get() on RemoveNullArgOnNullDefaultParamRector ([#&#8203;7665](https://github.com/rectorphp/rector-src/pull/7665)) <br> #### Removed :skull: - \[DeadCode] Skip used from property fetch reference on loop on RemoveUnusedVariableAssignRector ([#&#8203;7635](https://github.com/rectorphp/rector-src/pull/7635)) - \[internal] Extract ImmutableNodeTraverser from vendor, to remove patch and keep using cache for node types ([#&#8203;7634](https://github.com/rectorphp/rector-src/pull/7634)) - Deprecated STMT\_KEY and remove its set attribute value ([#&#8203;7647](https://github.com/rectorphp/rector-src/pull/7647)) - \[attribute] Remove unused AttributeKey::REPRINT\_RAW\_VALUE ([#&#8203;7664](https://github.com/rectorphp/rector-src/pull/7664)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[stmts-aware] Use NodeGroup::STMTS\_AWARE over StmtsAwareInterface ([#&#8203;886](https://github.com/rectorphp/rector-symfony/pull/886)) - Fix rule when method is \_\_invoke ([#&#8203;884](https://github.com/rectorphp/rector-symfony/pull/884)), Thanks [@&#8203;wilfi00](https://github.com/wilfi00) - \[CodeQuality] Do not replace variable assign on ControllerMethodInjectionToConstructorRector ([#&#8203;883](https://github.com/rectorphp/rector-symfony/pull/883)) - Handle Doctrine constraints in ConstraintOptionsToNamedArgumentsRector ([#&#8203;882](https://github.com/rectorphp/rector-symfony/pull/882)), Thanks [@&#8203;johndodev](https://github.com/johndodev) - \[CodeQuality] Skip FOS\RestBundle ParamFetcher on ControllerMethodInjectionToConstructorRector ([#&#8203;881](https://github.com/rectorphp/rector-symfony/pull/881)) - \[CodeQuality] Skip autowire() method via [@&#8203;required](https://github.com/required) and Required attribute ([#&#8203;880](https://github.com/rectorphp/rector-symfony/pull/880)) - Fix scoped \ cleared on single quote string on ControllerMethodInjectionToConstructorRector ([#&#8203;879](https://github.com/rectorphp/rector-symfony/pull/879)) - \[CodeQuality] Skip Common Entity contains subnamespaces on ControllerMethodInjectionToConstructorRector ([#&#8203;878](https://github.com/rectorphp/rector-symfony/pull/878)) - \[CodeQuality] Skip from route path /edit/{id} on ControllerMethodInjectionToConstructorRector ([#&#8203;877](https://github.com/rectorphp/rector-symfony/pull/877)) - handle use var ([#&#8203;875](https://github.com/rectorphp/rector-symfony/pull/875)) - Remove STMT\_KEY from rules ([#&#8203;874](https://github.com/rectorphp/rector-symfony/pull/874)) - Remove stmt key from LogoutHandlerToLogoutEventSubscriberRector ([#&#8203;870](https://github.com/rectorphp/rector-symfony/pull/870)) - Fix build of prefixed SymfonyFunctionName::REF and SymfonyFunctionName::SERVICE usage ([#&#8203;869](https://github.com/rectorphp/rector-symfony/pull/869)) - \[config] Fix couple config autowire rules ([#&#8203;868](https://github.com/rectorphp/rector-symfony/pull/868)) - Fix unit test ([#&#8203;867](https://github.com/rectorphp/rector-symfony/pull/867)) - skip constructor in ControllerMethodInjectionToConstructorRector ([#&#8203;866](https://github.com/rectorphp/rector-symfony/pull/866)) - \[code-quality] Add ControllerMethodInjectionToConstructorRector ([#&#8203;865](https://github.com/rectorphp/rector-symfony/pull/865)) <br> *** <br> #### rectorphp/rector-phpunit :green_circle: - \[CodeQuality] Skip Generator on AssertCompareOnCountableWithMethodToAssertCountRector ([#&#8203;591](https://github.com/rectorphp/rector-phpunit/pull/591)) - remove stmt key from ConstructClassMethodToSetUpTestCaseRector ([#&#8203;590](https://github.com/rectorphp/rector-phpunit/pull/590)) - Remove stmt key from TestListenerToHooksRector ([#&#8203;589](https://github.com/rectorphp/rector-phpunit/pull/589)) - fix phpunit covers default class with short covers methods ([#&#8203;588](https://github.com/rectorphp/rector-phpunit/pull/588)), Thanks [@&#8203;irosner](https://github.com/irosner) - \[CodeQuality] Do not use FullyQualified on "self" on WithCallbackIdenticalToStandaloneAssertsRector ([#&#8203;587](https://github.com/rectorphp/rector-phpunit/pull/587)) - \[phpunit 10] Improve PropertyExistsWithoutAssertRector coverage ([#&#8203;586](https://github.com/rectorphp/rector-phpunit/pull/586)) - \[depre] Deprecate AssertPropertyExistsRector as method was removed in PHPUnit 10 ([#&#8203;585](https://github.com/rectorphp/rector-phpunit/pull/585)) - \[depre] Deprecate RemoveDataProviderParamKeysRector as the keys can be useful to improve test readability ([#&#8203;584](https://github.com/rectorphp/rector-phpunit/pull/584)), Thanks [@&#8203;MacDada](https://github.com/MacDada) - \[CodeQuality] Handle on without namespace on DeclareStrictTypesTestsRector ([#&#8203;583](https://github.com/rectorphp/rector-phpunit/pull/583)) ### [`v2.2.8`](https://github.com/rectorphp/rector/releases/tag/2.2.8): Released Rector 2.2.8 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.7...2.2.8) #### New Features :partying\_face: - \[type-declaration] Add return data provider array type from strict test method param ([#&#8203;7605](https://github.com/rectorphp/rector-src/pull/7605)) - \[coding-style] Add NestedTernaryToMatchRector ([#&#8203;7572](https://github.com/rectorphp/rector-src/pull/7572)) - \[TypeDeclaration] Register NarrowObjectReturnTypeRector to type declaration set ([#&#8203;7615](https://github.com/rectorphp/rector-src/pull/7615)) <br> #### Bugfixes :bug: - \[Diffs] Handle --no-diffs usage to show file have been changed if any with --dry-run + --no-diffs ([#&#8203;7619](https://github.com/rectorphp/rector-src/pull/7619)) - \[Php81] Skip callable variadic in array\_all() on FunctionLikeToFirstClassCallableRector ([#&#8203;7606](https://github.com/rectorphp/rector-src/pull/7606)) - fix a syntax error in the ArrayFirstLastRector rule documentation ([#&#8203;7613](https://github.com/rectorphp/rector-src/pull/7613)), Thanks [@&#8203;esnard](https://github.com/esnard)! - Narrow object return type ([#&#8203;7575](https://github.com/rectorphp/rector-src/pull/7575)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[type-declaration] Rename NarrowTooWideReturnType to NarrowWideUnionReturnTypeRector ([#&#8203;7614](https://github.com/rectorphp/rector-src/pull/7614)) - \[TypeDeclaration] Also update generic collection docblock on NarrowObjectReturnTypeRector ([#&#8203;7616](https://github.com/rectorphp/rector-src/pull/7616)) - \[TypeDeclaration] Do not change valid generic docblock on NarrowObjectReturnTypeRector ([#&#8203;7617](https://github.com/rectorphp/rector-src/pull/7617)) - \[Privatization] Do not remove readonly on promoted property on PrivatizeFinalClassPropertyRector ([#&#8203;7611](https://github.com/rectorphp/rector-src/pull/7611)) <br> #### Removed :skull: - \[dx] help - omit explicit command name as no longer needed; remove verbosity option, use debug instead ([#&#8203;7620](https://github.com/rectorphp/rector-src/pull/7620)) <br> #### rectorphp/rector-symfony :musical_note: - ensure reset args after loop ([#&#8203;864](https://github.com/rectorphp/rector-symfony/pull/864)) - Bump PHPStan to ^2.1.32 and fix test for InlineClassRoutePrefixRector ([#&#8203;863](https://github.com/rectorphp/rector-symfony/pull/863)) - \[Symfony74] replace PropertyMetadata deprecated functions ([#&#8203;862](https://github.com/rectorphp/rector-symfony/pull/862)), Thanks [@&#8203;MrYamous](https://github.com/MrYamous) - \[Symfony74] update WorkflowDumpCommand namespace ([#&#8203;861](https://github.com/rectorphp/rector-symfony/pull/861)), Thanks [@&#8203;MrYamous](https://github.com/MrYamous) - add property support to ErrorNamesPropertyToConstantRector ([#&#8203;860](https://github.com/rectorphp/rector-symfony/pull/860)) - Support converting all options to twig attributes ([#&#8203;859](https://github.com/rectorphp/rector-symfony/pull/859)), Thanks [@&#8203;Spea](https://github.com/Spea) <br> #### rectorphp/rector-phpunit :green_circle: - \[CodeQuality] Skip in static method on AssertFuncCallToPHPUnitAssertRector ([#&#8203;582](https://github.com/rectorphp/rector-phpunit/pull/582)) - add implicit method call support ([#&#8203;581](https://github.com/rectorphp/rector-phpunit/pull/581)) - add multi callbacks support ([#&#8203;580](https://github.com/rectorphp/rector-phpunit/pull/580)) - allow extra stmt ([#&#8203;579](https://github.com/rectorphp/rector-phpunit/pull/579)) - add dynamic instanceof support ([#&#8203;578](https://github.com/rectorphp/rector-phpunit/pull/578)) - \[code-quality] Add SimplerWithIsInstanceOfRector ([#&#8203;577](https://github.com/rectorphp/rector-phpunit/pull/577)) - add sole instanceof support ([#&#8203;576](https://github.com/rectorphp/rector-phpunit/pull/576)) - add use var ([#&#8203;575](https://github.com/rectorphp/rector-phpunit/pull/575)) - add return type or empty if nothing to add ([#&#8203;574](https://github.com/rectorphp/rector-phpunit/pull/574)) - \[code-quality] Add MergeWithCallableAndWillReturnRector ([#&#8203;573](https://github.com/rectorphp/rector-phpunit/pull/573)) - handle solo identical as well, to get better message ([#&#8203;572](https://github.com/rectorphp/rector-phpunit/pull/572)) - always return true, as required by contract ([#&#8203;571](https://github.com/rectorphp/rector-phpunit/pull/571)) - add external variable use ([#&#8203;570](https://github.com/rectorphp/rector-phpunit/pull/570)) - add isset support, revert order to respect original one ([#&#8203;569](https://github.com/rectorphp/rector-phpunit/pull/569)) - \[code-quality] Add WithCallbackIdenticalToStandaloneAssertsRector ([#&#8203;568](https://github.com/rectorphp/rector-phpunit/pull/568)) <br> #### rectorphp/rector-downgrade-php :arrow_down: - Bump to PHPStan ^2.1.32 and ignore false positive instanceof in OR usage ([#&#8203;344](https://github.com/rectorphp/rector-downgrade-php/pull/344)) ### [`v2.2.7`](https://github.com/rectorphp/rector/releases/tag/2.2.7): Released Rector 2.2.7 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.6...2.2.7) #### New Features :partying\_face: - \[type-declaration] Add ReturnIteratorInDataProviderRector ([#&#8203;7593](https://github.com/rectorphp/rector-src/pull/7593)) - \[type-declarations] Add TypedStaticPropertyInBehatContextRector ([#&#8203;7596](https://github.com/rectorphp/rector-src/pull/7596)) - \[DeadCode] Register RemoveNullArgOnNullDefaultParamRector to dead code set ([#&#8203;7597](https://github.com/rectorphp/rector-src/pull/7597)) - \[php 8.5] Split of nested functions calls to pipe operator in a new standalone rule ([#&#8203;7603](https://github.com/rectorphp/rector-src/pull/7603)) <br> #### Bugfixes :bug: - always add nullable on TypedPropertyFromJMSSerializerAttributeTypeRector as serializer does not use constructor ([#&#8203;7599](https://github.com/rectorphp/rector-src/pull/7599)) - \[Php81] Skip callable param union on FunctionLikeToFirstClassCallableRector ([#&#8203;7589](https://github.com/rectorphp/rector-src/pull/7589)) - \[CodeQuality] Skip ArrayDimFetch with BitwiseXor on CombinedAssignRector ([#&#8203;7590](https://github.com/rectorphp/rector-src/pull/7590)) - \[Php84] Skip variable extraction with return early on ForeachToArrayAllRector ([#&#8203;7591](https://github.com/rectorphp/rector-src/pull/7591)) - \[PHP 8.5] rename NestedToPipeOeratorRector to SequentialAssignmentsToPipeOperatorRector, handle only assigns, not nested calls ([#&#8203;7588](https://github.com/rectorphp/rector-src/pull/7588)) - \[Php81] Skip as Arg of non-native function call on FunctionLikeToFirstClassCallableRector ([#&#8203;7592](https://github.com/rectorphp/rector-src/pull/7592)) - skip different args passed to call-like and required by arrow function in FunctionLikeToFirstClassCallableRector ([#&#8203;7594](https://github.com/rectorphp/rector-src/pull/7594)) - handle public properties in TypedPropertyFromJMSSerializerAttributeTypeRector as nullable ([#&#8203;7595](https://github.com/rectorphp/rector-src/pull/7595)) - skip to many in /TypedPropertyFromJMSSerializerAttributeTypeRector ([#&#8203;7598](https://github.com/rectorphp/rector-src/pull/7598)) - skip refernce one as well in /TypedPropertyFromJMSSerializerAttributeTypeRector ([rectorphp/rector-src@`842aa94`](https://github.com/rectorphp/rector-src/commit/842aa94d34c976e61545c7768f828be0b17b1a35)) - split TypedPropertyFromJMSSerializerAttributeTypeRector to scalar and object types ([#&#8203;7602](https://github.com/rectorphp/rector-src/pull/7602)) - Don't require parentheses for short-ternaries ([#&#8203;7604](https://github.com/rectorphp/rector-src/pull/7604)), Thanks [@&#8203;martinstuecklschwaiger](https://github.com/martinstuecklschwaiger)! <br> #### rectorphp/rector-symfony :musical_note: - \[Configs] Skip first class callable on RemoveConstructorAutowireServiceRector ([#&#8203;858](https://github.com/rectorphp/rector-symfony/pull/858)) <br> #### rectorphp/rector-phpunit :green_circle: - \[depre] Deprecate SetUpBeforeClassToSetUpRector as can break code easily ([#&#8203;567](https://github.com/rectorphp/rector-phpunit/pull/567)) ### [`v2.2.6`](https://github.com/rectorphp/rector/releases/tag/2.2.6): Released Rector 2.2.6 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.5...2.2.6) #### New Features :partying\_face: - \[PHP 8.5] Add `NestedToPipeOperatorRector` ([#&#8203;7577](https://github.com/rectorphp/rector-src/pull/7577)) - \[code-quality] Add `DirnameDirConcatStringToDirectStringPathRector` ([#&#8203;7552](https://github.com/rectorphp/rector-src/pull/7552)) - \[dead-code] Add `RemoveNullArgOnNullDefaultParamRector` ([#&#8203;7562](https://github.com/rectorphp/rector-src/pull/7562)) - register AddClosureParamTypeFromIterableMethodCallRector to type declaration set ([rectorphp/rector-src@`4d78f41`](https://github.com/rectorphp/rector-src/commit/4d78f41bf14585adc0a7897d246b502142159776)) - register AddParamArrayDocblockBasedOnCallableNativeFuncCallRector in type declaration docblocks ([rectorphp/rector-src@`80f7db8`](https://github.com/rectorphp/rector-src/commit/80f7db8a3b9a4ab34c6646c9d24f03e777cc20c7)) <br> #### Bugfixes :bug: - Fix next catch missed variable rename in CatchExceptionNameMatchingTypeRector ([#&#8203;7547](https://github.com/rectorphp/rector-src/pull/7547)) - \[Php81] Fix first class callable should not have trailing comma on FunctionLikeToFirstClassCallableRector ([#&#8203;7551](https://github.com/rectorphp/rector-src/pull/7551)) - \[CodingStyle] Skip Method target not found or defined only via [@&#8203;method](https://github.com/method) on FunctionLikeToFirstClassCallableRector ([#&#8203;7553](https://github.com/rectorphp/rector-src/pull/7553)) - \[Php81]\[CodingStyle] Allow both exists in both [@&#8203;method](https://github.com/method) and native method on FunctionLikeToFirstClassCallableRector ([#&#8203;7559](https://github.com/rectorphp/rector-src/pull/7559)) - \[Php81]\[CodingStyle] Skip param used as invokable function multi args on FunctionLikeToFirstClassCallableRector ([#&#8203;7563](https://github.com/rectorphp/rector-src/pull/7563)) - \[Php81]\[CodingStyle] Skip Closure/ArrowFunction as assign expr on FunctionLikeToFirstClassCallableRector ([#&#8203;7564](https://github.com/rectorphp/rector-src/pull/7564)) - finalize rules as well ([#&#8203;7575](https://github.com/rectorphp/rector-src/pull/7575)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[Php85] Clean up dynamic expr check on NestedToPipeOperatorRector ([#&#8203;7578](https://github.com/rectorphp/rector-src/pull/7578)) - \[Php81] Skip Closure bindTo on FunctionLikeToFirstClassCallableRector ([#&#8203;7581](https://github.com/rectorphp/rector-src/pull/7581)) - Remove trait support rom AddParamBasedOnParentClassMethodRector as depends on context; move to Class\_ node hooking for efficiency ([#&#8203;7587](https://github.com/rectorphp/rector-src/pull/7587)) - \[Php85] Handle indent inside class method on NestedToPipeOperatorRector ([#&#8203;7584](https://github.com/rectorphp/rector-src/pull/7584)) - make DeclareStrictTypesRector skip files without namespace, as very risky in files without PSR-4 autodiscovery ([#&#8203;7585](https://github.com/rectorphp/rector-src/pull/7585)) - speedup - skip refleciton if all params are typed ([rectorphp/rector-src@`08f6dc3`](https://github.com/rectorphp/rector-src/commit/08f6dc3c299038919818df2970eaf69a88fd1314)) - skip all-typed properties in TypedPropertyFromStrictConstructorRector ([rectorphp/rector-src@`c5d9fdf`](https://github.com/rectorphp/rector-src/commit/c5d9fdfcbe5bc43a8114307e24b5ca6cdd57f55b)) - skip no-type params in RenameParamToMatchTypeRector ([rectorphp/rector-src@`cd7eb93`](https://github.com/rectorphp/rector-src/commit/cd7eb93b7bb67f142708ad4a54ab12f9e09f31e2)) - optimize ParamTypeByParentCallTypeRector to handle only classes with parents and method without param type ([rectorphp/rector-src@`0ca4e91`](https://github.com/rectorphp/rector-src/commit/0ca4e9112b61bdbeb6b8fe826e7aae56c298272e)) - \[DeadCode] Allow FuncCall on RemoveNullArgOnNullDefaultParamRector ([#&#8203;7567](https://github.com/rectorphp/rector-src/pull/7567)) - \[DeadCode] Handle with middle default not null on RemoveNullArgOnNullDefaultParamRector ([#&#8203;7565](https://github.com/rectorphp/rector-src/pull/7565)) - \[DeadCode] Allow remove named argument if position is match with param on RemoveNullArgOnNullDefaultParamRector ([#&#8203;7566](https://github.com/rectorphp/rector-src/pull/7566)) - \[comments] Remove attribute comments support as comments require standalone line before any doctrine annotation ([#&#8203;7582](https://github.com/rectorphp/rector-src/pull/7582)) <br> #### Removed and Deprecated :skull: - \[depre] Deprecate ParentClassToTraitsRector as very narrow use case to be generic, create custom rule instead ([#&#8203;7550](https://github.com/rectorphp/rector-src/pull/7550)) - \[depre] Deprecate ReplaceParentCallByPropertyCallRector as not used since doctrine set service removed, not standalone rule ([#&#8203;7554](https://github.com/rectorphp/rector-src/pull/7554)) - \[depre] Deprecate MethodCallToNewRector as not used and based on assumptions ([#&#8203;7555](https://github.com/rectorphp/rector-src/pull/7555)) - \[depre] Deprecate MethodCallToPropertyFetchRector, as not practical/used and part of removed set ([#&#8203;7556](https://github.com/rectorphp/rector-src/pull/7556)) - \[depre] Deprecate MethodCallToPropertyFetchRector as not used and part of removed set ([#&#8203;7557](https://github.com/rectorphp/rector-src/pull/7557)) - \[depre] Deprecate PropertyFetchToMethodCallRector not used and as too generic, use custom rule instead ([#&#8203;7558](https://github.com/rectorphp/rector-src/pull/7558)) - \[depre] Deprecate PropertyAssignToMethodCallRector as too narrow use-case and never used ([#&#8203;7561](https://github.com/rectorphp/rector-src/pull/7561)) - \[depre] Deprecate ReturnTypeWillChangeRector as discourages from filling correct types, use type declaration set instead ([#&#8203;7570](https://github.com/rectorphp/rector-src/pull/7570)) - \[depre] Deprecate MultiDimensionalArrayToArrayDestructRector as not part of any set, can create less readable and harder to analyse code ([#&#8203;7573](https://github.com/rectorphp/rector-src/pull/7573)) - \[depre] Deprecate InlineVarDocTagToAssertRector as not par of any set, and create prod crashing code ([#&#8203;7574](https://github.com/rectorphp/rector-src/pull/7574)) - \[depre] Deprecate AddAllowDynamicPropertiesAttributeRector, as not in PHP sets and does not help by adding attribute everywhere ([#&#8203;7568](https://github.com/rectorphp/rector-src/pull/7568)) - \[depre] Deprecate AddLiteralSeparatorToNumberRector as cannot be automated and depends on context ([#&#8203;7569](https://github.com/rectorphp/rector-src/pull/7569)) <br> #### rectorphp/rector-symfony :musical_note: - \[Configs] Skip first class callable on RemoveConstructorAutowireServiceRector ([#&#8203;858](https://github.com/rectorphp/rector-symfony/pull/858)) - \[config] Add FromServicePublicToDefaultsPublicRector ([#&#8203;857](https://github.com/rectorphp/rector-symfony/pull/857)) - cover 2nd arg class in RemoveConstructorAutowireServiceRector ([#&#8203;856](https://github.com/rectorphp/rector-symfony/pull/856)) - \[config] Add RemoveConstructorAutowireServiceRector ([#&#8203;855](https://github.com/rectorphp/rector-symfony/pull/855)) - \[Symfony73] Skip empty result of named arguments on ConstraintOptionsToNamedArgumentsRector ([#&#8203;853](https://github.com/rectorphp/rector-symfony/pull/853)) - \[depre] Deprecate StringExtensionToConfigBuilderRector as deprecated in Symfony 7.4 ([#&#8203;854](https://github.com/rectorphp/rector-symfony/pull/854)) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] Add DeclareStrictTypesTestsRector to code-quality test ([#&#8203;566](https://github.com/rectorphp/rector-phpunit/pull/566)) - \[depre] Deprecate AddParentSetupCallOnSetupRector as not generic to be automated, fill manually where needed ([#&#8203;565](https://github.com/rectorphp/rector-phpunit/pull/565)) - \[CodeQuality] Skip used inside static closure on AssertFuncCallToPHPUnitAssertRector ([#&#8203;564](https://github.com/rectorphp/rector-phpunit/pull/564)) - register ReplaceAtMethodWithDesiredMatcherRector to code-quality ([#&#8203;563](https://github.com/rectorphp/rector-phpunit/pull/563)) - \[depre] Deprecate CreateMockToAnonymousClassRector as requires manual work, often value object setter can be better alternative ([#&#8203;562](https://github.com/rectorphp/rector-phpunit/pull/562)) ### [`v2.2.5`](https://github.com/rectorphp/rector/releases/tag/2.2.5): Released Rector 2.2.5 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.4...2.2.5) #### Rules Registered in sets :partying\_face: Couple long-existing rules were added to PHP 8.1, code quality and type declaration sets after optional community testing :heavy\_check\_mark:\ If you'll experience any undersired changes, let us know :+1: - register AddClosureParamTypeForArrayMapRector in type declaration level ([rectorphp/rector-src@`68bb0cc`](https://github.com/rectorphp/rector-src/commit/68bb0cca86e28df97a3bca15f0f85836b7b87ea4)) - register AddClosureParamTypeForArrayReduceRector to type declaration level ([rectorphp/rector-src@`38ecb98`](https://github.com/rectorphp/rector-src/commit/38ecb98e65a29d6a774f93013a32cf8d8d4e482e)) - improve description ([rectorphp/rector-src@`1ae7187`](https://github.com/rectorphp/rector-src/commit/1ae7187546914988d394830b60c96b2178e4c4ad)) - add FunctionFirstClassCallableRector to PHP 8.1 set ([rectorphp/rector-src@`0e18562`](https://github.com/rectorphp/rector-src/commit/0e18562ee6196eb3196169dd51a6dffac479ec60)) - register ReplaceConstantBooleanNotRector in code-quality level ([rectorphp/rector-src@`e164069`](https://github.com/rectorphp/rector-src/commit/e1640694bab2d29289c295e7875294e857cc2d01)) - register ClosureFromCallableToFirstClassCallableRector to PHP 8.1 set ([rectorphp/rector-src@`d229205`](https://github.com/rectorphp/rector-src/commit/d229205e5dbdf68c15d44a373203217368603361)) - register NewInInitializerRector in PHP 8.1 ([#&#8203;7545](https://github.com/rectorphp/rector-src/pull/7545)) <br> #### Bugfixes :bug: - \[fix] skip variadic param on ParamTypeByParentCallTypeRector ([#&#8203;7532](https://github.com/rectorphp/rector-src/pull/7532)) - \[Php81]\[CodingStyle] Skip multi params on FunctionLikeToFirstClassCallableRector ([#&#8203;7537](https://github.com/rectorphp/rector-src/pull/7537)) - \[Php81]\[CodingStyle] Skip callable param assign with signature multi params on FunctionLikeToFirstClassCallableRector ([#&#8203;7538](https://github.com/rectorphp/rector-src/pull/7538)) - Fix NullToStrictStringFuncCallArgRector with probabilistic check for plural array passed to function where array allowed ([#&#8203;7539](https://github.com/rectorphp/rector-src/pull/7539)) - \[Php81]\[CodingStyle] Skip variadic not used on FunctionLikeToFirstClassCallableRector ([#&#8203;7540](https://github.com/rectorphp/rector-src/pull/7540)) - \[Php81] Keep nullable param on NewInInitializerRector ([#&#8203;7545](https://github.com/rectorphp/rector-src/pull/7545)) - \[php 8.1] skip nullable property without null default in NewInInitializerRector ([#&#8203;7546](https://github.com/rectorphp/rector-src/pull/7546)) <br> #### Removed and deprecated :skull: - \[depre] Deprecate 3 configurable-only, never used closure param rules as too specific ([#&#8203;7541](https://github.com/rectorphp/rector-src/pull/7541)) - \[depre] Deprecate RenameFunctionLikeParamWithinCallLikeArgRector as never used, too narrow and better suits custom project ([#&#8203;7544](https://github.com/rectorphp/rector-src/pull/7544)) - \[depre] Deprecate AddTypeFromResourceDocblockRector as breaks code and does not solve any real problem ([#&#8203;7542](https://github.com/rectorphp/rector-src/pull/7542)) - \[Php81] Completely remove AttributeGroupNewLiner ([#&#8203;7536](https://github.com/rectorphp/rector-src/pull/7536)) <br> *** <br> #### rectorphp/rector-phpunit :green_circle: - \[depre] Add never used AddCoversClassAttributeRector, as very opionated and requires very specific file location - use custom rule instead ([#&#8203;561](https://github.com/rectorphp/rector-phpunit/pull/561)) - Fix implicit PHP and PHPUnit version in RequiresAnnotationWithValueToAttributeRector ([#&#8203;560](https://github.com/rectorphp/rector-phpunit/pull/560)) - \[code-quality] Add AssertArrayCastedObjectToAssertSameRector ([#&#8203;559](https://github.com/rectorphp/rector-phpunit/pull/559)) ### [`v2.2.4`](https://github.com/rectorphp/rector/releases/tag/2.2.4): Released Rector 2.2.4 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.3...2.2.4) #### New Features :partying\_face: - \[code-quality] Add RepeatedAndNotEqualToNotInArrayRector ([#&#8203;7517](https://github.com/rectorphp/rector-src/pull/7517)) - \[code-quality] Add ReplaceConstantBooleanNotRector ([#&#8203;7527](https://github.com/rectorphp/rector-src/pull/7527)) - \[code-quality] Add VariableConstFetchToClassConstFetchRector ([#&#8203;7457](https://github.com/rectorphp/rector-src/pull/7457)) - \[coding-style] Add BinaryOpStandaloneAssignsToDirectRector ([#&#8203;7466](https://github.com/rectorphp/rector-src/pull/7466)) <br> #### Bugfixes :bug: - Fix autoload preload on PHPUnit 12+ on global installation ([#&#8203;7468](https://github.com/rectorphp/rector-src/pull/7468)) ([#&#8203;7472](https://github.com/rectorphp/rector-src/pull/7472)) ([#&#8203;7475](https://github.com/rectorphp/rector-src/pull/7475)) - \[TypeDeclaration] Skip override from parent method on `AddParamStringTypeFromSprintfUseRector` ([#&#8203;7479](https://github.com/rectorphp/rector-src/pull/7479)) - Run PHPUnit 12 and PHPStan compatibilty check ([#&#8203;7455](https://github.com/rectorphp/rector-src/pull/7455)) - \[TypeDeclarationDocblocks] Handle repeated item type on DocblockReturnArrayFromDirectArrayInstanceRector ([#&#8203;7459](https://github.com/rectorphp/rector-src/pull/7459)) - \[BetterPhpDocParser] Unique handling string on `BracketsAwareUnionTypeNode` ([#&#8203;7462](https://github.com/rectorphp/rector-src/pull/7462)) - \[CodeQuality] Skip non-variable fetch on `VariableConstFetchToClassConstFetchRector` as may cause side effect ([#&#8203;7464](https://github.com/rectorphp/rector-src/pull/7464)) - \[CodingStyle] Skip any CallLike with args !== \[] on `BinaryOpStandaloneAssignsToDirectRector` ([#&#8203;7469](https://github.com/rectorphp/rector-src/pull/7469)) - \[CodingStyle] Skip compare binary op on BinaryOpStandaloneAssignsToDirectRector ([#&#8203;7470](https://github.com/rectorphp/rector-src/pull/7470)) - \[CodingStyle] Skip by ref params on BinaryOpStandaloneAssignsToDirectRector ([#&#8203;7471](https://github.com/rectorphp/rector-src/pull/7471)) <br> #### Removed and deprecated :skull: - \[deprecated] Deprecate `strict-types` rules as risky and not practical ([#&#8203;7523](https://github.com/rectorphp/rector-src/pull/7523)) - \[DeadCode] Skip vars exists in static vars on RemoveNonExistingVarAnnotationRector ([#&#8203;7463](https://github.com/rectorphp/rector-src/pull/7463)) - \[autoload] Remove PHPUnit version 12 check on preload.php load ([#&#8203;7474](https://github.com/rectorphp/rector-src/pull/7474)) - \[Removal] Remove --kaizen option, as it might jump right to risky rules, use levels instead ([#&#8203;7478](https://github.com/rectorphp/rector-src/pull/7478)) #### rectorphp/rector-phpunit - Fix argument.type PHPStan errors ([#&#8203;553](https://github.com/rectorphp/rector-phpunit/pull/553)), Thanks [@&#8203;staabm](https://github.com/staabm) ### [`v2.2.3`](https://github.com/rectorphp/rector/releases/tag/2.2.3): Released Rector 2.2.3 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.2...2.2.3) #### New Features :partying\_face: - \[code-quality] Add `VariableConstFetchToClassConstFetchRector` ([#&#8203;7457](https://github.com/rectorphp/rector-src/pull/7457)) - \[coding-style] Add `BinaryOpStandaloneAssignsToDirectRector` ([#&#8203;7466](https://github.com/rectorphp/rector-src/pull/7466)) - \[type-declaration] Add `AddParamStringTypeFromSprintfUseRector` ([#&#8203;7477](https://github.com/rectorphp/rector-src/pull/7477)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip override from parent method on AddParamStringTypeFromSprintfUseRector ([#&#8203;7479](https://github.com/rectorphp/rector-src/pull/7479)) - \[ci] Run PHPUnit 12 and PHPStan compatibilty check ([#&#8203;7455](https://github.com/rectorphp/rector-src/pull/7455)) - \[TypeDeclarationDocblocks] Handle repeated item type on DocblockReturnArrayFromDirectArrayInstanceRector ([#&#8203;7459](https://github.com/rectorphp/rector-src/pull/7459)) - \[BetterPhpDocParser] Unique handling string on BracketsAwareUnionTypeNode ([#&#8203;7462](https://github.com/rectorphp/rector-src/pull/7462)) - \[CodeQuality] Skip non-variable fetch on VariableConstFetchToClassConstFetchRector as may cause side effect ([#&#8203;7464](https://github.com/rectorphp/rector-src/pull/7464)) - Fix autoload preload on PHPUnit 12+ on global installation ([#&#8203;7468](https://github.com/rectorphp/rector-src/pull/7468)) - \[DeadCode] Skip vars exists in static vars on RemoveNonExistingVarAnnotationRector ([#&#8203;7463](https://github.com/rectorphp/rector-src/pull/7463)) <br> #### Removed :skull: - \[removal] Remove --kaizen option, as it might jump right to risky rules, use levels instead ([#&#8203;7478](https://github.com/rectorphp/rector-src/pull/7478)) - remove [@&#8203;experimental](https://github.com/experimental) from level classes, as used ([rectorphp/rector-src@`3ff3caa`](https://github.com/rectorphp/rector-src/commit/3ff3caa7d71385a8f6d2c282677e570683b202c6)) ### [`v2.2.2`](https://github.com/rectorphp/rector/releases/tag/2.2.2): Released Rector 2.2.2 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.1...2.2.2) This release contains important fix for Rector custom rules running on PHPUnit 12.2+ :heavy\_check\_mark: PHPUnit started to preload it's own `php-parser` version, that conflicts with Rector's one. Now we preload our side first again. Your tests shall run :+1: If not: let us know in: [#&#8203;9416](https://github.com/rectorphp/rector/issues/9416) <br> #### New Features :partying_face: - \[tdd] Add `AddParamArrayDocblockBasedOnArrayMapRector` ([#&#8203;7435](https://github.com/rectorphp/rector-src/pull/7435)) - \[Php85] Add `ShellExecFunctionCallOverBackticksRector` ([#&#8203;7445](https://github.com/rectorphp/rector-src/pull/7445)) <br> #### Bugfixes :bug: - **\[Scoped] Load early preload.php on scoped bootstrap.php on phpunit 12+ running** ([#&#8203;7451](https://github.com/rectorphp/rector-src/pull/7451)) - \[autoload] Fix phpstan + rector tests co-run to avoid duplicated php-parser loading error ([#&#8203;7440](https://github.com/rectorphp/rector-src/pull/7440)) - \[Php80] Skip inside by ref method on ChangeSwitchToMatchRector ([#&#8203;7443](https://github.com/rectorphp/rector-src/pull/7443)) - \[Renaming] Allow self/static on RenamePropertyRector ([#&#8203;7444](https://github.com/rectorphp/rector-src/pull/7444)) - Directly check type of substr() on RecastingRemovalRector ([#&#8203;7446](https://github.com/rectorphp/rector-src/pull/7446)) - \[fix] Skip symfony config closures on FirstClassCallableRector as they do not support first class callables ([#&#8203;7447](https://github.com/rectorphp/rector-src/pull/7447)) - \[DeadCode] Skip ClassLikeNameClassNameImportSkipVoter for RecastingRemovalRector ([#&#8203;7448](https://github.com/rectorphp/rector-src/pull/7448)) - \[dead-code] Skip substr casting removal on PHP 7.x, as can return false|string ([#&#8203;7449](https://github.com/rectorphp/rector-src/pull/7449)) - \[Php74] Skip used in compact on ClosureArrowFunctionAnalyzer ([#&#8203;7453](https://github.com/rectorphp/rector-src/pull/7453)) - \[TypeDeclarationDocblocks] Fix missing backslash on class-string type on DocblockGetterReturnArrayFromPropertyDocblockVarRector ([#&#8203;7454](https://github.com/rectorphp/rector-src/pull/7454)) ### [`v2.2.1`](https://github.com/rectorphp/rector/releases/tag/2.2.1): Released Rector 2.2.1 [Compare Source](https://github.com/rectorphp/rector/compare/2.2.0...2.2.1) #### Bugfixes :bug: - Fix php 7.4 regression on strtolower to false on ClassLikeNameClassNameImportSkipVoter ([#&#8203;7436](https://github.com/rectorphp/rector-src/pull/7436)) - \[CodeQuality] Handle property fetch and common nodes crash on InlineArrayReturnAssignRector ([#&#8203;7437](https://github.com/rectorphp/rector-src/pull/7437)) ### [`v2.2.0`](https://github.com/rectorphp/rector/releases/tag/2.2.0): Released Rector 2.2 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.7...2.2.0) This release includes dozens of fixes, new PHP and Type Declaration rules, many Symfony Console rules improvements... ...and one brand new set: **type coverage docblocks** :tada: :tada: :tada: Read the gist on our blog - [Rector 2.2: New rules for Array Docblocks](https://getrector.com/blog/rector-22-new-rules-for-array-docblocks) <br> #### New Features and Improvements :rocket: New rules for Type Coverage Docblocks: - Add AddReturnDocblockForCommonObjectDenominatorRector ([#&#8203;7249](https://github.com/rectorphp/rector-src/pull/7249)) - Add AddParamArrayDocblockFromDimFetchAccessRector ([#&#8203;7253](https://github.com/rectorphp/rector-src/pull/7253)) - Add AddParamArrayDocblockFromDataProviderRector ([#&#8203;7257](https://github.com/rectorphp/rector-src/pull/7257)) - Add ClassMethodArrayDocblockParamFromLocalCallsRector ([#&#8203;7259](https://github.com/rectorphp/rector-src/pull/7259)) - Add AddReturnDocblockDataProviderRector ([#&#8203;7266](https://github.com/rectorphp/rector-src/pull/7266)) - Add fixture for data provider return options ([#&#8203;7268](https://github.com/rectorphp/rector-src/pull/7268)) - Add AddReturnDocblockForArrayDimAssignedObjectRector ([#&#8203;7302](https://github.com/rectorphp/rector-src/pull/7302)) - Add DocblockVarArrayFromPropertyDefaultsRector ([#&#8203;7311](https://github.com/rectorphp/rector-src/pull/7311)) - Add DocblockVarArrayFromGetterReturnRector ([#&#8203;7313](https://github.com/rectorphp/rector-src/pull/7313)) - Add AddReturnDocblockForJsonArrayRector ([#&#8203;7320](https://github.com/rectorphp/rector-src/pull/7320)) - Add AddParamArrayDocblockFromAssignsParamToParamReferenceRector ([#&#8203;7323](https://github.com/rectorphp/rector-src/pull/7323)) - \[dx] add withTypeCoverageDocblockLevel() ([#&#8203;7363](https://github.com/rectorphp/rector-src/pull/7363)) *** - \[dead-code] Add `RemoveUnusedVariableUseRector` ([#&#8203;7430](https://github.com/rectorphp/rector-src/pull/7430)) - \[Php 8.5] Add WakeupToUnserializeRector ([#&#8203;7242](https://github.com/rectorphp/rector-src/pull/7242)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[code-quality] Add `RepeatedOrEqualToInArrayRector` ([#&#8203;7400](https://github.com/rectorphp/rector-src/pull/7400)) - \[Php 8.1] Add `NullToStrictIntPregSlitFuncCallLimitArgRector` ([#&#8203;7240](https://github.com/rectorphp/rector-src/pull/7240)) - feat: add greater and smaller support to StrlenZeroToIdenticalEmptyStringRector ([#&#8203;7329](https://github.com/rectorphp/rector-src/pull/7329)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[TypeDeclaration] Allow empty array to native array on AddMethodCallBasedStrictParamTypeRector ([#&#8203;7342](https://github.com/rectorphp/rector-src/pull/7342)) - \[TypeDeclaration] Allow named arg on AddArrayFunctionClosureParamTypeRector ([#&#8203;7397](https://github.com/rectorphp/rector-src/pull/7397)) - \[type-declarations] Add `KnownMagicClassMethodTypeRector` ([#&#8203;7419](https://github.com/rectorphp/rector-src/pull/7419)) - Add rector to migrate \_\_sleep() to \_\_serialize() ([#&#8203;7212](https://github.com/rectorphp/rector-src/pull/7212)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[type-declaration] Add `AddParamFromDimFetchKeyUseRector` ([#&#8203;7424](https://github.com/rectorphp/rector-src/pull/7424)) - Add first class callable support to `CallUserFuncArrayToVariadicRector` ([#&#8203;7428](https://github.com/rectorphp/rector-src/pull/7428)) <br> #### Bugfixes :bug: - fix: remove empty construct when parent has no construct ([#&#8203;7239](https://github.com/rectorphp/rector-src/pull/7239)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - fix: overly strict ArraySpreadInsteadOfArrayMergeRector ([#&#8203;7247](https://github.com/rectorphp/rector-src/pull/7247)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[CodingStyle] Skip non-native array type on PHP 7.4 for ArraySpreadInsteadOfArrayMergeRector ([#&#8203;7248](https://github.com/rectorphp/rector-src/pull/7248)) - fix: `FunctionLikeToFirstClassCallableRector` ([#&#8203;7265](https://github.com/rectorphp/rector-src/pull/7265)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - fix: `EnumCaseToPascalCaseRector` skips existing pascal case ([#&#8203;7264](https://github.com/rectorphp/rector-src/pull/7264)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[CodeQuality] Skip init not empty array on InlineArrayReturnAssignRector ([#&#8203;7276](https://github.com/rectorphp/rector-src/pull/7276)) - fix: EnumCaseToPascalCaseRector bugs ([#&#8203;7278](https://github.com/rectorphp/rector-src/pull/7278)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - Avoid complex nesting in ConstantArrayTypeGeneralizer ([#&#8203;7282](https://github.com/rectorphp/rector-src/pull/7282)) - \[TypeDeclaration] Fix return by variable anonymous on ReturnTypeFromReturnNewRector ([#&#8203;7292](https://github.com/rectorphp/rector-src/pull/7292)) - \[Php84] Allow early return on ForeachToArrayAllRector ([#&#8203;7316](https://github.com/rectorphp/rector-src/pull/7316)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[TypeDeclaration] Fix configurable on IncreaseDeclareStrictTypesRector to show on getrector.com ([#&#8203;7327](https://github.com/rectorphp/rector-src/pull/7327)) - Skip nested array dim fetch assigns in InlineArrayReturnAssignRector ([#&#8203;7380](https://github.com/rectorphp/rector-src/pull/7380)) - \[CodeQuality] Fix escape character on SimplifyRegexPatternRector ([#&#8203;7390](https://github.com/rectorphp/rector-src/pull/7390)) - Try use double quote on SimplifyRegexPatternRector ([#&#8203;7392](https://github.com/rectorphp/rector-src/pull/7392)) - \[type-declarations] Open isset check in StrictArrayParamDimFetchRectorTest, move to last position in type-declaration level ([#&#8203;7388](https://github.com/rectorphp/rector-src/pull/7388)) - \[CodeQuality] allow coalesce not on full variable, but dim fetch in StrictArrayParamDimFetchRector ([#&#8203;7404](https://github.com/rectorphp/rector-src/pull/7404)) - \[CodeQuality] Skip bool equal integer on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;7411](https://github.com/rectorphp/rector-src/pull/7411)) - update comment on fixtures ([#&#8203;7413](https://github.com/rectorphp/rector-src/pull/7413)) - \[CodeQuality] Use ->isBoolean() check on compare boolean and constant bool on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;7415](https://github.com/rectorphp/rector-src/pull/7415)) <br> #### Removed :skull: - \[Differ] Remove ConsoleDiffer, use DefaultDiffer that utilize ColorConsoleDiffFormatter instead to avoid double diffing process ([#&#8203;7309](https://github.com/rectorphp/rector-src/pull/7309)) <br> #### Rector Symfony :musical_note: - \[Symfony61] Handle already exists attributes name on CommandConfigureToAttributeRector ([#&#8203;849](https://github.com/rectorphp/rector-symfony/pull/849)) - \[Symfony 6.2] Move symfony/security-core to security-http and security-bundle as target class/contant exists there ([#&#8203;848](https://github.com/rectorphp/rector-symfony/pull/848)) - \[Symfony73] Remove extends AbstractExtension after apply change on GetFunctionsToAsTwigFunctionAttributeRector ([#&#8203;846](https://github.com/rectorphp/rector-symfony/pull/846)) - \[code-quality] keep attribute in InlineClassRoutePrefixRector if it contains other metadata ([#&#8203;845](https://github.com/rectorphp/rector-symfony/pull/845)) - \[console] \[7.3] Add implicit boolean type in InputOption::VALUE\_NONE option ([#&#8203;844](https://github.com/rectorphp/rector-symfony/pull/844)) - \[console] \[7.3] Add type declaration based on default value type in InvokableCommandInputAttributeRector ([#&#8203;843](https://github.com/rectorphp/rector-symfony/pull/843)) - \[console] \[7.3] add array argument support to /InvokableCommandInputAttributeRector ([#&#8203;842](https://github.com/rectorphp/rector-symfony/pull/842)) - \[console] \[7.3] Add support for default values in InvokableCommandInputAttributeRector ([#&#8203;841](https://github.com/rectorphp/rector-symfony/pull/841)) - \[console] \[7.3] Add const names in InvokableCommandInputAttributeRector + fix -\_ naming to camel case ([#&#8203;840](https://github.com/rectorphp/rector-symfony/pull/840)) - \[console] \[7.3] Fix missing options in InvokableCommandInputAttributeRector ([#&#8203;839](https://github.com/rectorphp/rector-symfony/pull/839)) - \[console] \[7.3] Replace input/output with symfony style if used in InvokableCommandInputAttributeRector ([#&#8203;838](https://github.com/rectorphp/rector-symfony/pull/838)) <br> #### Rector Doctrine :orange_circle: - \[dbal] \[4.0] remove constant rename, as will be turned into enum right away and required manaul upgrade ([#&#8203;467](https://github.com/rectorphp/rector-doctrine/pull/467)) - Fix PHPStan notice on PHPStan 2.1.23 ([#&#8203;466](https://github.com/rectorphp/rector-doctrine/pull/466)) <br> #### Rector PHPUnit :green_circle: - \[CodeQuality] Ensure verify ClassReflection->hasConstructor() on MethodParametersAndReturnTypesResolver ([#&#8203;550](https://github.com/rectorphp/rector-phpunit/pull/550)) - \[CodeQuality] Skip not match position named argument part 2 ([#&#8203;548](https://github.com/rectorphp/rector-phpunit/pull/548)) - \[code-quality] add New\_ support to ScalarArgumentToExpectedParamTypeRector ([#&#8203;547](https://github.com/rectorphp/rector-phpunit/pull/547)) - \[phpunit] \[9.0] resolve WithConsecutiveRector naming ad-hoc to PHPUnit real code ([#&#8203;546](https://github.com/rectorphp/rector-phpunit/pull/546)) ### [`v2.1.7`](https://github.com/rectorphp/rector/releases/tag/2.1.7): Released Rector 2.1.7 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.6...2.1.7) #### New Features :partying\_face: - Php8.5 OrdSingleByteRector ([#&#8203;7219](https://github.com/rectorphp/rector-src/pull/7219)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! <br> #### Bugfixes :bug: - fix: skip privatizing Laravel Model attributes and scopes ([#&#8203;7218](https://github.com/rectorphp/rector-src/pull/7218)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[CodeQuality] Change behaviour of OptionalParametersAfterRequiredRector to fill null default value when previous param is optional ([#&#8203;7222](https://github.com/rectorphp/rector-src/pull/7222)) - \[CodeQuality] Handle intersection on OptionalParametersAfterRequiredRector ([#&#8203;7223](https://github.com/rectorphp/rector-src/pull/7223)) - \[CodeQuality] Fill reasonable default value on OptionalParametersAfterRequiredRector ([#&#8203;7226](https://github.com/rectorphp/rector-src/pull/7226)) - Support Param nodes in makeNonFinal() ([#&#8203;7228](https://github.com/rectorphp/rector-src/pull/7228)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[CodeQuality] Add Closure support on OptionalParametersAfterRequiredRector ([#&#8203;7224](https://github.com/rectorphp/rector-src/pull/7224)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[console] \[7.3] add array argument support to /InvokableCommandInputAttributeRector ([#&#8203;842](https://github.com/rectorphp/rector-symfony/pull/842)) - \[console] \[7.3] Add support for default values in InvokableCommandInputAttributeRector ([#&#8203;841](https://github.com/rectorphp/rector-symfony/pull/841)) - \[console] \[7.3] Add const names in InvokableCommandInputAttributeRector + fix -\_ naming to camel case ([#&#8203;840](https://github.com/rectorphp/rector-symfony/pull/840)) - \[console] \[7.3] Fix missing options in InvokableCommandInputAttributeRector ([#&#8203;839](https://github.com/rectorphp/rector-symfony/pull/839)) - \[console] \[7.3] Replace input/output with symfony style if used in InvokableCommandInputAttributeRector ([#&#8203;838](https://github.com/rectorphp/rector-symfony/pull/838)) <br> #### rectorphp/rector-doctrine :orange_circle: - add target document support to CompletePropertyDocblockFromToManyRector ([#&#8203;465](https://github.com/rectorphp/rector-doctrine/pull/465)) - add support for multiple items ([#&#8203;464](https://github.com/rectorphp/rector-doctrine/pull/464)) - \[typed-collections] Add CollectionDocblockGenericTypeRector ([#&#8203;463](https://github.com/rectorphp/rector-doctrine/pull/463)) - fix document service repository class ([#&#8203;462](https://github.com/rectorphp/rector-doctrine/pull/462)) - \[code-quality] add document repository support to AddAnnotationToRepositoryRector ([#&#8203;461](https://github.com/rectorphp/rector-doctrine/pull/461)) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] add local call support to ScalarArgumentToExpectedParamTypeRector ([#&#8203;543](https://github.com/rectorphp/rector-phpunit/pull/543)) - cover scalar argument in behat as well ([#&#8203;542](https://github.com/rectorphp/rector-phpunit/pull/542)) - \[CodeQuality] Skip not match position named argument on ScalarArgumentToExpectedParamTypeRector ([#&#8203;540](https://github.com/rectorphp/rector-phpunit/pull/540)) - add float support to scalar argument rule ([#&#8203;539](https://github.com/rectorphp/rector-phpunit/pull/539)) - Add nullable support to ScalarArgumentToExpectedParamTypeRector ([#&#8203;538](https://github.com/rectorphp/rector-phpunit/pull/538)) - \[CodeQuality] Handle crash on no [@&#8203;depends](https://github.com/depends) on AddParamTypeFromDependsRector ([#&#8203;537](https://github.com/rectorphp/rector-phpunit/pull/537)) ### [`v2.1.6`](https://github.com/rectorphp/rector/releases/tag/2.1.6): Released Rector 2.1.6 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.5...2.1.6) #### rectorphp/rector-phpunit - \[code-quality] add with() + callback() support to TypeWillReturnCallableArrowFunctionRector ([#&#8203;535](https://github.com/rectorphp/rector-phpunit/pull/535)) - \[CodeQuality] Handle crash on no @&#8203; depends on AddParamTypeFromDependsRector ([#&#8203;537](https://github.com/rectorphp/rector-phpunit/pull/537)) ### [`v2.1.5`](https://github.com/rectorphp/rector/releases/tag/2.1.5): Released Rector 2.1.5 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.4...2.1.5) #### New Features :partying\_face: - feat: add NarrowTooWideReturnTypeRector ([#&#8203;7150](https://github.com/rectorphp/rector-src/pull/7150)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[Php85] Add ColonAfterSwitchCaseRector ([#&#8203;7157](https://github.com/rectorphp/rector-src/pull/7157)) - feat: add StaticToSelfStaticPropertyFetchOnFinalClassRector ([#&#8203;7161](https://github.com/rectorphp/rector-src/pull/7161)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - feat: Add AddReturnDocblockForScalarArrayFromAssignsRector ([#&#8203;7151](https://github.com/rectorphp/rector-src/pull/7151)), Thanks [@&#8203;imliam](https://github.com/imliam)! - \[TypeDeclaration] Register AddReturnDocblockForScalarArrayFromAssignsRector to type declaration set ([#&#8203;7166](https://github.com/rectorphp/rector-src/pull/7166)) - Refactor `RemoveDuplicatedCaseInSwitchRector` and adding test cases ([#&#8203;7175](https://github.com/rectorphp/rector-src/pull/7175)), Thanks [@&#8203;max-s-lab](https://github.com/max-s-lab)! - \[Php85] Add ArrayKeyExistsNullToEmptyStringRector ([#&#8203;7183](https://github.com/rectorphp/rector-src/pull/7183)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[Php85] Add fixture to skip integer key on ArrayKeyExistsNullToEmptyStringRector ([#&#8203;7189](https://github.com/rectorphp/rector-src/pull/7189)) - \[Php85] Add ChrArgModuloRector ([#&#8203;7190](https://github.com/rectorphp/rector-src/pull/7190)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[assert] Kick of experimental rule, AddAssertArrayFromClassMethodDocblockRector ([#&#8203;7206](https://github.com/rectorphp/rector-src/pull/7206)) - \[php 8.3] Add json\_validate rule. ([#&#8203;7213](https://github.com/rectorphp/rector-src/pull/7213)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - Add MbStrContainsRector ([#&#8203;7199](https://github.com/rectorphp/rector-src/pull/7199)), Thanks [@&#8203;arshidkv12](https://github.com/arshidkv12)! - \[PHP 8.5] Rename constant `FILTER_DEFAULT` to `FILTER_UNSAFE_RAW` ([#&#8203;7209](https://github.com/rectorphp/rector-src/pull/7209)), Thanks [@&#8203;ddevsr](https://github.com/ddevsr)! - \[PHP 8.5] Convert `@deprecated` to `#[\Deprecated]` on constants ([#&#8203;7155](https://github.com/rectorphp/rector-src/pull/7155)), Thanks [@&#8203;DanielEScherzer](https://github.com/DanielEScherzer)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip integer index on string on AddArrowFunctionParamArrayWhereDimFetchRector ([#&#8203;7178](https://github.com/rectorphp/rector-src/pull/7178)) - \[TypeDeclaration] Skip Valid type from return doc and typed param on AddMethodCallBasedStrictParamTypeRector ([#&#8203;7172](https://github.com/rectorphp/rector-src/pull/7172)) - \[Renaming] Keep parentheses on RenameCastRector ([#&#8203;7153](https://github.com/rectorphp/rector-src/pull/7153)) - \[CodeQuality] Skip next inside array\_filter() on SimplifyEmptyArrayCheckRector ([#&#8203;7154](https://github.com/rectorphp/rector-src/pull/7154)) - Clean up ternary on ColonAfterSwitchCaseRector ([#&#8203;7158](https://github.com/rectorphp/rector-src/pull/7158)) - fix: convert static::\* to self::\* for all constant access in final classes ([#&#8203;7159](https://github.com/rectorphp/rector-src/pull/7159)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - fix: static to self static method call on final class ([#&#8203;7160](https://github.com/rectorphp/rector-src/pull/7160)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - fix multi-line error message format ([#&#8203;7164](https://github.com/rectorphp/rector-src/pull/7164)), Thanks [@&#8203;FeBe95](https://github.com/FeBe95)! - \[CodeQuality] Skip [@&#8203;final](https://github.com/final) doc with public property on ConvertStaticToSelfRector ([#&#8203;7168](https://github.com/rectorphp/rector-src/pull/7168)) - \[CodeQuality] Skip [@&#8203;final](https://github.com/final) doc with public class constant on ConvertStaticToSelfRector ([#&#8203;7170](https://github.com/rectorphp/rector-src/pull/7170)) - Ensure native ReflectionClassConstant->isFinal() exists by check real php version ([#&#8203;7171](https://github.com/rectorphp/rector-src/pull/7171)) - Fix `RemoveDuplicatedCaseInSwitchRector` behavior ([#&#8203;7173](https://github.com/rectorphp/rector-src/pull/7173)), Thanks [@&#8203;max-s-lab](https://github.com/max-s-lab)! - replace `PHP_EOL` with `\n` when used with symfony console ([#&#8203;7174](https://github.com/rectorphp/rector-src/pull/7174)), Thanks [@&#8203;FeBe95](https://github.com/FeBe95)! - \[CodeQuality] Handle parentheses inner if with assign on CombineIfRector ([#&#8203;7179](https://github.com/rectorphp/rector-src/pull/7179)) - \[DeadCode] Fix merge comments on RemoveAlwaysTrueIfConditionRector ([#&#8203;7181](https://github.com/rectorphp/rector-src/pull/7181)) - \[Naming] Skip rename override method from /vendor/ on RenameParamToMatchTypeRector ([#&#8203;7182](https://github.com/rectorphp/rector-src/pull/7182)) - \[Php84] Handle named key argument with flipped position on ArrayKeyExistsNullToEmptyStringRector ([#&#8203;7186](https://github.com/rectorphp/rector-src/pull/7186)) - skip constructor param hook on ReadOnlyPropertyRector ([#&#8203;7192](https://github.com/rectorphp/rector-src/pull/7192)), Thanks [@&#8203;tandev](https://github.com/tandev)! - \[Php84] Skip value extraction on ForeachToArray\* rules ([#&#8203;7193](https://github.com/rectorphp/rector-src/pull/7193)) - \[Scope] Handle Scope refreshing on Attribute on print string with NOWDOC ([#&#8203;7194](https://github.com/rectorphp/rector-src/pull/7194)) - \[Transform] Fix example config on FuncCallToNewRector ([#&#8203;7196](https://github.com/rectorphp/rector-src/pull/7196)) - \[Composer] Make InstalledPackageResolver::resolvedInstalledPackages nullable to verify cached package lists ([#&#8203;7210](https://github.com/rectorphp/rector-src/pull/7210)) - \[AutoImport] Do not rename different namespaced function on auto import + RenameFunctionRector ([#&#8203;7214](https://github.com/rectorphp/rector-src/pull/7214)) - Rectify ([#&#8203;7216](https://github.com/rectorphp/rector-src/pull/7216)) - \[DeadCode] Skip non-public \_\_clone() method on RemoveEmptyClassMethodRector ([#&#8203;7187](https://github.com/rectorphp/rector-src/pull/7187)) <br> #### Removed and reprecated :skull: - Throw Deprecatation on StaticToSelfStaticMethodCallOnFinalClassRector and ConvertStaticPrivateConstantToSelfRector ([#&#8203;7165](https://github.com/rectorphp/rector-src/pull/7165)) - \[Php85] Remove calls to deprecated no-op functions ([#&#8203;7128](https://github.com/rectorphp/rector-src/pull/7128)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[8.4]\[DeprecatedAnnotationToDeprecatedAttributeRector] Remove invalid example ([#&#8203;7202](https://github.com/rectorphp/rector-src/pull/7202)), Thanks [@&#8203;DanielEScherzer](https://github.com/DanielEScherzer)! - Remove removed "Rector\Symfony\Set\FOSRestSetList/JMSSetList/SensiolabsSetList" usage ([#&#8203;7204](https://github.com/rectorphp/rector-src/pull/7204)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - restore SymfonyInternalSetList to allow relative paths to sets, use internally only ([#&#8203;837](https://github.com/rectorphp/rector-symfony/pull/837)) - \[code-quality] add filter\_var() support to ParameterBagTypedGetMethodCallRector ([#&#8203;836](https://github.com/rectorphp/rector-symfony/pull/836)) - \[CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector ([#&#8203;835](https://github.com/rectorphp/rector-symfony/pull/835)) - \[code-quality] Add ParameterBagTypedGetMethodCallRector ([#&#8203;834](https://github.com/rectorphp/rector-symfony/pull/834)) - \[config] add symfony cache pool support to StringExtensionToConfigBuilderRector ([#&#8203;832](https://github.com/rectorphp/rector-symfony/pull/832)) - \[doctrine] add mapping type support to StringExtensionToConfigBuilderRector ([#&#8203;831](https://github.com/rectorphp/rector-symfony/pull/831)) - \[config] Add query/result cache doctrine support in StringExtensionToConfigBuilderRector ([#&#8203;830](https://github.com/rectorphp/rector-symfony/pull/830)) - \[config] Add monolog and dbal fixes to StringExtensionToConfigBuilderRector ([#&#8203;829](https://github.com/rectorphp/rector-symfony/pull/829)) - \[SYMFONY 7.4] replace function call routing ([#&#8203;828](https://github.com/rectorphp/rector-symfony/pull/828)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) *** #### rectorphp/rector-phpunit :green\_circle: - \[code-quality] Add ScalarArgumentToExpectedParamTypeRector ([#&#8203;533](https://github.com/rectorphp/rector-phpunit/pull/533)) - \[CodeQuality] Fix assertGreater/Less apply on AssertComparisonToSpecificMethodRector ([#&#8203;532](https://github.com/rectorphp/rector-phpunit/pull/532)) - \[CodeQuality] Skip docblock based type on AddReturnTypeToDependedRector ([#&#8203;530](https://github.com/rectorphp/rector-phpunit/pull/530)) - Remove unused check return with expr as already covered on ReturnAnalyzer ([#&#8203;529](https://github.com/rectorphp/rector-phpunit/pull/529)) - \[code-quality] Add AddReturnTypeToDependedRector ([#&#8203;528](https://github.com/rectorphp/rector-phpunit/pull/528)) - \[code-quality] Add AddParamTypeFromDependsRector ([#&#8203;525](https://github.com/rectorphp/rector-phpunit/pull/525)) - Fix target method on dataProvider on DataProviderAnnotationToAttributeRector ([#&#8203;524](https://github.com/rectorphp/rector-phpunit/pull/524)) - \[AnnotationToAttribute] Handle already in use on DataProviderAnnotationToAttributeRector ([#&#8203;523](https://github.com/rectorphp/rector-phpunit/pull/523)) - \[CodeQuality] Skip already has return type on TypeWillReturnCallableArrowFunctionRector ([#&#8203;518](https://github.com/rectorphp/rector-phpunit/pull/518)) - Drop MatchAssertEqualsExpectedTypeRector ([#&#8203;517](https://github.com/rectorphp/rector-phpunit/pull/517)) - \[CodeQuality] Handle crash on native "object" type on TypeWillReturnCallableArrowFunctionRector ([#&#8203;516](https://github.com/rectorphp/rector-phpunit/pull/516)) - \[CodeQuality] Skip return createMock() on TypeWillReturnCallableArrowFunctionRector ([#&#8203;515](https://github.com/rectorphp/rector-phpunit/pull/515)) - \[CodeQuality] Rename MatchAssertSameExpectedTypeRector to MatchAssertEqualsExpectedTypeRector to only apply on assertEquals ([#&#8203;514](https://github.com/rectorphp/rector-phpunit/pull/514)) - \[code-quality] Add MatchAssertSameExpectedTypeRector ([#&#8203;510](https://github.com/rectorphp/rector-phpunit/pull/510)) - add GetMockBuilderGetMockToCreateMockRector to code quality set ([#&#8203;509](https://github.com/rectorphp/rector-phpunit/pull/509)) *** #### rectorphp/rector-downgrade-php - \[DowngradePhp83] Add DowngradeJsonValidateRector ([#&#8203;313](https://github.com/rectorphp/rector-downgrade-php/pull/313)) - \[DowngradePhp81] Handle parent is void on DowngradeNeverTypeDeclarationRector ([#&#8203;311](https://github.com/rectorphp/rector-downgrade-php/pull/311)) - \[DowngradePhp81] Skip check version\_compare with if on DowngradeHashAlgorithmXxHashRector (part 3) ([#&#8203;309](https://github.com/rectorphp/rector-downgrade-php/pull/309)) - \[DowngradePhp81] Skip check version\_compare with ternary on DowngradeHashAlgorithmXxHashRector (part 2) ([#&#8203;308](https://github.com/rectorphp/rector-downgrade-php/pull/308)) - \[DowngradePhp81] Skip check php version with ternary on DowngradeHashAlgorithmXxHashRector (part 1) ([#&#8203;307](https://github.com/rectorphp/rector-downgrade-php/pull/307)) - \[DowngradePhp81] Add PHP\_VERSION\_ID < 80100 check on DowngradeSetAccessibleReflectionPropertyRector ([#&#8203;306](https://github.com/rectorphp/rector-downgrade-php/pull/306)) ### [`v2.1.4`](https://github.com/rectorphp/rector/releases/tag/2.1.4): Released Rector 2.1.4 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.3...2.1.4) #### Bugfixes :bug: - \[Php85] Rename deprecated casts ([#&#8203;7138](https://github.com/rectorphp/rector-src/pull/7138)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Console] Fix symfony/console diff broken on windows on symfony/console 6.4.24 ([#&#8203;7148](https://github.com/rectorphp/rector-src/pull/7148)) - Use active voice and improve rule definitions ([#&#8203;7146](https://github.com/rectorphp/rector-src/pull/7146)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! ### [`v2.1.3`](https://github.com/rectorphp/rector/releases/tag/2.1.3): Released: Rector 2.1.3 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.2...2.1.3) #### New Features :partying\_face: - Add `ClosureFromCallableToFirstClassCallableRector` rule ([#&#8203;7071](https://github.com/rectorphp/rector-src/pull/7071)), Thanks [@&#8203;devnix](https://github.com/devnix)! - \[Php81] added `RemoveReflectionSetAccessibleCallsRector` ([#&#8203;7085](https://github.com/rectorphp/rector-src/pull/7085)), Thanks [@&#8203;NickSdot](https://github.com/NickSdot)! - \[type-declaration] Add AddReturnTypeFromTryCatchTypeRector ([#&#8203;7099](https://github.com/rectorphp/rector-src/pull/7099)) - Add check phpstan if phpstan is running on preload.php ([#&#8203;7040](https://github.com/rectorphp/rector-src/pull/7040)) - \[type-coverage] Add support for same returned object in ReturnTypeFromReturnNewRector ([#&#8203;7096](https://github.com/rectorphp/rector-src/pull/7096)) - feat: add support for set, isset, and unset operations in ArrayDimFetchToMethodCallRector ([#&#8203;7095](https://github.com/rectorphp/rector-src/pull/7095)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[TypeDeclaration] Skip try catch finally different type on AddReturnTypeFromTryCatchTypeRector ([#&#8203;7101](https://github.com/rectorphp/rector-src/pull/7101)) - \[type-declaration] Add AddArrayFilterClosureParamTypeRector ([#&#8203;7111](https://github.com/rectorphp/rector-src/pull/7111)) - \[type-coverage] Improve AddArrowFunctionParamArrayWhereDimFetchRector to handle multiple functions ([#&#8203;7112](https://github.com/rectorphp/rector-src/pull/7112)) - add list<...> support to AddArrayFunctionClosureParamTypeRector ([#&#8203;7116](https://github.com/rectorphp/rector-src/pull/7116)) - feat: add `RemoveReadonlyPropertyVisibilityOnReadonlyClassRector` ([#&#8203;7115](https://github.com/rectorphp/rector-src/pull/7115)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - feat: add laravel to RectorConfigBuilder::withComposerBased ([#&#8203;7110](https://github.com/rectorphp/rector-src/pull/7110)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[Renaming] Add `RenameCastRector` ([#&#8203;7117](https://github.com/rectorphp/rector-src/pull/7117)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[type-declarations] Add TypedPropertyFromDocblockSetUpDefinedRector ([#&#8203;7135](https://github.com/rectorphp/rector-src/pull/7135)) ##### PHP 8.5 :rocket: - \[Php85] Add missing url about openssl\_pkey\_derive arg deprecation ([#&#8203;7141](https://github.com/rectorphp/rector-src/pull/7141)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Remove deprecated arg from openssl\_pkey\_derive calls ([#&#8203;7127](https://github.com/rectorphp/rector-src/pull/7127)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Remove arg from get\_defined\_functions calls ([#&#8203;7126](https://github.com/rectorphp/rector-src/pull/7126)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Remove context arg from finfo\_buffer calls ([#&#8203;7129](https://github.com/rectorphp/rector-src/pull/7129)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Rename socket\_set\_timeout function calls ([#&#8203;7121](https://github.com/rectorphp/rector-src/pull/7121)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Rename mysqli\_execute function calls ([#&#8203;7122](https://github.com/rectorphp/rector-src/pull/7122)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Rename deprecated SplObjectStorage methods ([#&#8203;7123](https://github.com/rectorphp/rector-src/pull/7123)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Rename deprecated PDO constants and methods ([#&#8203;7125](https://github.com/rectorphp/rector-src/pull/7125)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! - \[Php85] Replace null return with empty array in \_\_debugInfo ([#&#8203;7124](https://github.com/rectorphp/rector-src/pull/7124)), Thanks [@&#8203;mttsch](https://github.com/mttsch)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Handle crash on direct callable without params on AddArrayFunctionClosureParamTypeRector ([#&#8203;7131](https://github.com/rectorphp/rector-src/pull/7131)) - \[TypeDeclaration] Skip ArrayAccess as array item type on AddArrowFunctionParamArrayWhereDimFetchRector ([#&#8203;7113](https://github.com/rectorphp/rector-src/pull/7113)) - \[Renaming] Allow rename attribute on Param on RenameAttributeRector ([#&#8203;7072](https://github.com/rectorphp/rector-src/pull/7072)) - \[CodeQuality] Mirror comment on InlineConstructorDefaultToPropertyRector ([#&#8203;7074](https://github.com/rectorphp/rector-src/pull/7074)) - \[CodeQuality] Move logic directly for merge comments on InlineConstructorDefaultToPropertyRector ([#&#8203;7075](https://github.com/rectorphp/rector-src/pull/7075)) - \[CodingStyle] Fix variable in the middle on WrapEncapsedVariableInCurlyBracesRector ([#&#8203;7076](https://github.com/rectorphp/rector-src/pull/7076)) - \[CodeQuality] Skip Never type by [@&#8203;return](https://github.com/return) docblock on ExplicitReturnNullRector ([#&#8203;7078](https://github.com/rectorphp/rector-src/pull/7078)) - \[Naming] Skip var used after switch on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;7080](https://github.com/rectorphp/rector-src/pull/7080)) - \[Naming] Use ScopeFetcher::fetch() near its usage on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;7081](https://github.com/rectorphp/rector-src/pull/7081)) - \[AutoImport] Handle auto import short name on global namespace ([#&#8203;7086](https://github.com/rectorphp/rector-src/pull/7086)) - \[TypeDeclaration] Skip ArrayAccess on StrictArrayParamDimFetchRector ([#&#8203;7087](https://github.com/rectorphp/rector-src/pull/7087)) - \[Php81] Handle on ternary on NullToStrictStringFuncCallArgRector ([#&#8203;7091](https://github.com/rectorphp/rector-src/pull/7091)) - fix: sorting of named parameters in variadic functions ([#&#8203;7090](https://github.com/rectorphp/rector-src/pull/7090)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - fix: skip AssignOps in ArrayDimFetchToMethodCallRector ([#&#8203;7100](https://github.com/rectorphp/rector-src/pull/7100)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - Skip PhpdocTypesFixer of PhpCsFixer on Scalar node ([#&#8203;7103](https://github.com/rectorphp/rector-src/pull/7103)) - fix: skip variable assignments in get\_defined\_vars ([#&#8203;7106](https://github.com/rectorphp/rector-src/pull/7106)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[Php80] Skip not match property hook type with parameter type on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;7109](https://github.com/rectorphp/rector-src/pull/7109)) - \[DeadCode] Early check GenericTypeNode is not dead code on DeadVar/ReturnParam Analyzer ([#&#8203;7118](https://github.com/rectorphp/rector-src/pull/7118)) - \[Config] Allow php85: true on withPhpSets() ([#&#8203;7130](https://github.com/rectorphp/rector-src/pull/7130)) - \[Php84] Allow on return on ForeachToArrayAnyRector ([#&#8203;7119](https://github.com/rectorphp/rector-src/pull/7119)), Thanks [@&#8203;Orest-Divintari](https://github.com/Orest-Divintari)! - \[TypeDeclaration] Keep Generic type docblock on TypedPropertyFromDocblockSetUpDefinedRector ([#&#8203;7140](https://github.com/rectorphp/rector-src/pull/7140)) - fix: allow more nodes to be passed to AttributeGroupNewLiner ([#&#8203;7145](https://github.com/rectorphp/rector-src/pull/7145)), Thanks [@&#8203;calebdw](https://github.com/calebdw)! - \[DeadCode] Skip used in compact() on RemoveUnusedForeachKeyRector ([#&#8203;7073](https://github.com/rectorphp/rector-src/pull/7073)) - \[DeadCode] Handle assign on Arg on RemoveUnusedPrivatePropertyRector ([#&#8203;7092](https://github.com/rectorphp/rector-src/pull/7092)) - \[DeadCode] Skip Templated type on param and return on RemoveUselessParamTagRector and RemoveUselessReturnTagRector under IntersectionType ([#&#8203;7093](https://github.com/rectorphp/rector-src/pull/7093)) - \[DeadCode] Skip mixed fallback null on trait on RemoveAlwaysTrueIfConditionRector ([#&#8203;7098](https://github.com/rectorphp/rector-src/pull/7098)) - \[DeadCode] Skip with first class callable on RemoveUnusedPrivateMethodParameterRector ([#&#8203;7104](https://github.com/rectorphp/rector-src/pull/7104)) - \[DeadCode] Skip with get\_defined\_vars() on RemoveUnusedPrivateMethodParameterRector (\[[#&#8203;7105](https://github.com/rectorphp/rector/issues/7105)]\([rectorphp/rector-src#7105](https://github.com/rectorphp/rector-src/pull/7105) *** <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Skip got duplicated method after suffix removed on ActionSuffixRemoverRector ([#&#8203;827](https://github.com/rectorphp/rector-symfony/pull/827)) - Keep AsCommand in InvokableCommandInputAttributeRector documentation ([#&#8203;824](https://github.com/rectorphp/rector-symfony/pull/824)), Thanks [@&#8203;bobvandevijver](https://github.com/bobvandevijver) <br> *** <br> #### rectorphp/rector-doctrine :orange_circle: - \[CodeQuality] Keep param/return doc with description on TypeNullableEntityFromDocblockRector ([#&#8203;460](https://github.com/rectorphp/rector-doctrine/pull/460)) - \[code-quality] Add TypeNullableEntityFromDocblockRector to add safe types to doctrine entities ([#&#8203;459](https://github.com/rectorphp/rector-doctrine/pull/459)) <br> *** <br> #### rectorphp/rector-phpunit :green_circle: - Cover array shape iterator for YieldDataProviderRector+RemoveUselessReturnTagRector. ([#&#8203;505](https://github.com/rectorphp/rector-phpunit/pull/505)), Thanks [@&#8203;biozshock](https://github.com/biozshock) ### [`v2.1.2`](https://github.com/rectorphp/rector/releases/tag/2.1.2): Released Rector 2.1.2 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.1...2.1.2) #### Bugfixes :bug: - \[Php82] Handle array dim fetch variable on VariableInStringInterpolationFixerRector ([#&#8203;7060](https://github.com/rectorphp/rector-src/pull/7060)) - \[Php82] Ensure ArrayDimFetch var is Variable to transform {$ on VariableInStringInterpolationFixerRector ([#&#8203;7061](https://github.com/rectorphp/rector-src/pull/7061)) - Update LNumber and DNumber to Int\_ and Float\_ ([#&#8203;7062](https://github.com/rectorphp/rector-src/pull/7062)) - \[DeadCode] Handle crash on empty content on SimplifyIfElseWithSameContentRector ([#&#8203;7063](https://github.com/rectorphp/rector-src/pull/7063)) - Fix return on SimplifyIfElseWithSameContentRector ([#&#8203;7064](https://github.com/rectorphp/rector-src/pull/7064)) - \[CodeQuality] Skip when class has \_\_isset() method on IssetOnPropertyObjectToPropertyExistsRector ([#&#8203;7067](https://github.com/rectorphp/rector-src/pull/7067)) - \[ReplaceArgumentDefaultValueRector] handle multiple replace argument values ([#&#8203;9256](https://github.com/rectorphp/rector/issues/9256)) ([#&#8203;7068](https://github.com/rectorphp/rector-src/pull/7068)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan)! <br> #### New Features :partying_face: - \[Php56] Add parentheses on unary minus pow left on PowToExpRector ([#&#8203;7065](https://github.com/rectorphp/rector-src/pull/7065)) <br> #### Removed :skull: - \[removal] Remove RectorConfigBuilderRector as not maintained and broken ([#&#8203;7066](https://github.com/rectorphp/rector-src/pull/7066)) #### rectorphp/rector-symfony - \[SYMFONY 4.4] replace Link withRel and withoutRel argument values with constants ([#&#8203;821](https://github.com/rectorphp/rector-symfony/pull/821)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[SYMFONY 5.1] replace Cookie withSameSite argument values with constants ([#&#8203;819](https://github.com/rectorphp/rector-symfony/pull/819)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[SYMFONY 4.2] replace Cookie argument values with constants ([#&#8203;818](https://github.com/rectorphp/rector-symfony/pull/818)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[SYMFONY 3.2] replace Cookie argument values with constants ([#&#8203;817](https://github.com/rectorphp/rector-symfony/pull/817)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[SYMFONY 6.3] replace Link argument values with constants ([#&#8203;816](https://github.com/rectorphp/rector-symfony/pull/816)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[Symfony73] Handle nested array on ConstraintOptionsToNamedArgumentsRector ([#&#8203;815](https://github.com/rectorphp/rector-symfony/pull/815)) - \[Symfony 74] Rename Application::add() to Application::addCommand() ([#&#8203;813](https://github.com/rectorphp/rector-symfony/pull/813)), Thanks [@&#8203;mttsch](https://github.com/mttsch) - \[SYMFONY 4.4] replace Link argument values with constants ([#&#8203;812](https://github.com/rectorphp/rector-symfony/pull/812)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[Symfony 74] Rename Application::add() to Application::addCommand() ([#&#8203;809](https://github.com/rectorphp/rector-symfony/pull/809)), Thanks [@&#8203;mttsch](https://github.com/mttsch) #### rectorphp/rector-doctrine - Update deprecated ArrayItem, Lnumber to use under Node, and Int\_ instead ([#&#8203;456](https://github.com/rectorphp/rector-doctrine/pull/456)) #### rectorphp/rector-phpunit - Update to use ArrayItem under Node ([#&#8203;504](https://github.com/rectorphp/rector-phpunit/pull/504)) #### rectorphp/rector-downgrade-php - \[DowngradePhp80] Handle not match [@&#8203;return](https://github.com/return) with native return type on DowngradeUnionTypeDeclarationRector ([#&#8203;295](https://github.com/rectorphp/rector-downgrade-php/pull/295)) - Clean up origNode set on DowngradeArrayAllRector ([#&#8203;294](https://github.com/rectorphp/rector-downgrade-php/pull/294)) - \[DowngradePhp84] Add DowngradeArrayFindKeyRector ([#&#8203;293](https://github.com/rectorphp/rector-downgrade-php/pull/293)) - \[DowngradePhp84] Add DowngradeArrayFindRector ([#&#8203;292](https://github.com/rectorphp/rector-downgrade-php/pull/292)) - \[DowngradePhp84] Add DowngradeArrayAnyRector ([#&#8203;291](https://github.com/rectorphp/rector-downgrade-php/pull/291)) - \[DowngradePhp84] Add DowngradeArrayAllRector ([#&#8203;290](https://github.com/rectorphp/rector-downgrade-php/pull/290)) ### [`v2.1.1`](https://github.com/rectorphp/rector/releases/tag/2.1.1): Released Rector 2.1.1 [Compare Source](https://github.com/rectorphp/rector/compare/2.1.0...2.1.1) #### New Features :partying\_face: - \[Php84] Add message name on multilines on DeprecatedAnnotationToDeprecatedAttributeRector ([#&#8203;7030](https://github.com/rectorphp/rector-src/pull/7030)) - Add SortNamedParamRector ([#&#8203;7047](https://github.com/rectorphp/rector-src/pull/7047)), Thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! <br> #### Bugfixes :bug: - \[CodeQuality] Properly handle Goto\_ on ExplicitReturnNullRector ([#&#8203;7018](https://github.com/rectorphp/rector-src/pull/7018)) - \[Php84] Skip non-array on ForeachToArray\* rules ([#&#8203;7023](https://github.com/rectorphp/rector-src/pull/7023)) - \[Console] Handle hidden "process" with --option without = on ConsoleApplication ([#&#8203;7022](https://github.com/rectorphp/rector-src/pull/7022)) - \[Php80] Handle with property hook on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;7024](https://github.com/rectorphp/rector-src/pull/7024)) - \[Scoped] Exclude DateRangeError on Scoper for prefixing ([#&#8203;7027](https://github.com/rectorphp/rector-src/pull/7027)) - \[Php84] Handle multi lines text on DeprecatedAnnotationToDeprecatedAttributeRector ([#&#8203;7028](https://github.com/rectorphp/rector-src/pull/7028)) - \[Php55] Avoid $scope = ScopeFetcher::fetch($node); when not needed on GetCalledClassToStaticClassRector ([#&#8203;7029](https://github.com/rectorphp/rector-src/pull/7029)) - Fix crash on ExactCompareFactory::createBooleanAnd/Or ([#&#8203;7031](https://github.com/rectorphp/rector-src/pull/7031)) - Move ScopeFetcher::fetch() to near its usage ([#&#8203;7032](https://github.com/rectorphp/rector-src/pull/7032)) - \[CodeQuality]\[Php84] Handle crash on ForeachToArrayFindRector+OptionalParametersAfterRequiredRector ([#&#8203;7033](https://github.com/rectorphp/rector-src/pull/7033)) - \[Php84] Skip foreach value used after foreach on ForeachToArray\* rules ([#&#8203;7034](https://github.com/rectorphp/rector-src/pull/7034)) - \[Php84] Handle key used on conditional on ForeachToArray\* rules ([#&#8203;7035](https://github.com/rectorphp/rector-src/pull/7035)) - \[code-quality] Make ctor defined dynamic properties private, as most probably case ([#&#8203;7036](https://github.com/rectorphp/rector-src/pull/7036)) - \[PostRector] Keep first comment after declare(strict\_types=1) on UnusedImportRemovingPostRector ([#&#8203;7042](https://github.com/rectorphp/rector-src/pull/7042)) - \[Php80] Make configurable to allow skip on model based classes on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;7043](https://github.com/rectorphp/rector-src/pull/7043)) - \[Kaizen] Save kaizen applied rules into cache to make works on parallel ([#&#8203;7046](https://github.com/rectorphp/rector-src/pull/7046)) - \[Kaizen] No need filter unchanged files when --kaizen is used ([#&#8203;7050](https://github.com/rectorphp/rector-src/pull/7050)) - \[Kaizen] When no files changed, early return empty on FilesFinder, even on kaizen ([#&#8203;7051](https://github.com/rectorphp/rector-src/pull/7051)) - \[Kaizen] Enforce clear cache when there is files changed + kaizen enabled ([#&#8203;7052](https://github.com/rectorphp/rector-src/pull/7052)) - Fix ambiguous variable name ([#&#8203;7053](https://github.com/rectorphp/rector-src/pull/7053)) - \[Php84] Handle with space on message like class name constant on DeprecatedAnnotationToDeprecatedAttributeRector ([#&#8203;7056](https://github.com/rectorphp/rector-src/pull/7056)) - \[CodeQuality] LogicalToBooleanRector should add parentheses on equal ([#&#8203;7048](https://github.com/rectorphp/rector-src/pull/7048)) - \[Kaizen] Remove unneeded clean kaizen cache since all cache cleared early when there are files to be changed + kaizen enabled ([#&#8203;7054](https://github.com/rectorphp/rector-src/pull/7054)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - Fix code style issues ([#&#8203;810](https://github.com/rectorphp/rector-symfony/pull/810)), Thanks [@&#8203;mttsch](https://github.com/mttsch) - \[Symfony 74] Rename Application::add() to Application::addCommand() ([#&#8203;809](https://github.com/rectorphp/rector-symfony/pull/809)), Thanks [@&#8203;mttsch](https://github.com/mttsch) - Fix links to Symfony 7.2/7.3 upgrade documents ([#&#8203;808](https://github.com/rectorphp/rector-symfony/pull/808)), Thanks [@&#8203;mttsch](https://github.com/mttsch) - \[Symfony 7.3] Handle existing named array arguments in ConstraintOptionsToNamedArgumentsRector ([#&#8203;807](https://github.com/rectorphp/rector-symfony/pull/807)), Thanks [@&#8203;gharlan](https://github.com/gharlan) - \[Symfony 73] add ConstraintOptionsToNamedArgumentsRector ([#&#8203;806](https://github.com/rectorphp/rector-symfony/pull/806)), Thanks [@&#8203;pedrocasado](https://github.com/pedrocasado) - Twig attributes: make methods public ([#&#8203;805](https://github.com/rectorphp/rector-symfony/pull/805)), Thanks [@&#8203;gharlan](https://github.com/gharlan) - AddVoteArgumentToVoteOnAttributeRector ([#&#8203;804](https://github.com/rectorphp/rector-symfony/pull/804)), Thanks [@&#8203;tugmaks](https://github.com/tugmaks) - \[CodeQuality] Skip first class callable on StringCastDebugResponseRector ([#&#8203;803](https://github.com/rectorphp/rector-symfony/pull/803)) - \[code-quality] Add StringCastDebugResponseRector ([#&#8203;802](https://github.com/rectorphp/rector-symfony/pull/802)) - add casting to string to AssertSameResponseCodeWithDebugContentsRector as response can be null, and message requires string ([#&#8203;801](https://github.com/rectorphp/rector-symfony/pull/801)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[dbal 3.8] Add MigrateQueryBuilderResetQueryPartRector ([#&#8203;455](https://github.com/rectorphp/rector-doctrine/pull/455)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi) <br> #### rectorphp/rector-phpunit :green_circle: - feat: make AddCoversClassAttributeRector configurable ([#&#8203;502](https://github.com/rectorphp/rector-phpunit/pull/502)), Thanks [@&#8203;canvural](https://github.com/canvural) - Support PHPUnit 12 in composer based set ([#&#8203;501](https://github.com/rectorphp/rector-phpunit/pull/501)), Thanks [@&#8203;alleknalle](https://github.com/alleknalle) - \[Attribute] Handle comment below [@&#8203;dataProvider](https://github.com/dataProvider) doc on DataProviderAnnotationToAttributeRector ([#&#8203;500](https://github.com/rectorphp/rector-phpunit/pull/500)) - \[code-quality] Add StringCastAssertStringContainsStringRector ([#&#8203;498](https://github.com/rectorphp/rector-phpunit/pull/498)) ### [`v2.1.0`](https://github.com/rectorphp/rector/releases/tag/2.1.0): Released Rector 2.1 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.19...2.1.0) This release comes with new PHP 8.4 rules and 2 new config options, that make rules more powerful :muscle: <br> #### New Features :partying_face: - \[PHP 8.4] Implement array\_find\_key upgrade ([#&#8203;7008](https://github.com/rectorphp/rector-src/pull/7008)), Thanks [@&#8203;xHeaven](https://github.com/xHeaven)! - \[PHP 8.4] Implement array\_find upgrade ([#&#8203;7009](https://github.com/rectorphp/rector-src/pull/7009)), Thanks [@&#8203;xHeaven](https://github.com/xHeaven)! - \[PHP 8.4] Implement array\_all upgrade ([#&#8203;7011](https://github.com/rectorphp/rector-src/pull/7011)), Thanks [@&#8203;xHeaven](https://github.com/xHeaven)! - \[PHP 8.4] Implement array\_any upgrade ([#&#8203;7010](https://github.com/rectorphp/rector-src/pull/7010)), Thanks [@&#8203;xHeaven](https://github.com/xHeaven)! - \[code-quality] add `TernaryImplodeToImplodeRector` ([#&#8203;6994](https://github.com/rectorphp/rector-src/pull/6994)) In this release we also add 2 DX features to streamline upgrades: - \[DX] Add ->withTreatClassesAsFinal() on so can be used in typed rules ([#&#8203;6974](https://github.com/rectorphp/rector-src/pull/6974)) - this extends more conservative rules to apply on classes that are not final - \[experimental] Add `--kaizen` option to apply only first X rules at a time ([#&#8203;6876](https://github.com/rectorphp/rector-src/pull/6876)) - this option will apply first X rules; especially great to make upgrade steps small, but relevant - check the PR for more <br> #### Bugfixes :bug: - \[Php80] Skip non-abstract method trait on AddParamBasedOnParentClassMethodRector ([#&#8203;6992](https://github.com/rectorphp/rector-src/pull/6992)) - \[Php81] Skip has JMS attribute on ReadOnlyPropertyRector ([#&#8203;6979](https://github.com/rectorphp/rector-src/pull/6979)) - \[TypeDeclaration] Move JMS class string definition constant to ClassName value object ([#&#8203;6980](https://github.com/rectorphp/rector-src/pull/6980)) - \[PhpAttribute] Ensure count($attributeGroups) before loop to avoid repetitive annotation product only single AttributeGroup ([#&#8203;6985](https://github.com/rectorphp/rector-src/pull/6985)) - \[code-quality] use direct instanceof instead of dummy null, if nullable object type is known ([#&#8203;6987](https://github.com/rectorphp/rector-src/pull/6987)) - Fix object type in TypedPropertyFromJMSSerializerAttributeTypeRector ([#&#8203;6989](https://github.com/rectorphp/rector-src/pull/6989)) - ExplicitReturnNullRector: skip on goto ([#&#8203;6988](https://github.com/rectorphp/rector-src/pull/6988)), Thanks [@&#8203;staabm](https://github.com/staabm)! - fix invalid string property type without default in PropertyTypeFromStrictSetterGetterRector ([#&#8203;6993](https://github.com/rectorphp/rector-src/pull/6993)) - \[CodeQuality] Skip first class callable on TernaryImplodeToImplodeRector ([#&#8203;6997](https://github.com/rectorphp/rector-src/pull/6997)) - Fix: Array Duplicated Key which is dynamic ([#&#8203;6999](https://github.com/rectorphp/rector-src/pull/6999)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Php83] Ensure class->isAbstract() on FeatureFlags::treatClassesAsFinal() check ([#&#8203;7003](https://github.com/rectorphp/rector-src/pull/7003)) - \[TypeDeclaration] Handle crash on generic iterable on TypedPropertyFromJMSSerializerAttributeTypeRector ([#&#8203;7004](https://github.com/rectorphp/rector-src/pull/7004)) - \[TypeDeclaration] Use common has < string for detect iterable types ([#&#8203;7005](https://github.com/rectorphp/rector-src/pull/7005)) - Covers scenario where func\_get\_args used in constructor ([#&#8203;7006](https://github.com/rectorphp/rector-src/pull/7006)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[DeadCode] Move Param used via variadic functions to ParamAnalyzer ([#&#8203;7016](https://github.com/rectorphp/rector-src/pull/7016)) - \[DeadCode] Skip used by unpack and named argument on RemoveUnusedPrivateMethodParameterRector ([#&#8203;6976](https://github.com/rectorphp/rector-src/pull/6976)) - \[DeadCode] Handle multiple default on RemoveArgumentFromDefaultParentCallRector ([#&#8203;6978](https://github.com/rectorphp/rector-src/pull/6978)) - \[DeadCode] Skip abstract method on RemoveUnusedPublicMethodParameterRector ([#&#8203;7002](https://github.com/rectorphp/rector-src/pull/7002)) - \[DeadCode] Allow named argument removal if argument position is equal with parameter position equal name on RemoveUnusedPrivateMethodParameterRector ([#&#8203;6977](https://github.com/rectorphp/rector-src/pull/6977)) - \[Php80] Skip used in finally on RemoveUnusedVariableInCatchRector ([#&#8203;6982](https://github.com/rectorphp/rector-src/pull/6982)) - \[DeadCode] Allow remove normal param that mix with property promotion on RemoveUnusedConstructorParamRector ([#&#8203;7017](https://github.com/rectorphp/rector-src/pull/7017)) <br> #### rectorphp/rector-symfony :musical_note: - fix to type arg name ([#&#8203;800](https://github.com/rectorphp/rector-symfony/pull/800)) - \[jms] Add AccessorAnnotationToAttributeRector ([#&#8203;799](https://github.com/rectorphp/rector-symfony/pull/799)) - \[jms] Add custom AccessTypeAnnotationToAttributeRector to handle annotation flip to attribute correctly ([#&#8203;798](https://github.com/rectorphp/rector-symfony/pull/798)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[typed-collections] Add RemoveNullFromInstantiatedArrayCollectionPropertyRector ([#&#8203;452](https://github.com/rectorphp/rector-doctrine/pull/452)) - skip behats ([#&#8203;451](https://github.com/rectorphp/rector-doctrine/pull/451)) - skip RemoveIfInstanceofCollectionRector in tests ([#&#8203;450](https://github.com/rectorphp/rector-doctrine/pull/450)) - add generic union support ([#&#8203;448](https://github.com/rectorphp/rector-doctrine/pull/448)) - add param / return test fixture ([#&#8203;447](https://github.com/rectorphp/rector-doctrine/pull/447)) - add docblock support to NarrowArrayCollectionToCollectionRector ([#&#8203;446](https://github.com/rectorphp/rector-doctrine/pull/446)) - initialize default array even for non-entity-property collections ([#&#8203;445](https://github.com/rectorphp/rector-doctrine/pull/445)) - remover default null ([#&#8203;444](https://github.com/rectorphp/rector-doctrine/pull/444)) - add local call setter support ([#&#8203;443](https://github.com/rectorphp/rector-doctrine/pull/443)) - Add intersection support to NarrowPropertyUnionToCollectionRector ([#&#8203;442](https://github.com/rectorphp/rector-doctrine/pull/442)) - remove nullable property type ([#&#8203;441](https://github.com/rectorphp/rector-doctrine/pull/441)) - Add native return type declaration support to NarrowReturnUnionToCollectionRector ([#&#8203;440](https://github.com/rectorphp/rector-doctrine/pull/440)) - add array-filter to ArrayMapOnCollectionToArrayRector ([#&#8203;439](https://github.com/rectorphp/rector-doctrine/pull/439)) - \[typed-collections] Add CurrentOnCollectionToArrayRector ([#&#8203;438](https://github.com/rectorphp/rector-doctrine/pull/438)) - \[typed-collections] Add RemoveUselessIsEmptyAssignRector ([#&#8203;437](https://github.com/rectorphp/rector-doctrine/pull/437)) - add boolean and not null case ([#&#8203;436](https://github.com/rectorphp/rector-doctrine/pull/436)) - skip it ([#&#8203;435](https://github.com/rectorphp/rector-doctrine/pull/435)) - \[typed-collections] Add RemoveIfCollectionIdenticalToNullRector ([#&#8203;434](https://github.com/rectorphp/rector-doctrine/pull/434)) - add native property type support to NarrowPropertyUnionToCollectionRector ([#&#8203;433](https://github.com/rectorphp/rector-doctrine/pull/433)) - add union null type support to RemoveNullFromNullableCollectionTypeRector ([#&#8203;431](https://github.com/rectorphp/rector-doctrine/pull/431)) - add nullable property doclbock support to RemoveNullFromNullableCollectionTypeRector ([#&#8203;430](https://github.com/rectorphp/rector-doctrine/pull/430)) - \[typed-collections] Add ArrayOffsetSetToSetCollectionCallRector ([#&#8203;429](https://github.com/rectorphp/rector-doctrine/pull/429)) - include message as well ([#&#8203;428](https://github.com/rectorphp/rector-doctrine/pull/428)) - add static call support to AssertSameCountOnCollectionToAssertCountRector ([#&#8203;427](https://github.com/rectorphp/rector-doctrine/pull/427)) - keep args in RemoveNullsafeOnCollectionRector ([#&#8203;426](https://github.com/rectorphp/rector-doctrine/pull/426)) - \[typed-collections] Add AssertSameCountOnCollectionToAssertCountRector ([#&#8203;425](https://github.com/rectorphp/rector-doctrine/pull/425)) - \[typed-collections] Add RemoveAssertNotNullOnCollectionRector ([#&#8203;424](https://github.com/rectorphp/rector-doctrine/pull/424)) - \[typed-collections] Add AssertNullOnCollectionToAssertEmptyRector ([#&#8203;423](https://github.com/rectorphp/rector-doctrine/pull/423)) ### [`v2.0.19`](https://github.com/rectorphp/rector/compare/2.0.18...2.0.19) [Compare Source](https://github.com/rectorphp/rector/compare/2.0.18...2.0.19) ### [`v2.0.18`](https://github.com/rectorphp/rector/releases/tag/2.0.18): Released: Rector 2.0.18 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.17...2.0.18) #### New Features :partying\_face: - Bump to PHP-Parser ^5.5.0 ([#&#8203;6946](https://github.com/rectorphp/rector-src/pull/6946)) - \[DeadCode] Add RemoveArgumentFromDefaultParentCallRector ([#&#8203;6949](https://github.com/rectorphp/rector-src/pull/6949)) - \[DeadCode] Add RemoveDeadCatchRector rule ([#&#8203;6939](https://github.com/rectorphp/rector-src/pull/6939)), Thanks [@&#8203;P3gucka](https://github.com/P3gucka)! <br> #### Bugfixes :bug: - \[Php80] Add more exact Expr node that always bool for switch(true) usage on ChangeSwitchToMatchRector ([#&#8203;6965](https://github.com/rectorphp/rector-src/pull/6965)) - \[Php80] Prevent adding empty return when stringable always throws ([#&#8203;6968](https://github.com/rectorphp/rector-src/pull/6968)), Thanks [@&#8203;Mika-](https://github.com/Mika-)! - \[php 8.0] Check if class is an attribute in AnnotationToAttributeRector, to avoid non-attribute bug ([#&#8203;6954](https://github.com/rectorphp/rector-src/pull/6954)) - \[Transform] Fix FQCN usage on new name on MergeInterfacesRector ([#&#8203;6956](https://github.com/rectorphp/rector-src/pull/6956)) - Rectify ([#&#8203;6957](https://github.com/rectorphp/rector-src/pull/6957)) - \[Printer] Skip change new line as space on anonymous class on print ([#&#8203;6958](https://github.com/rectorphp/rector-src/pull/6958)) - \[Printer] Use regex string new space detection for anonymous class ([#&#8203;6959](https://github.com/rectorphp/rector-src/pull/6959)) - \[Php80] Handle dynamic bool expr on ChangeSwitchToMatchRector ([#&#8203;6961](https://github.com/rectorphp/rector-src/pull/6961)) - \[Php80] Do not change to match(true) on defined case cond on ChangeSwitchToMatchRector ([#&#8203;6962](https://github.com/rectorphp/rector-src/pull/6962)) - \[Php80] Do not change to match(true) on variable from param on case cond on ChangeSwitchToMatchRector ([#&#8203;6963](https://github.com/rectorphp/rector-src/pull/6963)) - Fix fixture file name ([#&#8203;6964](https://github.com/rectorphp/rector-src/pull/6964)) - \[Renaming] \[Symfony 7.0] Skip ClassConstFetch that rename its ->class to Interface that constant not exists in new interface ([#&#8203;6966](https://github.com/rectorphp/rector-src/pull/6966)) - Fix stub ([#&#8203;6967](https://github.com/rectorphp/rector-src/pull/6967)) - \[DeadCode] Clean up useless union StmtsAwareInterface|ClassMethod on TerminatedNodeAnalyzer ([#&#8203;6969](https://github.com/rectorphp/rector-src/pull/6969)) - \[Php80] Handle has silent void on StringableForToStringRector ([#&#8203;6970](https://github.com/rectorphp/rector-src/pull/6970)) - \[PostRector] Clean up rename process on ClassRenamingPostRector ([#&#8203;6971](https://github.com/rectorphp/rector-src/pull/6971)) - \[DeadCode] Early check skip no extends on RemoveDefaultArgumentFromParentCallRector ([#&#8203;6950](https://github.com/rectorphp/rector-src/pull/6950)) - \[DeadCode] Allow remove createMock method call on RemoveUnusedVariableAssignRector ([#&#8203;6951](https://github.com/rectorphp/rector-src/pull/6951)) - \[DeadCode] Skip when next catch is parent class exception with special treatment over just throw on RemoveDeadCatchRector ([#&#8203;6952](https://github.com/rectorphp/rector-src/pull/6952)) <br> #### rectorphp/rector-symfony :musical_note: - \[Symfony 7.3] Handle commands without configure method in InvokableCommandInputAttributeRector ([#&#8203;797](https://github.com/rectorphp/rector-symfony/pull/797)), Thanks [@&#8203;gharlan](https://github.com/gharlan) - \[Symfony 7.3] Handle fluent call addArgument and addOption on InvokableCommandInputAttributeRector ([#&#8203;795](https://github.com/rectorphp/rector-symfony/pull/795)) - Twig attributes: add required first param ([#&#8203;793](https://github.com/rectorphp/rector-symfony/pull/793)), Thanks [@&#8203;gharlan](https://github.com/gharlan) - Fix namespace of console Option attribute ([#&#8203;792](https://github.com/rectorphp/rector-symfony/pull/792)), Thanks [@&#8203;gharlan](https://github.com/gharlan) - fix: Normalize variable names by replacing hyphens with underscores in Symfony73 command argument and option processing ([#&#8203;790](https://github.com/rectorphp/rector-symfony/pull/790)), Thanks [@&#8203;antoniovj1](https://github.com/antoniovj1) - remove return tags in TemplateAnnotationToThisRenderRector as no longer needed ([#&#8203;788](https://github.com/rectorphp/rector-symfony/pull/788)) - return array if is array type in TemplateAnnotationToThisRenderRector ([#&#8203;786](https://github.com/rectorphp/rector-symfony/pull/786)) - Bump to php-parser 5.5.0 and update fixture attributes usage ([#&#8203;784](https://github.com/rectorphp/rector-symfony/pull/784)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[typed-collections] Add RemoveNullsafeOnCollectionRector ([#&#8203;420](https://github.com/rectorphp/rector-doctrine/pull/420)) - skip assign of New\_ to CollectionParamTypeSetterToCollectionPropertyRector ([#&#8203;419](https://github.com/rectorphp/rector-doctrine/pull/419)) - fix reprint of type in CollectionSetterParamNativeTypeRector ([#&#8203;418](https://github.com/rectorphp/rector-doctrine/pull/418)) - Various improvements in typed-collections set ([#&#8203;417](https://github.com/rectorphp/rector-doctrine/pull/417)) - Skip RemoveNullFromNullableCollectionTypeRector if not exactly 1 param or in tests ([#&#8203;416](https://github.com/rectorphp/rector-doctrine/pull/416)) - \[typed-collections] allow 2nd+ param to be nullable in CollectionSetterParamNativeTypeRector as most likely null can be passed as non-setter ([#&#8203;415](https://github.com/rectorphp/rector-doctrine/pull/415)) - cleanup redundant fixtures, single rule ([#&#8203;414](https://github.com/rectorphp/rector-doctrine/pull/414)) - \[Dbal40] Skip different object on ExecuteQueryParamsToBindValueRector ([#&#8203;413](https://github.com/rectorphp/rector-doctrine/pull/413)) - \[dbal 4.0] Add ExecuteQueryParamsToBindValueRector ([#&#8203;412](https://github.com/rectorphp/rector-doctrine/pull/412)) - \[dbal 4.0] Add deprecated PDO class to enum like ([#&#8203;411](https://github.com/rectorphp/rector-doctrine/pull/411)) - \[dbal 4.2] Add AddArrayResultColumnNamesRector ([#&#8203;410](https://github.com/rectorphp/rector-doctrine/pull/410)) <br> #### rectorphp/rector-downgrade-php :arrow_down: - \[DowngradePhp73] Real patch for previous node token just swapped with trailing comma and named argument (take 2) ([#&#8203;288](https://github.com/rectorphp/rector-downgrade-php/pull/288)) - \[Test] Add more test fixture for downgrade named argument with trailing comma ([#&#8203;287](https://github.com/rectorphp/rector-downgrade-php/pull/287)) - \[Down to PHP 7.2] Handle download named argument with trailing comma ([#&#8203;285](https://github.com/rectorphp/rector-downgrade-php/pull/285)) ### [`v2.0.17`](https://github.com/rectorphp/rector/releases/tag/2.0.17): Released: Rector 2.0.17 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.16...2.0.17) #### New Features :partying\_face: - \[Php85] Add ArrayFirstLastRector ([#&#8203;6900](https://github.com/rectorphp/rector-src/pull/6900)) - Use active voice and add markdown style for code blocks ([#&#8203;6897](https://github.com/rectorphp/rector-src/pull/6897)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! - \[Php83] Add ReadOnlyAnonymousClassRector ([#&#8203;6916](https://github.com/rectorphp/rector-src/pull/6916)) - \[Php83] Add DynamicClassConstFetchRector ([#&#8203;6922](https://github.com/rectorphp/rector-src/pull/6922)) - \[Test] Add test for crash after reprint Stmt ([#&#8203;6924](https://github.com/rectorphp/rector-src/pull/6924)) - \[Command] Fix to make additionalAutoloader->autoloadPaths() works on both parallel and non-parallel proccess ([#&#8203;6927](https://github.com/rectorphp/rector-src/pull/6927)) - \[Alternative] Add EnumCaseToPascalCaseRector with use of DynamicSourceLocatorProvider ([#&#8203;6899](https://github.com/rectorphp/rector-src/pull/6899)) <br> #### Bugfixes :bug: - Directly use isNames() in rector rules ([#&#8203;6896](https://github.com/rectorphp/rector-src/pull/6896)) - \[StrContainsRector] also replace multibyte functions fro strpos and strstr ([#&#8203;6901](https://github.com/rectorphp/rector-src/pull/6901)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan)! - \[DeadCode] IsClassMethodUsedAnalyzer needs to use Scope from Class\_ level ([#&#8203;6910](https://github.com/rectorphp/rector-src/pull/6910)) - \[Php84] Skip with parentheses on class on NewMethodCallWithoutParenthesesRector ([#&#8203;6911](https://github.com/rectorphp/rector-src/pull/6911)) - \[CodeQuality] Skip Assign Op on ternary on SimplifyUselessVariableRector ([#&#8203;6913](https://github.com/rectorphp/rector-src/pull/6913)) - Rectify to trigger latest build ([#&#8203;6914](https://github.com/rectorphp/rector-src/pull/6914)) - \[Php82] Handle implicit public readonly on ReadOnlyClassRector ([#&#8203;6919](https://github.com/rectorphp/rector-src/pull/6919)) - Use dynamic check on last on ClassConstManipulator ([#&#8203;6921](https://github.com/rectorphp/rector-src/pull/6921)) - bump ([rectorphp/rector-src@`695228f`](https://github.com/rectorphp/rector-src/commit/695228f5f5da2ac53931301bd3fe1812bfbe4f3d)) - \[Naming] Re-use repetitive DateTimeInterface object type check on services into PropertyNaming service ([#&#8203;6926](https://github.com/rectorphp/rector-src/pull/6926)) - \[AutoImport] Skip conflict aliased with docblock on auto import ([#&#8203;6929](https://github.com/rectorphp/rector-src/pull/6929)) - \[AutoImport] Skip reserved class names on auto import ([#&#8203;6933](https://github.com/rectorphp/rector-src/pull/6933)) - \[AutoImport] Fix empty uses on auto import + rename class on no namespaced file ([#&#8203;6935](https://github.com/rectorphp/rector-src/pull/6935)) - \[Php83] Fix invalid constant use READONLY\_CLASS -> READONLY\_ANONYMOUS\_CLASS on ReadOnlyAnonymousClassRector ([#&#8203;6936](https://github.com/rectorphp/rector-src/pull/6936)) - fix: RenameMethodRector does not rename trait methods ([#&#8203;6928](https://github.com/rectorphp/rector-src/pull/6928)), Thanks [@&#8203;LordSimal](https://github.com/LordSimal)! - \[CodeQuality] Skip late static binding use on CompleteDynamicPropertiesRector ([#&#8203;6938](https://github.com/rectorphp/rector-src/pull/6938)) - \[dx] report false skipped rules in more nicer way ([#&#8203;6941](https://github.com/rectorphp/rector-src/pull/6941)) - \[PHP84] Deprecated annotation to Deprecated attribute ([#&#8203;6923](https://github.com/rectorphp/rector-src/pull/6923)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Renaming] Allow rename method in trait itself on RenameMethodRector ([#&#8203;6942](https://github.com/rectorphp/rector-src/pull/6942)) - \[Renaming] Handle rename caller on trait on RenameMethodRector ([#&#8203;6944](https://github.com/rectorphp/rector-src/pull/6944)) - \[TypeDeclaration] Fix crash on already return static on AddReturnTypeDeclarationRector ([#&#8203;6940](https://github.com/rectorphp/rector-src/pull/6940)) - \[TypeDeclaration] Handle crash on return different over static on AddReturnTypeDeclarationRector-a ([#&#8203;6943](https://github.com/rectorphp/rector-src/pull/6943)) <br> #### Removed :skull: - Use active voice and remove note about PHPUnit ([#&#8203;6907](https://github.com/rectorphp/rector-src/pull/6907)), Thanks [@&#8203;simonschaufi](https://github.com/simonschaufi)! - \[DeadCode] Skip used by Array callable on RemoveEmptyClassMethodRector ([#&#8203;6908](https://github.com/rectorphp/rector-src/pull/6908)) - \[DeadCode] Use IsClassMethodUsedAnalyzer service on RemoveEmptyClassMethodRector ([#&#8203;6909](https://github.com/rectorphp/rector-src/pull/6909)) - \[DeadCode] Handle called by static call on RemoveUnusedPrivateMethodParameterRector ([#&#8203;6912](https://github.com/rectorphp/rector-src/pull/6912)) - \[DeadCode] Skip used by $this on RemoveUnusedPrivateClassConstantRector ([#&#8203;6920](https://github.com/rectorphp/rector-src/pull/6920)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - Update to use ramsey/composer-install\@&#8203;v2 ([#&#8203;782](https://github.com/rectorphp/rector-symfony/pull/782)) - \[Symfony 7.3] Make \_\_invoke() public in InvokableCommandInputAttributeRector ([#&#8203;779](https://github.com/rectorphp/rector-symfony/pull/779)), Thanks [@&#8203;mickverm](https://github.com/mickverm) - Fix ClassConstFetch use on InvokableCommandInputAttributeRector ([#&#8203;778](https://github.com/rectorphp/rector-symfony/pull/778)) - \[Symfony 7.3] handle name from constant on InvokableCommandInputAttributeRector ([#&#8203;777](https://github.com/rectorphp/rector-symfony/pull/777)) - \[Symfony 7.3] Remove Argument argument: mode on InvokableCommandInputAttributeRector ([#&#8203;776](https://github.com/rectorphp/rector-symfony/pull/776)), Thanks [@&#8203;mickverm](https://github.com/mickverm) - \[Symfony 7.3] Make nullable argument param type on Optional InputArgument::OPTIONAL on InvokableCommandInputAttributeRector ([#&#8203;775](https://github.com/rectorphp/rector-symfony/pull/775)) - \[Symfony 7.3] Keep $output param on InvokableCommandInputAttributeRector ([#&#8203;774](https://github.com/rectorphp/rector-symfony/pull/774)) - \[Symfony 7.3] Add Argument arguments: name, mode, description on InvokableCommandInputAttributeRector ([#&#8203;773](https://github.com/rectorphp/rector-symfony/pull/773)) - \[Symfony 7.3] Handle with #\[\Override] on InvokableCommandInputAttributeRector ([#&#8203;772](https://github.com/rectorphp/rector-symfony/pull/772)) <br> #### rectorphp/rector-doctrine :orange_circle: - skip default param array, to respect colleciton type ([#&#8203;408](https://github.com/rectorphp/rector-doctrine/pull/408)) - Add array<> support to /NarrowParamUnionToCollectionRector ([#&#8203;407](https://github.com/rectorphp/rector-doctrine/pull/407)) - \[typed-collections] Add CollectionSetterParamNativeTypeRector ([#&#8203;406](https://github.com/rectorphp/rector-doctrine/pull/406)) - only remove new array collection to a new property ([#&#8203;405](https://github.com/rectorphp/rector-doctrine/pull/405)) - Update to use ramsey/composer-install\@&#8203;v2 ([#&#8203;404](https://github.com/rectorphp/rector-doctrine/pull/404)) - \[typed-collections] Add embed many support InitializeCollectionInConstructorRector ([#&#8203;403](https://github.com/rectorphp/rector-doctrine/pull/403)) - Add static call support to setter array collection wrap ([#&#8203;402](https://github.com/rectorphp/rector-doctrine/pull/402)) - \[typed-collections] Decouple RemoveIsArrayOnCollectionRector ([#&#8203;401](https://github.com/rectorphp/rector-doctrine/pull/401)) - \[typed-collections] Allow new array in tests for RemoveNewArrayCollectionOutsideConstructorRector ([#&#8203;400](https://github.com/rectorphp/rector-doctrine/pull/400)) - \[typed-collections] Allow new array in tests for RemoveNewArrayCollectionOutsideConstructorRector ([#&#8203;399](https://github.com/rectorphp/rector-doctrine/pull/399)) - \[typed-collections] Add nullable support to array wrapper rule ([#&#8203;398](https://github.com/rectorphp/rector-doctrine/pull/398)) - \[TypedCollections] Use directly param->type->type assign on RemoveNullFromNullableCollectionTypeRector ([#&#8203;397](https://github.com/rectorphp/rector-doctrine/pull/397)) - \[typed-collections] Add RemoveNullFromNullableCollectionTypeRector rule ([#&#8203;396](https://github.com/rectorphp/rector-doctrine/pull/396)) - Typed collections fixes ([#&#8203;395](https://github.com/rectorphp/rector-doctrine/pull/395)) - \[typed-collections] remove DefaultNewArrayCollectionRector as duplicate of InitializeCollectionInConstructorRector ([#&#8203;394](https://github.com/rectorphp/rector-doctrine/pull/394)) - Fix scoper Doctrine class in use statement prefixed with RectorPrefix ([#&#8203;393](https://github.com/rectorphp/rector-doctrine/pull/393)) - \[typed-collections] Add dozens of rules to handle doctrine collection types ([#&#8203;392](https://github.com/rectorphp/rector-doctrine/pull/392)) - Rename ExplicitRelationCollectionRector to InitializeCollectionInConstructorRector ([#&#8203;391](https://github.com/rectorphp/rector-doctrine/pull/391)) - \[typed-collections] Make TypedPropertyFromToManyRelationTypeRector work only for native types, docblocks are handled in another rule ([#&#8203;390](https://github.com/rectorphp/rector-doctrine/pull/390)) - \[typed-collections] Decouple new namespace and move 4 rules there ([#&#8203;389](https://github.com/rectorphp/rector-doctrine/pull/389)) - Directly use isName(s) and getName() on rector rules ([#&#8203;388](https://github.com/rectorphp/rector-doctrine/pull/388)) - Add mapped superclass case to ToManyRelationPropertyTypeResolver ([#&#8203;387](https://github.com/rectorphp/rector-doctrine/pull/387)) - Remove array on collection in TypedPropertyFromToManyRelationTypeRector ([#&#8203;386](https://github.com/rectorphp/rector-doctrine/pull/386)) - Remove default null value in TypedPropertyFromToManyRelationTypeRector ([#&#8203;384](https://github.com/rectorphp/rector-doctrine/pull/384)) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] Add additional non-static methods to NonAssertNonStaticMethods ([#&#8203;497](https://github.com/rectorphp/rector-phpunit/pull/497)), Thanks [@&#8203;philiprabbett](https://github.com/philiprabbett) - \[CodeQuality] Skip in static arrow function on PreferPHPUnitThisCallRector ([#&#8203;496](https://github.com/rectorphp/rector-phpunit/pull/496)) - Update to use ramsey/composer-install\@&#8203;v2 ([#&#8203;495](https://github.com/rectorphp/rector-phpunit/pull/495)) - Only remove [@&#8203;covers](https://github.com/covers) when target exists ([#&#8203;494](https://github.com/rectorphp/rector-phpunit/pull/494)) - PHPUnit 10/11 Only set attribute when target attribute class exists on CoversAnnotationWithValueToAttributeRector ([#&#8203;493](https://github.com/rectorphp/rector-phpunit/pull/493)) - \[AnnotationsToAttributes] Apply to class level on [@&#8203;uses](https://github.com/uses) on AnnotationWithValueToAttributeRector ([#&#8203;492](https://github.com/rectorphp/rector-phpunit/pull/492)) - \[PHPUnit 12] Add RemoveOverrideFinalConstructTestCaseRector ([#&#8203;491](https://github.com/rectorphp/rector-phpunit/pull/491)) - \[CodeQuality] Skip with if else condition result on AddInstanceofAssertForNullableInstanceRector ([#&#8203;489](https://github.com/rectorphp/rector-phpunit/pull/489)) ### [`v2.0.16`](https://github.com/rectorphp/rector/releases/tag/2.0.16): Released Rector 2.0.16 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.15...2.0.16) #### New Features :partying\_face: - \[dx] add symfonyRoute and symfonyValidator option to ->withAttributesSets() to ease upgrade ([#&#8203;6882](https://github.com/rectorphp/rector-src/pull/6882)) - \[nette/utils] \[4.0] Add upgrade set to handle named args in Json class ([#&#8203;6884](https://github.com/rectorphp/rector-src/pull/6884)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip \_\_destruct() from add return type based on parent on AddReturnTypeDeclarationBasedOnParentClassMethodRector ([#&#8203;6883](https://github.com/rectorphp/rector-src/pull/6883)) - \[CodeQuality] Skip with init non empty dynamic array on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;6881](https://github.com/rectorphp/rector-src/pull/6881)) - UseIdenticalOverEqualWithSameTypeRector should not trust phpdoc ([#&#8203;6880](https://github.com/rectorphp/rector-src/pull/6880)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Php70] Handle class named Pool on Php4ConstructorRector ([#&#8203;6887](https://github.com/rectorphp/rector-src/pull/6887)) - \[Php73] Handle key() called multiple times on ArrayKeyFirstLastRector ([#&#8203;6888](https://github.com/rectorphp/rector-src/pull/6888)) - Clean up repetitive recursive call and flag on ArrayKeyFirstLastRector ([#&#8203;6889](https://github.com/rectorphp/rector-src/pull/6889)) - \[Config] Handle config realpath() actually has asterisk, not pattern ([#&#8203;6891](https://github.com/rectorphp/rector-src/pull/6891)) - \[Php82] Handle implicit "public" on construtor promotion on ReadOnlyClassRector ([#&#8203;6895](https://github.com/rectorphp/rector-src/pull/6895)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[Symfony73] Skip different object on GetFunctionsToAsTwigFunctionAttributeRector ([#&#8203;767](https://github.com/rectorphp/rector-symfony/pull/767)) - skip magic first class callable ([#&#8203;766](https://github.com/rectorphp/rector-symfony/pull/766)) - \[symfony 7.2] AddPushRequestToRequestStackConstructorRector ([#&#8203;765](https://github.com/rectorphp/rector-symfony/pull/765)) - \[Symfony 7.3] kick off GetFunctionsToAsTwigFunctionAttributeRector ([#&#8203;764](https://github.com/rectorphp/rector-symfony/pull/764)) - \[Symfony 7.3] Handle first class callable on GetFiltersToAsTwigFilterAttributeRector ([#&#8203;763](https://github.com/rectorphp/rector-symfony/pull/763)) - Register symfony73-twig-bundle into Symfony7SetProvider ([#&#8203;762](https://github.com/rectorphp/rector-symfony/pull/762)) - \[symfony 7.3] Add GetFiltersToAsTwigFilterAttributeRector to migrate #\[TwigFilter] ([#&#8203;761](https://github.com/rectorphp/rector-symfony/pull/761)) - \[code-quality] Improve TemplateAnnotationToThisRenderRector to keep ternary types ([#&#8203;758](https://github.com/rectorphp/rector-symfony/pull/758)) - Keep JsonResponse type ([#&#8203;757](https://github.com/rectorphp/rector-symfony/pull/757)) - Remove array shape return in TemplateAnnotationToThisRenderRector as no longer used ([#&#8203;755](https://github.com/rectorphp/rector-symfony/pull/755)) - Add attribute support to TemplateAnnotationToThisRenderRector ([#&#8203;754](https://github.com/rectorphp/rector-symfony/pull/754)) - \[7.3] Update InvokableCommandRector to InvokableCommandInputAttributeRector to improve discoverability ([#&#8203;743](https://github.com/rectorphp/rector-symfony/pull/743)) <br> #### rectorphp/rector-doctrine :orange_circle: - Remove array on collection in TypedPropertyFromToManyRelationTypeRector ([#&#8203;386](https://github.com/rectorphp/rector-doctrine/pull/386)) - Remove default null value in TypedPropertyFromToManyRelationTypeRector ([#&#8203;384](https://github.com/rectorphp/rector-doctrine/pull/384)) - \[collection] Add embed many annotation support to TypedPropertyFromToManyRelationTypeRector ([#&#8203;383](https://github.com/rectorphp/rector-doctrine/pull/383)) - Fix `#[AsListener]` attribute location to doctrine bundle 2.8, deprecate doctrine constants and refer to composer based sets ([#&#8203;382](https://github.com/rectorphp/rector-doctrine/pull/382)) <br> #### rectorphp/rector-phpunit :green_circle: - Detect Test Attribute in TestsNodeAnalyzer::isTestClassMethod ([#&#8203;486](https://github.com/rectorphp/rector-phpunit/pull/486)), Thanks [@&#8203;Levivb](https://github.com/Levivb) - \[code-quality] Skip ctor to setup in ConstructClassMethodToSetUpTestCaseRector for non-test classes, e.g. helpers ([#&#8203;485](https://github.com/rectorphp/rector-phpunit/pull/485)) - \[phpunit 10] Add ParentTestClassConstructorRector ([#&#8203;484](https://github.com/rectorphp/rector-phpunit/pull/484)) ### [`v2.0.15`](https://github.com/rectorphp/rector/releases/tag/2.0.15): Released Rector 2.0.15 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.14...2.0.15) #### New features and changes :tada: - \[parallel] bump default threads from 16 to 32 to keep up with modern technology ([#&#8203;6877](https://github.com/rectorphp/rector-src/pull/6877)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Reduce repetitive new ObjectType() on each properties on TypedPropertyFromCreateMockAssignRector ([#&#8203;6869](https://github.com/rectorphp/rector-src/pull/6869)) - \[CodeQuality] Handle with parentheses on SimplifyIfReturnBoolRector ([#&#8203;6871](https://github.com/rectorphp/rector-src/pull/6871)) - \[Naming] Skip protected property on non-final class on RenamePropertyToMatchTypeRector ([#&#8203;6872](https://github.com/rectorphp/rector-src/pull/6872)) - \[PHPStan 2.1.14] Fix resolve \_\_toString() parent non builtin method without return type ([#&#8203;6879](https://github.com/rectorphp/rector-src/pull/6879)) - \[phpstan] prefer isName() from abstract class over protected service ([#&#8203;6875](https://github.com/rectorphp/rector-src/pull/6875)) - \[DeadCode] Skip value from docblock on RemoveFilterVarOnExactTypeRector ([#&#8203;6873](https://github.com/rectorphp/rector-src/pull/6873)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[symfony 6.2] Fix attribute adding on abstract class in MessageHandlerInterfaceToAttributeRector ([#&#8203;724](https://github.com/rectorphp/rector-symfony/pull/724)) <br> #### rectorphp/rector-phpunit :green_circle: - \[depre] Remove deprecated AssertCountWithZeroToAssertEmptyRector ([#&#8203;483](https://github.com/rectorphp/rector-phpunit/pull/483)) - Ensure that rule PreferPHPUnitSelfCall refactor call only for static methods, not any ([#&#8203;482](https://github.com/rectorphp/rector-phpunit/pull/482)), Thanks [@&#8203;andrew-demb](https://github.com/andrew-demb) - \[tests] add test fixture for double instanceof check ([#&#8203;481](https://github.com/rectorphp/rector-phpunit/pull/481)) - \[PhpUnit] Skip different object on PreferPHPUnit(This/Self)CallRector ([#&#8203;480](https://github.com/rectorphp/rector-phpunit/pull/480)) ### [`v2.0.14`](https://github.com/rectorphp/rector/releases/tag/2.0.14): Released Rector 2.0.14 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.13...2.0.14) #### Bugfixes :bug: - \[EarlyReturn] Skip re-assign in loop on PreparedValueToEarlyReturnRector ([#&#8203;6867](https://github.com/rectorphp/rector-src/pull/6867)) - \[EarlyReturn] Only check on loop when initialAssign is set on PreparedValueToEarlyReturnRector ([#&#8203;6868](https://github.com/rectorphp/rector-src/pull/6868)) ### [`v2.0.13`](https://github.com/rectorphp/rector/releases/tag/2.0.13): Released Rector 2.0.13 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.12...2.0.13) #### Bugfixes :bug: - \[naming] Skip public properties in RenamePropertyToMatchTypeRector to avoid external code conflicts ([#&#8203;6860](https://github.com/rectorphp/rector-src/pull/6860)) - feat: handle edge cases of DateFuncCallToCarbonRector ([#&#8203;6822](https://github.com/rectorphp/rector-src/pull/6822)), Thanks [@&#8203;tony-stark-eth](https://github.com/tony-stark-eth)! - \[CodeQuality] Skip ArrayDimFetch on IssetOnPropertyObjectToPropertyExistsRector ([#&#8203;6862](https://github.com/rectorphp/rector-src/pull/6862)) - \[type-declaration] Skip intersection type on TypedPropertyFromCreateMockAssignRector ([#&#8203;6863](https://github.com/rectorphp/rector-src/pull/6863)) - \[Configuration] Fix composer resolver with custom vendor-dir ([#&#8203;6864](https://github.com/rectorphp/rector-src/pull/6864)), Thanks [@&#8203;maxime-vf](https://github.com/maxime-vf)! - Ensure pass string on PathNormalizer::normalize() on InstalledPackageResolver ([#&#8203;6865](https://github.com/rectorphp/rector-src/pull/6865)) <br> #### rectorphp/rector-symfony :musical_note: - \[Symfony 7.3] add constant and test for 7.3 and test help to attribute [#&#8203;718](https://github.com/rectorphp/rector/issues/718) ([#&#8203;722](https://github.com/rectorphp/rector-symfony/pull/722)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - Update fixture on parent construct empty usage ([#&#8203;719](https://github.com/rectorphp/rector-symfony/pull/719)) <br> #### rectorphp/rector-doctrine :orange_circle: - improve add generics annotation to repository to code quality doctrine set ([#&#8203;380](https://github.com/rectorphp/rector-doctrine/pull/380)) ### [`v2.0.12`](https://github.com/rectorphp/rector/releases/tag/2.0.12): Released Rector 2.0.12 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.11...2.0.12) #### New Features :partying\_face: - \[dx] \[experimental] Prepend command name automatically if only paths are passed ([#&#8203;6759](https://github.com/rectorphp/rector-src/pull/6759)) ```bash # before vendor/bin/rector process src # now - default command is run, no need to write the sole main command manually vendor/bin/rector src ``` - \[Configuration] \[experimental] Add ability to specify file path without extension ([#&#8203;6839](https://github.com/rectorphp/rector-src/pull/6839)) - \[type-declaration] Add AddClosureParamArrayWhereDimFetchRector ([#&#8203;6815](https://github.com/rectorphp/rector-src/pull/6815)) - \[dx] add test to check that a rule is not applied if it does not change the code ([#&#8203;6794](https://github.com/rectorphp/rector-src/pull/6794)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[renaming Add enum support to rename method ([#&#8203;6832](https://github.com/rectorphp/rector-src/pull/6832)) - \[Php83] Make configurable to allow add #\[\Override] on override empty method on AddOverrideAttributeToOverriddenMethodsRector ([#&#8203;6831](https://github.com/rectorphp/rector-src/pull/6831)) - \[Transform] Follow parent construct before add new param on StaticCallToMethodCallRector ([#&#8203;6854](https://github.com/rectorphp/rector-src/pull/6854)) <br> #### Bugfixes :bug: - Skip DateTime from property type to property renaming to keep code readable ([#&#8203;6812](https://github.com/rectorphp/rector-src/pull/6812)) - Add a hint how to upgrade custom `SetListInterface` to Rector 2.0 ([#&#8203;6816](https://github.com/rectorphp/rector-src/pull/6816)), Thanks [@&#8203;alexander-schranz](https://github.com/alexander-schranz)! - Return if var type has changed in PhpDocTypeChanger ([#&#8203;6813](https://github.com/rectorphp/rector-src/pull/6813)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - fix: RenamePropertyToMatchTypeRector renames DateTimeInterface ([#&#8203;6814](https://github.com/rectorphp/rector-src/pull/6814)), Thanks [@&#8203;tony-stark-eth](https://github.com/tony-stark-eth)! - \[TypeDeclaration] ReturnTypeFromStrictNewArrayRector support list ([#&#8203;6820](https://github.com/rectorphp/rector-src/pull/6820)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Php80] Handle null value on AnnotationToAttributeRector ([#&#8203;6821](https://github.com/rectorphp/rector-src/pull/6821)) - \[DeadCode] Handle crash on no stmts on ReplaceBlockToItsStmtsRector ([#&#8203;6824](https://github.com/rectorphp/rector-src/pull/6824)) - \[type-declaration] Override existing wrong type on TypedPropertyFromCreateMockAssignRector ([#&#8203;6826](https://github.com/rectorphp/rector-src/pull/6826)) - \[TypeDeclaration] Skip already typed with PHPUnit\Framework\MockObject\MockObject on TypedPropertyFromCreateMockAssignRector ([#&#8203;6827](https://github.com/rectorphp/rector-src/pull/6827)) - \[NodeTypeResolver] Pass null on 2nd arg on ReflectionProvider->getFunction() to ensure get correct function ([#&#8203;6829](https://github.com/rectorphp/rector-src/pull/6829)) - \[Php80] Handle aliased with multi properties on AnnotationToAttributeRector ([#&#8203;6838](https://github.com/rectorphp/rector-src/pull/6838)) - \[Configuration] Fix root standalone registered rules verify on RectorConfigBuilder ([#&#8203;6840](https://github.com/rectorphp/rector-src/pull/6840)) - \[Php73] Fix escaped single quote on RegexDashEscapeRector ([#&#8203;6843](https://github.com/rectorphp/rector-src/pull/6843)) - \[Php80] Handle crash on [@&#8203;testdoc](https://github.com/testdoc) with rector-phpunit AnnotationWithValueToAttributeRector ([#&#8203;6846](https://github.com/rectorphp/rector-src/pull/6846)) - Fix scoped error on ClassConstFetchAnnotationToAttributeMapper ([#&#8203;6848](https://github.com/rectorphp/rector-src/pull/6848)) - \[PhpAttribute] Handle multi double colon on AnnotationWithValueToAttributeRector ([#&#8203;6851](https://github.com/rectorphp/rector-src/pull/6851)) - \[Transform] Follow empty parent construct parameters on StaticCallToMethodCallRector ([#&#8203;6855](https://github.com/rectorphp/rector-src/pull/6855)) - \[TypeDeclaration] Skip with closure inside on AddArrowFunctionParamArrayWhereDimFetchRector ([#&#8203;6817](https://github.com/rectorphp/rector-src/pull/6817)) - \[Php71] Skip replaced native function on RemoveExtraParametersRector ([#&#8203;6828](https://github.com/rectorphp/rector-src/pull/6828)) - \[DeadCode] Skip switch break not unreachable on RemoveUnreachableStatementRector ([#&#8203;6837](https://github.com/rectorphp/rector-src/pull/6837)) *** #### rectorphp/rector-symfony :musical\_note: - Clean up #\[RunClassInSeparateProcess] tweak ([#&#8203;721](https://github.com/rectorphp/rector-symfony/pull/721)) - \[CodeQuality] Handle crash on no extensions on StringExtensionToConfigBuilderRector ([#&#8203;717](https://github.com/rectorphp/rector-symfony/pull/717)) - add ampersand support ([#&#8203;716](https://github.com/rectorphp/rector-symfony/pull/716)) - \[code-quality] Add SplitAndSecurityAttributeToIsGrantedRector ([#&#8203;715](https://github.com/rectorphp/rector-symfony/pull/715)) - \[code-quality] Add SecurityAttributeToIsGrantedRector ([#&#8203;714](https://github.com/rectorphp/rector-symfony/pull/714)) - \[code-quality] Add attribute-existance check to SecurityAttributeToIsGrantedAttributeRector, add to code-quality set ([#&#8203;713](https://github.com/rectorphp/rector-symfony/pull/713)) - Skip excluded tag in container ([#&#8203;710](https://github.com/rectorphp/rector-symfony/pull/710)), Thanks [@&#8203;Myks92](https://github.com/Myks92) <br> #### rectorphp/rector-doctrine :orange_circle: - \[NodeAnalyzer] Handle no repositoryClass on RepositoryClassResolver ([#&#8203;379](https://github.com/rectorphp/rector-doctrine/pull/379)) - Fix ImproveDoctrineCollectionDocTypeInEntityRector ([#&#8203;378](https://github.com/rectorphp/rector-doctrine/pull/378)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados) - Fix YamlToAttributeDoctrineMappingRector ([#&#8203;377](https://github.com/rectorphp/rector-doctrine/pull/377)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados) <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPUnit100] Skip already key = null on RemoveNamedArgsInDataProviderRector ([#&#8203;475](https://github.com/rectorphp/rector-phpunit/pull/475)) - \[PHPUnit90] Handle crash on different object without second arg on SpecificAssertContainsWithoutIdentityRector ([#&#8203;474](https://github.com/rectorphp/rector-phpunit/pull/474)) - add test fixture ([#&#8203;473](https://github.com/rectorphp/rector-phpunit/pull/473)) - Fix RemoveNamedArgsInDataProviderRector so that it is not applied if no change is made ([#&#8203;472](https://github.com/rectorphp/rector-phpunit/pull/472)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados) - \[CodeQuality] fix assertInstanceOf casing ([#&#8203;471](https://github.com/rectorphp/rector-phpunit/pull/471)), Thanks [@&#8203;staabm](https://github.com/staabm) - \[CodeQuality] Handle crash on multiple assert cause undefined variable on AddInstanceofAssertForNullableInstanceRector ([#&#8203;470](https://github.com/rectorphp/rector-phpunit/pull/470)) ### [`v2.0.11`](https://github.com/rectorphp/rector/releases/tag/2.0.11): Released Rector 2.0.11 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.10...2.0.11) #### New Features 🎉 - \[TypeDeclaration] Handle nested method crashes on `AddParamTypeBasedOnPHPUnitDataProviderRector` ([#&#8203;6772](https://github.com/rectorphp/rector-src/pull/6772)) - \[TypeDeclaration] Skip void return on callback docblock in `AddArrowFunctionReturnTypeRector` ([#&#8203;6780](https://github.com/rectorphp/rector-src/pull/6780)) - \[Php84] Add `AddEscapeArgumentRector` ([#&#8203;6782](https://github.com/rectorphp/rector-src/pull/6782)) ([#&#8203;6790](https://github.com/rectorphp/rector-src/pull/6790)) - \[dead-code] Add `RemoveFilterVarOnExactTypeRector` ([#&#8203;6792](https://github.com/rectorphp/rector-src/pull/6792)) [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[Php84] Add `NewMethodCallWithoutParenthesesRector` ([#&#8203;6802](https://github.com/rectorphp/rector-src/pull/6802)) - \[CodingStyle] Add `FunctionLikeToFirstClassCallableRector` ([#&#8203;6667](https://github.com/rectorphp/rector-src/pull/6667)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Rector Rule] Replace `date`, `strtotime`, and `time` calls with `Carbon` equivalents ([#&#8203;6749](https://github.com/rectorphp/rector-src/pull/6749)), Thanks [@&#8203;gollumeo](https://github.com/gollumeo)! <br> #### Bugfixes :bug: - Fix `AddReturnArrayDocblockBasedOnArrayMapRector` ([#&#8203;6800](https://github.com/rectorphp/rector-src/pull/6800)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix `AddParamTypeBasedOnPHPUnitDataProviderRector` ([#&#8203;6799](https://github.com/rectorphp/rector-src/pull/6799)), Thanks - \[dx] Log rules registered in both `withRules()` and sets, keeping them once to avoid duplication ([#&#8203;6761](https://github.com/rectorphp/rector-src/pull/6761)) - Fix method name in `StaticCallToMethodCallRector` ([#&#8203;6789](https://github.com/rectorphp/rector-src/pull/6789)), Thanks [@&#8203;parth391](https://github.com/parth391)! - Fix `MultiDirnameRector` ([#&#8203;6796](https://github.com/rectorphp/rector-src/pull/6796)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix `ConsecutiveNullCompareReturnsToNullCoalesceQueueRector` ([#&#8203;6797](https://github.com/rectorphp/rector-src/pull/6797)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix `WrapReturnRector` ([#&#8203;6798](https://github.com/rectorphp/rector-src/pull/6798)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix `ArgumentDefaultValueReplacer` ([#&#8203;6795](https://github.com/rectorphp/rector-src/pull/6795)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix `ParamTypeByMethodCallTypeRector` ([#&#8203;6803](https://github.com/rectorphp/rector-src/pull/6803)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix nested alias unused import ([#&#8203;6807](https://github.com/rectorphp/rector-src/pull/6807)), Thanks [@&#8203;Myks92](https://github.com/Myks92)! - \[CodeQuality] Improve `SimplifyIfElseToTernaryRector` to handle binary operations on the left ([#&#8203;6810](https://github.com/rectorphp/rector-src/pull/6810)) - Update `AnonymousFunctionFactory` to disallow superglobal variables in use statements ([#&#8203;6811](https://github.com/rectorphp/rector-src/pull/6811)), Thanks [@&#8203;bryannielsen](https://github.com/bryannielsen)! <br> #### Removed & Deprecations 🗑️ - \[deprecation] Add explicit warning to deprecated `withPhpPolyfill()` method and error on `withPhpSets()` misuse on PHP 7.4- projects - \[DeadCode] Skip used-by-property hook on `RemoveUnusedPromotedPropertyRector` ([#&#8203;6765](https://github.com/rectorphp/rector-src/pull/6765)) - \[DeadCode] Skip side-effect cases on `RemoveDeadLoopRector` ([#&#8203;6770](https://github.com/rectorphp/rector-src/pull/6770)) - \[deprecated] Remove deprecated `AbstractScopeAwareRector` ([#&#8203;6791](https://github.com/rectorphp/rector-src/pull/6791)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[code-quality] Add `RequestIsMainRector` ([#&#8203;708](https://github.com/rectorphp/rector-symfony/pull/708)) - \[symfony 7.3] Add `InvokableCommandRector` - kick off ([#&#8203;707](https://github.com/rectorphp/rector-symfony/pull/707)) - feat: Add Flysystem key support ([#&#8203;705](https://github.com/rectorphp/rector-symfony/pull/705)), Thanks [@&#8203;dsdeboer](https://github.com/dsdeboer) - \[CodeQuality] Enhance `InlineClassRoutePrefixRector` to concatenate name annotation/attribute ([#&#8203;704](https://github.com/rectorphp/rector-symfony/pull/704)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[BUNDLE-230] Add `AddAnnotationToRepositoryRector` rule ([#&#8203;375](https://github.com/rectorphp/rector-doctrine/pull/375)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[ORM-300] Add `CastDoctrineExprToStringRector` ([#&#8203;372](https://github.com/rectorphp/rector-doctrine/pull/372)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[ORM-213] Add replace method call support ([#&#8203;369](https://github.com/rectorphp/rector-doctrine/pull/369)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[deprecated] Remove deprecated `MakeEntityDateTimePropertyDateTimeInterfaceRector` ([#&#8203;376](https://github.com/rectorphp/rector-doctrine/pull/376)) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] Add `RemoveDataProviderParamKeysRector` ([#&#8203;469](https://github.com/rectorphp/rector-phpunit/pull/469)) - \[CodeQuality] Add `AddInstanceofAssertForNullableInstanceRector` ([#&#8203;466](https://github.com/rectorphp/rector-phpunit/pull/466)) - \[deprecated] Remove deprecated `AssertCompareToSpecificMethodRector` ([#&#8203;468](https://github.com/rectorphp/rector-phpunit/pull/468)) - \[deprecated] Deprecate `AssertCountWithZeroToAssertEmptyRector` for better readability with explicit methods ([#&#8203;467](https://github.com/rectorphp/rector-phpunit/pull/467)) ### [`v2.0.10`](https://github.com/rectorphp/rector/releases/tag/2.0.10): Released Rector 2.0.10 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.9...2.0.10) #### New Features :partying\_face: - Add GitHub output formatter ([#&#8203;6747](https://github.com/rectorphp/rector-src/pull/6747)), Thanks [@&#8203;neilime](https://github.com/neilime)! - JUnit output format ([#&#8203;6726](https://github.com/rectorphp/rector-src/pull/6726)), Thanks [@&#8203;VitalyArt](https://github.com/VitalyArt)! - \[dx] warn about too high level configuration and suggets more efficient set ([#&#8203;6735](https://github.com/rectorphp/rector-src/pull/6735)) <br> #### Bugfixes :bug: - \[PhpParser] Re-add back get value from `__DIR__` and `__FILE__` on `ValueResolver` ([#&#8203;6756](https://github.com/rectorphp/rector-src/pull/6756)) - \[TypeDeclaration] Skip already typed param on AddClosureParamTypeForArrayReduceRector ([#&#8203;6737](https://github.com/rectorphp/rector-src/pull/6737)) - \[TypeDeclaration] Skip already typed param on AddClosureParamTypeForArrayMapRector ([#&#8203;6738](https://github.com/rectorphp/rector-src/pull/6738)) - \[Renaming] Handle crash on assign on for loop on RenameFunctionRector ([#&#8203;6730](https://github.com/rectorphp/rector-src/pull/6730)) - \[CodeQuality] Skip unused static methods in LocallyCalledStaticMethodToNonStaticRector, as should be handled by another rule ([#&#8203;6731](https://github.com/rectorphp/rector-src/pull/6731)) - \[Carbon] Fix refactor time to carbon to use ->getTimestamp() over ->timestamp ([#&#8203;6733](https://github.com/rectorphp/rector-src/pull/6733)) - \[TypeDeclaration] Unregister AddClosureParamTypeForArrayMapRector and AddClosureParamTypeForArrayReduceRector due to may read from docblock ([#&#8203;6727](https://github.com/rectorphp/rector-src/pull/6727)) - \[TypeDeclaration] Handle crash on union intersection on AddClosureParamTypeForArrayReduceRector ([#&#8203;6729](https://github.com/rectorphp/rector-src/pull/6729)) - \[Privatization] Skip magic method on PrivatizeFinalClassMethodRector ([#&#8203;6734](https://github.com/rectorphp/rector-src/pull/6734)) - \[Php74] Skip property hook on RestoreDefaultNullToNullableTypePropertyRector ([#&#8203;6736](https://github.com/rectorphp/rector-src/pull/6736)) - \[Php53] Handle parentheses in else on TernaryToElvisRector ([#&#8203;6740](https://github.com/rectorphp/rector-src/pull/6740)) - \[Php81] Handle crash Class parent was not found on MyCLabsMethodCallToEnumConstRector ([#&#8203;6741](https://github.com/rectorphp/rector-src/pull/6741)) - \[CodeQuality] Handle crash division by zero error on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;6743](https://github.com/rectorphp/rector-src/pull/6743)) - fix(ValueObject): FileDiff first line number is below as expected ([#&#8203;6746](https://github.com/rectorphp/rector-src/pull/6746)), Thanks [@&#8203;neilime](https://github.com/neilime)! - \[naming] Skip variadic params in RenameParamToMatchTypeRector to avoid single naming for multiple types ([#&#8203;6748](https://github.com/rectorphp/rector-src/pull/6748)) - Do not try to refresh attributes ([#&#8203;6750](https://github.com/rectorphp/rector-src/pull/6750)), Thanks [@&#8203;lyrixx](https://github.com/lyrixx)! - \[Php74] Skip with [@&#8203;var](https://github.com/var) doc with more specific type on ClosureToArrowFunctionRector ([#&#8203;6753](https://github.com/rectorphp/rector-src/pull/6753)) - \[Php81] Skip property hook on ReadOnlyPropertyRector ([#&#8203;6758](https://github.com/rectorphp/rector-src/pull/6758)) - \[code-quality] Skip complex new instance with args assigns in InlineArrayReturnAssignRector ([#&#8203;6762](https://github.com/rectorphp/rector-src/pull/6762)) - \[CodeQuality] Handle crash first class callable on InlineArrayReturnAssignRector ([#&#8203;6763](https://github.com/rectorphp/rector-src/pull/6763)) - \[dx] Remove 3 rules registered in both code quality and coding style levels, keep them in coding style level only ([#&#8203;6757](https://github.com/rectorphp/rector-src/pull/6757)) <br> *** <br> #### rectorphp/rector-symfony - \[Symfony] Add attribute routing with mix other annotation ([#&#8203;703](https://github.com/rectorphp/rector-symfony/pull/703)) - \[code-quality] Add InlineClassRoutePrefixRector ([#&#8203;701](https://github.com/rectorphp/rector-symfony/pull/701)) - Do not change method if name does not need to change ([#&#8203;700](https://github.com/rectorphp/rector-symfony/pull/700)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados) - \[code-quality] Add attribute support ([#&#8203;702](https://github.com/rectorphp/rector-symfony/pull/702)) - \[SYMFONY 5 & 6] Security add missing param ([#&#8203;699](https://github.com/rectorphp/rector-symfony/pull/699)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) <br> *** <br> #### rectorphp/rector-doctrine - \[code-quality] Add GetRepositoryServiceLocatorToRepositoryServiceInjectionRector ([#&#8203;368](https://github.com/rectorphp/rector-doctrine/pull/368)) - \[NodeAnalyzer] Ensure mix annotation and attribute lookup finder on AttrinationFinder::findManyBy\* ([#&#8203;367](https://github.com/rectorphp/rector-doctrine/pull/367)) - Add AttrinationFinder::findManyBy() ([#&#8203;366](https://github.com/rectorphp/rector-doctrine/pull/366)) - Orm querybuilder set parameters to collection ([#&#8203;326](https://github.com/rectorphp/rector-doctrine/pull/326)), Thanks [@&#8203;marcelthole](https://github.com/marcelthole) <br> *** <br> #### rectorphp/rector-phpunit - add custom message support to AssertEmptyNullableObjectToAssertInstanceofRector ([#&#8203;461](https://github.com/rectorphp/rector-phpunit/pull/461)) - \[Attribute] Add CoversTrait support on CoversAnnotationWithValueToAttributeRector ([#&#8203;460](https://github.com/rectorphp/rector-phpunit/pull/460)) - \[CodeQuality] Skip union type on AssertCountWithZeroToAssertEmptyRector ([#&#8203;459](https://github.com/rectorphp/rector-phpunit/pull/459)) ### [`v2.0.9`](https://github.com/rectorphp/rector/releases/tag/2.0.9): Released Rector 2.0.9 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.8...2.0.9) #### Bugfixes :bug: - \[Php81] Exclude Doctrine ODM MongoDB Document and EmbeddedDocument from ReadOnlyPropertyRector ([#&#8203;6721](https://github.com/rectorphp/rector-src/pull/6721)), Thanks [@&#8203;mickverm](https://github.com/mickverm)! - \[PostRector] Handle with FQCN docblock on UnusedImportRemovingPostRector ([#&#8203;6722](https://github.com/rectorphp/rector-src/pull/6722)) - Type hint array reduce closure ([#&#8203;6725](https://github.com/rectorphp/rector-src/pull/6725)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[PHPStan 2.1.3] Add ReflectionAttribute and ReflectionIntersectionType stub for PHPStan 2.1.3 ([#&#8203;6723](https://github.com/rectorphp/rector-src/pull/6723)) ### [`v2.0.8`](https://github.com/rectorphp/rector/releases/tag/2.0.8): Released Rector 2.0.8 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.7...2.0.8) #### New Features :partying\_face: - feat: add coding style levels ([#&#8203;6695](https://github.com/rectorphp/rector-src/pull/6695)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Bugfixes :bug: - \[CodeQuality] Skip with comment inside on SimplifyIfElseToTernaryRector ([#&#8203;6683](https://github.com/rectorphp/rector-src/pull/6683)) - \[CodeQuality] Skip windows absolute path on AbsolutizeRequireAndIncludePathRector ([#&#8203;6684](https://github.com/rectorphp/rector-src/pull/6684)) - \[Strict] Handle in assign on BooleanInIfConditionRuleFixerRector ([#&#8203;6685](https://github.com/rectorphp/rector-src/pull/6685)) - Replace ambiguous wrapped\_with\_brackets with existing attribute wrapped\_in\_parentheses ([#&#8203;6691](https://github.com/rectorphp/rector-src/pull/6691)) - \[NodeTypeResolver] Clean up wrap in parentheses check ReprintNodeVisitor ([#&#8203;6692](https://github.com/rectorphp/rector-src/pull/6692)) - \[Php80]\[TypeDeclaration] Fix crash on ClassPropertyAssignToConstructorPromotionRector + ReturnNeverTypeRector ([#&#8203;6694](https://github.com/rectorphp/rector-src/pull/6694)) - CodeClimate output format ([#&#8203;6697](https://github.com/rectorphp/rector-src/pull/6697)), Thanks [@&#8203;VitalyArt](https://github.com/VitalyArt)! - Exclude node modules path ([#&#8203;6702](https://github.com/rectorphp/rector-src/pull/6702)), Thanks [@&#8203;vaishnavyogesh](https://github.com/vaishnavyogesh)! - Fix str\_getcsv() escape argument on PHP 8.4 ([#&#8203;6704](https://github.com/rectorphp/rector-src/pull/6704)) - \[Php74] Handle crash curly based array on trait on CurlyToSquareBracketArrayStringRector ([#&#8203;6706](https://github.com/rectorphp/rector-src/pull/6706)) - \[Php73] Handle infinite cast on StringifyStrNeedlesRector ([#&#8203;6707](https://github.com/rectorphp/rector-src/pull/6707)) - Clean up unused use ([#&#8203;6708](https://github.com/rectorphp/rector-src/pull/6708)) - fix: NewlineBeforeNewAssignSetRector variable as same name like property ([#&#8203;6705](https://github.com/rectorphp/rector-src/pull/6705)), Thanks [@&#8203;guideloince](https://github.com/guideloince)! - \[TypeDeclaration] Skip override trait method on StrictStringParamConcatRector ([#&#8203;6711](https://github.com/rectorphp/rector-src/pull/6711)) - \[Test] Clean up test on WorkerCommandLineFactoryTest ([#&#8203;6714](https://github.com/rectorphp/rector-src/pull/6714)) - \[DX] Move isWindows() method from AbstractRectorTestCase to AbstractLazyTestCase ([#&#8203;6715](https://github.com/rectorphp/rector-src/pull/6715)) - \[Performance] Use exactly equal or append / file path check on RealpathMatcher ([#&#8203;6716](https://github.com/rectorphp/rector-src/pull/6716)) - \[TypeDeclaration] Allow union with closure type on property on TypedPropertyFromAssignsRector ([#&#8203;6717](https://github.com/rectorphp/rector-src/pull/6717)) - \[DeadCode] Skip union falsy mixed on trait on RecastingRemovalRector ([#&#8203;6718](https://github.com/rectorphp/rector-src/pull/6718)) - Skip hexa chars in EncapsedStringsToSprintfRector ([#&#8203;6719](https://github.com/rectorphp/rector-src/pull/6719)) - \[CodingStyle] Rename method: containsASCIIChar to containsControlASCIIChar on EncapsedStringsToSprintfRector ([#&#8203;6720](https://github.com/rectorphp/rector-src/pull/6720)) ### [`v2.0.7`](https://github.com/rectorphp/rector/releases/tag/2.0.7): Released Rector 2.0.7 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.6...2.0.7) #### New Features :partying\_face: - Add `withSetProviders` method ([#&#8203;6515](https://github.com/rectorphp/rector-src/pull/6515)), Thanks [@&#8203;ghostwriter](https://github.com/ghostwriter)! - feature: replace MyCLabs Enum constructor call ([#&#8203;6588](https://github.com/rectorphp/rector-src/pull/6588)), Thanks [@&#8203;carlosvinicius](https://github.com/carlosvinicius)! <br> #### Bugfixes :bug: - \[type-declaration] Add typed property, if traits do not duplicate the property ([#&#8203;6663](https://github.com/rectorphp/rector-src/pull/6663)) - \[removing] Add interface support to RemoveInterfaceRector ([#&#8203;6681](https://github.com/rectorphp/rector-src/pull/6681)) - fix: add Symfony support as a composer-based option ([#&#8203;6673](https://github.com/rectorphp/rector-src/pull/6673)), Thanks [@&#8203;ayedbelsem](https://github.com/ayedbelsem)! - \[CodeQuality] Handle on assign on FlipTypeControlToUseExclusiveTypeRector ([#&#8203;6653](https://github.com/rectorphp/rector-src/pull/6653)) - \[Performance] Early return FullyQualifiedObjectType on FQCN on ObjectTypeSpecifier ([#&#8203;6658](https://github.com/rectorphp/rector-src/pull/6658)) - \[CodeQuality] Skip indirect return on SimplifyIfReturnBoolRector ([#&#8203;6660](https://github.com/rectorphp/rector-src/pull/6660)) - \[Php83] Handle concat in first argument on CombineHostPortLdapUriRector ([#&#8203;6661](https://github.com/rectorphp/rector-src/pull/6661)) - \[TypeDeclaration] Skip unset by trait on TypedPropertyFromStrictConstructorRector ([#&#8203;6664](https://github.com/rectorphp/rector-src/pull/6664)) - \[Renaming] Skip used by trait as property promotion on RenamePropertyToMatchTypeRector ([#&#8203;6665](https://github.com/rectorphp/rector-src/pull/6665)) - \[TypeDeclaration] Skip changed by ref from trait on TypedPropertyFromStrictConstructorRector ([#&#8203;6666](https://github.com/rectorphp/rector-src/pull/6666)) - \[CodeQuality] Handle with assign missing parentheses on ExplicitBoolCompareRector ([#&#8203;6668](https://github.com/rectorphp/rector-src/pull/6668)) - use ->ignoreVCSIgnored() on RectorConfigBuilder::withRootFiles() over custom logic ([#&#8203;6669](https://github.com/rectorphp/rector-src/pull/6669)) - \[BetterPhpDocParser] Check for closing brace in text content ([#&#8203;8977](https://github.com/rectorphp/rector/issues/8977)) ([#&#8203;6670](https://github.com/rectorphp/rector-src/pull/6670)), Thanks [@&#8203;andrewnicols](https://github.com/andrewnicols)! - \[AutoImport] Handle FQCN with sub namespace ([#&#8203;6672](https://github.com/rectorphp/rector-src/pull/6672)) - \[BetterPhpDocParser] Use str\_contains() for DoctrineAnnotationDecorator ([#&#8203;6671](https://github.com/rectorphp/rector/issues/6671)) ([#&#8203;6674](https://github.com/rectorphp/rector-src/pull/6674)), Thanks [@&#8203;andrewnicols](https://github.com/andrewnicols)! - \[AutoImport] Handle inner with sub namespace on auto import ([#&#8203;6679](https://github.com/rectorphp/rector-src/pull/6679)) - \[DeadCode] Skip dynamic name on RemoveParentCallWithoutParentRector ([#&#8203;6659](https://github.com/rectorphp/rector-src/pull/6659)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - Back to require-dev rector-src:dev-main ([#&#8203;697](https://github.com/rectorphp/rector-symfony/pull/697)) - Update GetBySymfonyStringToConstructorInjectionRector fixture test to cover rector-srv:tv-readonly-add-ctor ([#&#8203;696](https://github.com/rectorphp/rector-symfony/pull/696)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[ORM-300] add missing rename class ([#&#8203;365](https://github.com/rectorphp/rector-doctrine/pull/365)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) - \[ORM-28] add missing sets list for ORM-28 ([#&#8203;364](https://github.com/rectorphp/rector-doctrine/pull/364)), Thanks [@&#8203;JohJohan](https://github.com/JohJohan) <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPUnit 10] Register PropertyExistsWithoutAssertRector to phpunit100.php ([#&#8203;443](https://github.com/rectorphp/rector-phpunit/pull/443)) - Added testcase to demonstrate [rector#8977](https://github.com/rector/rector/issues/8977) ([#&#8203;440](https://github.com/rectorphp/rector-phpunit/pull/440)), Thanks [@&#8203;andrewnicols](https://github.com/andrewnicols) - \[PHPUnit10] Replace deleted PHPUnit methods ([#&#8203;438](https://github.com/rectorphp/rector-phpunit/pull/438)), Thanks [@&#8203;66Ton99](https://github.com/66Ton99) ### [`v2.0.6`](https://github.com/rectorphp/rector/releases/tag/2.0.6): Released: Rector 2.0.6 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.5...2.0.6) #### New Features :partying\_face: - **\[dx] Add --only-suffix to filter files by suffixes** ([#&#8203;6647](https://github.com/rectorphp/rector-src/pull/6647)) - \[DeadCode] Add ReplaceBlockToItsStmtsRector ([#&#8203;6641](https://github.com/rectorphp/rector-src/pull/6641)) - \[DeadCode] Add RemoveUselessAssignFromPropertyPromotionRector ([#&#8203;6643](https://github.com/rectorphp/rector-src/pull/6643)) - Add readonly by default on new promoted property ([#&#8203;6650](https://github.com/rectorphp/rector-src/pull/6650)) - Use autowired method if exists in adding new dependency ([#&#8203;6652](https://github.com/rectorphp/rector-src/pull/6652)) <br> #### Bugfixes :bug: - \[CodeQuality] Handle crash inside block statement with unreachable statement on OptionalParametersAfterRequiredRector ([#&#8203;6640](https://github.com/rectorphp/rector-src/pull/6640)) - \[DX] Use Param->isPromoted() over param->flags !== 0 check on promotion property check ([#&#8203;6646](https://github.com/rectorphp/rector-src/pull/6646)) - \[Php80] Keep numeric string, string "true", "false" as is on StringAnnotationToAttributeMapper ([#&#8203;6610](https://github.com/rectorphp/rector-src/pull/6610)) - \[PHPStan ^2.1.1] Handle next unreachable statement via UnreachableStatementNode->getNextUnreachableStatements() ([#&#8203;6642](https://github.com/rectorphp/rector-src/pull/6642)) <br> #### Removed :skull: - \[Parser] Remove SmartPhpParserFactory and SmartPhpParser ([#&#8203;6651](https://github.com/rectorphp/rector-src/pull/6651)) ### [`v2.0.5`](https://github.com/rectorphp/rector/releases/tag/2.0.5): Released: Rector 2.0.5 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.4...2.0.5) ## 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 ([#&#8203;6637](https://github.com/rectorphp/rector-src/pull/6637)) - Bump to PHPStan ^2.1.0 ([#&#8203;6639](https://github.com/rectorphp/rector-src/pull/6639)) - \[DeadCode] Allow remove useless @&#8203; var on typed class constant as well on RemoveUselessVarTagRector ([#&#8203;6633](https://github.com/rectorphp/rector-src/pull/6633)) #### Removed :skull: - Remove unused AssignVariableNameResolverInterface instances ([#&#8203;6631](https://github.com/rectorphp/rector-src/pull/6631)) <br> #### Bugfixes :bug: - \[DX] Warn about ->withPhpSets() called multiple times, to avoid invalid set mix ([#&#8203;6632](https://github.com/rectorphp/rector-src/pull/6632)) - \[CodeQuality] Skip fopen() or die() on LogicalToBooleanRector on assign ([#&#8203;6635](https://github.com/rectorphp/rector-src/pull/6635)) - use vendor-patches main branch that already include php-parser 5.4.0 patch ([#&#8203;6638](https://github.com/rectorphp/rector-src/pull/6638)) ### [`v2.0.4`](https://github.com/rectorphp/rector/releases/tag/2.0.4): Released Rector 2.0.4 [Compare Source](https://github.com/rectorphp/rector/compare/2.0.3...2.0.4) #### New Features :partying\_face: - \[PHP 8.0] Add lcfirst annotation to attribute support ([#&#8203;6577](https://github.com/rectorphp/rector-src/pull/6577)) - Add multiline comment fixture ([#&#8203;6580](https://github.com/rectorphp/rector-src/pull/6580)) - \[TypeDeclaration] Add param type to array map closure ([#&#8203;6377](https://github.com/rectorphp/rector-src/pull/6377)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[deprecation] Add message about deprecated MixedTypeRector rule, Remove deprecated SetListInterface as no longer used ([#&#8203;6590](https://github.com/rectorphp/rector-src/pull/6590)) - \[Php81]\[php82] Add AttributeGroupNewLiner to make new line based on token on ReadOnlyPropertyRector and ReadOnlyClassRector ([#&#8203;6618](https://github.com/rectorphp/rector-src/pull/6618)) - \[Php84] Add rule for RoundingMode enum ([#&#8203;6369](https://github.com/rectorphp/rector-src/pull/6369)), Thanks [@&#8203;jorgsowa](https://github.com/jorgsowa)! <br> #### Bugfixes :bug: - \[dx] polyfill sets is running out of the box in php sets ([#&#8203;6591](https://github.com/rectorphp/rector-src/pull/6591)) - \[phpstan] Fix var assumed ignored errors ([#&#8203;6571](https://github.com/rectorphp/rector-src/pull/6571)) - \[phpstan] fix next ingored errors ([#&#8203;6572](https://github.com/rectorphp/rector-src/pull/6572)) - \[CodeQuality] Handle crash on property hook on OptionalParametersAfterRequiredRector ([#&#8203;6575](https://github.com/rectorphp/rector-src/pull/6575)) - \[PHP 8.0] Make AnnotationToAttributeRector return after 1st newline without slash ([#&#8203;6578](https://github.com/rectorphp/rector-src/pull/6578)) - \[Php80] Fix end slash regex on AttributeValueResolver ([#&#8203;6579](https://github.com/rectorphp/rector-src/pull/6579)) - Fix annotation on doctrine one ([#&#8203;6582](https://github.com/rectorphp/rector-src/pull/6582)) - \[Comments] Move left over clean empty doc handling to DocBlockUpdater ([#&#8203;6584](https://github.com/rectorphp/rector-src/pull/6584)) - fix: replace getKey method for name property ([#&#8203;6583](https://github.com/rectorphp/rector-src/pull/6583)), Thanks [@&#8203;carlosvinicius](https://github.com/carlosvinicius)! - fix: replace getKey/getValue methods when enum is a variable ([#&#8203;6585](https://github.com/rectorphp/rector-src/pull/6585)), Thanks [@&#8203;carlosvinicius](https://github.com/carlosvinicius)! - \[Php80] Handle comment multi line on AttributeValueResolver ([#&#8203;6586](https://github.com/rectorphp/rector-src/pull/6586)) - \[Php80] Use more proper check for doc comment multi lines on AttributeValueResolver ([#&#8203;6587](https://github.com/rectorphp/rector-src/pull/6587)) - \[Php80] Handle value as argument with keep description as comment on AttributeValueResolver ([#&#8203;6589](https://github.com/rectorphp/rector-src/pull/6589)) - :sparkles: `withRootFiles` now apply rector for dotfiles too ([#&#8203;6592](https://github.com/rectorphp/rector-src/pull/6592)), Thanks [@&#8203;andrew-demb](https://github.com/andrew-demb)! - :package: Ignore `.phpstorm.meta.php` because this is not PHP file ([#&#8203;6594](https://github.com/rectorphp/rector-src/pull/6594)), Thanks [@&#8203;andrew-demb](https://github.com/andrew-demb)! - \[Php81] Skip reassign on array destruct on ReadOnlyPropertyRector ([#&#8203;6596](https://github.com/rectorphp/rector-src/pull/6596)) - \[Php80] Handle crash on multi next stmts on ChangeSwitchToMatchRector ([#&#8203;6597](https://github.com/rectorphp/rector-src/pull/6597)) - \[CodingStyle] Handle crash on pass args on CallUserFuncToMethodCallRector ([#&#8203;6598](https://github.com/rectorphp/rector-src/pull/6598)) - \[Php81] Skip with next required on NewInInitializerRector ([#&#8203;6599](https://github.com/rectorphp/rector-src/pull/6599)) - Move FunctionLike reindex under StmtsAwareInterface on NodeAttributeReIndexer ([#&#8203;6605](https://github.com/rectorphp/rector-src/pull/6605)) - \[DeadCode] Skip value variable used in throw stmts in catch on UnusedForeachValueToArrayKeysRector ([#&#8203;6607](https://github.com/rectorphp/rector-src/pull/6607)) - Revert "\[Php80] Keep numeric string as is on StringAnnotationToAttributeMappe…" ([#&#8203;6609](https://github.com/rectorphp/rector-src/pull/6609)) - \[Php54] Use token base replace on LongArrayToShortArrayRector ([#&#8203;6616](https://github.com/rectorphp/rector-src/pull/6616)) - \[Performance] Only register WrappedNodeRestoringNodeVisitor() when there is found AlwaysRememberedExpr or Match\_ node on processNodes() ([#&#8203;6620](https://github.com/rectorphp/rector-src/pull/6620)) - \[Fix] Renamed gzwrites (undefined function) to gzwrite ([#&#8203;6622](https://github.com/rectorphp/rector-src/pull/6622)), Thanks [@&#8203;Vqcheslav](https://github.com/Vqcheslav)! - \[FunctionLike] Skip return by ref with switch on SimplifyUselessVariableRector ([#&#8203;6623](https://github.com/rectorphp/rector-src/pull/6623)) - Rollback SimpleCallableNodeTraverser usage on ByRefReturnNodeVisitor ([#&#8203;6624](https://github.com/rectorphp/rector-src/pull/6624)) - \[TypeDeclaration] Skip assign on while cond on WhileNullableToInstanceofRector ([#&#8203;6628](https://github.com/rectorphp/rector-src/pull/6628)) - \[TypeDeclaration] Skip assign in if condition on BinaryOpNullableToInstanceofRector ([#&#8203;6629](https://github.com/rectorphp/rector-src/pull/6629)) - Clean up ignore phpstan errors ([#&#8203;6630](https://github.com/rectorphp/rector-src/pull/6630)) - \[DeadCode] Skip [@&#8203;return](https://github.com/return) positive-int|0 on RemoveUselessReturnTagRector ([#&#8203;6576](https://github.com/rectorphp/rector-src/pull/6576)) - \[DeadCode] Skip key variable used in throw stmts in catch on RemoveUnusedForeachKeyRector ([#&#8203;6606](https://github.com/rectorphp/rector-src/pull/6606)) <br> #### Removed :skull: - Remove TypeNormalizer as type comparison is handled well by PHPStan ([#&#8203;6570](https://github.com/rectorphp/rector-src/pull/6570)) - Removed unused method `ClassChildAnalyzer-> hasParentClassMethod()` ([#&#8203;6595](https://github.com/rectorphp/rector-src/pull/6595)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Experiment] Remove WrappedNodeRestoringNodeVisitor ([#&#8203;6626](https://github.com/rectorphp/rector-src/pull/6626)) ### [`v2.0.3`](https://github.com/rectorphp/rector/compare/2.0.2...2.0.3) [Compare Source](https://github.com/rectorphp/rector/compare/2.0.2...2.0.3) ### [`v2.0.2`](https://github.com/rectorphp/rector/compare/2.0.1...2.0.2) [Compare Source](https://github.com/rectorphp/rector/compare/2.0.1...2.0.2) ### [`v2.0.1`](https://github.com/rectorphp/rector/compare/2.0.0...2.0.1) [Compare Source](https://github.com/rectorphp/rector/compare/2.0.0...2.0.1) ### [`v2.0.0`](https://github.com/rectorphp/rector/releases/tag/2.0.0): Released Rector 2.0 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.10...2.0.0) ### **Rector 2.0** is here :partying\_face: 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 <br> We've managed to fit in couple cool features: **[5 New Features in Rector 2.0](https://getrector.com/blog/5-new-features-in-rector-20)** <br> For custom rules writers, see [upgrading guide](https://github.com/rectorphp/rector/blob/main/UPGRADING.md). The rest of upgrade is straighforward :tada: <br> To celebrate the upgrade, we're also modernized our logo! 🤩 <img src="https://github.com/rectorphp/getrector-com/blob/main/public/assets/images/new-logo/rector-square.png?raw=true" width=200> *** #### New Features and Improvements :tada: - **Add "--only" option to process only a single rule ([#&#8203;6441](https://github.com/rectorphp/rector-src/pull/6441)), Thanks [@&#8203;cweiske](https://github.com/cweiske)!** - **\[DX] Add version-based set loading based on installed package version** ([#&#8203;6428](https://github.com/rectorphp/rector-src/pull/6428)) - \[dx] enable polyfills by default when PHP is on, to make config simpler ([#&#8203;6433](https://github.com/rectorphp/rector-src/pull/6433)) - \[dx] enable all attributes, if none are selected to streamline config ([#&#8203;6451](https://github.com/rectorphp/rector-src/pull/6451)) - feat: add the option to use the annotation value as an argument to the attribute ([#&#8203;6468](https://github.com/rectorphp/rector-src/pull/6468)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - feat: add Behat annotations to attributes set ([#&#8203;6510](https://github.com/rectorphp/rector-src/pull/6510)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Deprecated and Removed :skull: - \[deprecation] Deprecate AbstractScopeAwareRector in favor of single AbstractRector ([#&#8203;6425](https://github.com/rectorphp/rector-src/pull/6425)) - \[deprecation] Deprecate MixedTypeRector, to avoid mixed type filled blindly, use type declaration set instead ([#&#8203;6434](https://github.com/rectorphp/rector-src/pull/6434)) - \[docs] getRuleDefinition() no longer required for custom rules ([#&#8203;6440](https://github.com/rectorphp/rector-src/pull/6440)) - \[deprecation] Remove deprecated `PublicConstantVisibilityRector`, cleanup deprecated `SetListInterface` ([#&#8203;6424](https://github.com/rectorphp/rector-src/pull/6424)) - \[deprecated] Remove deprecated `AbstractTestCase` ([#&#8203;6426](https://github.com/rectorphp/rector-src/pull/6426)) <br> #### Bugfixes :bug: - \[Php80] Returns null on no change on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;6418](https://github.com/rectorphp/rector-src/pull/6418)) - \[attributes] Make sure the target attribute class exists ([#&#8203;6454](https://github.com/rectorphp/rector-src/pull/6454)) - \[TypeDeclaration] Skip test methods with exception in ReturnNeverTypeRector, \[php74] Skip conditinal assign in RestoreDefaultNullToNullableTypePropertyRector as most likely desired to assign or fail ([#&#8203;6430](https://github.com/rectorphp/rector-src/pull/6430)) - Support php-64bit as required in composer.json ([#&#8203;6432](https://github.com/rectorphp/rector-src/pull/6432)), Thanks [@&#8203;hans-thomas](https://github.com/hans-thomas)! - \[dx] Allow external rules without getRuleDefinition() to make them easier to write ([#&#8203;6438](https://github.com/rectorphp/rector-src/pull/6438)) - \[fix] class phpdoc generic method ([#&#8203;6439](https://github.com/rectorphp/rector-src/pull/6439)), Thanks [@&#8203;lammafish](https://github.com/lammafish)! - Fix RemoveDoubleAssignRector in case of method call ([#&#8203;6442](https://github.com/rectorphp/rector-src/pull/6442)) - Upgrade to PHPParser 5 and PHPStan 2 ([#&#8203;6431](https://github.com/rectorphp/rector-src/pull/6431)) - \[CodeQuality] Handle crash on return array constant on ExplicitReturnNullRector ([#&#8203;6458](https://github.com/rectorphp/rector-src/pull/6458)) - \[Php80] Handle crash single quoted doctrine on AnnotationToAttributeRector ([#&#8203;6459](https://github.com/rectorphp/rector-src/pull/6459)) - \[Php71] Skip already array destruct on ListToArrayDestructRector ([#&#8203;6460](https://github.com/rectorphp/rector-src/pull/6460)) - \[TypeDeclaration] Skip mixed as on right of and on ParamTypeByMethodCallTypeRector ([#&#8203;6401](https://github.com/rectorphp/rector-src/pull/6401)) - \[Renaming] Fix space on union docblock during rename on RenameClassRector ([#&#8203;6463](https://github.com/rectorphp/rector-src/pull/6463)) - \[CodeQuality] Skip used by array callable on LocallyCalledStaticMethodToNonStaticRector ([#&#8203;6473](https://github.com/rectorphp/rector-src/pull/6473)) - \[CodeQuality] Skip compare nullable object on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;6474](https://github.com/rectorphp/rector-src/pull/6474)) - Use Type->getIterableValueType() over ArrayType-> getItemType() ([#&#8203;6479](https://github.com/rectorphp/rector-src/pull/6479)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Allow remove assign variable with next method call on RemoveDoubleAssignRector ([#&#8203;6443](https://github.com/rectorphp/rector-src/pull/6443)) - \[DeadCode] Handle InterpolatedStringPart crash on RemoveUnusedForeachKeyRector ([#&#8203;6457](https://github.com/rectorphp/rector-src/pull/6457)) - \[DeadCode] Skip used by get\_object\_vars() when implements JsonSerializable on RemoveUnusedPromotedPropertyRector ([#&#8203;6472](https://github.com/rectorphp/rector-src/pull/6472)) - \[DeadCode] Handle crash on valid conditional type on RemoveUselessReturnTagRector ([#&#8203;6475](https://github.com/rectorphp/rector-src/pull/6475)) - Use Type->getIterableKeyType() over ArrayType->getKeyType() ([#&#8203;6480](https://github.com/rectorphp/rector-src/pull/6480)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Update developing with docker: Fix php version to 8.2. ([#&#8203;6490](https://github.com/rectorphp/rector-src/pull/6490)), Thanks [@&#8203;uncaught](https://github.com/uncaught)! - \[Renaming] Handle docblock aliased rename on RenameClassR\* \[Php81] Allow not readonly property on API Platform api resource ([#&#8203;6531](https://github.com/rectorphp/rector-src/pull/6531)), Thanks [@&#8203;alexndlm](https://github.com/alexndlm)! ector ([#&#8203;6498](https://github.com/rectorphp/rector-src/pull/6498)) - \[CodeQuality]\[Renaming] Handle DynamicDocBlockPropertyToNativePropertyRector+RenameClassRector with aliased name ([#&#8203;6506](https://github.com/rectorphp/rector-src/pull/6506)) - \[TypeDeclaration] Skip with default value and assigned mixed on TypedPropertyFromAssignsRector ([#&#8203;6514](https://github.com/rectorphp/rector-src/pull/6514)) - \[Php80] Mirror comments on assign on ChangeSwitchToMatchRector ([#&#8203;6516](https://github.com/rectorphp/rector-src/pull/6516)) - \[Php70] Handle parent method call on Php4ConstructorRector ([#&#8203;6519](https://github.com/rectorphp/rector-src/pull/6519)) - \[Php70] Do not replace if method call if method exists in current class on call same method with parent on Php4ConstructorRector ([#&#8203;6520](https://github.com/rectorphp/rector-src/pull/6520)) - \[PostRector] Keep first comment before first Use\_ on UnusedImportRemovingPostRector ([#&#8203;6522](https://github.com/rectorphp/rector-src/pull/6522)) - \[Php81] Allow not readonly property on API Platform api resource ([#&#8203;6531](https://github.com/rectorphp/rector-src/pull/6531)), Thanks [@&#8203;alexndlm](https://github.com/alexndlm)! - \[Php81] Skip by ref param on ReadOnlyPropertyRector ([#&#8203;6532](https://github.com/rectorphp/rector-src/pull/6532)) - \[Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBracesRector ([#&#8203;6533](https://github.com/rectorphp/rector-src/pull/6533)) - Fix fixture end `]` fixture on NestedAnnotationToAttributeRector ([#&#8203;6537](https://github.com/rectorphp/rector-src/pull/6537)) - \[Php80] Handle mix quote single and double on AnnotationToAttributeRector ([#&#8203;6538](https://github.com/rectorphp/rector-src/pull/6538)) - \[CodeQuality] Handle crash on yield from on OptionalParametersAfterRequiredRector ([#&#8203;6545](https://github.com/rectorphp/rector-src/pull/6545)) - Fix str\_contains() never returns 0 ([#&#8203;6546](https://github.com/rectorphp/rector-src/pull/6546)) - \[CodeQuality] Handle crash on unary minums on OptionalParametersAfterRequiredRector ([#&#8203;6547](https://github.com/rectorphp/rector-src/pull/6547)) - \[CodeQuality] Handle crash on assign ref on OptionalParametersAfterRequiredRector ([#&#8203;6551](https://github.com/rectorphp/rector-src/pull/6551)) - \[Attributes] Cover slash newline in AnnotationToAttributeRector with values ([#&#8203;6557](https://github.com/rectorphp/rector-src/pull/6557)) - \[TypedPropertyFromAssignsRector] Handle parse\_url() native function with second arg on TypedPropertyFromAssignsRector ([#&#8203;6562](https://github.com/rectorphp/rector-src/pull/6562)) - \[TypeDeclaration] Handle default value with contant type on TypedPropertyFromAssignsRector ([#&#8203;6563](https://github.com/rectorphp/rector-src/pull/6563)) - \[NodeTypeResolver] Handle namespaced function call name on NodeTypeResolver ([#&#8203;6564](https://github.com/rectorphp/rector-src/pull/6564)) <br> #### rectorphp/rector-symfony :musical_note: - Fill listener method name, based on kernel.x event name in EventListenerToEventSubscriberRectory ([#&#8203;694](https://github.com/rectorphp/rector-symfony/pull/694)) - \[scoped] Fix scoped prefixed UrlGeneratorInterface on RedirectToRouteRector ([#&#8203;692](https://github.com/rectorphp/rector-symfony/pull/692)) - \[DependencyInjection] Add `GetBySymfonyStringToConstructorInjectionRector` ([#&#8203;688](https://github.com/rectorphp/rector-symfony/pull/688)) - \[DependencyInjection] Add `TraitGetByTypeToInjectRector` ([#&#8203;687](https://github.com/rectorphp/rector-symfony/pull/687)) - \[DependencyInjection] Extract `CommandGetByTypeToConstructorInjectionRector` to make migration smoother ([#&#8203;686](https://github.com/rectorphp/rector-symfony/pull/686)) - \[DependencyInjection] Extract `GetByTypeMethodCallToConstructorInjectionRector` to make migration smoother ([#&#8203;685](https://github.com/rectorphp/rector-symfony/pull/685)) - \[Symfony 7.2] Add SetList ([#&#8203;684](https://github.com/rectorphp/rector-symfony/pull/684)), Thanks [@&#8203;alamirault](https://github.com/alamirault) - Upgrade deprecated ScopeAware to AbstractRector ([#&#8203;680](https://github.com/rectorphp/rector-symfony/pull/680)) - Fix twig 2.40 set to 2.4 ([#&#8203;678](https://github.com/rectorphp/rector-symfony/pull/678)) - \[deprecation] Remove deprecated rules ([#&#8203;677](https://github.com/rectorphp/rector-symfony/pull/677)) - Remove deprecated set list marker ([#&#8203;676](https://github.com/rectorphp/rector-symfony/pull/676)) <br> #### rectorphp/rector-doctrine :orange_circle: - \[deprecation] Remove deprecated AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector, InitializeDefaultEntityCollectionRector, TypedPropertyFromDoctrineCollectionRector ([#&#8203;347](https://github.com/rectorphp/rector-doctrine/pull/347)) <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPUnit] Support list in YieldDataProviderRector ([#&#8203;418](https://github.com/rectorphp/rector-phpunit/pull/418)), Thanks [@&#8203;staabm](https://github.com/staabm) - \[Phpunit] Avoid reprint doc for remove/replace when no [@&#8203;return](https://github.com/return) tag on YieldDataProviderRector ([#&#8203;417](https://github.com/rectorphp/rector-phpunit/pull/417)) - \[PHPUnit] Add missing DocblockUpdater usage on YieldDataProviderRector when removing [@&#8203;return](https://github.com/return) doc ([#&#8203;416](https://github.com/rectorphp/rector-phpunit/pull/416)) - \[PHPUnit] Change [@&#8203;return](https://github.com/return) array<> to [@&#8203;return](https://github.com/return) Iterator<> on YieldDataProviderRector ([#&#8203;415](https://github.com/rectorphp/rector-phpunit/pull/415)) - \[CodeQuality] Handle createMock as well in PreferPHPUnitThisCallRector ([#&#8203;407](https://github.com/rectorphp/rector-phpunit/pull/407)) - \[fix] Keep original message in AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector ([#&#8203;406](https://github.com/rectorphp/rector-phpunit/pull/406)) - \[PHPUnit 10] Remove AssertIssetToAssertObjectHasPropertyRector ([#&#8203;405](https://github.com/rectorphp/rector-phpunit/pull/405)) - \[CodeQuality] Skip possible data provider method called and used as array on YieldDataProviderRector ([#&#8203;404](https://github.com/rectorphp/rector-phpunit/pull/404)) ### [`v1.2.10`](https://github.com/rectorphp/rector/releases/tag/1.2.10): Released Rector 1.2.10 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.9...1.2.10) #### New Features :partying\_face: - \[PHP8.3] add new rectors for get\_class()/get\_parent\_class() without arguments ([#&#8203;6405](https://github.com/rectorphp/rector-src/pull/6405)), Thanks [@&#8203;cabbey](https://github.com/cabbey)! <br> #### Bugfixes :bug: - Fix ClassDependencyManipulator to add dependency on right position ([#&#8203;6413](https://github.com/rectorphp/rector-src/pull/6413)) - \[Php81] Skip Doctrine Embeddable on ReadOnlyPropertyRector ([#&#8203;6411](https://github.com/rectorphp/rector-src/pull/6411)) - \[Privatization] Skip with parameter on PrivatizeLocalGetterToPropertyRector ([#&#8203;6412](https://github.com/rectorphp/rector-src/pull/6412)) <br> #### Removed :skull: - \[DeadCode] Skip nullable @&#8203; template on RemoveUselessReturnTagRector ([#&#8203;6409](https://github.com/rectorphp/rector-src/pull/6409)) <br> *** <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPUnit 10] Skip with Magic \_\_get() on AssertIssetToAssertObjectHasPropertyRector ([#&#8203;403](https://github.com/rectorphp/rector-phpunit/pull/403)) - \[CodeQuality] Add `CreateMockToDirectNewRector` ([#&#8203;402](https://github.com/rectorphp/rector-phpunit/pull/402)) - \[CodeQuality] Add `SingleMockPropertyTypeRector` ([#&#8203;401](https://github.com/rectorphp/rector-phpunit/pull/401)) - \[CodeQuality] Skip used by trait and multiple props on NarrowUnusedSetUpDefinedPropertyRector ([#&#8203;400](https://github.com/rectorphp/rector-phpunit/pull/400)) - Skip property with default value in NarrowUnusedSetUpDefinedPropertyRector ([#&#8203;398](https://github.com/rectorphp/rector-phpunit/pull/398)) - \[CodeQuality] Add `FlipAssertRector` ([#&#8203;397](https://github.com/rectorphp/rector-phpunit/pull/397)) - Add count() support to `AssertCompareOnCountableWithMethodToAssertCountRector` ([#&#8203;395](https://github.com/rectorphp/rector-phpunit/pull/395)) - Add enum/const fetch support to AssertEqualsToSameRector ([#&#8203;394](https://github.com/rectorphp/rector-phpunit/pull/394)) - skip static property in NarrowUnusedSetUpDefinedPropertyRector ([#&#8203;393](https://github.com/rectorphp/rector-phpunit/pull/393)) ### [`v1.2.9`](https://github.com/rectorphp/rector/releases/tag/1.2.9): Released Rector 1.2.9 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.8...1.2.9) #### Bugfixes :bug: - \[Strict] Using in\_array() on CallLike instead of double call on Strict Rules ([#&#8203;6388](https://github.com/rectorphp/rector-src/pull/6388)) - \[CodeQuality] Handle If cond as assign on ExplicitBoolCompareRector ([#&#8203;6389](https://github.com/rectorphp/rector-src/pull/6389)) - \[CodeQuality] Skip append non empty array on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;6390](https://github.com/rectorphp/rector-src/pull/6390)) - \[Php80] Mirror return comment on ChangeSwitchToMatchRector ([#&#8203;6394](https://github.com/rectorphp/rector-src/pull/6394)) - \[TypeDeclaration] Skip union intersection types on php 8.1, allow on php 8.2+ ([#&#8203;6395](https://github.com/rectorphp/rector-src/pull/6395)) - \[Php80] Skip [@&#8203;template](https://github.com/template) T as mixed on MixedTypeRector ([#&#8203;6399](https://github.com/rectorphp/rector-src/pull/6399)) - \[DeadCode] Check TemplateType instance check on Dead\*TagValueNodeAnalyzer ([#&#8203;6400](https://github.com/rectorphp/rector-src/pull/6400)) - \[CodeQuality] Skip multiple lines on JoinStringConcatRector ([#&#8203;6404](https://github.com/rectorphp/rector-src/pull/6404)) - \[CodingStyle] Skip equal modifier on direct parent method compatible on MakeInheritedMethodVisibilitySameAsParentRector ([#&#8203;6406](https://github.com/rectorphp/rector-src/pull/6406)) <br> #### Removed :skull: - \[DeadCode] Handle consecutive equal case stmts on RemoveDuplicatedCaseInSwitchRector ([#&#8203;6392](https://github.com/rectorphp/rector-src/pull/6392)) - \[DeadCode] Handle handle consecutive equal with jump different case on RemoveDuplicatedCaseInSwitchRector ([#&#8203;6393](https://github.com/rectorphp/rector-src/pull/6393)) - \[DeadCode] Skip [@&#8203;template](https://github.com/template) tag on RemoveUselessVarTagRector ([#&#8203;6396](https://github.com/rectorphp/rector-src/pull/6396)) - \[DeadCode] Support multiple templates in RemoveUselessVarTagRector ([#&#8203;6402](https://github.com/rectorphp/rector-src/pull/6402)), Thanks [@&#8203;dragosprotung](https://github.com/dragosprotung)! <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Skip Request param used by caller method on RemoveUnusedRequestParamRector ([#&#8203;675](https://github.com/rectorphp/rector-symfony/pull/675)) - Better note highlighting ([#&#8203;674](https://github.com/rectorphp/rector-symfony/pull/674)), Thanks [@&#8203;OskarStark](https://github.com/OskarStark) - remove extra character ([#&#8203;673](https://github.com/rectorphp/rector-symfony/pull/673)), Thanks [@&#8203;IndraGunawan](https://github.com/IndraGunawan) <br> #### rectorphp/rector-phpunit :green_circle: - \[code-quality] Add NarrowUnusedSetUpDefinedPropertyRector ([#&#8203;388](https://github.com/rectorphp/rector-phpunit/pull/388)) - Add enum/const fetch support to AssertEqualsToSameRector ([#&#8203;394](https://github.com/rectorphp/rector-phpunit/pull/394)) - Add count() support to AssertCompareOnCountableWithMethodToAssertCountRector ([#&#8203;395](https://github.com/rectorphp/rector-phpunit/pull/395)) - \[AnnotationsToAttribute] Skip not in test on AnnotationWithValueToAttributeRector ([#&#8203;387](https://github.com/rectorphp/rector-phpunit/pull/387)) - Add ReplaceTestFunctionPrefixWithAttributeRector ([#&#8203;386](https://github.com/rectorphp/rector-phpunit/pull/386)), Thanks [@&#8203;blackwolf12333](https://github.com/blackwolf12333) ### [`v1.2.8`](https://github.com/rectorphp/rector/releases/tag/1.2.8): Released Rector 1.2.8 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.7...1.2.8) #### Bugfixes :bug: - \[UnusedImport] Fix removing multiple uses ([#&#8203;6376](https://github.com/rectorphp/rector-src/pull/6376)), Thanks [@&#8203;jorgsowa](https://github.com/jorgsowa)! - \[PostRector] Clean up variables and conditional usage on UnusedImportRemovingPostRector ([#&#8203;6378](https://github.com/rectorphp/rector-src/pull/6378)) - \[PostRector] Reduce repetitive toString() on loop on UnusedImportRemovingPostRector ([#&#8203;6379](https://github.com/rectorphp/rector-src/pull/6379)) - \[CodeQuality] Skip no @&#8203; property doc on DynamicDocBlockPropertyToNativePropertyRector ([#&#8203;6380](https://github.com/rectorphp/rector-src/pull/6380)) - \[CodeQuality] Handle with other attributes on DynamicDocBlockPropertyToNativePropertyRector ([#&#8203;6381](https://github.com/rectorphp/rector-src/pull/6381)) - \[CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector ([#&#8203;6382](https://github.com/rectorphp/rector-src/pull/6382)) - Fix duplicated register ContinueToBreakInSwitchRector in php52.php and php73.php ([#&#8203;6385](https://github.com/rectorphp/rector-src/pull/6385)) - \[AutoImport] Fix missing @&#8203; in deep annotation auto import ([#&#8203;6386](https://github.com/rectorphp/rector-src/pull/6386)) - \[DeadCode] Skip non FullyQualified property type on RemoveTypedPropertyNonMockDocblockRector ([#&#8203;6383](https://github.com/rectorphp/rector-src/pull/6383)) <br> #### New Features :partying_face: - \[CodeQuality] Add DynamicDocBlockPropertyToNativePropertyRector ([#&#8203;5691](https://github.com/rectorphp/rector-src/pull/5691)) - \[DX] \[Experimental] Add withPhpLevel() to raise PHP level one rule at a time ([#&#8203;6261](https://github.com/rectorphp/rector-src/pull/6261)) ### [`v1.2.7`](https://github.com/rectorphp/rector/releases/tag/1.2.7): Released Rector 1.2.7 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.6...1.2.7) #### New Features :partying\_face: - Apply AddOverrideAttributeToOverriddenMethodsRector to traits ([#&#8203;6367](https://github.com/rectorphp/rector-src/pull/6367)), Thanks [@&#8203;jrjohnson](https://github.com/jrjohnson)! - \[Transform] MethodCall to New ([#&#8203;6352](https://github.com/rectorphp/rector-src/pull/6352)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - Add RemoveTypedPropertyNonMockDocblockRector ([#&#8203;6306](https://github.com/rectorphp/rector-src/pull/6306)) - \[DX] Add links to open the editor to the names of processed files and the names of rules applied ([#&#8203;6272](https://github.com/rectorphp/rector-src/pull/6272)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! <br> #### Bugfixes :bug: - Fixed --memory-limit=-1 option handling when used in parallel ([#&#8203;6349](https://github.com/rectorphp/rector-src/pull/6349)), Thanks [@&#8203;ddegasperi](https://github.com/ddegasperi)! - \[Php70] Fix delimiter in the middle on EregToPregMatchRector ([#&#8203;6356](https://github.com/rectorphp/rector-src/pull/6356)) - \[Php70] More delimiter case in the middle fix on EregToPregMatchRector ([#&#8203;6357](https://github.com/rectorphp/rector-src/pull/6357)) - \[Php80] Cast string/int for int vs string condition and case condition on ChangeSwitchToMatchRector ([#&#8203;6359](https://github.com/rectorphp/rector-src/pull/6359)) - \[DeadCode] Skip from call with return docblock on ReduceAlwaysFalseIfOrRector ([#&#8203;6361](https://github.com/rectorphp/rector-src/pull/6361)) - \[TypeDeclaration] Closure Param Types from Iterator Source ([#&#8203;6345](https://github.com/rectorphp/rector-src/pull/6345)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Privatization] Allow privatize protected promoted property on PrivatizeFinalClassPropertyRector ([#&#8203;6360](https://github.com/rectorphp/rector-src/pull/6360)) - \[DeadCode] Skip with Else and ElseIf on SimplifyIfNotNullReturnRector ([#&#8203;6365](https://github.com/rectorphp/rector-src/pull/6365)) - \[Php70] Handle empty branch crash on unprintable char \x0C on EregToPregMatchRector ([#&#8203;6368](https://github.com/rectorphp/rector-src/pull/6368)) - \[UnusedImport] Different letter case for classes + optimization ([#&#8203;6362](https://github.com/rectorphp/rector-src/pull/6362)), Thanks [@&#8203;jorgsowa](https://github.com/jorgsowa)! - \[CodeQuality] Skip else indirect return on SimplifyIfReturnBoolRector ([#&#8203;6371](https://github.com/rectorphp/rector-src/pull/6371)) - \[CodeQuality] Clean up else check on SimplifyIfReturnBoolRector ([#&#8203;6372](https://github.com/rectorphp/rector-src/pull/6372)) - \[TypeDeclaration] Fix deep nested array docblock with \ prefix on ReturnTypeFromStrictNewArrayRector ([#&#8203;6373](https://github.com/rectorphp/rector-src/pull/6373)) - \[EarlyReturn] Skip nested with OR in root if statement condition on ChangeNestedForeachIfsToEarlyContinueRector ([#&#8203;6375](https://github.com/rectorphp/rector-src/pull/6375)) - \[DeadCode] Skip RemoveUnusedPrivatePropertyRector in middle assign ([#&#8203;6363](https://github.com/rectorphp/rector-src/pull/6363)) <br> #### Removed :skull: - \[NodeAnalyzer] Remove ClassAnalyzer::isAnonymousClassName() ([#&#8203;6351](https://github.com/rectorphp/rector-src/pull/6351)) - \[NodeAnalyzer] Remove unused AstResolver on VariadicAnalyzer ([#&#8203;6353](https://github.com/rectorphp/rector-src/pull/6353)) - \[DeadCode] Clean up double private method filtering on RemoveUnusedPrivateMethodRector ([#&#8203;6364](https://github.com/rectorphp/rector-src/pull/6364)) - \[DeadCode] Skip union docblock param with is\_object() native type check on RemoveAlwaysTrueIfConditionRector ([#&#8203;6370](https://github.com/rectorphp/rector-src/pull/6370)) <br> *** <br> #### rectorphp/rector-symfony :musical_note: - \[CodeQuality] Add AddTraitGetterReturnTypeBasedOnSetterRequiredRector ([#&#8203;671](https://github.com/rectorphp/rector-symfony/pull/671)) <br> #### rectorphp/rector-phpunit :green_circle: - \[PHPUnit 10] Add ifs as default way for withConsecutive, as more readable and opens upgrade during PHPUnit 9 ([#&#8203;382](https://github.com/rectorphp/rector-phpunit/pull/382)) - Use simple direct assert on consecutive in case of arrow function in callable ([#&#8203;381](https://github.com/rectorphp/rector-phpunit/pull/381)) - Use more readable ifs on will return in WithConsecutiveRector ([#&#8203;380](https://github.com/rectorphp/rector-phpunit/pull/380)) - add NarrowSingleWillReturnCallbackRector to code quality set ([#&#8203;379](https://github.com/rectorphp/rector-phpunit/pull/379)) ### [`v1.2.6`](https://github.com/rectorphp/rector/releases/tag/1.2.6): Released Rector 1.2.6 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.5...1.2.6) #### New Features :partying\_face: - \[TypeDeclaration] Add isset(), empty(), and negation support on BoolReturnTypeFromBooleanStrictReturnsRector ([#&#8203;6339](https://github.com/rectorphp/rector-src/pull/6339)) - \[TypeDeclaration] Add NativeMethodReflection support on ReturnStrictTypeAnalyzer ([#&#8203;6344](https://github.com/rectorphp/rector-src/pull/6344)) - \[DX] Show paths not match any file/directory on ProcessCommand when given path not exists ([#&#8203;6307](https://github.com/rectorphp/rector-src/pull/6307)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Convert inline [@&#8203;var](https://github.com/var) tag to assert() ([#&#8203;6300](https://github.com/rectorphp/rector-src/pull/6300)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix incorrect result after using RemoveByType in PhpDocInfo ([#&#8203;6301](https://github.com/rectorphp/rector-src/pull/6301)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[TypeDeclaration] Skip nullable callable on TypedPropertyFromAssignsRector ([#&#8203;6308](https://github.com/rectorphp/rector-src/pull/6308)) - Fix LocallyCalledStaticMethodToNonStaticRector when static function is called using the class name ([#&#8203;6310](https://github.com/rectorphp/rector-src/pull/6310)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[Php81] Handle crash on ArrowFunction attribute on FirstClassCallableRector ([#&#8203;6313](https://github.com/rectorphp/rector-src/pull/6313)) - \[Performance] Reduce double traverse on StrictNativeFunctionReturnTypeAnalyzer ([#&#8203;6320](https://github.com/rectorphp/rector-src/pull/6320)) - \[PhpParser] Alternative PR for findInstancesOfScoped() to keep existing performance ([#&#8203;6324](https://github.com/rectorphp/rector-src/pull/6324)) - \[CodingStyle] Use double quote to escape quotes in EncapsedStringsToSprintfRector ([#&#8203;6326](https://github.com/rectorphp/rector-src/pull/6326)) - \[TypeDeclaration] Handle crash on func call not found on BoolReturnTypeFromBooleanStrictReturnsRector ([#&#8203;6327](https://github.com/rectorphp/rector-src/pull/6327)) - Fix first class callable to use combineAcceptors() to avoid assert Arg instance error ([#&#8203;6330](https://github.com/rectorphp/rector-src/pull/6330)) - \[Php81] Allow used as assign expr on ReadOnlyPropertyRector ([#&#8203;6331](https://github.com/rectorphp/rector-src/pull/6331)) - Skip arrow function in scoped search ([#&#8203;6333](https://github.com/rectorphp/rector-src/pull/6333)) - \[TypeDeclaration] Better approach for native type check on ReturnStrictTypeAnalyzer ([#&#8203;6343](https://github.com/rectorphp/rector-src/pull/6343)) - \[DeadCode] Skip extension load append variable on RemoveAlwaysTrueIfConditionRector ([#&#8203;6332](https://github.com/rectorphp/rector-src/pull/6332)) - \[TypeDeclaration] Remove only void type on ReturnedNodesReturnTypeInfererTypeInferer ([#&#8203;6340](https://github.com/rectorphp/rector-src/pull/6340)) - \[DeadCode] Skip indirect next line definition of [@&#8203;var](https://github.com/var) on RemoveNonExistingVarAnnotationRector ([#&#8203;6348](https://github.com/rectorphp/rector-src/pull/6348)) <br> #### rectorphp/rector-symfony :musical_note: - Added return type declaration rules for FormTypeInterface ([#&#8203;670](https://github.com/rectorphp/rector-symfony/pull/670)), Thanks [@&#8203;stollr](https://github.com/stollr) <br> #### rectorphp/rector-phpunit :green_circle: - \[CodeQuality] Add NarrowSingleWillReturnCallbackRector ([#&#8203;374](https://github.com/rectorphp/rector-phpunit/pull/374)) - \[CodeQuality] Add SingleWithConsecutiveToWithRector ([#&#8203;370](https://github.com/rectorphp/rector-phpunit/pull/370)) - \[CodeQuality] Add NarrowIdenticalWithConsecutiveRector ([#&#8203;369](https://github.com/rectorphp/rector-phpunit/pull/369)) - \[CodeQuality] Add AddParentSetupCallOnSetupRector ([#&#8203;364](https://github.com/rectorphp/rector-phpunit/pull/364)) - Include match() to invoke counting in WithConsecutiveRector ([#&#8203;362](https://github.com/rectorphp/rector-phpunit/pull/362)) - Move WithConsecutiveRector to its PHPUnit100 namespace, CreateMockToAnonymousClassRector + PreferPHPUnitSelfCallRector to CodeQuality ([#&#8203;360](https://github.com/rectorphp/rector-phpunit/pull/360)) - Add existing willReturnCallback() support to WithConsecutiveRector ([#&#8203;358](https://github.com/rectorphp/rector-phpunit/pull/358)) ### [`v1.2.5`](https://github.com/rectorphp/rector/releases/tag/1.2.5): Released Rector 1.2.5 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.4...1.2.5) #### New Features and Improvements :partying\_face: - **20-30 % Rector speedup** - Optimise checking the node types allowed for each rule ([#&#8203;6232](https://github.com/rectorphp/rector-src/pull/6232)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[docs] Add help on the default process command ([#&#8203;6226](https://github.com/rectorphp/rector-src/pull/6226)), Thanks [@&#8203;94noni](https://github.com/94noni)! - \[TypeDeclaration] Adds `AddClosureParamTypeFromArgRector` ([#&#8203;6258](https://github.com/rectorphp/rector-src/pull/6258)) - Adds `AddClosureParamTypeFromObjectRector` ([#&#8203;6265](https://github.com/rectorphp/rector-src/pull/6265)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Config] Improve ComposerJsonPhpVersionResolver API, make use of explicit php set files ([#&#8203;6273](https://github.com/rectorphp/rector-src/pull/6273)) - \[FileSystem] Add data and writable to not include on InitFilePathsResolver ([#&#8203;6285](https://github.com/rectorphp/rector-src/pull/6285)) - always make paths absolute before processing files ([#&#8203;6293](https://github.com/rectorphp/rector-src/pull/6293)), Thanks [@&#8203;Kanti](https://github.com/Kanti)! <br> #### Bugfixes :bug: - \[CodeQuality] Handle crash on first class callable inside match on OptionalParametersAfterRequiredRector ([#&#8203;6263](https://github.com/rectorphp/rector-src/pull/6263)) - \[ReturnTypeInferer] Drop this/static docblock type check on ReturnTypeInferer ([#&#8203;6270](https://github.com/rectorphp/rector-src/pull/6270)) <br> #### Removed :skull: - \[deprecated] Remove deprecated ChangeAndIfToEarlyReturnRector, CallableThisArrayToAnonymousFunctionRector + casting rules ([#&#8203;6276](https://github.com/rectorphp/rector-src/pull/6276)) - \[deprecations] Remove deprecated GetClassToInstanceOfRector, UseIncrementAssignRector, DetectNodeCommand ([#&#8203;6278](https://github.com/rectorphp/rector-src/pull/6278)) - \[deprecated] Remove deprecated closure return rules, return type from strict bool/scalar returns ([#&#8203;6287](https://github.com/rectorphp/rector-src/pull/6287)) *** <br> #### rectorphp/rector-symfony :musical_note: - Add Class\_ annotation support to TemplateAnnotationToThisRenderRector ([#&#8203;666](https://github.com/rectorphp/rector-symfony/pull/666)) <br> #### rectorphp/rector-doctrine :orange_circle: - Refactor the OrderByKeyToClassConstRector to use the new enum only in `Criteria::orderBy` method calls ([#&#8203;336](https://github.com/rectorphp/rector-doctrine/pull/336)), Thanks [@&#8203;julienfastre](https://github.com/julienfastre) ### [`v1.2.4`](https://github.com/rectorphp/rector/releases/tag/1.2.4): Released Rector 1.2.4 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.3...1.2.4) #### Bugfixes :bug: - Fix PropertyTypeFromStrictSetterGetterRector for default null ([#&#8203;6231](https://github.com/rectorphp/rector-src/pull/6231)) - \[Php70] Fix with \r\n on EregToPregMatchRector ([#&#8203;6246](https://github.com/rectorphp/rector-src/pull/6246)) - Optimise post rectors ([#&#8203;6240](https://github.com/rectorphp/rector-src/pull/6240)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[Php84] Do not reprint node type on ExplicitNullableParamTypeRector ([#&#8203;6250](https://github.com/rectorphp/rector-src/pull/6250)) - Skip Doctrine collections in TypedPropertyFromAssignsRector ([#&#8203;6253](https://github.com/rectorphp/rector-src/pull/6253)) - Skip Columns from TypedPropertyFromAssignsRector, as handled better in doctrine rules ([#&#8203;6254](https://github.com/rectorphp/rector-src/pull/6254)) - \[AutoImport] Do not add cast on valid Integer type on Name Node on auto import enabled ([#&#8203;6236](https://github.com/rectorphp/rector-src/pull/6236)) - \[AutoImport] Do not add cast on valid Integer type on aliased Name Node on auto import enabled ([#&#8203;6237](https://github.com/rectorphp/rector-src/pull/6237)) - \[Performance] Cache should traverse for AddUseStatementGuard ([#&#8203;6234](https://github.com/rectorphp/rector-src/pull/6234)) <br> #### New Features :partying_face: - Adds the `ScalarValueToConstFetchRector` rule ([#&#8203;6195](https://github.com/rectorphp/rector-src/pull/6195)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[TypeDeclaration] Add `AddParamArrayDocblockBasedOnCallableNativeFuncCallRector` ([#&#8203;6233](https://github.com/rectorphp/rector-src/pull/6233)) - \[TypeDeclaration] Add `AddReturnArrayDocblockBasedOnArrayMapRector` ([#&#8203;6235](https://github.com/rectorphp/rector-src/pull/6235)) <br> #### Deprecated :skull: - Deprecate `PublicConstantVisibilityRector`, as adds public blindly everywhere; use scope-based approach instead ([#&#8203;6238](https://github.com/rectorphp/rector-src/pull/6238)) <br> #### rectorphp/rector-symfony :musical_note: - \[Symfony 6.1] Skip abstract class on CommandConfigureToAttributeRector ([#&#8203;662](https://github.com/rectorphp/rector-symfony/pull/662)) - \[CodeQuality] skip array + non native response return on ResponseReturnTypeControllerActionRector ([#&#8203;661](https://github.com/rectorphp/rector-symfony/pull/661)) - \[CodeQuality] Skip posible return array + response on ResponseReturnTypeControllerActionRector ([#&#8203;660](https://github.com/rectorphp/rector-symfony/pull/660)) - Do not convert to array Process->setInput() ([#&#8203;647](https://github.com/rectorphp/rector-symfony/pull/647)), Thanks [@&#8203;refsz](https://github.com/refsz) <br> #### rectorphp/rector-doctrine :orange_circle: - \[CodeQuality] Skip blob type on TypedPropertyFromColumnTypeRector ([#&#8203;340](https://github.com/rectorphp/rector-doctrine/pull/340)) - Fix attribute support in ImproveDoctrineCollectionDocTypeInEntityRector ([#&#8203;339](https://github.com/rectorphp/rector-doctrine/pull/339)) <br> #### rectorphp/rector-phpunit :large_blue_circle: - \[PHPUnit100] Fix typo in AssertIssetToAssertObjectHasPropertyRector ([#&#8203;356](https://github.com/rectorphp/rector-phpunit/pull/356)), Thanks [@&#8203;haydulski](https://github.com/haydulski) - \[Prefix] Fix Prefixed PHPUnit Ticket class ([#&#8203;355](https://github.com/rectorphp/rector-phpunit/pull/355)) - \[CodeQuality] Assert compare on countable ([#&#8203;353](https://github.com/rectorphp/rector-phpunit/pull/353)), Thanks [@&#8203;peterfox](https://github.com/peterfox) ### [`v1.2.3`](https://github.com/rectorphp/rector/releases/tag/1.2.3): Released Rector 1.2.3 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.2...1.2.3) #### New Features :partying\_face: - Add withRealPathReporting() to allow real paths in output formatters ([#&#8203;6187](https://github.com/rectorphp/rector-src/pull/6187)), Thanks [@&#8203;llaville](https://github.com/llaville)! - Add known type casting to AnnotationToAttributeRector ([#&#8203;6217](https://github.com/rectorphp/rector-src/pull/6217)) - Improve Carbon use parse method ([#&#8203;6183](https://github.com/rectorphp/rector-src/pull/6183)), Thanks [@&#8203;florisbosch](https://github.com/florisbosch)! <br> #### Bugfixes :bug: - Only import docblock if import name enabled on PostFileProcessor ([#&#8203;6185](https://github.com/rectorphp/rector-src/pull/6185)) - fix issue [#&#8203;8755](https://github.com/rectorphp/rector/issues/8755) about wrong systemError location ([#&#8203;6184](https://github.com/rectorphp/rector-src/pull/6184)), Thanks [@&#8203;llaville](https://github.com/llaville)! - Support more assign cases in PropertyFetchAssignManipulator ([#&#8203;6192](https://github.com/rectorphp/rector-src/pull/6192)), Thanks [@&#8203;andersonamuller](https://github.com/andersonamuller)! - Skip Symfony Response in ReturnTypeFromReturnNewRector ([#&#8203;6202](https://github.com/rectorphp/rector-src/pull/6202)) - Skip only response inside controller class ([#&#8203;6204](https://github.com/rectorphp/rector-src/pull/6204)) - \[Php54] No need reprint when array is just created on LongArrayToShortArrayRector ([#&#8203;6206](https://github.com/rectorphp/rector-src/pull/6206)) - \[TypeDeclaration] Handle crash on nullable intersection on ClosureReturnTypeRector ([#&#8203;6213](https://github.com/rectorphp/rector-src/pull/6213)) - \[Php71] Allow multiple same catches on MultiExceptionCatchRector ([#&#8203;6218](https://github.com/rectorphp/rector-src/pull/6218)) - \[CodeQuality] Skip Generator on SimplifyForeachToCoalescingRector ([#&#8203;6221](https://github.com/rectorphp/rector-src/pull/6221)) - \[CodeQuality] Ensure check native array type on Foreach\* rules ([#&#8203;6222](https://github.com/rectorphp/rector-src/pull/6222)) - \[TypeDeclaration] Skip isset and empty with index on param variable on StrictArrayParamDimFetchRector ([#&#8203;6227](https://github.com/rectorphp/rector-src/pull/6227)) - \[TypeDeclaration] Skip mixed in union on ClosureReturnTypeRector ([#&#8203;6228](https://github.com/rectorphp/rector-src/pull/6228)) <br> #### Removed :skull: - Remove SimplifyUselessVariableRector from code quality level ([#&#8203;6201](https://github.com/rectorphp/rector-src/pull/6201)), Thanks [@&#8203;Harfusha](https://github.com/Harfusha)! <br> *** <br> #### rectorphp/rector-symfony :musical_note: - Add the Symfony 7.0 set to SymfonySetList.php ([#&#8203;659](https://github.com/rectorphp/rector-symfony/pull/659)), Thanks [@&#8203;pbowyer](https://github.com/pbowyer) - \[Config] Add ParameterBagToAutowireAttributeRector ([#&#8203;654](https://github.com/rectorphp/rector-symfony/pull/654)) - add void fixture ([#&#8203;653](https://github.com/rectorphp/rector-symfony/pull/653)) - \[CodeQuality] Remove no returns check on ResponseReturnTypeControllerActionRector ([#&#8203;652](https://github.com/rectorphp/rector-symfony/pull/652)) - Add new Response() support to ResponseReturnTypeControllerActionRector ([#&#8203;651](https://github.com/rectorphp/rector-symfony/pull/651)) - \[Configs] Add MergeServiceNameTypeRector ([#&#8203;650](https://github.com/rectorphp/rector-symfony/pull/650)) - Deprecate ServicesSetNameToSetTypeRector as it creates invalid code ([#&#8203;649](https://github.com/rectorphp/rector-symfony/pull/649)) <br> #### rectorphp/rector-doctrine :orange_circle: - Add ODM support to TypedPropertyFromToManyRelationTypeRector ([#&#8203;335](https://github.com/rectorphp/rector-doctrine/pull/335)) - Add next fixture ([#&#8203;334](https://github.com/rectorphp/rector-doctrine/pull/334)) - Include ODM in description ([#&#8203;333](https://github.com/rectorphp/rector-doctrine/pull/333)) - Add TYPED\_COLLECTIONS set, to have rules deadling with collections together ([#&#8203;332](https://github.com/rectorphp/rector-doctrine/pull/332)) - Merge AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector to single rule ([#&#8203;331](https://github.com/rectorphp/rector-doctrine/pull/331)) - Add odm support to AddReturnDocBlockToCollectionPropertyGetterByToManyAnnotationRector ([#&#8203;330](https://github.com/rectorphp/rector-doctrine/pull/330)) - Add ODM support to ExplicitRelationCollectionRector ([#&#8203;329](https://github.com/rectorphp/rector-doctrine/pull/329)) <br> #### rectorphp/rector-phpunit :large_blue_circle: - \[PHPUnit100] Skip First class callable on RemoveSetMethodsMethodCallRector ([#&#8203;352](https://github.com/rectorphp/rector-phpunit/pull/352)) - Add magic methods mocking to RemoveSetMethodsMethodCallRector ([#&#8203;351](https://github.com/rectorphp/rector-phpunit/pull/351)) - \[CodeQuality] SetUpBeforeClassToSetUpRector ([#&#8203;350](https://github.com/rectorphp/rector-phpunit/pull/350)) ### [`v1.2.2`](https://github.com/rectorphp/rector/releases/tag/1.2.2): Released Rector 1.2.2 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.1...1.2.2) #### New Features :partying\_face: - \[TypeDeclaration] Add ReturnTypeFromMockObjectRector ([#&#8203;6166](https://github.com/rectorphp/rector-src/pull/6166)) - \[TypeDeclaration] Add TypedPropertyFromCreateMockAssignRector ([#&#8203;6177](https://github.com/rectorphp/rector-src/pull/6177)) <br> #### Bugfixes :bug: - Skip phpdoc types in NumericReturnTypeFromStrictReturnsRector ([#&#8203;6153](https://github.com/rectorphp/rector-src/pull/6153)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Fix union type by multiple method calls on ParamTypeByMethodCallTypeRector ([#&#8203;6155](https://github.com/rectorphp/rector-src/pull/6155)) - \[TypeDeclaration] Handle throw without new on on ParamTypeByMethodCallTypeRector ([#&#8203;6156](https://github.com/rectorphp/rector-src/pull/6156)) - \[TypeDeclaration] Refactor CallerParamMatcher to avoid ambigous returns usage ([#&#8203;6157](https://github.com/rectorphp/rector-src/pull/6157)) - \[TypeDeclaration] Prevent uncaught exception in ReturnTypeFromReturnNewRector ([#&#8203;6159](https://github.com/rectorphp/rector-src/pull/6159)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Prevent uncaught class-not-found exceptions ([#&#8203;6160](https://github.com/rectorphp/rector-src/pull/6160)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip variadic on StrictArrayParamDimFetchRector ([#&#8203;6163](https://github.com/rectorphp/rector-src/pull/6163)) - \[CodeQuality] Skip used in next stmt on UnusedForeachValueToArrayKeysRector ([#&#8203;6164](https://github.com/rectorphp/rector-src/pull/6164)) - \[Scoper] Fix prefixed MockObject on ReturnTypeFromMockObjectRector ([#&#8203;6167](https://github.com/rectorphp/rector-src/pull/6167)) - \[TypeDeclaration] Flip position between bool return and return tyep from strict constant on TypeDeclarationLevel ([#&#8203;6168](https://github.com/rectorphp/rector-src/pull/6168)) - \[TypeDeclaration] Skip possible void and return by docblock on ReturnTypeFromMockObjectRector ([#&#8203;6170](https://github.com/rectorphp/rector-src/pull/6170)) - \[TypeDeclaration] Update fixture and example method name ([#&#8203;6171](https://github.com/rectorphp/rector-src/pull/6171)) - \[NodeTypeResolver] Handle crash on variable variable with assign on FirstClassCallableRector ([#&#8203;6173](https://github.com/rectorphp/rector-src/pull/6173)) - \[NodeTypeResolver] Clean up re-fill scope on PHPStanNodeScopeResolver on variable variable ([#&#8203;6174](https://github.com/rectorphp/rector-src/pull/6174)) - \[NodeTypeResolver] Fill scope of dynamic variable variable ([#&#8203;6175](https://github.com/rectorphp/rector-src/pull/6175)) - fix: Convert DateTime to Carbon properly when hours/minutes/seconds are used ([#&#8203;6176](https://github.com/rectorphp/rector-src/pull/6176)), Thanks [@&#8203;florisbosch](https://github.com/florisbosch)! ### [`v1.2.1`](https://github.com/rectorphp/rector/releases/tag/1.2.1): Released Rector 1.2.1 [Compare Source](https://github.com/rectorphp/rector/compare/1.2.0...1.2.1) #### New Features :partying\_face: - \[type-declarations] Add ReturnNullableTypeRector ([#&#8203;6110](https://github.com/rectorphp/rector-src/pull/6110)) - \[type-declarations] Add StringsReturnTypeFromStrictScalarReturnsRector to complete the string returns ([#&#8203;6111](https://github.com/rectorphp/rector-src/pull/6111)) - \[PhpDoc] Add warning about missing PhpDocInfo name form tag value node ([#&#8203;6134](https://github.com/rectorphp/rector-src/pull/6134)) - \[TypeDeclaration] Introducing ClosureReturnTypeRector to handle closure types separately ([#&#8203;6106](https://github.com/rectorphp/rector-src/pull/6106)) - \[TypeDeclaration] Skip has named arg on AddMethodCallBasedStrictParamTypeRector ([#&#8203;6137](https://github.com/rectorphp/rector-src/pull/6137)) - \[e2e]\[Printer] Handle crash indentation on AddParamBasedOnParentClassMethodRector ([#&#8203;6112](https://github.com/rectorphp/rector-src/pull/6112)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip variadic on AddParamTypeBasedOnPHPUnitDataProviderRector ([#&#8203;6150](https://github.com/rectorphp/rector-src/pull/6150)) - \[TypeDeclaration] Add ConstFetch support on ReturnTypeFromStrictConstantReturnRector ([#&#8203;6151](https://github.com/rectorphp/rector-src/pull/6151)) - Refactor BooleanTypeMapper to handle value based on context ([#&#8203;6095](https://github.com/rectorphp/rector-src/pull/6095)) - Check root return in ReturnTypeFromReturnNewRector ([#&#8203;6102](https://github.com/rectorphp/rector-src/pull/6102)) - Make ReturnUnionTypeRector run on PHP 8.0+ ([#&#8203;6103](https://github.com/rectorphp/rector-src/pull/6103)) - ReturnUnionTypeRector now return only non-nullable types, to prepare space for new nullable rule as off PHP 7.1+ ([#&#8203;6105](https://github.com/rectorphp/rector-src/pull/6105)) - \[TypeDeclaration] handle explicit if else new on ReturnTypeFromReturnNewRector ([#&#8203;6104](https://github.com/rectorphp/rector-src/pull/6104)) - \[Php70] Swap min is higher than max on RandomFunctionRector ([#&#8203;6109](https://github.com/rectorphp/rector-src/pull/6109)) - Split StringReturnTypeFromStrictScalarReturnsRector into string, bool and numeric scalar + strict return type rules ([#&#8203;6113](https://github.com/rectorphp/rector-src/pull/6113)) - \[Php71] Handle not identical to Float for empty string should compare to 0.0 on BinaryOpBetweenNumberAndStringRector ([#&#8203;6117](https://github.com/rectorphp/rector-src/pull/6117)) - \[TypeDeclaration] Skip void on BoolReturnTypeFromBooleanStrictReturnsRector ([#&#8203;6118](https://github.com/rectorphp/rector-src/pull/6118)) - \[TypeDeclaration] Fix inline closure type on ClosureReturnTypeRector ([#&#8203;6119](https://github.com/rectorphp/rector-src/pull/6119)) - \[TypeDeclaration] Skip start with shebang on DeclareStrictTypesRector ([#&#8203;6121](https://github.com/rectorphp/rector-src/pull/6121)) - \[Php52] Handle deep if stmts on ContinueToBreakInSwitchRector ([#&#8203;6122](https://github.com/rectorphp/rector-src/pull/6122)) - \[Php52] Handle in deep else on ContinueToBreakInSwitchRector ([#&#8203;6123](https://github.com/rectorphp/rector-src/pull/6123)) - \[TypeDeclaration] Clean up ArrowFunction check on ReturnTypeInferer ([#&#8203;6124](https://github.com/rectorphp/rector-src/pull/6124)) - \[TypeDeclaration] Skip union with yield on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;6125](https://github.com/rectorphp/rector-src/pull/6125)) - \[Php82] Handle has only readonly properties but not all promoted property on ReadOnlyClassRector ([#&#8203;6129](https://github.com/rectorphp/rector-src/pull/6129)) - refactor: Move function first-class-callable to a standalone rule ([#&#8203;6131](https://github.com/rectorphp/rector-src/pull/6131)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - typo ([rectorphp/rector-src@`d102bd1`](https://github.com/rectorphp/rector-src/commit/d102bd166e8cc13ec50506dac2b2765ba29698a7)) - Fix ArrayDimFetchToMethodCallRector ([#&#8203;6138](https://github.com/rectorphp/rector-src/pull/6138)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[CodeQuality] Skip used in static Closure/ArrowFunction on LocallyCalledStaticMethodToNonStaticRector ([#&#8203;6139](https://github.com/rectorphp/rector-src/pull/6139)) - \[CodeQuality] Skip multiple new lines on JoinStringConcatRector ([#&#8203;6141](https://github.com/rectorphp/rector-src/pull/6141)) - \[CodeQuality] Allow change empty() to \[] compare of other object property usage on SimplifyEmptyCheckOnEmptyArrayRector ([#&#8203;6147](https://github.com/rectorphp/rector-src/pull/6147)) - \[Php55] Skip parse error on no concat in left in left Concat on PregReplaceEModifierRector ([#&#8203;6148](https://github.com/rectorphp/rector-src/pull/6148)) - \[CodingStyle] Handle with trait use adaptations on SeparateMultiUseImportsRector ([#&#8203;6149](https://github.com/rectorphp/rector-src/pull/6149)) - \[DeadCode] Remove unused [@&#8203;var](https://github.com/var) on key after remove key on RemoveUnusedForeachKeyRector ([#&#8203;6135](https://github.com/rectorphp/rector-src/pull/6135)) - \[DeadCode] Handle same namespace param type on RemoveUselessParamTagRector ([#&#8203;6133](https://github.com/rectorphp/rector-src/pull/6133)) <br> #### Removed and deprecated :skull: - Add - number support, deprecate ReturnTypeFromStrictScalarReturnExprRector functionality, already split ([#&#8203;6114](https://github.com/rectorphp/rector-src/pull/6114)) - Deprecate BoolReturnTypeFromStrictScalarReturnsRector, use BoolReturnTypeFromBooleanStrictReturnsRector instead ([#&#8203;6115](https://github.com/rectorphp/rector-src/pull/6115)) - \[DeadCode] Skip fluent no return type on RemoveUnusedPrivateMethodRector ([#&#8203;6108](https://github.com/rectorphp/rector-src/pull/6108)) - \[DeadCode] Skip fluent no return type on RemoveUnusedPrivateMethodRector take 2 ([#&#8203;6116](https://github.com/rectorphp/rector-src/pull/6116)) - \[Php80] Skip used in compact() on RemoveUnusedVariableInCatchRector ([#&#8203;6152](https://github.com/rectorphp/rector-src/pull/6152)) <br><br> #### rectorphp/rector-symfony - Correct return type definition for DataTransformerInterface ([#&#8203;645](https://github.com/rectorphp/rector-symfony/pull/645)), Thanks [@&#8203;bobvandevijver](https://github.com/bobvandevijver) - \[Symfony 6.1] Improve CommandPropertyToAttributeRector to work with freshly created AsCommand ([#&#8203;644](https://github.com/rectorphp/rector-symfony/pull/644)) - Add more complex names support to CommandPropertyToAttributeRector ([#&#8203;643](https://github.com/rectorphp/rector-symfony/pull/643)) - \[Symfony 6.3] Add ParamAndEnvAttributeRector ([#&#8203;641](https://github.com/rectorphp/rector-symfony/pull/641)) - \[Symfony 6.2] Improve SecurityAttributeToIsGrantedAttributeRector ([#&#8203;640](https://github.com/rectorphp/rector-symfony/pull/640)) - Add args() support to AutowireAttributeRector ([#&#8203;639](https://github.com/rectorphp/rector-symfony/pull/639)) - \[Config] Add configurable AutowireAttributeRector to add #\[Autowire(...)] to services ([#&#8203;637](https://github.com/rectorphp/rector-symfony/pull/637)) - feat: add api-platform/core config key ([#&#8203;635](https://github.com/rectorphp/rector-symfony/pull/635)), Thanks [@&#8203;dsdeboer](https://github.com/dsdeboer) - feat: add nelmio/cors-bundle config key ([#&#8203;634](https://github.com/rectorphp/rector-symfony/pull/634)), Thanks [@&#8203;dsdeboer](https://github.com/dsdeboer) - feat: two additional config ([#&#8203;633](https://github.com/rectorphp/rector-symfony/pull/633)), Thanks [@&#8203;dsdeboer](https://github.com/dsdeboer) - Hybrid CommandConfigureToAttributeRector ([#&#8203;632](https://github.com/rectorphp/rector-symfony/pull/632)), Thanks [@&#8203;ruudk](https://github.com/ruudk) <br> #### rectorphp/rector-doctrine - Fix outdated documentation in README.md ([#&#8203;328](https://github.com/rectorphp/rector-doctrine/pull/328)), Thanks [@&#8203;alexis-boyer](https://github.com/alexis-boyer) - Check is nullable doctrine annotation ([#&#8203;324](https://github.com/rectorphp/rector-doctrine/pull/324)), Thanks [@&#8203;marcelthole](https://github.com/marcelthole) - Add return doc block to Collection property's getter method by ToMany annotation ([#&#8203;322](https://github.com/rectorphp/rector-doctrine/pull/322)), Thanks [@&#8203;jszutkowski](https://github.com/jszutkowski) - Fix for AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector ([#&#8203;321](https://github.com/rectorphp/rector-doctrine/pull/321)), Thanks [@&#8203;jszutkowski](https://github.com/jszutkowski) <br> #### rectorphp/rector-phpunit - Add support for multiple dataProviders for a single test method ([#&#8203;349](https://github.com/rectorphp/rector-phpunit/pull/349)), Thanks [@&#8203;marcelthole](https://github.com/marcelthole) ### [`v1.2.0`](https://github.com/rectorphp/rector/releases/tag/1.2.0): Released Rector 1.2.0 [Compare Source](https://github.com/rectorphp/rector/compare/1.1.1...1.2.0) #### New Rules :rocket: - \[Renaming] Add RenameAttributeRector ([#&#8203;6009](https://github.com/rectorphp/rector-src/pull/6009)) - \[TypeDeclaration] Add AddClosureUnionReturnTypeRector ([#&#8203;6033](https://github.com/rectorphp/rector-src/pull/6033)) - \[TypeDeclaration] Add AddClosureNeverReturnTypeRector ([#&#8203;6039](https://github.com/rectorphp/rector-src/pull/6039)) - \[Php71] Add MultiDimensionalArrayToArrayDestructRector ([#&#8203;6031](https://github.com/rectorphp/rector-src/pull/6031)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - \[TypeDeclaration] Add AddClosureReturnTypeFromStrictParamRector ([#&#8203;6044](https://github.com/rectorphp/rector-src/pull/6044)) - \[TypeDeclaration] Add AddClosureReturnTypeFromReturnCastRector ([#&#8203;6061](https://github.com/rectorphp/rector-src/pull/6061)) - \[TypeDeclaration] Add AddClosureReturnTypeFromStrictNativeCallRector ([#&#8203;6059](https://github.com/rectorphp/rector-src/pull/6059)) <br> #### New Features :partying\_face: - **\[DX] Add withAttributes(all) option, add PHPUnit and Doctrine code quality sets to withPreparedSets() ([#&#8203;6004](https://github.com/rectorphp/rector-src/pull/6004))** - \[DX] Add symfony code quality preset ([#&#8203;6008](https://github.com/rectorphp/rector-src/pull/6008)) - \[DX] Add `withDowngradeSets()` to better target downgrades ([#&#8203;6015](https://github.com/rectorphp/rector-src/pull/6015)) - Add `always` config for EncapsedStringsToSprintfRector ([#&#8203;6050](https://github.com/rectorphp/rector-src/pull/6050)), Thanks [@&#8203;ruudk](https://github.com/ruudk)! - Add `only_direct_assign` config for SimplifyUselessVariableRector ([#&#8203;6034](https://github.com/rectorphp/rector-src/pull/6034)), Thanks [@&#8203;ruudk](https://github.com/ruudk)! - Skip files with short \<?= PHP tag as leads to invalid changes ([#&#8203;6068](https://github.com/rectorphp/rector-src/pull/6068)), ([#&#8203;6075](https://github.com/rectorphp/rector-src/pull/6075)) - \[Bridge] Add SetRectorsResolver, SetProviderCollector for easier use in 3rd-party tools ([#&#8203;6030](https://github.com/rectorphp/rector-src/pull/6030)) - \[DX] Inform about deprecated rules in config ([#&#8203;6047](https://github.com/rectorphp/rector-src/pull/6047)) - \[Config] Exclude listed on .gitignore for withRootFiles() ([#&#8203;6028](https://github.com/rectorphp/rector-src/pull/6028)) <br> #### Bugfixes :bug: - AddTypeToConstRector: apply if const references another class const ([#&#8203;6017](https://github.com/rectorphp/rector-src/pull/6017)), Thanks [@&#8203;tugmaks](https://github.com/tugmaks)! - fix: Skip adding string casting to closure return when it returns str… ([#&#8203;6018](https://github.com/rectorphp/rector-src/pull/6018)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - fix: Add code as a named argument ([#&#8203;6062](https://github.com/rectorphp/rector-src/pull/6062)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - Fix message handler removal in RemoveUnusedPublicMethodParameterRector ([#&#8203;6001](https://github.com/rectorphp/rector-src/pull/6001)) - fix: Skip refactoring when foreach if statement contains calls to met… ([#&#8203;6019](https://github.com/rectorphp/rector-src/pull/6019)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - fix: Use named arguments if they are already used ([#&#8203;6022](https://github.com/rectorphp/rector-src/pull/6022)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - \[Naming] Handle used in arrow function param, then used again outer ArrowFunction on RenameParamToMatchTypeRector ([#&#8203;6046](https://github.com/rectorphp/rector-src/pull/6046)) - Fix docker commands in CONTRIBUTING.md ([#&#8203;6023](https://github.com/rectorphp/rector-src/pull/6023)), Thanks [@&#8203;tugmaks](https://github.com/tugmaks)! - fix: Skip static calls which are made using the class name ([#&#8203;6024](https://github.com/rectorphp/rector-src/pull/6024)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - feat: Support functions for first-class-callable ([#&#8203;6027](https://github.com/rectorphp/rector-src/pull/6027)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - \[Cleanup] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions ([#&#8203;6041](https://github.com/rectorphp/rector-src/pull/6041)) - fix: Convert DateTime to Carbon properly when negative days/months are used ([#&#8203;6051](https://github.com/rectorphp/rector-src/pull/6051)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! - \[Php81] Handle usage as arg by ref key on falsy ObjectType on ReadOnlyPropertyRector ([#&#8203;6054](https://github.com/rectorphp/rector-src/pull/6054)) - fix: Skip remove always true condition on method calls ([#&#8203;6063](https://github.com/rectorphp/rector-src/pull/6063)), Thanks [@&#8203;nikolicaleksa](https://github.com/nikolicaleksa)! <br> #### Removed and Deprecated :skull: - \[TypeDeclaration] Remove ArrowFunction from ReturnTypeFromReturnDirectArrayRector and ReturnTypeFromReturnNewRector ([#&#8203;6032](https://github.com/rectorphp/rector-src/pull/6032)) - \[Cleanup] Remove [@&#8203;changelog](https://github.com/changelog) as no longer maintained/used, use RuleDefinition instead ([#&#8203;6035](https://github.com/rectorphp/rector-src/pull/6035)) - \[Cleanup] Remove FormatPerservingPrinter as only delegate method, use BetterStandardPrinter directly ([#&#8203;6036](https://github.com/rectorphp/rector-src/pull/6036)) - Remove CurrentFileProvider from ValueResolver, let type resolver handle dir and filename ([#&#8203;6069](https://github.com/rectorphp/rector-src/pull/6069)) - \[Cleanup] Deprecate UseIncrementAssignRector as depends on context and might be intentional (\[[#&#8203;6042](https://github.com/rectorphp/rector/issues/6042)] - \[CodeQuality] Deprecate GetClassToInstanceOfRector as can create invalid comparison ([#&#8203;6005](https://github.com/rectorphp/rector-src/pull/6005)) - \[Cleanup] Deprecate \*ToTypeCastRector rules as no difference in performance, handle by cs instead ([#&#8203;6043](https://github.com/rectorphp/rector-src/pull/6043)) - deprecate SetListInterface ([rectorphp/rector-src@`442bff7`](https://github.com/rectorphp/rector-src/commit/442bff7bb8c8138227b19e9fa5907cb4d4f5dae8)) - Unregister GetClassToInstanceOfRector from CodeQualityLevel.php ([#&#8203;6006](https://github.com/rectorphp/rector-src/pull/6006)) - Split docblock name imports and name imports as different scope, skip for HTML nodes ([#&#8203;6071](https://github.com/rectorphp/rector-src/pull/6071)) - \[DX] Deprecate dump-node command, use more advanced <https://getrector.com/ast> instead ([#&#8203;6040](https://github.com/rectorphp/rector-src/pull/6040)) <br> This is first release that includes news from other Rector core rules, so you know about all the hot stuff 😇 #### Symfony (rectorphp/rector-symfony) ##### New Rules and Improvements - Improve CommandConfigureToAttributeRector to allow merge with existing attribute ([#&#8203;632](https://github.com/rectorphp/rector-symfony/pull/632)), Thanks [@&#8203;ruudk](https://github.com/ruudk) - feat: add web\_profiler as config builder ([#&#8203;631](https://github.com/rectorphp/rector-symfony/pull/631)), Thanks [@&#8203;dsdeboer](https://github.com/dsdeboer) - Add "hidden" support to CommandConfigureToAttributeRector ([#&#8203;628](https://github.com/rectorphp/rector-symfony/pull/628)) - \[Symfony 7.0 and 7.1] Extend sets based on upgrade notes ([#&#8203;627](https://github.com/rectorphp/rector-symfony/pull/627)) - \[Symfony 6.4] Add DataTransformerInterface return types ([#&#8203;624](https://github.com/rectorphp/rector-symfony/pull/624)) - \[Symfony 6.4] Deprecate ChangeRouteAttributeFromAnnotationSubnamespaceRector, make use of RenameAttribute instead ([#&#8203;623](https://github.com/rectorphp/rector-symfony/pull/623)) - \[Symfony 6.2] Add SecurityAttributeToIsGrantedAttributeRector ([#&#8203;622](https://github.com/rectorphp/rector-symfony/pull/622)) - \[Symfony 6.1] Add CommandConfigureToAttributeRector ([#&#8203;619](https://github.com/rectorphp/rector-symfony/pull/619)) - \[EventDispatcher] Skip EventListenerToEventSubscriberRector for classes with #\[AsEventListener] attribute ([#&#8203;616](https://github.com/rectorphp/rector-symfony/pull/616)) ##### Deprecated - \[Symfony 4.3] Deprecate WebTestCaseAssertSelectorTextContainsRector as does not create valid code ([#&#8203;621](https://github.com/rectorphp/rector-symfony/pull/621)) - \[Symfony 4.0] Deprecate ProcessBuilderGetProcessRector, as change is not valid ([#&#8203;620](https://github.com/rectorphp/rector-symfony/pull/620)) - \[CodeQuality] Deprecate MakeCommandLazyRector, as Symfony 6.1 introduces more reliable native attribute ([#&#8203;618](https://github.com/rectorphp/rector-symfony/pull/618)) - \[Symfony 5.3] Deprecated CommandDescriptionToPropertyRector rule, as only middle step before 6.1 native attribute ([#&#8203;617](https://github.com/rectorphp/rector-symfony/pull/617)) <br> #### Doctrine - rectorphp/rector-doctrine - Add return doc block to Collection property's getter method by ToMany attribute ([#&#8203;317](https://github.com/rectorphp/rector-doctrine/pull/317)), Thanks [@&#8203;jszutkowski](https://github.com/jszutkowski) <br> #### PHPUnit - rectorphp/rector-phpunit - Add support for multiple dataProviders for a single test method ([#&#8203;349](https://github.com/rectorphp/rector-phpunit/pull/349)), Thanks [@&#8203;marcelthole](https://github.com/marcelthole) - Remove NamedArgumentForDataProviderRector from the PHPUnit 11 set as optional upgrade path ([#&#8203;348](https://github.com/rectorphp/rector-phpunit/pull/348)) - Fix prefixed scoped DataProvider class on NamedArgumentForDataProviderRector ([#&#8203;347](https://github.com/rectorphp/rector-phpunit/pull/347)) - Make AddSeeTestAnnotationRector slightly more performant as very slow, keep existing see annotations ([#&#8203;343](https://github.com/rectorphp/rector-phpunit/pull/343)) - \[PHPUnit 10] Fix typo assertObjectHasNotProperty -> assertObjectNotHasProperty ([#&#8203;340](https://github.com/rectorphp/rector-phpunit/pull/340)) - \[PHPUnit 10] Rename assertObjectHasAttribute() to assertObjectHasProperty(), add AssertIssetToAssertObjectHasPropertyRector ([#&#8203;338](https://github.com/rectorphp/rector-phpunit/pull/338)) - Fix AssertCompareToSpecificMethodRector to skip gettype checks, as will be deprecated in next PHPUnit version ([#&#8203;337](https://github.com/rectorphp/rector-phpunit/pull/337)) ### [`v1.1.1`](https://github.com/rectorphp/rector/releases/tag/1.1.1): Released Rector 1.1.1 [Compare Source](https://github.com/rectorphp/rector/compare/1.1.0...1.1.1) **\[Performance] Fix huge performance hit by reverting children class detection ([#&#8203;5995](https://github.com/rectorphp/rector-src/pull/5995)) - fixes [#&#8203;8679](https://github.com/rectorphp/rector/issues/8679), [#&#8203;8638](https://github.com/rectorphp/rector/issues/8638), [#&#8203;8637](https://github.com/rectorphp/rector/issues/8637)** <br> #### New Rules - \[TypeDeclaration] Add ReturnTypeFromReturnCastRector ([#&#8203;5905](https://github.com/rectorphp/rector-src/pull/5905)) - \[TypeDeclaration] Add ReturnTypeFromSymfonySerializerRector ([#&#8203;5908](https://github.com/rectorphp/rector-src/pull/5908)) - \[TypeDeclaration] Add TypedPropertyFromJMSSerializerAttributeTypeRector ([#&#8203;5909](https://github.com/rectorphp/rector-src/pull/5909)) - \[TypeDeclaration] Add AddTypeFromResourceDocblockRector ([#&#8203;5915](https://github.com/rectorphp/rector-src/pull/5915)) - \[Php74] Add HebrevcToNl2brHebrevRector ([#&#8203;5977](https://github.com/rectorphp/rector-src/pull/5977)) - \[Php74] Add RestoreIncludePathToIniRestoreRector ([#&#8203;5973](https://github.com/rectorphp/rector-src/pull/5973)) - \[Carbon] Init set to migrate DateTime to Carbon ([#&#8203;5868](https://github.com/rectorphp/rector-src/pull/5868)) - \[Carbon] Add immutable support to other rules ([#&#8203;5896](https://github.com/rectorphp/rector-src/pull/5896)) - Convert DateTimeImmutable to CarbonImmutable ([#&#8203;5895](https://github.com/rectorphp/rector-src/pull/5895)) - Convert time() to Carbon::now()->timestamp ([#&#8203;5901](https://github.com/rectorphp/rector-src/pull/5901)), Thanks [@&#8203;kylekatarnls](https://github.com/kylekatarnls)! <br> #### New Features and DX improvements :partying_face: - **Add code quality levels** ([#&#8203;5910](https://github.com/rectorphp/rector-src/pull/5910)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - **\[DX] Introduce set providers**, to enable package + version based set registration ([#&#8203;5976](https://github.com/rectorphp/rector-src/pull/5976)) - \[DX] Report rules that registered in withSkip() but never registered in withRules() ([#&#8203;5919](https://github.com/rectorphp/rector-src/pull/5919)) - \[Set] Add new rector-preset set to have opiniated rector rules that can be enabled in rector-src and its extension ([#&#8203;5924](https://github.com/rectorphp/rector-src/pull/5924)) - \[DeadCode] Add RemoveUnusedPublicMethodParameterRector ([#&#8203;5925](https://github.com/rectorphp/rector-src/pull/5925)) - \[TypeDeclaration] Handle double declare(strict\_types=1) addition on DeclareStrictTypesRector + IncreaseDeclareStrictTypesRector ([#&#8203;5928](https://github.com/rectorphp/rector-src/pull/5928)) - \[CodingStyle]\[Php80] Add join func call support on ConsistentImplodeRector ([#&#8203;5958](https://github.com/rectorphp/rector-src/pull/5958)) - \[CodeQuality] Add support for (), {}, \[], <> delimiter on RegexPatternDetector ([#&#8203;5957](https://github.com/rectorphp/rector-src/pull/5957)) - \[TypeDeclaration] Add Static Call support on AddMethodCallBasedStrictParamTypeRector ([#&#8203;5960](https://github.com/rectorphp/rector-src/pull/5960)) - \[Config] Add withPhpPolyfill() method to load php polyfill set on RectorConfigBuilder ([#&#8203;5983](https://github.com/rectorphp/rector-src/pull/5983)) - **\[DX] Add ->withPhpXSets() for PHP 7.4 and lower, improve ->withPreparedSets()** ([#&#8203;5984](https://github.com/rectorphp/rector-src/pull/5984)) - \[config] Disable parallel on --debug ([#&#8203;5904](https://github.com/rectorphp/rector-src/pull/5904)) - \[Php80] Skip mixed doc with description and valid doc on MixedTypeRector ([#&#8203;5906](https://github.com/rectorphp/rector-src/pull/5906)) - \[DX] Add `withPhpPolyfills()` method to add polyfill rules ([#&#8203;5981](https://github.com/rectorphp/rector-src/pull/5981)) [rectorphp/rector-src#5983](https://github.com/rectorphp/rector-src/pull/5983) - \[DX] Ommit static functions/closure from coding-style, as often ignored and depends on personal preference ([#&#8203;5916](https://github.com/rectorphp/rector-src/pull/5916)) - \[DX] Ommit post-inc to pre-inc rule from coding-style as too opinionated ([#&#8203;5917](https://github.com/rectorphp/rector-src/pull/5917)) - \[DX] Remove UseIncrementAssignRector from coding-style set, as often ignored ([#&#8203;5920](https://github.com/rectorphp/rector-src/pull/5920)) <br> #### Bugfixes :bug: - \[AutoImport] No need RenamedClassesDataCollector usage on UsesClassNameImportSkipVoter ([#&#8203;5921](https://github.com/rectorphp/rector-src/pull/5921)) - \[Php81] Skip private method from instantiated class on FirstClassCallableRector ([#&#8203;5929](https://github.com/rectorphp/rector-src/pull/5929)) - \[NodeTypeCorrector] Directly use StringType on Intersection of strings on AccessoryNonEmptyStringTypeCorrector ([#&#8203;5933](https://github.com/rectorphp/rector-src/pull/5933)) - \[CodeQuality] Allow check in current Class\_ with multiple props on CompleteDynamicPropertiesRector ([#&#8203;5938](https://github.com/rectorphp/rector-src/pull/5938)) - \[Naming] Handle rename property with only comment, without [@&#8203;var](https://github.com/var) doc on RenamePropertyToMatchTypeRector ([#&#8203;5945](https://github.com/rectorphp/rector-src/pull/5945)) - Remove the renaming of apache\_request\_headers ([#&#8203;5943](https://github.com/rectorphp/rector-src/pull/5943)), Thanks [@&#8203;rhuijts](https://github.com/rhuijts)! - \[Naming] Handle nullable object [@&#8203;var](https://github.com/var) docblock on RenamePropertyToMatchTypeRector ([#&#8203;5946](https://github.com/rectorphp/rector-src/pull/5946)) - \[Php81] Skip param variable used in next stmt after coalesce on NewInInitializerRector ([#&#8203;5971](https://github.com/rectorphp/rector-src/pull/5971)) - \[Php71] Skip call abstract method on RemoveExtraParametersRector ([#&#8203;5930](https://github.com/rectorphp/rector-src/pull/5930)) - \[TypeDeclaration] Do not remove docblock with description on MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5931](https://github.com/rectorphp/rector-src/pull/5931)) - \[DeadCode] Remove param docblock on RemoveUnusedPromotedPropertyRector when exists ([#&#8203;5936](https://github.com/rectorphp/rector-src/pull/5936)) - \[Cleanup] Remove deprecated AttributeKey::PARENT\_NODE, remove deprecated NodeNameResolver::isCaseSensitiveName() ([#&#8203;5939](https://github.com/rectorphp/rector-src/pull/5939)) - \[NodeTypeResolver] Remove Property->type instanceof Node check on NodeTypeResolver->getType() ([#&#8203;5947](https://github.com/rectorphp/rector-src/pull/5947)) - \[BetterPhpDocParser] Remove unnecessary PrivatesAccessor usage on BetterTokenIterator and TokenIteratorFactory ([#&#8203;5950](https://github.com/rectorphp/rector-src/pull/5950)) - \[DeadCode] Skip dynamic variable on RemoveUnusedVariableAssignRector ([#&#8203;5964](https://github.com/rectorphp/rector-src/pull/5964)) - \[DeadCode] Reduce loop for used in next stmt on RemoveUnusedVariableAssignRector ([#&#8203;5969](https://github.com/rectorphp/rector-src/pull/5969)) <br> #### Removed and Deprecated :skull: - Remove deprecated and empty FinalizeClassesWithoutChildrenRector + FinalizePublicClassConstantRector ([#&#8203;5980](https://github.com/rectorphp/rector-src/pull/5980)) - \[DX] Soft-deprecate CallableThisArrayToAnonymousFunctionRector, as FirstClassCallableRector handles the same case better ([#&#8203;5918](https://github.com/rectorphp/rector-src/pull/5918)) ### [`v1.1.0`](https://github.com/rectorphp/rector/releases/tag/1.1.0): Released Rector 1.1.0 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.5...1.1.0) #### New Features :partying\_face: - \[PHPStan] Bump to PHPStan 1.11 ([#&#8203;5883](https://github.com/rectorphp/rector-src/pull/5883)) #### Bugfixes :bug: - \[CodeQuality] Skip increment variable on else on TernaryFalseExpressionToIfRector ([#&#8203;5867](https://github.com/rectorphp/rector-src/pull/5867)) - \[CodeQuality] Skip on property and class const on CallableThisArrayToAnonymousFunctionRector ([#&#8203;5869](https://github.com/rectorphp/rector-src/pull/5869)) - \[NodeTypeResolver] Using built int ->isArray()->yes() on ArrayTypeAnalyzer::isArrayType() ([#&#8203;5870](https://github.com/rectorphp/rector-src/pull/5870)) - Fix "method x was not found in reflection of class" ([#&#8203;5871](https://github.com/rectorphp/rector-src/pull/5871)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[NodeTypeResolver] Clean up array check on NameTypeResolver ([#&#8203;5872](https://github.com/rectorphp/rector-src/pull/5872)) - \[NodeTypeResolver] Clean up "this" from NameTypeResolver, as not from Name node ([#&#8203;5873](https://github.com/rectorphp/rector-src/pull/5873)) - \[TypeDeclaration] Skip array by doc with different assign on ReturnTypeFromStrictNewArrayRector ([#&#8203;5875](https://github.com/rectorphp/rector-src/pull/5875)) - \[TypeDeclaration] Skip possible array on StrictStringParamConcatRector ([#&#8203;5876](https://github.com/rectorphp/rector-src/pull/5876)) - \[Performance] Ensure call $reflector->reflectAllClasses() once on Worker take 3 ([#&#8203;5878](https://github.com/rectorphp/rector-src/pull/5878)) - \[Performance] Call cached class names collection on FamilyRelationsAnalyzer ([#&#8203;5879](https://github.com/rectorphp/rector-src/pull/5879)) - \[NodeTypeResolver] Clean up resolve cache class name key ([#&#8203;5880](https://github.com/rectorphp/rector-src/pull/5880)) - \[NodeTypeResolver] No need json\_decode/json\_encode for cache class name collection ([#&#8203;5881](https://github.com/rectorphp/rector-src/pull/5881)) - \[TypeDeclaration] Handle crash on interface Mixin on ReturnTypeFromStrictConstantReturnRector ([#&#8203;5884](https://github.com/rectorphp/rector-src/pull/5884)) - \[PHPStan] Handle PHPStan internal ShouldNotHappenException on FamilyRelationsAnalyzer and PHPStanNodeScopeResolver ([#&#8203;5885](https://github.com/rectorphp/rector-src/pull/5885)) - \[NodeTypeResolver] No need to resolve class name on anonymous classes ([#&#8203;5886](https://github.com/rectorphp/rector-src/pull/5886)) - \[PHPStan] Fix missingType.generics notice on phpstan.neon on PHPStan 1.11 ([#&#8203;5888](https://github.com/rectorphp/rector-src/pull/5888)) - \[TypeDeclaration] Skip unitialized property on EmptyOnNullableObjectToInstanceOfRector ([#&#8203;5889](https://github.com/rectorphp/rector-src/pull/5889)) - \[Php80] Skip remove non-mixed type doc on MixedTypeRector ([#&#8203;5874](https://github.com/rectorphp/rector-src/pull/5874)) - \[TypeDeclaration] Add test for nullable object usage on AddReturnTypeDeclarationRector ([#&#8203;5887](https://github.com/rectorphp/rector-src/pull/5887)) - \[Configuration] Add missing LevelSetList::UP\_TO\_PHP\_84 on PhpLevelSetResolver::resolveFromPhpVersion() ([#&#8203;5890](https://github.com/rectorphp/rector-src/pull/5890)) ### [`v1.0.5`](https://github.com/rectorphp/rector/releases/tag/1.0.5): Released Rector 1.0.5 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.4...1.0.5) #### New Features :partying\_face: - \[TypeDeclarations] Add IncreaseDeclareStrictTypesRector to raise level of declare() coverage ([#&#8203;5849](https://github.com/rectorphp/rector-src/pull/5849)) <br> #### Bugfixes :bug: - ExplicitReturnNullRector should skip never return ([#&#8203;5802](https://github.com/rectorphp/rector-src/pull/5802)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Make Compatible with phpstan 1.11.x code ([#&#8203;5804](https://github.com/rectorphp/rector-src/pull/5804)) - \[CodeQuality] Skip Always return in try catch with finally on ExplicitReturnNullRector ([#&#8203;5807](https://github.com/rectorphp/rector-src/pull/5807)) - \[CodeQuality] Skip never type on default switch on ExplicitReturnNullRector ([#&#8203;5808](https://github.com/rectorphp/rector-src/pull/5808)) - \[CodeQuality] Skip while(true) always returned on ExplicitReturnNullRector ([#&#8203;5810](https://github.com/rectorphp/rector-src/pull/5810)) - \[TypeDeclaration] Skip maybe not returned on while on ReturnUnionTypeRector ([#&#8203;5812](https://github.com/rectorphp/rector-src/pull/5812)) - \[Php81] Skip on property and class const on FirstClassCallableRector ([#&#8203;5813](https://github.com/rectorphp/rector-src/pull/5813)) - \[Php81] Skip \_\_invoke() usage from non-class code on FirstClassCallableRector ([#&#8203;5816](https://github.com/rectorphp/rector-src/pull/5816)) - \[Php81] Skip always string if else DomElement on NullToStrictStringFuncCallArgRector ([#&#8203;5822](https://github.com/rectorphp/rector-src/pull/5822)) - \[TypeDeclaration] Handle crash on [@&#8203;mixin](https://github.com/mixin) usage on ReturnTypeFromStrictTypedCallRector ([#&#8203;5823](https://github.com/rectorphp/rector-src/pull/5823)) - \[Php81] Skip mixed type on ArrayDimFetch on NullToStrictStringFuncCallArgRector ([#&#8203;5826](https://github.com/rectorphp/rector-src/pull/5826)) - Fix original quotes in PregReplaceEModifierRector ([#&#8203;5827](https://github.com/rectorphp/rector-src/pull/5827)) - \[CodeQuality] Skip $counter variable exists on ForRepeatedCountToOwnVariableRector ([#&#8203;5828](https://github.com/rectorphp/rector-src/pull/5828)) - \[Php81] Use PHPStan ParametersAcceptor to detect allowed argument types on NullToStrictStringFuncCallArgRector ([#&#8203;5829](https://github.com/rectorphp/rector-src/pull/5829)) - \[Renaming] Skip func call name on RenameClassRector ([#&#8203;5833](https://github.com/rectorphp/rector-src/pull/5833)) - Support NullSafeMethod calls in unused-code analysis ([#&#8203;5838](https://github.com/rectorphp/rector-src/pull/5838)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Support NullSafeProperty fetches in unused-code analysis ([#&#8203;5839](https://github.com/rectorphp/rector-src/pull/5839)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Ignore phpdoc type in RecastingRemovalRector ([#&#8203;5841](https://github.com/rectorphp/rector-src/pull/5841)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Naming] Skip DateTime as individual in name resolver ([#&#8203;5842](https://github.com/rectorphp/rector-src/pull/5842)) - \[Experiment] Rework child classes detection on DynamicSourceLocatorProvider ([#&#8203;5735](https://github.com/rectorphp/rector-src/pull/5735)) - \[Printer] Handle Strip left spaces from opening tags on namespaced PHP + HTML content ([#&#8203;5851](https://github.com/rectorphp/rector-src/pull/5851)) - \[CodeQuality] Fix tautology transformation on identical check on SimplifyTautologyTernaryRector ([#&#8203;5854](https://github.com/rectorphp/rector-src/pull/5854)) - \[CodeQuality] Skip dynamic second arg or has uppercase second arg on SimplifyStrposLowerRector ([#&#8203;5855](https://github.com/rectorphp/rector-src/pull/5855)) - \[NodeTypeResolver] Use existing DefaultReflector::reflectAllClasses() method on DynamicSourceLocatorProvider ([#&#8203;5856](https://github.com/rectorphp/rector-src/pull/5856)) - \[EarlyReturn] Skip with AssignOp on PreparedValueToEarlyReturnRector ([#&#8203;5857](https://github.com/rectorphp/rector-src/pull/5857)) - \[TypeDeclaration] Handle array with index assigned on TypedPropertyFromAssignsRector ([#&#8203;5861](https://github.com/rectorphp/rector-src/pull/5861)) - \[TypeDeclaration] Handle return by array shape type on AddArrowFunctionReturnTypeRector ([#&#8203;5815](https://github.com/rectorphp/rector-src/pull/5815)) - \[CodeQuality] Add Function\_ and FuncCall support on OptionalParametersAfterRequiredRector ([#&#8203;5835](https://github.com/rectorphp/rector-src/pull/5835)) - \[Php83] Handle default native constant on AddTypeToConstRector ([#&#8203;5843](https://github.com/rectorphp/rector-src/pull/5843)) - \[PHP 7.2] Add error suppres support to each() rule ([#&#8203;5844](https://github.com/rectorphp/rector-src/pull/5844)) - \[TypeDeclaration] Skip more detailed type on AddMethodCallBasedStrictParamTypeRector ([#&#8203;5866](https://github.com/rectorphp/rector-src/pull/5866)) - \[DeadCode] Skip $this instanceof in Trait on RemoveAlwaysTrueIfConditionRector ([#&#8203;5817](https://github.com/rectorphp/rector-src/pull/5817)) - \[DeadCode] Skip $this in trait on RemoveDeadInstanceOfRector ([#&#8203;5818](https://github.com/rectorphp/rector-src/pull/5818)) ### [`v1.0.4`](https://github.com/rectorphp/rector/releases/tag/1.0.4): Released Rector 1.0.4 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.3...1.0.4) #### New Features and Changes :partying\_face: - \[Php84] Add ExplicitNullableParamTypeRector ([#&#8203;5724](https://github.com/rectorphp/rector-src/pull/5724)) - \[Transform] Adds ArrayDimFetchToMethodCallRector rule ([#&#8203;5723](https://github.com/rectorphp/rector-src/pull/5723)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - Add support for getOneOrNullResult() method in ChildDoctrineRepositoryClassTypeRector ([#&#8203;5747](https://github.com/rectorphp/rector-src/pull/5747)) - Add boolean and support to RemoveDeadInstanceOfRector ([#&#8203;5748](https://github.com/rectorphp/rector-src/pull/5748)) - \[DeadCode] Add new rule - ReduceAlwaysFalseIfOrRector ([rectorphp/rector-src@`0dd1a43`](https://github.com/rectorphp/rector-src/commit/0dd1a43904e7d12c76e810b1bbd87d99a0f835c3)) - \[CodeQuality] Add new rule - ExplicitReturnNullRector ([#&#8203;5753](https://github.com/rectorphp/rector-src/pull/5753)) - \[CodeQuality] Transform type|void docblock to type|null as well on ExplicitReturnNullRector after add return null ([rectorphp/rector-src@`576198c`](https://github.com/rectorphp/rector-src/commit/576198cf701684dd85ed42530bcb8c54b6c41a02)) - \[CodeQuality] Add Function\_ support on ExplicitReturnNullRector ([#&#8203;5762](https://github.com/rectorphp/rector-src/pull/5762)) - \[CodeQuality] Add Goto\_ possible return null on SilentVoidResolver under Do\_ ([#&#8203;5773](https://github.com/rectorphp/rector-src/pull/5773)) - Add `rector` test suite to `phpunit.xml` or `phpunit.xml.dist` ([#&#8203;5717](https://github.com/rectorphp/rector-src/pull/5717)), Thanks [@&#8203;ghostwriter](https://github.com/ghostwriter)! - \[Php82] Add VariableInStringInterpolationFixerRector ([#&#8203;5781](https://github.com/rectorphp/rector-src/pull/5781)) - \[DeadCode] Add RemoveUselessReadOnlyTagRector ([rectorphp/rector-src@`ef333de`](https://github.com/rectorphp/rector-src/commit/ef333de3d58a4649558971b19f4814fd92823abe)) <br> #### Bugfixes :bug: - \[php84] Clean up contains null check type on ExplicitNullableParamTypeRector ([#&#8203;5726](https://github.com/rectorphp/rector-src/pull/5726)) - Fixes for ArrayDimFetchToMethodCallRector ([#&#8203;5727](https://github.com/rectorphp/rector-src/pull/5727)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - Update ArrayDimFetchToMethodCall to use ObjectType ([#&#8203;5728](https://github.com/rectorphp/rector-src/pull/5728)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Configuration] Do not sets, skip, rules on empty array on RectorConfigBuilder ([#&#8203;5731](https://github.com/rectorphp/rector-src/pull/5731)) - \[Php81] Skip $this::class on trait on NullToStrictStringFuncCallArgRector ([#&#8203;5732](https://github.com/rectorphp/rector-src/pull/5732)) - \[Dep] Temporary pin to use nikic/php-parser 4.18.0 ([#&#8203;5733](https://github.com/rectorphp/rector-src/pull/5733)) - Handle readonly class with attrs ([#&#8203;5736](https://github.com/rectorphp/rector-src/pull/5736)), Thanks [@&#8203;tugmaks](https://github.com/tugmaks)! - \[Scoper] Handle use nette/utils on php < 7.4 on 6th param on preg\_replace\_callback() ([rectorphp/rector-src@`fd9e172`](https://github.com/rectorphp/rector-src/commit/fd9e17209bc91983324f07902980d9957c232673)) - \[Renaming]\[AutoImport] Handle after change annotation to attribute with rename on AnnotationToAttributeRector + RenameClassRector with auto import ([#&#8203;5741](https://github.com/rectorphp/rector-src/pull/5741)) - \[Php80] Skip var property usage on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;5744](https://github.com/rectorphp/rector-src/pull/5744)) - \[Php80] Use identical compare on PromotedPropertyCandidateResolver ([#&#8203;5745](https://github.com/rectorphp/rector-src/pull/5745)) - Fix ChildDoctrineRepositoryClassTypeRector for generic type ([#&#8203;5746](https://github.com/rectorphp/rector-src/pull/5746)) - \[DeadCode] Skip From docblock on ReduceAlwaysFalseIfOrRector ([rectorphp/rector-src@`f32dff3`](https://github.com/rectorphp/rector-src/commit/f32dff3ddb3bb8062fced070984017352f2b653a)) - \[CodeQuality] Skip if else return on ExplicitReturnNullRector ([#&#8203;5755](https://github.com/rectorphp/rector-src/pull/5755)) - \[CodeQuality] No need to re-update doc when already union null doc on ExplicitReturnNullRector ([#&#8203;5757](https://github.com/rectorphp/rector-src/pull/5757)) - \[CodeQuality] Skip \_\_construct() method on ExplicitReturnNullRector ([#&#8203;5758](https://github.com/rectorphp/rector-src/pull/5758)) - \[CodeQuality] Move Yield\_ and YieldFrom check to SilentVoidResolver ([#&#8203;5759](https://github.com/rectorphp/rector-src/pull/5759)) - \[CodeQuality] Skip do { } while always returned on ExplicitReturnNullRector ([rectorphp/rector-src@`cae0691`](https://github.com/rectorphp/rector-src/commit/cae06912ed7d7274d900fdc996448f100be2ed34)) - \[CodeQuality] Allow transform return; to return null; when there is other return with Expr on ExplicitReturnNullRector ([#&#8203;5761](https://github.com/rectorphp/rector-src/pull/5761)) - \[AutoImport] Allow auto import same namespace with sub use with docblock short name ([rectorphp/rector-src@`e3e741e`](https://github.com/rectorphp/rector-src/commit/e3e741edd3ca55fc2c24c040f43c8974bda7e953)) - \[CodeQuality] Handle do { } while maybe returned on ExplicitReturnNullRector ([#&#8203;5766](https://github.com/rectorphp/rector-src/pull/5766)) - More fixture on Do\_ maybe returned ([#&#8203;5767](https://github.com/rectorphp/rector-src/pull/5767)) - \[DeadCode] Fix array callable with constructor args ([#&#8203;5770](https://github.com/rectorphp/rector-src/pull/5770)), Thanks [@&#8203;hogejiro](https://github.com/hogejiro)! - \[TypeDeclaration] Ensure always return with Expr on maybe continued in next stmt on SilentVoidResolver ([#&#8203;5771](https://github.com/rectorphp/rector-src/pull/5771)) - \[Scope] Fix resolve Scope from fluent call ([#&#8203;5743](https://github.com/rectorphp/rector-src/pull/5743)) - Clean up scope skip scope check on ExprScopeFromStmtNodeVisitor ([#&#8203;5776](https://github.com/rectorphp/rector-src/pull/5776)) - \[NodeCollector] Fix non-string value on ArrayCallableMethodMatcher::resolveClassContextType() ([#&#8203;5780](https://github.com/rectorphp/rector-src/pull/5780)) - \[Printer] Apply configurable multiline on Fluent Method Call on print after method call created/re-printed ([#&#8203;5779](https://github.com/rectorphp/rector-src/pull/5779)) - \[TypeDeclaration] Handle initialized on getter on ReturnTypeFromStrictTypedPropertyRector ([#&#8203;5784](https://github.com/rectorphp/rector-src/pull/5784)) - \[TypeDeclaration] Handle in inner function on ReturnTypeFromStrictTernaryRector ([#&#8203;5785](https://github.com/rectorphp/rector-src/pull/5785)) - \[TypeDeclaration] Do not use Required::class reference on AutowiredClassMethodOrPropertyAnalyzer ([#&#8203;5788](https://github.com/rectorphp/rector-src/pull/5788)) - \[Performance]\[Php81] Early property promotion and readonly param check before changeable check on ReadOnlyPropertyRector ([#&#8203;5791](https://github.com/rectorphp/rector-src/pull/5791)) - Fix removal of useless [@&#8203;param](https://github.com/param) tag when string|null insteadof ?string is used. ([#&#8203;5684](https://github.com/rectorphp/rector-src/pull/5684)), Thanks [@&#8203;arjenschol](https://github.com/arjenschol) - \[DeadCode] Clean up TypeHasher on Union Type ([#&#8203;5792](https://github.com/rectorphp/rector-src/pull/5792)) - \[NodeTypeResolver] Move UnionType doc vs FullyQualified native type as not equal to TypeComparator ([#&#8203;5793](https://github.com/rectorphp/rector-src/pull/5793)) - Support [@&#8203;immutable](https://github.com/immutable) phpdoc in RestoreDefaultNullToNullableTypePropertyRector([#&#8203;5795](https://github.com/rectorphp/rector-src/pull/5795)), Thanks [@&#8203;staabm](https://github.com/staabm) - \[CodeQuality] Skip Switch\_ always returned on ExplicitReturnNullRector ([#&#8203;5800](https://github.com/rectorphp/rector-src/pull/5800)) - \[CodeQuality] Handle Switch maybe return on ExplicitReturnNullRector ([#&#8203;5801](https://github.com/rectorphp/rector-src/pull/5801)) - \[DeadCode] Skip use docblock on BooleanAnd check on RemoveDeadInstanceOfRector ([#&#8203;5751](https://github.com/rectorphp/rector-src/pull/5751)) - \[DeadCode] Skip isset() from property fetch from docblock on RemoveAlwaysTrueIfConditionRector ([#&#8203;5754](https://github.com/rectorphp/rector-src/pull/5754)) <br> #### Removed :skull: - \[code-quality] Remove intval/strval from sets, as no clear difference and personal preference ([#&#8203;5721](https://github.com/rectorphp/rector-src/pull/5721)) - \[CodeQuality] Remove BoolvalToTypeCastRector and FloatvalToTypeCastRector as well from code-quality set ([#&#8203;5722](https://github.com/rectorphp/rector-src/pull/5722)) - \[CodingStyle] Remove usage of Reflection::expandClassName() from nette/utils 4.0 as cause bug on downgrade ([#&#8203;5740](https://github.com/rectorphp/rector-src/pull/5740)) - \[DeadCode] Skip implements interface on RemoveUnusedConstructorParamRector ([#&#8203;5778](https://github.com/rectorphp/rector-src/pull/5778)) - \[DeadCode] Skip Array Callable dynamic method using **CLASS** with constructor (no default args) on RemoveUnusedPrivateMethodRector ([#&#8203;5774](https://github.com/rectorphp/rector-src/pull/5774)), Thanks [@&#8203;hogejiro](https://github.com/hogejiro) - \[Php81] Remove [@&#8203;readonly](https://github.com/readonly) doc on transformation to native readonly on ReadOnlyPropertyRector ([#&#8203;5789](https://github.com/rectorphp/rector-src/pull/5789)) - \[DeadCode] Remove union with interface on RemoveUselessParamTagRector to make it consistent ([#&#8203;5794](https://github.com/rectorphp/rector-src/pull/5794)) - \[DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector ([#&#8203;5796](https://github.com/rectorphp/rector-src/pull/5796)) - \[DeadCode] Skip [@&#8203;param](https://github.com/param) true on native bool type on RemoveUselessParamTagRector ([#&#8203;5798](https://github.com/rectorphp/rector-src/pull/5798)) - ArgumentRemoverRectorTest: replace symfony\yaml reference with dummy ([#&#8203;5799](https://github.com/rectorphp/rector-src/pull/5799)), Thanks [@&#8203;janedbal](https://github.com/janedbal)! ### [`v1.0.3`](https://github.com/rectorphp/rector/releases/tag/1.0.3): Released Rector 1.0.3 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.2...1.0.3) #### New Features and Improvements :partying\_face: - \[TypeDeclaration] Add `ChildDoctrineRepositoryClassTypeRector` ([#&#8203;5695](https://github.com/rectorphp/rector-src/pull/5695)) - \[TypeDeclaration] No need check parent method when method is private on AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5690](https://github.com/rectorphp/rector-src/pull/5690)) - \[Php83] Add support +/- value on constant on AddTypeToConstRector ([#&#8203;5694](https://github.com/rectorphp/rector-src/pull/5694)) - Add dump\_node() helper function ([#&#8203;5696](https://github.com/rectorphp/rector-src/pull/5696)) - \[CodeQuality] Add Equal and NotEqual support on SimplifyIfReturnBoolRector ([#&#8203;5697](https://github.com/rectorphp/rector-src/pull/5697)) - \[CodeQuality] Add support for compare $this::class compare with string on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;5698](https://github.com/rectorphp/rector-src/pull/5698)) <br> #### Bugfixes :bug: - \[Configuration] Fix parallel config always replaced by next config per-default true ([#&#8203;5683](https://github.com/rectorphp/rector-src/pull/5683)) - \[CodingStyle] Skip anonymous class on MakeInheritedMethodVisibilitySameAsParentRector ([#&#8203;5688](https://github.com/rectorphp/rector-src/pull/5688)) - \[Php80] Fix typo class name: DoctrineCoverterterAttributeDecorator -> DoctrineConverterAttributeDecorator ([#&#8203;5689](https://github.com/rectorphp/rector-src/pull/5689)) - \[Php81] Handle with attribute on ReadOnlyPropertyRector on property promotion ([#&#8203;5692](https://github.com/rectorphp/rector-src/pull/5692)) - \[Php72]\[TypeDeclaration] Fix infinite loop on ParseStrWithResultArgumentRector+DeclareStrictTypesRector ([#&#8203;5699](https://github.com/rectorphp/rector-src/pull/5699)) - \[CodeQuality] Skip sort/ksort on TernaryFalseExpressionToIfRector ([#&#8203;5703](https://github.com/rectorphp/rector-src/pull/5703)) - fix: Strip left spaces from opening tags when comparing output for changes ([#&#8203;5701](https://github.com/rectorphp/rector-src/pull/5701)), Thanks [@&#8203;stilliard](https://github.com/stilliard)! - \[CodingStyle] Skip implements interface on MakeInheritedMethodVisibilitySameAsParentRector ([#&#8203;5707](https://github.com/rectorphp/rector-src/pull/5707)) - \[CodeQuality] Skip throw after foreach with return in loop on SimplifyForeachToCoalescingRector ([#&#8203;5714](https://github.com/rectorphp/rector-src/pull/5714)) - Skip mixed in ParamTypeByMethodCallTypeRector as not specific ([#&#8203;5715](https://github.com/rectorphp/rector-src/pull/5715)) - \[CodeQuality] Skip compare string with stringable object on UseIdenticalOverEqualWithSameTypeRector ([#&#8203;5718](https://github.com/rectorphp/rector-src/pull/5718)) - \[Php80] Skip ObjectType on ChangeSwitchToMatchRector ([#&#8203;5719](https://github.com/rectorphp/rector-src/pull/5719)) ### [`v1.0.2`](https://github.com/rectorphp/rector/releases/tag/1.0.2): Released Rector 1.0.2 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.1...1.0.2) #### New Features and changes :partying\_face: - Add minimal memory limit for local run phpstan without result cache ([#&#8203;5624](https://github.com/rectorphp/rector-src/pull/5624)), Thanks [@&#8203;integer](https://github.com/integer)! - Add method RectorConfigBuilder::withSkipPath() ([#&#8203;5626](https://github.com/rectorphp/rector-src/pull/5626)), Thanks [@&#8203;integer](https://github.com/integer)! - Add basic validation for skipped path ([#&#8203;5628](https://github.com/rectorphp/rector-src/pull/5628)), Thanks [@&#8203;integer](https://github.com/integer)! - \[Php80] Add DoctrineCoverterterAttributeDecorator to convert "false"/"true" string to false/true on nullable arg on Doctrine\ORM\Mapping\Column ([#&#8203;5629](https://github.com/rectorphp/rector-src/pull/5629)) - Add const fetch to class const fetch rector. ([#&#8203;5627](https://github.com/rectorphp/rector-src/pull/5627)), Thanks [@&#8203;micaherne](https://github.com/micaherne)! - \[DX] Add error message information for include full path to load internal phpstan bleedingEdge.neon config ([#&#8203;5635](https://github.com/rectorphp/rector-src/pull/5635)) - \[TypeDeclaration] Adds AddParamTypeForFunctionLikeWithinCallLikeArgDeclarationRector rule ([#&#8203;5547](https://github.com/rectorphp/rector-src/pull/5547)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[Php83] Add type to final class constant ([#&#8203;5662](https://github.com/rectorphp/rector-src/pull/5662)), Thanks [@&#8203;philbates35](https://github.com/philbates35)! <br> #### Bugfixes :bug: - \[Php83] Early check private method in child before check parent on AddOverrideAttributeToOverriddenMethodsRector ([#&#8203;5622](https://github.com/rectorphp/rector-src/pull/5622)) - RectorConfigBuilder: skip and rules can be called multiple times ([#&#8203;5623](https://github.com/rectorphp/rector-src/pull/5623)), Thanks [@&#8203;integer](https://github.com/integer)! - \[CodeQuality] Skip not autoloaded parent class on CompleteDynamicPropertiesRector ([#&#8203;5636](https://github.com/rectorphp/rector-src/pull/5636)) - \[Transform] Allow transform ruleWithConfiguration() to withConfiguredRule() on RectorConfigBuilderRector ([#&#8203;5637](https://github.com/rectorphp/rector-src/pull/5637)) - \[Rector] Allow transform sets() to withSets() on RectorConfigBuilderRector ([#&#8203;5638](https://github.com/rectorphp/rector-src/pull/5638)) - \[Transform] Allow transform disableParallel() to withoutParallel() on RectorConfigBuilderRector ([#&#8203;5640](https://github.com/rectorphp/rector-src/pull/5640)) - \[Transform] Allow transform fileExtensions() to withFileExtensions() ([#&#8203;5641](https://github.com/rectorphp/rector-src/pull/5641)) - \[Performance] \[VendorLocker] Early allow change return type on private method on ClassMethodReturnTypeOverrideGuard::shouldSkipClassMethod() ([#&#8203;5642](https://github.com/rectorphp/rector-src/pull/5642)) - \[VendorLocker] Early return false on private method on ParentClassMethodTypeOverrideGuard::hasParentClassMethod() ([#&#8203;5644](https://github.com/rectorphp/rector-src/pull/5644)) - \[Renaming] Handle crash on RenameFunctionRector with die() and $\_SESSION usage ([#&#8203;5646](https://github.com/rectorphp/rector-src/pull/5646)) - Cleanup scope check on UnreachableStatementNodeVisitor ([#&#8203;5648](https://github.com/rectorphp/rector-src/pull/5648)) - Keep comments in annotations when converting them to attributes ([#&#8203;5650](https://github.com/rectorphp/rector-src/pull/5650)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[Util] Make consistent new line splitter to Util ([#&#8203;5651](https://github.com/rectorphp/rector-src/pull/5651)) - \[TypeDeclaration] Fix abs() returns on ReturnTypeFromStrictTypedCallRector ([#&#8203;5652](https://github.com/rectorphp/rector-src/pull/5652)) - \[TypeDeclaration] Allow abs() to return int when pass int arg on ReturnTypeFromStrictTypedCallRector ([#&#8203;5653](https://github.com/rectorphp/rector-src/pull/5653)) - \[TypeDeclaration] Skip possible returns false on ReturnTypeFromStrictNewArrayRector ([#&#8203;5654](https://github.com/rectorphp/rector-src/pull/5654)) - \[TypeDeclaration] Include MockObject\&ClassName docblock with IntersectionTypeNode on TypedPropertyFromStrictSetUpRector ([#&#8203;5655](https://github.com/rectorphp/rector-src/pull/5655)) - \[Renaming] New Rule: RenameFunctionLikeParamWithinCallLikeArgRector ([#&#8203;5554](https://github.com/rectorphp/rector-src/pull/5554)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[PHPStanStaticTypeMapper] Avoid double \ prefix on IntersectionTypeMapper ([#&#8203;5656](https://github.com/rectorphp/rector-src/pull/5656)) - \[BetterPhpDocParser] Clean up unnecessary create new ConstFetchNode() on ArrayItemClassNameDecorator ([#&#8203;5658](https://github.com/rectorphp/rector-src/pull/5658)) - \[Php71] Skip re-assign as string on AssignArrayToStringRector ([#&#8203;5659](https://github.com/rectorphp/rector-src/pull/5659)) - \[Privatization] Skip with suffix "TestCase" on FinalizeTestCaseClassRector ([#&#8203;5660](https://github.com/rectorphp/rector-src/pull/5660)) - \[Php71] Skip re-assign as string on AssignArrayToStringRector part 2 ([#&#8203;5661](https://github.com/rectorphp/rector-src/pull/5661)) - \[DeadCode] Fix infinite loop on RemoveDeadStmtRector + RemoveUnusedVariableAssignRector ([#&#8203;5666](https://github.com/rectorphp/rector-src/pull/5666)) - \[Php81] Skip execution operator on NullToStrictStringFuncCallArgRector ([#&#8203;5667](https://github.com/rectorphp/rector-src/pull/5667)) - \[Naming] Handle crash with numeric-string doc on RenamePropertyToMatchTypeRector ([#&#8203;5670](https://github.com/rectorphp/rector-src/pull/5670)) - \[CodeQuality] Handle crash on named arg on deep closure on OptionalParametersAfterRequiredRector ([#&#8203;5671](https://github.com/rectorphp/rector-src/pull/5671)) - chore: bump min version of github actions (fix deprecations) ([#&#8203;5675](https://github.com/rectorphp/rector-src/pull/5675)), Thanks [@&#8203;Chris53897](https://github.com/Chris53897)! - \[PHP 8.0] Fix case insenstive false positive replacement for str\_ends\_with ([#&#8203;5677](https://github.com/rectorphp/rector-src/pull/5677)) - \[Transform] Allow transform phpVersion() to withPhpVersion() on RectorConfigBuilderRector ([#&#8203;5678](https://github.com/rectorphp/rector-src/pull/5678)) - Fix duplicated fixture class name on StaticToSelfStaticMethodCallOnFinalClassRector test ([#&#8203;5679](https://github.com/rectorphp/rector-src/pull/5679)) - \[CodeQuality] Skip nested array on InlineArrayReturnAssignRector ([#&#8203;5680](https://github.com/rectorphp/rector-src/pull/5680)) - \[CodeQuality] Skip combine var with property fetch on InlineArrayReturnAssignRector ([#&#8203;5681](https://github.com/rectorphp/rector-src/pull/5681)) - \[CodeQuality] Handle array destructuring of unpack on ArrayMergeOfNonArraysToSimpleArrayRector ([#&#8203;5682](https://github.com/rectorphp/rector-src/pull/5682)) - Update README to use the new config syntax ([#&#8203;5674](https://github.com/rectorphp/rector-src/pull/5674)), Thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - \[PostRector] Skip remove use statement on used in annotation on removeUnusedImports() ([#&#8203;5657](https://github.com/rectorphp/rector-src/pull/5657)) - \[DeadCode] Skip implements interface \_\_construct() on RemoveUnusedPromotedPropertyRector ([#&#8203;5669](https://github.com/rectorphp/rector-src/pull/5669)) - \[Performance] \[DeadCode] Early check no params in \_\_construct() on RemoveUnusedPromotedPropertyRector ([#&#8203;5672](https://github.com/rectorphp/rector-src/pull/5672)) ### [`v1.0.1`](https://github.com/rectorphp/rector/releases/tag/1.0.1): Released Rector 1.0.1 [Compare Source](https://github.com/rectorphp/rector/compare/1.0.0...1.0.1) #### New Features :partying\_face: - \[Custom] Add "detect-node" command to help with writing custom rules ([#&#8203;5576](https://github.com/rectorphp/rector-src/pull/5576)) - \[Config] Add registerService() method to allow container extension ([#&#8203;5591](https://github.com/rectorphp/rector-src/pull/5591)) - \[TypeDeclaration] Add AddTestsVoidReturnTypeWhereNoReturnRector ([#&#8203;5611](https://github.com/rectorphp/rector-src/pull/5611)) - \[PHP 8.0] Add always class to AnnotationToAttribute to include string to ::class reference conversion ([#&#8203;5619](https://github.com/rectorphp/rector-src/pull/5619)) - \[CodeQuality] Add StaticToSelfStaticMethodCallOnFinalClassRector ([#&#8203;5621](https://github.com/rectorphp/rector-src/pull/5621)) <br> #### Bugfixes :bug: - ExplicitBoolCompareRector: skip phpdoc ([#&#8203;5567](https://github.com/rectorphp/rector-src/pull/5567)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Fix ArrayTypeMapper to handle arrays with UnionType items ([#&#8203;8225](https://github.com/rectorphp/rector/issues/8225)) ([#&#8203;5568](https://github.com/rectorphp/rector-src/pull/5568)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - \[Configuration] Fix detect /vendor on root project on vendor analyzed on VendorMissAnalyseGuard ([#&#8203;5569](https://github.com/rectorphp/rector-src/pull/5569)) - Fix missing / suffix on VendorMissAnalyseGuard ([#&#8203;5571](https://github.com/rectorphp/rector-src/pull/5571)) - \[PHP81] Skip after is\_string on object call on NullToStrictStringFuncCallArgRector ([#&#8203;5572](https://github.com/rectorphp/rector-src/pull/5572)) - \[Config] Make sure only one of type-declaration/dead-code or with\*Level() is used to avoid duplicates ([#&#8203;5578](https://github.com/rectorphp/rector-src/pull/5578)) - Fix undefined MHASH\_\* constant on running downgrade from php 8.0 ([#&#8203;5585](https://github.com/rectorphp/rector-src/pull/5585)) - \[NodeTypeResolver] Ignore PHPStan internal error on PHPStanNodeScopeResolver on NodeScopeResolver::processNodes() ([#&#8203;5586](https://github.com/rectorphp/rector-src/pull/5586)) - \[Php81] Skip possible array on NullToStrictStringFuncCallArgRector ([#&#8203;5587](https://github.com/rectorphp/rector-src/pull/5587)) - \[Php81] Skip another possible cast array to string on NullToStrictStringFuncCallArgRector ([#&#8203;5589](https://github.com/rectorphp/rector-src/pull/5589)) - \[Transform] Allow class const fetch value on rules() on RectorConfigBuilderRector ([#&#8203;5596](https://github.com/rectorphp/rector-src/pull/5596)) - \[Performance] Use strlen() early before loop on VendorMissAnalyseGuard ([#&#8203;5597](https://github.com/rectorphp/rector-src/pull/5597)) - Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;8438](https://github.com/rectorphp/rector/issues/8438)) ([#&#8203;5603](https://github.com/rectorphp/rector-src/pull/5603)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - config method must be static, to avoid creating rule before loading related ctor services ([#&#8203;5606](https://github.com/rectorphp/rector-src/pull/5606)) - fix config for configured rule ([rectorphp/rector-src@`5edb023`](https://github.com/rectorphp/rector-src/commit/5edb023974a55b0efee74dd9fe92b314dd521f2c)) - \[PHP 8.0] Fix annotation to attribute in case of FQN class without () ([#&#8203;5609](https://github.com/rectorphp/rector-src/pull/5609)) - \[Php80] Support windows new line line DoctrineAnnotationDecorator::LONG\_ANNOTATION\_REGEX ([#&#8203;5610](https://github.com/rectorphp/rector-src/pull/5610)) - \[Php81] Handle after open parentheses on AnnotationToAttributeRector ([#&#8203;5613](https://github.com/rectorphp/rector-src/pull/5613)) - \[BetterPhpDocParser] Move split new line with @&#8203;\ to regex to support windows new line ([#&#8203;5615](https://github.com/rectorphp/rector-src/pull/5615)) - \[Php81] Handle nested Fqcn UniqueConstraint on NestedAnnotationToAttributeRector ([#&#8203;5614](https://github.com/rectorphp/rector-src/pull/5614)) - \[DX] Accept Y/y for confirmation of init config ([#&#8203;5616](https://github.com/rectorphp/rector-src/pull/5616)) - \[CodeQuality] Skip private static call from static:: on LocallyCalledStaticMethodToNonStaticRector ([#&#8203;5620](https://github.com/rectorphp/rector-src/pull/5620)) - \[PostRector] Skip remove unused imports on used in multiple docs in single node ([#&#8203;5604](https://github.com/rectorphp/rector-src/pull/5604)) - \[DeadCode] Skip sub type false => bool on RemoveUselessVarTagRector ([#&#8203;5588](https://github.com/rectorphp/rector-src/pull/5588)) <br> #### Removed :skull: - \[DeadCode] Skip with magic \_\_get() on RemoveUnusedPromotedPropertyRector ([#&#8203;5573](https://github.com/rectorphp/rector-src/pull/5573)) - \[DX] Remove phpstan strict rules to ease contributing ([#&#8203;5579](https://github.com/rectorphp/rector-src/pull/5579)) - \[DX] Remove type covarege, as handled by phpstan itself ([#&#8203;5583](https://github.com/rectorphp/rector-src/pull/5583)) - \[DeadCode] Handle used in assign return on RemoveUnusedPrivatePropertyRector ([#&#8203;5608](https://github.com/rectorphp/rector-src/pull/5608)) ### [`v1.0.0`](https://github.com/rectorphp/rector/releases/tag/1.0.0): Released Rector 1.0.0 🎉🎉🎉 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.8...1.0.0) The stable Rector version is here. It was about time and we've done all planned changes by the end of 2023. <br> What could be better time and place to release a stable Rector than [live on stage during talk](https://twitter.com/christophrumpel/status/1754862081600332020) :tada: <br> 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**. <br> 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. <br> #### 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: ```php use Rector\Config\RectorConfig; return RectorConfig::configure() ->withPreparedSets(codeQuality: true, codingStyle: true) ->withAttributesSets(symfony: true, doctrine: true) ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', ]) ->withRootFiles(); ``` <br> #### PHP Sets Automated To keep up to date with you PHP, now you can use single method: ```php 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. <br> #### 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: ```php 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. <br> #### New and Improved Commands - We added a new command to generate bare custom rule files and structure for you: ```bash 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. <br> - We improve the command, that generates Github and Gitlab CI setup files, so you can let Rector work for you: ```bash vendor/bin/rector setup-ci ``` The command handles generic setup for you and then guides you to register needed access. ### [`v0.19.8`](https://github.com/rectorphp/rector/releases/tag/0.19.8): Released Rector 0.19.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.7...0.19.8) #### New Features :partying\_face: - \[experimental] Add withTypeCoverageLevel() method to streamline Rector integration to new projects ([#&#8203;5553](https://github.com/rectorphp/rector-src/pull/5553)) <br> #### Bugfixes :bug: - Cache null result on ProjectComposerJsonPhpVersionResolver ([#&#8203;5559](https://github.com/rectorphp/rector-src/pull/5559)) - Real fix paths The given paths do not match any files on RectorConfigBuilder ([#&#8203;5561](https://github.com/rectorphp/rector-src/pull/5561)) ### [`v0.19.7`](https://github.com/rectorphp/rector/releases/tag/0.19.7): Released Rector 0.19.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.6...0.19.7) #### Bugfixes :bug: - \[TypeDeclaration] Skip assign in construct with method call property same name on RestoreDefaultNullToNullableTypePropertyRector ([#&#8203;5556](https://github.com/rectorphp/rector-src/pull/5556)) - \[Privatization] Fix reprint with attribute on FinalizeTestCaseClassRector ([#&#8203;5557](https://github.com/rectorphp/rector-src/pull/5557)) - \[DX] Fix missing Rector\RectorGenerator\Exception\ConfigurationException ([#&#8203;5558](https://github.com/rectorphp/rector-src/pull/5558)) - Fix platform version resolution, use require first ([#&#8203;5555](https://github.com/rectorphp/rector-src/pull/5555)) - bump template version ([rectorphp/rector-src@`02a088c`](https://github.com/rectorphp/rector-src/commit/02a088c735b9b829c8f0dec445e71dea70e559bc)) ### [`v0.19.6`](https://github.com/rectorphp/rector/releases/tag/0.19.6): Released Rector 0.19.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.5...0.19.6) #### New Features and Changes :partying\_face: - \[EarlyReturn] Improve RemoveAlwaysElseRector to handle multiple ElseIfs ([#&#8203;8178](https://github.com/rectorphp/rector/issues/8178)) ([#&#8203;5521](https://github.com/rectorphp/rector-src/pull/5521)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - \[Privatization] Add FinalizeTestCaseClassRector ([#&#8203;5539](https://github.com/rectorphp/rector-src/pull/5539)) - Add support for YieldFrom into places where Yield\_ is checked ([#&#8203;5499](https://github.com/rectorphp/rector-src/pull/5499)), Thanks [@&#8203;integer](https://github.com/integer)! - \[Transform] Add RectorConfigBuilderRector ([#&#8203;5551](https://github.com/rectorphp/rector-src/pull/5551)) - \[DX] Warn about run on /vendor directory ([#&#8203;5525](https://github.com/rectorphp/rector-src/pull/5525)) - \[DX] PHP sets should not disable all other version-based rules ([#&#8203;5527](https://github.com/rectorphp/rector-src/pull/5527)) - **\[stabilize] Deprecate FinalizeClassesWithoutChildrenRector as causing bugs without full context ([#&#8203;5535](https://github.com/rectorphp/rector-src/pull/5535))** <br> #### Bugfixes :bug: - **Fix xdebug handling ([#&#8203;5544](https://github.com/rectorphp/rector-src/pull/5544)), Thanks [@&#8203;staabm](https://github.com/staabm)!** - Added 4 methods into RectorConfigBuilder ([#&#8203;5524](https://github.com/rectorphp/rector-src/pull/5524)), Thanks [@&#8203;Perf](https://github.com/Perf)! - Fix AddMethodCallBasedStrictParamTypeRector if already has a type ([#&#8203;5530](https://github.com/rectorphp/rector-src/pull/5530)) - \[CodingStyle] Return null on no change on StrictArraySearchRector ([#&#8203;5528](https://github.com/rectorphp/rector-src/pull/5528)) - \[Php81] Allow nullable union on NullToStrictStringFuncCallArgRector ([#&#8203;5532](https://github.com/rectorphp/rector-src/pull/5532)) - \[stabilize] Deprecate FinalizePublicClassConstantRector as not reliable and causes uncontroller changed ([#&#8203;5534](https://github.com/rectorphp/rector-src/pull/5534)) - \[TypeDeclaration] Change bool to false or true docblock when union has false/true standalone type on ReturnUnionTypeRector ([#&#8203;5543](https://github.com/rectorphp/rector-src/pull/5543)) - \[EarlyReturn] Skip append variable in PreparedValueToEarlyReturnRector ([#&#8203;8390](https://github.com/rectorphp/rector/issues/8390)) ([#&#8203;5545](https://github.com/rectorphp/rector-src/pull/5545)), Thanks [@&#8203;pkvach](https://github.com/pkvach)! - Fix make ReadOnlyPropertyRector skip if traits are used, as not reliable ([#&#8203;5548](https://github.com/rectorphp/rector-src/pull/5548)) - Kick off basic rector.php with simpler and more practical rule ([#&#8203;5552](https://github.com/rectorphp/rector-src/pull/5552)) <br> #### Removed :skull: - Exclude finalize rule from private set, to keep safer ([#&#8203;5523](https://github.com/rectorphp/rector-src/pull/5523)) - \[Performance] Remove CollectedData on ProcessResult ([#&#8203;5520](https://github.com/rectorphp/rector-src/pull/5520)) - \[stabilize] Remove family tree check from ClassMethodParamVendorLockResolver as not reliable ([#&#8203;5536](https://github.com/rectorphp/rector-src/pull/5536)) - \[stabilize] Remove child classes from MixedTypeRector as not reliable ([#&#8203;5537](https://github.com/rectorphp/rector-src/pull/5537)) - \[stabilize] Remove last children method checks ([#&#8203;5538](https://github.com/rectorphp/rector-src/pull/5538)) ### [`v0.19.5`](https://github.com/rectorphp/rector/releases/tag/0.19.5): Released Rector 0.19.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.4...0.19.5) #### New Features :tada: - \[Autoloading] Allow to define bootstrapFiles(\[**DIR** . '/some.phar']) on BootstrapFilesIncluder ([#&#8203;5518](https://github.com/rectorphp/rector-src/pull/5518)) - add withPhpSets() methods ([#&#8203;5519](https://github.com/rectorphp/rector-src/pull/5519)) ### [`v0.19.4`](https://github.com/rectorphp/rector/releases/tag/0.19.4): Released Rector 0.19.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.3...0.19.4) #### Bugfixes :bug: - Fix configured rule ([#&#8203;5517](https://github.com/rectorphp/rector-src/pull/5517)) ### [`v0.19.3`](https://github.com/rectorphp/rector/releases/tag/0.19.3): Released Rector 0.19.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.2...0.19.3) #### New Features ahd Changes :partying\_face: - **\[Config] Add RectorConfigBuilder ([#&#8203;5503](https://github.com/rectorphp/rector-src/pull/5503))** - Add gitlab to "setup-ci" command ([#&#8203;5497](https://github.com/rectorphp/rector-src/pull/5497)) - **Add "custom-rule" command to make creating rules easy ([#&#8203;5498](https://github.com/rectorphp/rector-src/pull/5498))** - \[Windows] Rework add windows support on tests CI ([#&#8203;5504](https://github.com/rectorphp/rector-src/pull/5504)) - make literal separator optional, as rather coding style and not always desired ([#&#8203;5505](https://github.com/rectorphp/rector-src/pull/5505)) <br> #### Bugfixes :bug: - \[Php70] Skip inside Encapsed on ThisCallOnStaticMethodToStaticCallRector ([#&#8203;5481](https://github.com/rectorphp/rector-src/pull/5481)) - \[Performance] Cache PHP version features on reading composer.json on PhpVersionProvider ([#&#8203;5484](https://github.com/rectorphp/rector-src/pull/5484)) - Fix phpstan ([#&#8203;5489](https://github.com/rectorphp/rector-src/pull/5489)) - \[Config] Restore default values for RectorConfig->parallel() config similar to original <=0.18.x version ([#&#8203;5472](https://github.com/rectorphp/rector-src/pull/5472)) - \[Performance]\[PhpParser] Deprecate InlineCodeParser::parse(), extract into parseFile() and parseString() ([#&#8203;5482](https://github.com/rectorphp/rector-src/pull/5482)) - \[CodeQuality] Skip surplus open square bracket on SimplifyRegexPatternRector ([#&#8203;5494](https://github.com/rectorphp/rector-src/pull/5494)) - \[AutoImport] Skip start with \<?= short open tag on auto import ([#&#8203;5496](https://github.com/rectorphp/rector-src/pull/5496)) - \[Testing] Deprecate FileInfoParser, use existing TestingParser instead ([#&#8203;5501](https://github.com/rectorphp/rector-src/pull/5501)) - custom copy path fix ([#&#8203;5502](https://github.com/rectorphp/rector-src/pull/5502)) - \[DX] Allow Arg in value resolver, as often used and intuitive ([#&#8203;5512](https://github.com/rectorphp/rector-src/pull/5512)) - \[Windows] Support replace \r\n on DocBlockInliner ([#&#8203;5513](https://github.com/rectorphp/rector-src/pull/5513)) - \[Php83] add string type to concat constant ([#&#8203;5516](https://github.com/rectorphp/rector-src/pull/5516)), Thanks [@&#8203;jdohuutin](https://github.com/jdohuutin)! <br> #### Removed :skull: - \[Renaming] Remove namespace renames in ClassRename, as it should only rename references, not move to new namespace ([#&#8203;5487](https://github.com/rectorphp/rector-src/pull/5487)) - \[Renaming] Remove rename class name ([#&#8203;5488](https://github.com/rectorphp/rector-src/pull/5488)) ### [`v0.19.2`](https://github.com/rectorphp/rector/releases/tag/0.19.2): Released Rector 0.19.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.19.1...0.19.2) #### New features and Changes :tada: - \[DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets ([#&#8203;5477](https://github.com/rectorphp/rector-src/pull/5477)) - Remove collectors, as performance very costly and not practically useful ([#&#8203;5470](https://github.com/rectorphp/rector-src/pull/5470)) <br> #### Bugfixes :bug: - **Fix repeated timeouts on CI - [#&#8203;8403](https://github.com/rectorphp/rector/issues/8403), [#&#8203;8396](https://github.com/rectorphp/rector/issues/8396)** - Bump PHPStan to 1.10.56 ([#&#8203;5471](https://github.com/rectorphp/rector-src/pull/5471)) - Remove collector interface and fix SpatieEnumClassToEnumRector already has underscore to double underscore ([#&#8203;5473](https://github.com/rectorphp/rector-src/pull/5473)) - \[DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets ([#&#8203;5477](https://github.com/rectorphp/rector-src/pull/5477)) <br> #### Removed :skull: - \[Performance] Remove unused AttributeKey::ARGUMENT\_POSITION ([#&#8203;5469](https://github.com/rectorphp/rector-src/pull/5469)) - \[Autoload] Remove src/core\_namespace\_aliases.php ([#&#8203;5476](https://github.com/rectorphp/rector-src/pull/5476)) ### [`v0.19.1`](https://github.com/rectorphp/rector/compare/0.19.0...0.19.1) [Compare Source](https://github.com/rectorphp/rector/compare/0.19.0...0.19.1) ### [`v0.19.0`](https://github.com/rectorphp/rector/releases/tag/0.19.0): Released Rector 0.19.0 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.13...0.19.0) 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: ```diff -use Rector\Core\ +use Rector\ ``` That's it! #### New Features :partying\_face: - \[psr-4] Move /packages directory to /src under single Rector\ namespace ([#&#8203;5414](https://github.com/rectorphp/rector-src/pull/5414)) - \[Arguments] Allow no default value on ArgumentAdderRector ([#&#8203;5382](https://github.com/rectorphp/rector-src/pull/5382)) - **Add related polyfill interface to other PHP 8.0/7.3 rules** ([#&#8203;5389](https://github.com/rectorphp/rector-src/pull/5389)) - \[CodingStyle] Add RemoveUselessAliasInUseStatementRector ([#&#8203;5394](https://github.com/rectorphp/rector-src/pull/5394)) - \[Php83] Add CombineHostPortLdapUriRector ([#&#8203;5397](https://github.com/rectorphp/rector-src/pull/5397)) - \[TypeDeclaration] optionally only add types for hard coded return values in `ReturnTypeFromStrictScalarReturnExprRector` ([#&#8203;5364](https://github.com/rectorphp/rector-src/pull/5364)), Thanks [@&#8203;RobertMe](https://github.com/RobertMe)! - Add phpstan native cond types for getName() for nodes that always return a string ([#&#8203;5413](https://github.com/rectorphp/rector-src/pull/5413)) - \[Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector ([#&#8203;5428](https://github.com/rectorphp/rector-src/pull/5428)) - \[Php83] Add implements interface support on AddOverrideAttributeToOverriddenMethodsRector ([#&#8203;5429](https://github.com/rectorphp/rector-src/pull/5429)) - \[cs] Make use of new ECS config ([#&#8203;5445](https://github.com/rectorphp/rector-src/pull/5445)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Add false and true in union support on ReturnUnionTypeRector ([#&#8203;5355](https://github.com/rectorphp/rector-src/pull/5355)) - Skip classes without final and exception as possibly invoke child implement in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5381](https://github.com/rectorphp/rector-src/pull/5381)) - Skip non-final class method with no content in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5386](https://github.com/rectorphp/rector-src/pull/5386)) - \[TypeDeclaration] Allow add void return type on magic `__invoke()` method on AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5376](https://github.com/rectorphp/rector-src/pull/5376)) - Add `ReturnTypeFromStrictBoolReturnExprRector` support for if/else returns ([#&#8203;5384](https://github.com/rectorphp/rector-src/pull/5384)) - Skip void without final keyword in ReturnNeverTypeRector as could be implemented with more precise children ([#&#8203;5379](https://github.com/rectorphp/rector-src/pull/5379)) - Fix StrictArrayParamDimFetchRector for string access ([#&#8203;5383](https://github.com/rectorphp/rector-src/pull/5383)) - Fix variable to property fetch update in ClassPropertyAssignToConstructorPromotionRector ([#&#8203;5385](https://github.com/rectorphp/rector-src/pull/5385)) - \[Php] Fix filter cache on PolyfillPackagesProvider ([#&#8203;5390](https://github.com/rectorphp/rector-src/pull/5390)) - \[Parallel] Fix missing --xdebug in WorkerCommand line on WorkerCommandLineFactory when --xdebug provided ([#&#8203;5398](https://github.com/rectorphp/rector-src/pull/5398)) - Bump phpstan to 1.10.50 ([#&#8203;5399](https://github.com/rectorphp/rector-src/pull/5399)) - \[Php83] Handle dynamic host and port values on CombineHostPortLdapUriRector ([#&#8203;5401](https://github.com/rectorphp/rector-src/pull/5401)) - \[config] Extract RectorConfigValidator and handle config validation there ([#&#8203;5404](https://github.com/rectorphp/rector-src/pull/5404)) - \[psr-4] Update Rector core test reference ([#&#8203;5410](https://github.com/rectorphp/rector-src/pull/5410)) - \[cleanup] Decouple changelog generator ([#&#8203;5412](https://github.com/rectorphp/rector-src/pull/5412)) - \[Strict] Handle may be unitialized property on DisallowedEmptyRuleFixerRector ([#&#8203;5409](https://github.com/rectorphp/rector-src/pull/5409)) - Bump min. version to PHP 8.2 - readonly classes ([#&#8203;5415](https://github.com/rectorphp/rector-src/pull/5415)) - Decouple LongAndDependentComplexRectorRule to cognitive-complexity package ([#&#8203;5427](https://github.com/rectorphp/rector-src/pull/5427)) - \[TypeDeclaration] Skip with empty() check on StrictArrayParamDimFetchRector ([#&#8203;5432](https://github.com/rectorphp/rector-src/pull/5432)) - \[TypeDeclaration] Allow both integer and string index array on StrictArrayParamDimFetchRector ([#&#8203;5433](https://github.com/rectorphp/rector-src/pull/5433)) - \[TypeDeclaration] Skip re-assign with call and use as arg on StrictArrayParamDimFetchRector ([#&#8203;5434](https://github.com/rectorphp/rector-src/pull/5434)) - \[CodeQuality] Handle crash with call inside loop on SimplifyForeachToCoalescingRector ([#&#8203;5436](https://github.com/rectorphp/rector-src/pull/5436)) - \[TypeDeclaration] Handle with default null on ParamTypeByMethodCallTypeRector ([#&#8203;5437](https://github.com/rectorphp/rector-src/pull/5437)) - \[NodeTypeResolver] Handle crash PHPStan\File\CouldNotReadFileException: Could not read file on IntermediateSourceLocator ([#&#8203;5438](https://github.com/rectorphp/rector-src/pull/5438)) - Allows to convert Spatie enum names to snake upper case ([#&#8203;5435](https://github.com/rectorphp/rector-src/pull/5435)), Thanks [@&#8203;JoolsMcFly](https://github.com/JoolsMcFly)! - fix: RenameMethodRector should handle NullsafeMethodCall ([#&#8203;5444](https://github.com/rectorphp/rector-src/pull/5444)), Thanks [@&#8203;nikophil](https://github.com/nikophil)! - \[Php80]\[CodeQuality] Handle crash on ChangeSwitchToMatchRector + TernaryFalseExpressionToIfRector on under if else ([#&#8203;5446](https://github.com/rectorphp/rector-src/pull/5446)) - Skip cond with side effect in RemoveDeadConditionAboveReturnRector ([#&#8203;5424](https://github.com/rectorphp/rector-src/pull/5424)) - \[DeadCode] Skip nullable array on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#&#8203;5375](https://github.com/rectorphp/rector-src/pull/5375)) - Keep called method in RemoveEmptyClassMethodRector ([#&#8203;5425](https://github.com/rectorphp/rector-src/pull/5425)) <br> #### Removed :skull: - \[DeadCode] Remove RemoveJustPropertyFetchForAssignRector as tailored for single case of private project, not practical for generic use ([#&#8203;5418](https://github.com/rectorphp/rector-src/pull/5418)) - remove array spread from coding style, as often part of personal preference ([rectorphp/rector-src@`a326b85`](https://github.com/rectorphp/rector-src/commit/a326b8504d37093f639245da0b283f588f954890)) ### [`v0.18.13`](https://github.com/rectorphp/rector/releases/tag/0.18.13): Released Rector 0.18.13 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.12...0.18.13) #### New Features :partying\_face: - \[DeadCode] Add Function\_ support on RemoveUselessReturnTagRector ([#&#8203;5325](https://github.com/rectorphp/rector-src/pull/5325)) - \[TypeDeclaration] Add MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5327](https://github.com/rectorphp/rector-src/pull/5327)) - \[DeadCode] Add Function\_ support on RemoveUselessParamTagRector ([#&#8203;5331](https://github.com/rectorphp/rector-src/pull/5331)) - \[DeadCode] Add RemoveNullTagValueNodeRector ([#&#8203;5352](https://github.com/rectorphp/rector-src/pull/5352)) <br> #### Bugfixes :bug: - \[Php83] Fix const from applying incorrect types ([#&#8203;5326](https://github.com/rectorphp/rector-src/pull/5326)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - \[TypeDeclaration] Fix missing change type to DateTimeInterface on MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5329](https://github.com/rectorphp/rector-src/pull/5329)) - \[TypeDeclaration] Handle DateTimeInterface from use statement on MergeDateTimePropertyTypeDeclarationRector ([#&#8203;5330](https://github.com/rectorphp/rector-src/pull/5330)) - \[TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector ([#&#8203;5333](https://github.com/rectorphp/rector-src/pull/5333)) - Fix array type if property is used in TypedPropertyFromStrictConstructorRector ([#&#8203;5339](https://github.com/rectorphp/rector-src/pull/5339)) - \[Naming] Skip DateTimeImmutable on RenamePropertyToMatchTypeRector ([#&#8203;5340](https://github.com/rectorphp/rector-src/pull/5340)) - \[PHP 7.4] Skip typed properties in the set, as standalone set now available ([#&#8203;5342](https://github.com/rectorphp/rector-src/pull/5342)) - \[TypeDeclaration] Skip has child return different type on ReturnNeverTypeRector ([#&#8203;5343](https://github.com/rectorphp/rector-src/pull/5343)) - \[Experiment]\[TypeDeclaration] Allow change abstract class methods with body on ReturnType\*Rector ([#&#8203;5344](https://github.com/rectorphp/rector-src/pull/5344)) - \[Php55] Make StringClassNameToClassConstantRector configurable to keep first pre-backslash string configurable ([#&#8203;5354](https://github.com/rectorphp/rector-src/pull/5354)) - \[TypeDeclaration] Skip casted to (array) on StrictArrayParamDimFetchRector ([#&#8203;5356](https://github.com/rectorphp/rector-src/pull/5356)) - \[TypeDeclaration] Return new static from different object on ReturnTypeFromStrictTypedCallRector ([#&#8203;5357](https://github.com/rectorphp/rector-src/pull/5357)) - \[TypeDeclaration] Allow return static from under function on ReturnTypeFromStrictTypedCallRector ([#&#8203;5358](https://github.com/rectorphp/rector-src/pull/5358)) - \[Naming] Skip `$this` in RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;5360](https://github.com/rectorphp/rector-src/pull/5360)), Thanks [@&#8203;sreichel](https://github.com/sreichel)! - \[Transform] Do not create a new node if the existing node is already the correct one on AttributeKeyToClassConstFetchRector ([#&#8203;5328](https://github.com/rectorphp/rector-src/pull/5328)), Thanks [@&#8203;SerethiX](https://github.com/SerethiX)! - Bump to php parser 4.18 ([#&#8203;5362](https://github.com/rectorphp/rector-src/pull/5362)) - \[CodeQuality] Skip Superglobals variable on SimplifyEmptyCheckOnEmptyArrayRector ([#&#8203;5369](https://github.com/rectorphp/rector-src/pull/5369)) - \[Php55] Handle crash after exit() on GetCalledClassToSelfClassRector ([#&#8203;5372](https://github.com/rectorphp/rector-src/pull/5372)) - \[CodeQuality] Skip method call on else on TernaryFalseExpressionToIfRector ([#&#8203;5373](https://github.com/rectorphp/rector-src/pull/5373)) - Remove return type in case of never in RemoveUselessReturnTagRector ([#&#8203;5323](https://github.com/rectorphp/rector-src/pull/5323)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Remove unused [@&#8203;return](https://github.com/return) mixed on RemoveUselessReturnTagRector ([#&#8203;5332](https://github.com/rectorphp/rector-src/pull/5332)) - \[DeadCode] Skip has parent class with \_\_call() magic method on RemoveParentCallWithoutParentRector ([#&#8203;5336](https://github.com/rectorphp/rector-src/pull/5336)) - \[PHP 5.5] Remove extra preslash in class reference, as in practice removal manually ([#&#8203;5338](https://github.com/rectorphp/rector-src/pull/5338)) - \[DeadCode] Remove null as never used param type in RemoveUselessParamTagRector ([#&#8203;5348](https://github.com/rectorphp/rector-src/pull/5348)) - **Remove json throw on error rule from PHP 7.3 set, as changed behavior and must be applied on purpose** ([#&#8203;5349](https://github.com/rectorphp/rector-src/pull/5349)) - \[Testing] Remove unnecessary set Parameter Source on TestingParser ([#&#8203;5371](https://github.com/rectorphp/rector-src/pull/5371)) ### [`v0.18.12`](https://github.com/rectorphp/rector/releases/tag/0.18.12): Released Rector 0.18.12 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.11...0.18.12) #### New Features :partying\_face: - \[CodeQuality] Add RemoveUselessIsObjectCheckRector ([#&#8203;5316](https://github.com/rectorphp/rector-src/pull/5316)) - \[PHP83] Implements a rule to add types to class constants ([#&#8203;5290](https://github.com/rectorphp/rector-src/pull/5290)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip iterable already there in AddReturnTypeDeclarationFromYieldsRector ([#&#8203;5291](https://github.com/rectorphp/rector-src/pull/5291)) - \[TypeDeclaration] Remove ParamTypeFromStrictTypedPropertyRector as seems similar feature with AddParamTypeFromPropertyTypeRector ([#&#8203;5293](https://github.com/rectorphp/rector-src/pull/5293)) - \[CodingStyle] Remove AddArrayDefaultToArrayPropertyRector as based on docblock types and public contract, better use type declaration set instad ([#&#8203;5298](https://github.com/rectorphp/rector-src/pull/5298)) - \[TypeDeclaration] Skip return void in abstract empty class in AddVoidReturnTypeWhereNoReturnRector ([#&#8203;5311](https://github.com/rectorphp/rector-src/pull/5311)) - \[Php80] Skip PDO::query() on AddParamBasedOnParentClassMethodRector ([#&#8203;5313](https://github.com/rectorphp/rector-src/pull/5313)) - \[TypeDeclaration] Add If else assign support on TypedPropertyFromAssignsRector ([#&#8203;5314](https://github.com/rectorphp/rector-src/pull/5314)) - \[CodeQuality] Make CommonNotEqualRector skip if not <> ([#&#8203;5292](https://github.com/rectorphp/rector-src/pull/5292)) - \[Naming] Skip singularize "cms" on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;5294](https://github.com/rectorphp/rector-src/pull/5294)) - \[TypeDeclaration]\[Performance] Check typed param already early on ParamTypeByMethodCallTypeRector ([#&#8203;5295](https://github.com/rectorphp/rector-src/pull/5295)) - \[Strict] Fix DisallowedEmptyRuleFixerRector empty() allow string '0' check ([#&#8203;5296](https://github.com/rectorphp/rector-src/pull/5296)) - \[EarlyReturn] Skip duplicating complex expression in ChangeAndIfToEarlyReturnRector ([#&#8203;5301](https://github.com/rectorphp/rector-src/pull/5301)) - \[Scoped] Exclude symfony/console/Debug/CliRequest.php from parallel-lint PHP 7.2 syntax check ([#&#8203;5304](https://github.com/rectorphp/rector-src/pull/5304)) - Skip RenameMethodRector in never ([#&#8203;5305](https://github.com/rectorphp/rector-src/pull/5305)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality] Skip with else on SimplifyForeachToCoalescingRector ([#&#8203;5307](https://github.com/rectorphp/rector-src/pull/5307)) - \[Doc] Typo fix on sample code documentation on SimplifyForeachToCoalescingRector ([#&#8203;5308](https://github.com/rectorphp/rector-src/pull/5308)) - \[Privatization] Skip call non-private method on non-final class on PrivatizeLocalGetterToPropertyRector ([#&#8203;5309](https://github.com/rectorphp/rector-src/pull/5309)) - \[Privatization] Fix first class callable in PrivatizeLocalGetterToPropertyRector ([#&#8203;5310](https://github.com/rectorphp/rector-src/pull/5310)) - \[TypeDeclaration] Keep constant false return type from strict native call ([#&#8203;5223](https://github.com/rectorphp/rector-src/pull/5223)), Thanks [@&#8203;tomi85](https://github.com/tomi85)! - \[PHP 7.0] Skip mt\_rand() replacement as not valuable ([#&#8203;5315](https://github.com/rectorphp/rector-src/pull/5315)) - \[Strict] Allow check '0' empty zero on BooleanInTernaryOperatorRuleFixerRector on string type ([#&#8203;5297](https://github.com/rectorphp/rector-src/pull/5297)) - Fix annotation to attribute parsing string ([#&#8203;5317](https://github.com/rectorphp/rector-src/pull/5317)) - \[Instanceof] Fix combination of dead instance and compare ([#&#8203;5319](https://github.com/rectorphp/rector-src/pull/5319)) - Remove isPositiveInteger() check for third argument to strpos() ([#&#8203;5257](https://github.com/rectorphp/rector-src/pull/5257)), Thanks [@&#8203;ikari7789](https://github.com/ikari7789)! - Remove return type in case of void in RemoveUselessReturnTagRector ([#&#8203;5318](https://github.com/rectorphp/rector-src/pull/5318)) - \[DeadCode] Skip [@&#8203;return](https://github.com/return) never with void on RemoveUselessReturnTagRector ([#&#8203;5320](https://github.com/rectorphp/rector-src/pull/5320)) - \[DeadCode] Remove useless nullable [@&#8203;return](https://github.com/return) doc on RemoveUselessReturnTagRector ([#&#8203;5321](https://github.com/rectorphp/rector-src/pull/5321)) ### [`v0.18.11`](https://github.com/rectorphp/rector/releases/tag/0.18.11): Released Rector 0.18.11 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.10...0.18.11) #### Bugfixes :bug: - \[DeadCode] Skip multi no stmts on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5258](https://github.com/rectorphp/rector-src/pull/5258)) - \[Performance]\[Renaming] Remove unnecessary array\_reverse() on RenameClassRector ([#&#8203;5266](https://github.com/rectorphp/rector-src/pull/5266)) - \[TypeDeclaration] Skip default not array type on StrictArrayParamDimFetchRector ([#&#8203;5259](https://github.com/rectorphp/rector-src/pull/5259)) - \[TypeDeclaration] Skip echo-ed on StrictArrayParamDimFetchRector ([#&#8203;5260](https://github.com/rectorphp/rector-src/pull/5260)) - \[Php71] Skip re-assigned as array on AssignArrayToStringRector ([#&#8203;5261](https://github.com/rectorphp/rector-src/pull/5261)) - \[Php71] Ensure re-assign after definition on AssignArrayToStringRector ([#&#8203;5262](https://github.com/rectorphp/rector-src/pull/5262)) - \[Renaming] Handle Rename no namespace to namespaced class with existing use statements ([#&#8203;5264](https://github.com/rectorphp/rector-src/pull/5264)) - \[Renaming]\[Performance] Re-structure check namespace only on renamed node got Namespace\_ ([#&#8203;5265](https://github.com/rectorphp/rector-src/pull/5265)) - \[Php81] Skip increment/decrement on ReadOnlyPropertyRector ([#&#8203;5267](https://github.com/rectorphp/rector-src/pull/5267)) - \[TypeDeclaration] Deprecate TypedPropertyFromStrictGetterMethodReturnTypeRector as depends on missing context and creates invalid code ([#&#8203;5269](https://github.com/rectorphp/rector-src/pull/5269)) - \[AutoImport] Fixing auto import on multiple @&#8203;\ usage ([#&#8203;5271](https://github.com/rectorphp/rector-src/pull/5271)) - \[Performance]\[Renaming] Use FullyQualified on RenameClassRector ([#&#8203;5272](https://github.com/rectorphp/rector-src/pull/5272)) - \[AutoImport] Handle complex usage of multiple @&#8203;\ combined with other doc ([#&#8203;5273](https://github.com/rectorphp/rector-src/pull/5273)) - \[AutoImport] Handle multi @&#8203;\ usage on multiline description ([#&#8203;5274](https://github.com/rectorphp/rector-src/pull/5274)) - \[Php80] Handle FQCN @&#8203;\ usage on AnnotationToAttributeRector ([#&#8203;5240](https://github.com/rectorphp/rector-src/pull/5240)) - \[BetterPhpDocParser] Handle nested doctrine annotation with single quote content ([#&#8203;5281](https://github.com/rectorphp/rector-src/pull/5281)) - \[Privatization] Skip method with parent call ([#&#8203;5283](https://github.com/rectorphp/rector-src/pull/5283)) - \[BetterPhpDocParser] Use ORIG\_NODE attribute on DoctrineAnnotationDecorator on handle @&#8203;\ after generic ([#&#8203;5285](https://github.com/rectorphp/rector-src/pull/5285)) - \[Php80] Allow subnamespace from use statements support on AnnotationToAttributeRector ([#&#8203;5287](https://github.com/rectorphp/rector-src/pull/5287)) <br> #### Removed :skull: - Remove deprecated Rector rules ([#&#8203;5270](https://github.com/rectorphp/rector-src/pull/5270)) ### [`v0.18.10`](https://github.com/rectorphp/rector/releases/tag/0.18.10): Released Rector 0.18.10 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.9...0.18.10) #### Bugfixes :bug: - \[Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector ([#&#8203;5256](https://github.com/rectorphp/rector-src/pull/5256)) ### [`v0.18.9`](https://github.com/rectorphp/rector/releases/tag/0.18.9): Released Rector 0.18.9 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.8...0.18.9) #### New Features 🥳 - \[DeadCode]: Support functions in RemoveUnusedVariableAssignRector ([#&#8203;5249](https://github.com/rectorphp/rector-src/pull/5249) - \[Performance]\[PostRector] Only process FullyQualified on import Node name on NameImportingPostRector ([#&#8203;5255](https://github.com/rectorphp/rector-src/pull/5255)) #### Bugfixes :bug: - \[AutoImport]\[Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector ([#&#8203;5251](https://github.com/rectorphp/rector-src/pull/5251)) - \[Naming] Fix dotted name on generics bug in RenameVariableToMatchMethodCallReturnTypeRector ([#&#8203;5250](https://github.com/rectorphp/rector-src/pull/5250)) - \[Php73] Handle crash on JsonThrowOnErrorRector + SensitiveConstantNameRector ([#&#8203;5253](https://github.com/rectorphp/rector-src/pull/5253)) - \[CodingStyle] Refactor UseImportsAdder to return \[FileWithoutNamespace] code on no namespaced code ([#&#8203;5254](https://github.com/rectorphp/rector-src/pull/5254)) ### [`v0.18.8`](https://github.com/rectorphp/rector/releases/tag/0.18.8): Released Rector 0.18.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.7...0.18.8) #### Bugfixes :bug: - Bump to reactphp/event-loop ^1.5 ([#&#8203;5246](https://github.com/rectorphp/rector-src/pull/5246)) - \[AutoImport] Skip auto import on no namespace used class on auto import enabled ([#&#8203;5247](https://github.com/rectorphp/rector-src/pull/5247)) - \[AutoImport]\[Renaming] Handle same last name no namespace just renamed auto import ([#&#8203;5248](https://github.com/rectorphp/rector-src/pull/5248)) ### [`v0.18.7`](https://github.com/rectorphp/rector/releases/tag/0.18.7): Released Rector 0.18.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.6...0.18.7) #### New Features :partying\_face: - \[CodeQuality] Add negated support on SingleInArrayToCompareRector ([#&#8203;5205](https://github.com/rectorphp/rector-src/pull/5205)) - \[Php83] Adds rule for adding Override attribute ([#&#8203;5170](https://github.com/rectorphp/rector-src/pull/5170)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! <br> #### Bugfixes :bug: - BinaryOpBetweenNumberAndStringRector don't trust phpdoc ([#&#8203;5199](https://github.com/rectorphp/rector-src/pull/5199)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality]\[Php70] Handle LocallyCalledStaticMethodToNonStaticRector + ThisCallOnStaticMethodToStaticCallRector must change both method and caller ([#&#8203;5196](https://github.com/rectorphp/rector-src/pull/5196)) - CountArrayToEmptyArrayComparisonRector: don't trust phpdoc ([#&#8203;5203](https://github.com/rectorphp/rector-src/pull/5203)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip union false on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;5204](https://github.com/rectorphp/rector-src/pull/5204)) - \[CodeQuality] Handle negated isset on IssetOnPropertyObjectToPropertyExistsRector on property not exists ([#&#8203;5206](https://github.com/rectorphp/rector-src/pull/5206)) - \[CodeQuality] Handle crash no scope on ThrowWithPreviousExceptionRector+OptionalParametersAfterRequiredRector ([#&#8203;5207](https://github.com/rectorphp/rector-src/pull/5207)) - \[NodeTypeResolver] Clean up TryCatch\_ Scope filling ([#&#8203;5208](https://github.com/rectorphp/rector-src/pull/5208)) - \[PHPStanStaticTypeMapper] Clean up tweak false and bool check on UnionTypeMapper ([#&#8203;5209](https://github.com/rectorphp/rector-src/pull/5209)) - \[TypeDeclaration] Skip default numeric string on param int on ParamTypeByMethodCallTypeRector ([#&#8203;5210](https://github.com/rectorphp/rector-src/pull/5210)) - \[AutoImport] Handle AnnotationToAttributeRector + RenameClassRector then enable auto import ([#&#8203;5213](https://github.com/rectorphp/rector-src/pull/5213)) - \[Php80] Keep single quoted Argument Attribute on AnnotationToAttributeRector ([#&#8203;5214](https://github.com/rectorphp/rector-src/pull/5214)) - \[Php80] Keep single quoted key: 'value' on AnnotationToAttributeRector ([#&#8203;5215](https://github.com/rectorphp/rector-src/pull/5215)) - \[AutoImport] Ensure change to FullyQualified for Attribute on just changed from annotation ([#&#8203;5216](https://github.com/rectorphp/rector-src/pull/5216)) - \[Php52]\[Php70] Handle ContinueToBreakInSwitchRector + BreakNotInLoopOrSwitchToReturnRector ([#&#8203;5217](https://github.com/rectorphp/rector-src/pull/5217)) - \[Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined ([#&#8203;5219](https://github.com/rectorphp/rector-src/pull/5219)) - \[Testing] In case of failed test using multiple rules, show applied Rector rules to make easy to find them ([#&#8203;5222](https://github.com/rectorphp/rector-src/pull/5222)) - \[NodeTypeResolver] Handle nullable extended class on ->isObjectType() on DowngradeReflectionGetAttributesRector ([#&#8203;5224](https://github.com/rectorphp/rector-src/pull/5224)) - NullableCompareToNullRector: Don't trust phpdocs ([#&#8203;5225](https://github.com/rectorphp/rector-src/pull/5225)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodingStyle] Move ArraySpreadInsteadOfArrayMergeRector from php74 to codingstyle sets list ([#&#8203;5230](https://github.com/rectorphp/rector-src/pull/5230)) - \[PostRector] Ensure old classes in use statements cleaned up after rename attribuet on ClassRenamingPostRector ([#&#8203;5231](https://github.com/rectorphp/rector-src/pull/5231)) - RestoreDefaultNullToNullableTypePropertyRector: skip `@readonly` phpdoc ([#&#8203;5233](https://github.com/rectorphp/rector-src/pull/5233)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[AutoImport] Handle DeclareStrictTypesRector on importNames() enabled on no namespace ([#&#8203;5241](https://github.com/rectorphp/rector-src/pull/5241)) - \[AutoImport] Allow auto import just renamed [@&#8203;var](https://github.com/var) only docblock on RenameClassRector without removeUnusedImports() enabled ([#&#8203;5220](https://github.com/rectorphp/rector-src/pull/5220)) - Remove rule DataProviderArrayItemsNewlinedRector.php ([#&#8203;5227](https://github.com/rectorphp/rector-src/pull/5227)), Thanks [@&#8203;eerison](https://github.com/eerison)! - Remove `ArraySpreadInsteadOfArrayMergeRector` from `LevelSetList::UP_TO_PHP_74` ([#&#8203;5228](https://github.com/rectorphp/rector-src/pull/5228)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Allow indirect duplicated grouping on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5234](https://github.com/rectorphp/rector-src/pull/5234)) - \[DeadCode] Reduce double loop on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5235](https://github.com/rectorphp/rector-src/pull/5235)) - \[DeadCode] Handle different indirect duplicated on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5236](https://github.com/rectorphp/rector-src/pull/5236)) - \[DeadCode] Ensure change hasChanged flag on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5237](https://github.com/rectorphp/rector-src/pull/5237)) - \[DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5239](https://github.com/rectorphp/rector-src/pull/5239)) - Rename parameter variable to nextCase on RemoveDuplicatedCaseInSwitchRector ([#&#8203;5244](https://github.com/rectorphp/rector-src/pull/5244)) ### [`v0.18.6`](https://github.com/rectorphp/rector/releases/tag/0.18.6): Released Rector 0.18.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.5...0.18.6) #### New Features and Changes :partying\_face: - \[CodeQuality] Add CompleteMissingIfElseBracketRector ([#&#8203;5121](https://github.com/rectorphp/rector-src/pull/5121)) - \[CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector ([#&#8203;5124](https://github.com/rectorphp/rector-src/pull/5124)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector ([#&#8203;5156](https://github.com/rectorphp/rector-src/pull/5156)) - \[DeadCode] Add RemoveUselessReturnExprInConstructRector ([#&#8203;5158](https://github.com/rectorphp/rector-src/pull/5158)) - Improve UnaryPlus and UnaryMinus support in isDynamicExpr ([#&#8203;5177](https://github.com/rectorphp/rector-src/pull/5177)), Thanks [@&#8203;JulianCBC](https://github.com/JulianCBC)! <br> #### Bugfixes :bug: - \[CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector ([#&#8203;5122](https://github.com/rectorphp/rector-src/pull/5122)) - \[CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector ([#&#8203;5125](https://github.com/rectorphp/rector-src/pull/5125)) - \[CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector ([#&#8203;5126](https://github.com/rectorphp/rector-src/pull/5126)) - \[CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector ([#&#8203;5127](https://github.com/rectorphp/rector-src/pull/5127)) - \[CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector ([#&#8203;5129](https://github.com/rectorphp/rector-src/pull/5129)) - \[CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector ([#&#8203;5132](https://github.com/rectorphp/rector-src/pull/5132)) - Skip `__construct()` in BoolReturnTypeFromStrictScalarReturnsRector ([#&#8203;5133](https://github.com/rectorphp/rector-src/pull/5133)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector ([#&#8203;5134](https://github.com/rectorphp/rector-src/pull/5134)) - \[CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector ([#&#8203;5135](https://github.com/rectorphp/rector-src/pull/5135)) - \[CodeQuality] Use its start token pos on Else\_ on CompleteMissingIfElseBracketRector as no cond ([#&#8203;5136](https://github.com/rectorphp/rector-src/pull/5136)) - \[PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() ([#&#8203;5138](https://github.com/rectorphp/rector-src/pull/5138)) - \[TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector ([#&#8203;5144](https://github.com/rectorphp/rector-src/pull/5144)) - \[TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector ([#&#8203;5149](https://github.com/rectorphp/rector-src/pull/5149)) - \[CodeQuality] Fix missing parentheses on CombineIfRector ([#&#8203;5151](https://github.com/rectorphp/rector-src/pull/5151)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;5155](https://github.com/rectorphp/rector-src/pull/5155)) - \[CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector ([#&#8203;5159](https://github.com/rectorphp/rector-src/pull/5159)) - \[CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector ([#&#8203;5161](https://github.com/rectorphp/rector-src/pull/5161)) - \[CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector ([#&#8203;5163](https://github.com/rectorphp/rector-src/pull/5163)) - \[PostRector] Reduce loop on ClassRenamingPostRector ([#&#8203;5174](https://github.com/rectorphp/rector-src/pull/5174)) - \[PostRector] Fix ClassRenamingPostRector return when no auto import replacement ([#&#8203;5175](https://github.com/rectorphp/rector-src/pull/5175)) - \[Renaming] Skip nullable object object|null on RenameMethodRector ([#&#8203;5181](https://github.com/rectorphp/rector-src/pull/5181)) - \[Downgradephp81]\[DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector ([#&#8203;5183](https://github.com/rectorphp/rector-src/pull/5183)) - \[Naming] Skip DateTime from renaming, to keep convention of named dates ([#&#8203;5184](https://github.com/rectorphp/rector-src/pull/5184)) - Skip new self in RenameVariableToMatchNewTypeRector ([#&#8203;5185](https://github.com/rectorphp/rector-src/pull/5185)) - Skip DateTime in ExpectedNameResolver ([#&#8203;5186](https://github.com/rectorphp/rector-src/pull/5186)) - \[Naming] Skip all kinds of generators ([#&#8203;5187](https://github.com/rectorphp/rector-src/pull/5187)) - \[Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector ([#&#8203;5188](https://github.com/rectorphp/rector-src/pull/5188)) - \[Php70] Fix Php4 contructor not replaced with \_\_construct() on php 7.4 environment ([#&#8203;5189](https://github.com/rectorphp/rector-src/pull/5189)) - \[Php74]\[Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled ([#&#8203;5190](https://github.com/rectorphp/rector-src/pull/5190)) - \[TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() ([#&#8203;5191](https://github.com/rectorphp/rector-src/pull/5191)) - Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() ([#&#8203;5193](https://github.com/rectorphp/rector-src/pull/5193)) - \[PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper ([#&#8203;5141](https://github.com/rectorphp/rector-src/pull/5141)) - \[DeadCode] Remove UnionType check on RecastingRemovalRector ([#&#8203;5142](https://github.com/rectorphp/rector-src/pull/5142)) - Remove src/constants.php for T\_ENUM and T\_NAME\_RELATIVE ([#&#8203;5143](https://github.com/rectorphp/rector-src/pull/5143)) - \[PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper ([#&#8203;5145](https://github.com/rectorphp/rector-src/pull/5145)) - \[PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper ([#&#8203;5146](https://github.com/rectorphp/rector-src/pull/5146)) - \[DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector ([#&#8203;5152](https://github.com/rectorphp/rector-src/pull/5152)) - \[DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector ([#&#8203;5153](https://github.com/rectorphp/rector-src/pull/5153)) - \[DeadCode] Skip used in next For\_/Foreach\_ on RemoveDeadIfForeachForRector ([#&#8203;5154](https://github.com/rectorphp/rector-src/pull/5154)) - \[DeadCode] Handle file\_get\_contents() only remove variable on RemoveUnusedVariableAssignRector ([#&#8203;5162](https://github.com/rectorphp/rector-src/pull/5162)) - \[DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#&#8203;5160](https://github.com/rectorphp/rector-src/pull/5160)) - RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types ([#&#8203;5169](https://github.com/rectorphp/rector-src/pull/5169)), Thanks [@&#8203;staabm](https://github.com/staabm)! - RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch ([#&#8203;5166](https://github.com/rectorphp/rector-src/pull/5166)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector ([#&#8203;5172](https://github.com/rectorphp/rector-src/pull/5172)) - \[AutoImport] \[Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import ([#&#8203;5168](https://github.com/rectorphp/rector-src/pull/5168)) - \[DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector ([#&#8203;5195](https://github.com/rectorphp/rector-src/pull/5195)) ### [`v0.18.5`](https://github.com/rectorphp/rector/releases/tag/0.18.5): Released Rector 0.18.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.4...0.18.5) #### New Features and Improvements :partying\_face: - \[build] Remove duplicated phpstan/phpstan from the build, as require by build package in composer.json already ([rectorphp/rector-src@`51ed7b6`](https://github.com/rectorphp/rector-src/commit/51ed7b693fbfab70cf6a246bec4cc35f0ceacf7a)) - AddParamTypeBasedOnPHPUnitDataProviderRector: Check all data providers ([#&#8203;5068](https://github.com/rectorphp/rector-src/pull/5068)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - AddParamTypeBasedOnPHPUnitDataProviderRector: Enhance existing rule to handle PHPUnit 10+ DataProvider Attribute ([#&#8203;4925](https://github.com/rectorphp/rector-src/pull/4925)), Thanks [@&#8203;mcampbell508](https://github.com/mcampbell508)! - make PhpDocInfo::findByAnnotationClass() public to use in Symfony rules ([#&#8203;5103](https://github.com/rectorphp/rector-src/pull/5103)) <br> #### Bugfixes :bug: - Feature/fix class annotation bad print ([#&#8203;5081](https://github.com/rectorphp/rector-src/pull/5081)), Thanks [@&#8203;etshy](https://github.com/etshy)! - \[Performance] Avoid ReflectionProvider check function exists on NameImportingPostRector ([#&#8203;5083](https://github.com/rectorphp/rector-src/pull/5083)) - InlineConstructorDefaultToPropertyRector Readonly Class ([#&#8203;5085](https://github.com/rectorphp/rector-src/pull/5085)), Thanks [@&#8203;beschoenen](https://github.com/beschoenen)! - \[CodeQuality] Handle crash on variable variable on assign closure on OptionalParametersAfterRequiredRector ([#&#8203;5089](https://github.com/rectorphp/rector-src/pull/5089)) - \[NodeTypeResolver] Use isScalar()->yes() usage on StaticTypeAnalyzer and ScalarTypeComparator services ([#&#8203;5099](https://github.com/rectorphp/rector-src/pull/5099)) - \[ProcessAnalyzer] Ensure instanceof Stmt on check infinite loop on not yet has "created\_by\_rule" attribute ([#&#8203;5100](https://github.com/rectorphp/rector-src/pull/5100)) - \[DX] Rename shouldImportName() to shouldSkipName() on ClassNameImportSkipper ([#&#8203;5107](https://github.com/rectorphp/rector-src/pull/5107)) - The ReturnTypeFromReturnNewRector must only handle new instances, to avoid leaking to everything ([#&#8203;5115](https://github.com/rectorphp/rector-src/pull/5115)) - \[Php80] Skip when already implements Stringable and has string return type on StringableForToStringRector ([#&#8203;5120](https://github.com/rectorphp/rector-src/pull/5120)) <br> #### Removed and Deprecated :skull: - \[DX] Remove CurrentFileProvider dependency on ChangedNodeScopeRefresher ([#&#8203;5087](https://github.com/rectorphp/rector-src/pull/5087)) - \[DX] Remove DependencyClassMethodDecorator as not used anymore due to paralel nature ([#&#8203;5094](https://github.com/rectorphp/rector-src/pull/5094)) - \[PostRector] Remove CurrentFileProvider on PostFileProcessor ([#&#8203;5097](https://github.com/rectorphp/rector-src/pull/5097)) - \[Comments] Remove unused copy Node object on CommentRemover ([#&#8203;5103](https://github.com/rectorphp/rector-src/pull/5103)) - \[Performance]\[AutoImport] Remove just renamed check on ClassNameImportSkipper ([#&#8203;5106](https://github.com/rectorphp/rector-src/pull/5106)) - Deprecate CountOnNullRector as depends on previous context and require manual adjustment of previous result ([#&#8203;5101](https://github.com/rectorphp/rector-src/pull/5101)) ### [`v0.18.4`](https://github.com/rectorphp/rector/releases/tag/0.18.4): Released Rector 0.18.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.3...0.18.4) #### New Features and Improvements :partying\_face: - **Introducing Collectors** :partying\_face: - processing collected data + test case ([#&#8203;4970](https://github.com/rectorphp/rector-src/pull/4970)) - Run tests on macos ([#&#8203;5019](https://github.com/rectorphp/rector-src/pull/5019)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Move betterNodeFinder, valueResolver, phpDocInfoFactory dependencies from AbstractRector into rules ([#&#8203;5071](https://github.com/rectorphp/rector-src/pull/5071)) - DX: Validate paths in RectorConfig->paths() ([#&#8203;5065](https://github.com/rectorphp/rector-src/pull/5065)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Make PhpDocInfoFactory explicitly required in Rector rule constructor, if needed ([#&#8203;5051](https://github.com/rectorphp/rector-src/pull/5051)) - \[DX] Make ValueResolver explicitly required in Rector rules constructor if needed ([#&#8203;5052](https://github.com/rectorphp/rector-src/pull/5052)) <br> #### Bugfixes :bug: - \[DeadCode] RemoveDeadZeroAndOneOperationRector should not remove Constants ([#&#8203;4910](https://github.com/rectorphp/rector-src/pull/4910)), Thanks [@&#8203;TwanVermeulen](https://github.com/TwanVermeulen)! - \[PostRector] Fix unused import not removed on empty generic class name exists ([#&#8203;5012](https://github.com/rectorphp/rector-src/pull/5012)) - \[Parallel] Handle Spaced root project main script on parallel process ([#&#8203;4813](https://github.com/rectorphp/rector-src/pull/4813)) - Fix TypedPropertyFromStrictConstructor\* order ([#&#8203;5021](https://github.com/rectorphp/rector-src/pull/5021)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Lower current node dependency - pass it directly to doc node parsing ([#&#8203;5023](https://github.com/rectorphp/rector-src/pull/5023)) - \[AutoImport] Fix conflict current namespace auto import ([#&#8203;5024](https://github.com/rectorphp/rector-src/pull/5024)) - Simplify UseIdenticalOverEqualWithSameTypeRector ([#&#8203;5029](https://github.com/rectorphp/rector-src/pull/5029)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Performance]\[Testing] Use str\_contains instead of regex in FixtureSplitter ([#&#8203;5030](https://github.com/rectorphp/rector-src/pull/5030)) - Fix ArrayKeyFirstLastRector: Skip exection when pointer is changed ([#&#8203;5038](https://github.com/rectorphp/rector-src/pull/5038)), Thanks [@&#8203;scyzoryck](https://github.com/scyzoryck)! - \[TypeDeclaration] Handle fallback from param same type object on ReturnTypeFromReturnNewRector ([#&#8203;5039](https://github.com/rectorphp/rector-src/pull/5039)) - \[NodeTypeResolver] Use Scope->getType() on ArrayDimFetch on NodeTypeResolver::getNativeType() ([#&#8203;5037](https://github.com/rectorphp/rector-src/pull/5037)) - \[NodeTypeResolver] pull getType() on ArrayDimFetch when not mixed type from its variable native definition ([#&#8203;5056](https://github.com/rectorphp/rector-src/pull/5056)) - \[CodingStyle]\[EarlyReturn] Fix infinite if else on BinarySwitchToIfElseRector+RemoveAlwaysElseRector ([#&#8203;5057](https://github.com/rectorphp/rector-src/pull/5057)) - \[TypeDeclaration] Skip ArrayDimFetch for return and param types ([#&#8203;5059](https://github.com/rectorphp/rector-src/pull/5059)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[NodeTypeResolver] Handle optional array shape on native function like with ArrayDimFetch ([#&#8203;5062](https://github.com/rectorphp/rector-src/pull/5062)) - \[Php80] Mirror switch comment to match to ChangeSwitchToMatchRector ([#&#8203;5072](https://github.com/rectorphp/rector-src/pull/5072)) - \[AutoImport] Skip case insensitive conflict defined class name on $rectorConfig->importNames() ([#&#8203;5076](https://github.com/rectorphp/rector-src/pull/5076)) - Docblock fix on ShortNameResolver ([#&#8203;5077](https://github.com/rectorphp/rector-src/pull/5077)) - \[TypeDeclaration] Add return static property support on ReturnTypeFromStrictTypedPropertyRector ([#&#8203;5050](https://github.com/rectorphp/rector-src/pull/5050)) <br> #### Removed and Deprecated :skull: - \[Config] Remove asterisk support in import() for file, use explicit paths instead ([#&#8203;5010](https://github.com/rectorphp/rector-src/pull/5010)) - \[Performance] Remove regex check on open tag spaced check on FileProcessor ([#&#8203;5073](https://github.com/rectorphp/rector-src/pull/5073)) - Deprecate TypedPropertyFromStrictConstructorReadonlyClassRector as based on docblock and public elements; use private elements and property promotion instead ([#&#8203;5049](https://github.com/rectorphp/rector-src/pull/5049)) - Deprecate BinarySwitchToIfElseRector as opinionated to allow more suitable match() refactoring ([#&#8203;5064](https://github.com/rectorphp/rector-src/pull/5064)) ### [`v0.18.3`](https://github.com/rectorphp/rector/releases/tag/0.18.3): Released Rector 0.18.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.2...0.18.3) #### New Features and Changes :partying\_face: - **\[BC] docblock changes in custom Rector rules now have to be reprinted directly in the rule - [#&#8203;8201 (comment)](https://github.com/rectorphp/rector/issues/8201#issue-1894148095)** - \[TypeDeclaration] Add return empty string defined support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4919](https://github.com/rectorphp/rector-src/pull/4919)) - \[TypeDeclaration] Add fallback return direct array support on ReturnTypeFromStrictNewArrayRector ([#&#8203;4928](https://github.com/rectorphp/rector-src/pull/4928)) - \[TypeDeclaration] Add init assign method call support on ReturnTypeFromStrictNewArrayRector ([#&#8203;4929](https://github.com/rectorphp/rector-src/pull/4929)) - \[TypeDeclaration] Ensure ArrayType on ReturnTypeFromStrictNewArrayRector::shouldAddReturnArrayDocType() ([#&#8203;4932](https://github.com/rectorphp/rector-src/pull/4932)) - \[TypeDeclaration] Add test fixture return docblock on init method call assign as skipped on ReturnTypeFromStrictNewArrayRector ([#&#8203;4933](https://github.com/rectorphp/rector-src/pull/4933)) - \[TypeDeclaration] Add non native function return support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4934](https://github.com/rectorphp/rector-src/pull/4934)) - **BC: Separated regex matching in NodeNameResolver->isName() ([#&#8203;4951](https://github.com/rectorphp/rector-src/pull/4951)), Thanks [@&#8203;staabm](https://github.com/staabm)!** - Add support for Custom Skip Voters ([#&#8203;5002](https://github.com/rectorphp/rector-src/pull/5002)), Thanks [@&#8203;kaczenski](https://github.com/kaczenski)! - Implement a max jobs per worker budget ([#&#8203;4965](https://github.com/rectorphp/rector-src/pull/4965)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Prevent unnecessary calls to spl\_object\_id() ([#&#8203;4992](https://github.com/rectorphp/rector-src/pull/4992)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor use import resolving ([#&#8203;4998](https://github.com/rectorphp/rector-src/pull/4998)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NodeNameResolver: Throw exception in BC breaking path ([#&#8203;4980](https://github.com/rectorphp/rector-src/pull/4980)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Internals] Decouple output from AbstractRector, narrow debugging output to file path ([#&#8203;4976](https://github.com/rectorphp/rector-src/pull/4976)) - Update docblock only when changed, directly in rector rule ([#&#8203;4986](https://github.com/rectorphp/rector-src/pull/4986)) <br> #### Bugfixes :bug: - AddVoidReturnTypeWhereNoReturnRector: fix never type handling ([#&#8203;4918](https://github.com/rectorphp/rector-src/pull/4918)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip return after return closure on AddVoidReturnTypeWhereNoReturnRector ([#&#8203;4930](https://github.com/rectorphp/rector-src/pull/4930)) - \[TypeDeclaration] Use $type->isScalar()->yes() on AlwaysStrictScalarExprAnalyzer ([#&#8203;4920](https://github.com/rectorphp/rector-src/pull/4920)) - Refactor BetterNodeFinder::findFirstInFunctionLikeScoped() to work with SilentVoidResolver ([#&#8203;4931](https://github.com/rectorphp/rector-src/pull/4931)) - \[NodeTypeResolver] Handle isObjectType() on new $class dynamic variable should return false compare to Object FQCN ([#&#8203;4936](https://github.com/rectorphp/rector-src/pull/4936)) - \[Testing] Fix running unit test on macOS ([#&#8203;4941](https://github.com/rectorphp/rector-src/pull/4941)) - Faster name resolving ([#&#8203;4955](https://github.com/rectorphp/rector-src/pull/4955)), Thanks [@&#8203;staabm](https://github.com/staabm)! - UseImportsTraverser: don't deep traverse ([#&#8203;4994](https://github.com/rectorphp/rector-src/pull/4994)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[tests] Replace wildcard e2e test with unit one ([#&#8203;5000](https://github.com/rectorphp/rector-src/pull/5000)) - \[DocBlock] Update docblock contents right in the rule ([#&#8203;4999](https://github.com/rectorphp/rector-src/pull/4999)) - \[PhpParser] Fix crash read jetbrains/phpstorm-stubs included in phpstan.phar on PHP 8.0 and PHP 7.4 ([#&#8203;5001](https://github.com/rectorphp/rector-src/pull/5001)) - RenameFunctionRector: prevent repeated isName() calls ([#&#8203;5003](https://github.com/rectorphp/rector-src/pull/5003)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Make PhpDocINfo::removeByType() return bool to inform about changed node ([#&#8203;4979](https://github.com/rectorphp/rector-src/pull/4979)) <br> #### Removed :skull: - \[cleanup] Remove deprecated NonPhpRectorInterface, PseudoNamespaceToNamespaceRector and mysql to mysqli sets ([#&#8203;4927](https://github.com/rectorphp/rector-src/pull/4927)) - Remove UnSpreadOperatorRector as not clear value and spread used on purpose ([#&#8203;4949](https://github.com/rectorphp/rector-src/pull/4949)) - \[Naming] Remove matchesStringName() check completely from NodeNameResolver, including endsWith() method - use getName() and compare directly instead ([#&#8203;4954](https://github.com/rectorphp/rector-src/pull/4954)) - \[Performance]\[Php55] Remove regex replace e on RegexMatcher ([#&#8203;4974](https://github.com/rectorphp/rector-src/pull/4974)) - Remove CurrentRectorProvider and used for docblock changes report, return bool value and node directly in the rector rule instead ([#&#8203;4982](https://github.com/rectorphp/rector-src/pull/4982)) - Deprecated PhpDocInfo::markAsChanged() to ensure doc block is changed directly in the Rector rule ([#&#8203;4987](https://github.com/rectorphp/rector-src/pull/4987)) ### [`v0.18.2`](https://github.com/rectorphp/rector/releases/tag/0.18.2): Released Rector 0.18.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.1...0.18.2) #### New Features and Changes :partying\_face: - Add MyCLabs enum equals + keeping methods ([#&#8203;4645](https://github.com/rectorphp/rector-src/pull/4645)), Thanks [@&#8203;K0nias](https://github.com/K0nias)! - \[TypeDeclaration] skip variadic constructor param of mixed type on AddParamTypeFromPropertyTypeRector ([#&#8203;4887](https://github.com/rectorphp/rector-src/pull/4887)), Thanks [@&#8203;Celebrate-Reinhard](https://github.com/Celebrate-Reinhard)! - \[TypeDeclaration] Do not add default value when assigned in \_\_construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector ([#&#8203;4886](https://github.com/rectorphp/rector-src/pull/4886)) - \[TypeDeclaration] Add ReturnTypeFromStrictFluentReturnRector ([#&#8203;4890](https://github.com/rectorphp/rector-src/pull/4890)) - Add single value concat support to EncapsedStringsToSprintfRector ([#&#8203;4897](https://github.com/rectorphp/rector-src/pull/4897)) - Add number support to concat EncapsedStringsToSprintfRector ([#&#8203;4898](https://github.com/rectorphp/rector-src/pull/4898)) - \[DeadCode] Remove [@&#8203;return](https://github.com/return) void on return self on RemoveUselessReturnTagRector ([#&#8203;4894](https://github.com/rectorphp/rector-src/pull/4894)) - Add test case for caching $rectorConfig->rules() changed ([#&#8203;4903](https://github.com/rectorphp/rector-src/pull/4903)) - \[CodeQuality] Add NumberCompareToMaxFuncCallRector ([#&#8203;4914](https://github.com/rectorphp/rector-src/pull/4914)) - \[TypeDeclaration] Add return self object support on ReturnTypeFromStrictFluentReturnRector ([#&#8203;4915](https://github.com/rectorphp/rector-src/pull/4915)) - \[TypeDeclaration] Add return static object support on ReturnTypeFromStrictFluentReturnRector ([#&#8203;4916](https://github.com/rectorphp/rector-src/pull/4916)) <br> #### Bugfixes :bug: - \[Caching] Add VersionResolver::PACKAGE\_VERSION to FileHashComputer::compute() so cache cleared on composer update got new version ([#&#8203;4904](https://github.com/rectorphp/rector-src/pull/4904)) - \[TypeDeclaration] Using ClassMethodReturnTypeOverrideGuard on ReturnTypeFromStrictParamRector ([#&#8203;4878](https://github.com/rectorphp/rector-src/pull/4878)) - \[e2e] $rectorConfig->skip() should not skip inside different path over config ([#&#8203;4882](https://github.com/rectorphp/rector-src/pull/4882)) - Fix missing default string in TypedPropertyFromStrictGetterMethodReturnTypeRector ([#&#8203;4885](https://github.com/rectorphp/rector-src/pull/4885)) - Fix tests fixture updater ([#&#8203;4892](https://github.com/rectorphp/rector-src/pull/4892)) - Fix union type check of object ([#&#8203;4893](https://github.com/rectorphp/rector-src/pull/4893)) - Simplify isMatchingUnionType() ([#&#8203;4895](https://github.com/rectorphp/rector-src/pull/4895)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skip identical to false in SimplifyBoolIdenticalTrueRector, as exact comparison is stronger than negated expression ([#&#8203;4901](https://github.com/rectorphp/rector-src/pull/4901)) - Fix Rector invalidation in case of changes sets or rules ([#&#8203;4902](https://github.com/rectorphp/rector-src/pull/4902)) - \[TypeDeclaration] Skip mixing native + docblock union assign on TypedPropertyFromAssignsRector ([#&#8203;4905](https://github.com/rectorphp/rector-src/pull/4905)) - StrictArrayParamDimFetchRector: Skip objects ([#&#8203;4907](https://github.com/rectorphp/rector-src/pull/4907)), Thanks [@&#8203;staabm](https://github.com/staabm)! - FamilyRelationsAnalyzer: final classes can't have children ([#&#8203;4913](https://github.com/rectorphp/rector-src/pull/4913)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Config] Remove $isBound usage as cause empty configuration on RectorConfig ([#&#8203;4880](https://github.com/rectorphp/rector-src/pull/4880)) ### [`v0.18.1`](https://github.com/rectorphp/rector/releases/tag/0.18.1): Released Rector 0.18.1 [Compare Source](https://github.com/rectorphp/rector/compare/0.18.0...0.18.1) This release is accompanied by 2 posts that explains behind the scenes context: - [Rector 0.18 - From Symfony Container to Laravel and How to Upgrade your Extensions](https://getrector.com/blog/rector-018-from-symfony-container-to-laravel-and-how-to-upgrade-your-extensions) - [Rector 0.18 - How we made tests Seven Times Faster](https://getrector.com/blog/rector-018-how-we-made-tests-seven-times-faster) <br> #### New Features and Changes :partying_face: - **\[CI] Narrow tests to single job, as now takes 20 s :rocket:** ([#&#8203;4827](https://github.com/rectorphp/rector-src/pull/4827)) - \[Config] Handle $rectorConfig->import() with wildcards \* config ([#&#8203;4832](https://github.com/rectorphp/rector-src/pull/4832)) - \[DX] Display rule count in list-rules ([#&#8203;4848](https://github.com/rectorphp/rector-src/pull/4848)) - Skip PHPDoc return type in AddReturnTypeDeclarationBasedOnParentClassMethodRector ([#&#8203;4809](https://github.com/rectorphp/rector-src/pull/4809)), Thanks [@&#8203;staabm](https://github.com/staabm)! - AddReturnTypeDeclarationBasedOnParentClassMethodRector: don't trust phpdoc types ([#&#8203;4810](https://github.com/rectorphp/rector-src/pull/4810)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[DX] Add optional testdox/pest like output to get exact test metrics per unit test fixture ([#&#8203;4821](https://github.com/rectorphp/rector-src/pull/4821)) - \[TypeDeclaration] Add new array replaced with array on ReturnTypeFromStrictNewArrayRector ([#&#8203;4825](https://github.com/rectorphp/rector-src/pull/4825)) - \[DX] Merge PhpRectorInterface to RectorInterface as identical contract and separation no longer needed ([#&#8203;4812](https://github.com/rectorphp/rector-src/pull/4812)) - \[PHPStan] Avoid removing bleeding edge from phar include, let user handle own phpstan configuration ([#&#8203;4840](https://github.com/rectorphp/rector-src/pull/4840)) <br> #### Bugfixes :bug: - \[Php73]\[Php80] Handle empty long array syntax default value on SensitiveConstantNameRector+AddParamBasedOnParentClassMethodRector ([#&#8203;4837](https://github.com/rectorphp/rector-src/pull/4837)) - \[Config] Add merging of rules configuration, call configure() just once ([#&#8203;4838](https://github.com/rectorphp/rector-src/pull/4838)) - Fix RenamePropertyToMatchTypeRector to skip Laravel collections and avoid accident rename ([#&#8203;4811](https://github.com/rectorphp/rector-src/pull/4811)) - \[BetterPhpDocParser] Enable textBetweenTagsBelongsToDescription on BetterPhpDocParser extends PhpDocParser ([#&#8203;4817](https://github.com/rectorphp/rector-src/pull/4817)) - \[PHPUnit] Fix extreemely slow PHPUnit run on data providers with objects ([#&#8203;4823](https://github.com/rectorphp/rector-src/pull/4823)) - \[AutoImport] Handle case insensitive name collide on auto import ([#&#8203;4829](https://github.com/rectorphp/rector-src/pull/4829)) - \[Traverser] Set explicitely nodeConnectingVisitorCompatibility: false config in config/phpstan/static-reflection.neon ([#&#8203;4841](https://github.com/rectorphp/rector-src/pull/4841)) - replaces `get_headers` $associative with bool ([#&#8203;4850](https://github.com/rectorphp/rector-src/pull/4850)), Thanks [@&#8203;mvhirsch](https://github.com/mvhirsch)! - \[Php55]\[Renaming] Handle rename string on combination StringClassNameToClassConstantRector+RenameStringRector ([#&#8203;4869](https://github.com/rectorphp/rector-src/pull/4869)) - \[Php80] Handle crash parent default empty array/string param on AddParamBasedOnParentClassMethodRector ([#&#8203;4833](https://github.com/rectorphp/rector-src/pull/4833)) <br> #### Removed :skull: - Remove deprecated `FileProcessorInterface` ([#&#8203;4835](https://github.com/rectorphp/rector-src/pull/4835)) - Remove `SwapFuncCallArgumentsRector` as keeps swaping to infinity, use custom rule instead ([#&#8203;4874](https://github.com/rectorphp/rector-src/pull/4874)) ### [`v0.18.0`](https://github.com/rectorphp/rector/releases/tag/0.18.0): Released Rector 0.18.0 with Laravel container ⚡️ [Compare Source](https://github.com/rectorphp/rector/compare/0.17.13...0.18.0) #### New Features and Changes :partying\_face: - **\[DI] Switch container to Laravel - final step 🥳 ([#&#8203;4698](https://github.com/rectorphp/rector-src/pull/4698))** - do you use `$rectorConfig->import('src/*');` with mask? - this is removed now, use explicit real paths instead - \[DI] Remove symfony/dependency-injection dependency ([#&#8203;4796](https://github.com/rectorphp/rector-src/pull/4796)) - \[DI] Add symfony config BC warnings layer, to inform about an upgrade ([#&#8203;4800](https://github.com/rectorphp/rector-src/pull/4800)) - Add possibility to add multiple phpstan configs ([#&#8203;4798](https://github.com/rectorphp/rector-src/pull/4798)), Thanks [@&#8203;alexander-schranz](https://github.com/alexander-schranz)! - \[DX] Make use of `addParameter()` ([#&#8203;4801](https://github.com/rectorphp/rector-src/pull/4801)) - Add deprecation warning for `FileProcessorInterface` ([#&#8203;4808](https://github.com/rectorphp/rector-src/pull/4808)) <br> #### Bugfixes :bug: - \[DeadCode] Handle duplicated annotation on space before close parentheses on RemoveUselessParamTagRector ([#&#8203;4795](https://github.com/rectorphp/rector-src/pull/4795)) - Fix skip() Rector class, make container forget it comleteely ([#&#8203;4807](https://github.com/rectorphp/rector-src/pull/4807)) ### [`v0.17.13`](https://github.com/rectorphp/rector/releases/tag/0.17.13): Released Rector 0.17.13 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.12...0.17.13) #### New Features and Changes :partying\_face: - \[TypeDeclaration] Skip in conditional on AddParamTypeFromPropertyTypeRector ([#&#8203;4779](https://github.com/rectorphp/rector-src/pull/4779)) - \[DX] Deprecate NonPhpRectorInterface, the only rule and its file processor, to make Rector handle exlusively PHP ([#&#8203;4761](https://github.com/rectorphp/rector-src/pull/4761)) - Bump nikic/php-parser to 4.17 ([#&#8203;4781](https://github.com/rectorphp/rector-src/pull/4781)) <br> #### Removed :skull: - Remove SwapMethodCallArgumentsRector as could lead to infinite swapping, use custom rule with type/value check instead ([#&#8203;4766](https://github.com/rectorphp/rector-src/pull/4766)) - \[Php81] Remove IntersectionTypesRector as rely on docblock ([#&#8203;4784](https://github.com/rectorphp/rector-src/pull/4784)) <br> #### Bugfixes :bug: - \[DeadCode] Skip used by trait on RemoveUnusedPrivateMethodRector ([#&#8203;4770](https://github.com/rectorphp/rector-src/pull/4770)) - \[DeadCode] Skip used by trait inside Closure on RemoveUnusedPrivateMethodRector ([#&#8203;4773](https://github.com/rectorphp/rector-src/pull/4773)) - \[e2e] Handle $rectorConfig->paths() with wilcards \* config ([#&#8203;4765](https://github.com/rectorphp/rector-src/pull/4765)) - \[Config] Move from magic loading of all PHPStan extensions, their bootstrap files etc. under control with explicit file listing ([#&#8203;4769](https://github.com/rectorphp/rector-src/pull/4769)) - \[TypeDeclaration] Handle crash on concat param append returned used on Arg on StrictStringParamConcatRector ([#&#8203;4774](https://github.com/rectorphp/rector-src/pull/4774)) - \[TypeDeclaration] Skip param re-assign on Strict Param rules ([#&#8203;4775](https://github.com/rectorphp/rector-src/pull/4775)) - \[TypeDeclaration] Skip param int on StrictStringParamConcatRector ([#&#8203;4780](https://github.com/rectorphp/rector-src/pull/4780)) - \[PHPStanStaticTypeMapper] Allow Closure type on ClosureTypeMapper based on PHP versions ([#&#8203;4785](https://github.com/rectorphp/rector-src/pull/4785)) - \[PHPStanStaticTypeMapper] Allow standalone null type on NullTypeMapper on php 8.2 ([#&#8203;4783](https://github.com/rectorphp/rector-src/pull/4783)) - Make SimplifyUselessVariableRector run without scope ([#&#8203;4791](https://github.com/rectorphp/rector-src/pull/4791)) - Make NullToStrictStringFuncCallArgRector run without scope ([#&#8203;4792](https://github.com/rectorphp/rector-src/pull/4792)) ### [`v0.17.12`](https://github.com/rectorphp/rector/compare/0.17.11...0.17.12) [Compare Source](https://github.com/rectorphp/rector/compare/0.17.11...0.17.12) ### [`v0.17.11`](https://github.com/rectorphp/rector/releases/tag/0.17.11): Released Rector 0.17.11 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.10...0.17.11) #### New Features and Improvements :partying\_face: - \[TypeDeclaration] Add nullable param from null compare on StrictStringParamConcatRector ([#&#8203;4636](https://github.com/rectorphp/rector-src/pull/4636)) - \[TypeDeclaration] Add ReturnUnionTypeRector ([#&#8203;4655](https://github.com/rectorphp/rector-src/pull/4655)) - \[TypeDeclaration] Skip public method on AddMethodCallBasedStrictParamTypeRector ([#&#8203;4659](https://github.com/rectorphp/rector-src/pull/4659)) - \[CodeQuality]\[TypeDeclaration] Add string append support on ReturnTypeFromStrictScalarReturnExprRector ([#&#8203;4657](https://github.com/rectorphp/rector-src/pull/4657)) - \[TypeDeclaration] Handle anonymous class in union on AddArrowFunctionReturnTypeRector ([#&#8203;4676](https://github.com/rectorphp/rector-src/pull/4676)) - \[Types] Make AddVoidReturnTypeWhereNoReturnRector work only with type-declaration, as reliable ([#&#8203;4720](https://github.com/rectorphp/rector-src/pull/4720)) - \[TypeDeclaration] Allow change multiple methods on AddParamTypeDeclarationRector ([#&#8203;4727](https://github.com/rectorphp/rector-src/pull/4727)) - \[DX] Add ProcessConfigureDecorator to avoid superfluous composition ([#&#8203;4734](https://github.com/rectorphp/rector-src/pull/4734)) - \[Logging] Add RectorOutput logging service ([#&#8203;4736](https://github.com/rectorphp/rector-src/pull/4736)) - \[DX] Cache rector test config loading by file + class to avoid booting over and over per fixture ([#&#8203;4718](https://github.com/rectorphp/rector-src/pull/4718)) - \[DX] Validate rules no longer existing rules in $rectorConfig->skip() ([#&#8203;4728](https://github.com/rectorphp/rector-src/pull/4728)) - \[DX] Merge RectorOutputStyle, OutputStyleInterface to RectorStyle ([#&#8203;4711](https://github.com/rectorphp/rector-src/pull/4711)) <br> #### Bugfixes :bug: - \[TypeDeclaration] Do not change different type defualt value on StrictStringParamConcatRector ([#&#8203;4635](https://github.com/rectorphp/rector-src/pull/4635)) - \[Strict] Skip docblock on BooleanInTernaryOperatorRuleFixerRector ([#&#8203;4638](https://github.com/rectorphp/rector-src/pull/4638)) - \[Strict] Skip docblock on DisallowedShortTernaryRuleFixerRector ([#&#8203;4639](https://github.com/rectorphp/rector-src/pull/4639)) - \[Strict] Skip docblock on BooleanInBooleanNotRuleFixerRector ([#&#8203;4640](https://github.com/rectorphp/rector-src/pull/4640)) - \[TypeDeclaration] Using native type scope get on ReturnTypeInferer ([#&#8203;4648](https://github.com/rectorphp/rector-src/pull/4648)) - \[CodingStyle]\[Php80]\[Privatization] Handle SeparateMultiUseImportsRector+ClassPropertyAssignToConstructorPromotionRector+FinalizeClassesWithoutChildrenRector cause invalid removal ([#&#8203;4649](https://github.com/rectorphp/rector-src/pull/4649)) - \[DX] Cleanup ForRepeatedCountToOwnVariableRector counter ([#&#8203;4651](https://github.com/rectorphp/rector-src/pull/4651)) - \[DX] Make MoneyFormatToNumberFormatRector wrap func call directly to keep simple ([#&#8203;4653](https://github.com/rectorphp/rector-src/pull/4653)) - Move ArrayManipulator to rector-symfony, where only used ([#&#8203;4656](https://github.com/rectorphp/rector-src/pull/4656)) - \[DX] Move FlipNegatedTernaryInstanceofRector to instanceof rules category ([#&#8203;4663](https://github.com/rectorphp/rector-src/pull/4663)) - Resolve encapsed values as strings ([#&#8203;4622](https://github.com/rectorphp/rector-src/pull/4622)), Thanks [@&#8203;Bellardia](https://github.com/Bellardia)! - \[Privatization] Skip parent class unknown on PrivatizeFinalClassMethodRector ([#&#8203;4671](https://github.com/rectorphp/rector-src/pull/4671)) - \[TypeDeclaration] Skip anonymous class and other object on ReturnUnionTypeRector ([#&#8203;4670](https://github.com/rectorphp/rector-src/pull/4670)) - \[TypeDeclaration] Allow return anonymous class on ReturnTypeFromReturnNewRector ([#&#8203;4669](https://github.com/rectorphp/rector-src/pull/4669)) - \[TypeDeclaration]\[CodeQuality] Move ReturnTypeFromStrictScalarReturnExprRector from CodeQuality to TypeDeclaration set ([#&#8203;4668](https://github.com/rectorphp/rector-src/pull/4668)) - \[TypeDeclaration] Allow \_\_invoke() method for return type changed on ClassMethodReturnTypeOverrideGuard ([#&#8203;4667](https://github.com/rectorphp/rector-src/pull/4667)) - \[NodeTypeResolver] Clean up anonymous class detection on NodeTypeResolver::getNativeType() ([#&#8203;4673](https://github.com/rectorphp/rector-src/pull/4673)) - \[NodeAnalyzer] Pass ReflectionProvider to \_\_construct() on CallAnalyzer ([#&#8203;4699](https://github.com/rectorphp/rector-src/pull/4699)) - Skip code changes on unresolvable/unknown classes ([#&#8203;4619](https://github.com/rectorphp/rector-src/pull/4619)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Use return bool for ParentClassMethodTypeOverrideGuard::hasParentClassMethod(), return ?MethodReflection for ParentClassMethodTypeOverrideGuard::getParentClassMethod() ([#&#8203;4703](https://github.com/rectorphp/rector-src/pull/4703)) - \[TypeDeclaration] Skip param setter method intersection docblock not autoload on ReturnNeverTypeRector ([#&#8203;4721](https://github.com/rectorphp/rector-src/pull/4721)) - \[TypeDeclaration] Skip non void or never already return typed on ReturnNeverTypeRector ([#&#8203;4723](https://github.com/rectorphp/rector-src/pull/4723)) - Make relativeFilePathFromDirectory() private as used only locally ([#&#8203;4735](https://github.com/rectorphp/rector-src/pull/4735)) - \[DX] Avoid supporting edge-case multi-layered comments, must be covered in php-parser itself ([#&#8203;4743](https://github.com/rectorphp/rector-src/pull/4743)) - \[TypeDeclaration] Skip void type on caller on ReturnTypeFromStrictTypedCallRector ([#&#8203;4751](https://github.com/rectorphp/rector-src/pull/4751)) - Use direct VoidType definition on Return\_ expr is null on ReturnedNodesReturnTypeInfererTypeInferer ([#&#8203;4752](https://github.com/rectorphp/rector-src/pull/4752)) - \[Renaming] Deprecate PseudoNamespaceToNamespaceRector as too dynamic and unreliable, use the RenameClassRector instead ([#&#8203;4755](https://github.com/rectorphp/rector-src/pull/4755)) <br> #### Removed :skull: Since Rector 0.15 we declare type stricness and avoid docblock changes, as unreliable and could lead to incorrect assumptions: [getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations](https://getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations) Few rules work with unreliable docblocks, and were removed. Instead handle cases yourself with PHPStan help 👍 - \[DX] Remove deprecated RectorConfigProvider, use SimpleParameterProvider instead ([#&#8203;4658](https://github.com/rectorphp/rector-src/pull/4658)) - \[DX] Remove usage of deprecated symfony parameters ([#&#8203;4674](https://github.com/rectorphp/rector-src/pull/4674)) - Remove deprecated ArrayShapeFromConstantArrayReturnRector ([#&#8203;4662](https://github.com/rectorphp/rector-src/pull/4662)) - Remove RemoveParentRector as never used and only for demo purposes, handle custom way where needed ([#&#8203;4679](https://github.com/rectorphp/rector-src/pull/4679)) - \[DX] Remove \*AnnotationIncorrectNullableRector rules as works with unreliable docblocks and can have 2 solutions ([#&#8203;4719](https://github.com/rectorphp/rector-src/pull/4719)) - Remove appendArgs() method on AbstractRector ([#&#8203;4732](https://github.com/rectorphp/rector-src/pull/4732)) - \[Renaming] Remove callables from class renames to avoid missed rename bugs, better handle with PHSPtan and custom rule ([#&#8203;4745](https://github.com/rectorphp/rector-src/pull/4745)) - \[DX] Remove NullifyUnionNullableRector, let cs tools handle it ([#&#8203;4660](https://github.com/rectorphp/rector-src/pull/4660)) - \[DX] Remove RemoveJustPropertyFetchRector as used for one time job, not practical for general use ([#&#8203;4661](https://github.com/rectorphp/rector-src/pull/4661)) - \[TypeDeclaration] Remove AddClosureReturnTypeRector ([#&#8203;4637](https://github.com/rectorphp/rector-src/pull/4637)) - \[DX] Remove AddDefaultValueForUndefinedVariableRector as can generate broken code and depends on context ([#&#8203;4729](https://github.com/rectorphp/rector-src/pull/4729)) ### [`v0.17.10`](https://github.com/rectorphp/rector/releases/tag/0.17.10): Released Rector 0.17.10 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.9...0.17.10) #### New Features :partying\_face: - \[TypeDeclaration] Add Closure support on NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4631](https://github.com/rectorphp/rector-src/pull/4631)) - \[TypeDeclaration] Add Closure support on StrictArrayParamDimFetchRector ([#&#8203;4632](https://github.com/rectorphp/rector-src/pull/4632)) - \[TypeDeclaration] Add Closure support on ReturnTypeFromStrictParamRector ([#&#8203;4633](https://github.com/rectorphp/rector-src/pull/4633)) - \[TypeDeclaration] Add Closure support on StrictStringParamConcatRector ([#&#8203;4634](https://github.com/rectorphp/rector-src/pull/4634)) <br> #### Bugfixes :bug: - \[Downgrade] \[FIX] Fix infinite loop in DowngradeArrayFilterNullableCallbackRector ([#&#8203;150](https://github.com/rectorphp/rector-downgrade-php/pull/150)) ### [`v0.17.9`](https://github.com/rectorphp/rector/releases/tag/0.17.9): Released Rector 0.17.9 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.8...0.17.9) #### Bugfixes :bug: - Fix last arg trailing comma removal DowngradeTrailingCommasInFunctionCallsRector - [rectorphp/rector-downgrade-php@`059d483`](https://github.com/rectorphp/rector-downgrade-php/commit/059d48366ee50115006a8d26ede574d70da724d2) ### [`v0.17.8`](https://github.com/rectorphp/rector/releases/tag/0.17.8): Released Rector 0.17.8 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.7...0.17.8) #### New Features :partying\_face: - \[TypeDeclaration] Add Closure support on BoolReturnTypeFromStrictScalarReturnsRector ([#&#8203;4610](https://github.com/rectorphp/rector-src/pull/4610)) - AddMethodCallBasedStrictParamTypeRector: Support changing protected methods in final classes ([#&#8203;4611](https://github.com/rectorphp/rector-src/pull/4611)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Add StrictStringParamConcatRector ([#&#8203;4624](https://github.com/rectorphp/rector-src/pull/4624)) <br> #### Bugfixes :bug: - \[PHPStanStaticTypeMapper] FQCN for Closure type mapper ([#&#8203;4584](https://github.com/rectorphp/rector-src/pull/4584)) - Fixed constant types handling in TypedPropertyFromStrictConstructorRector ([#&#8203;4588](https://github.com/rectorphp/rector-src/pull/4588)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Skip coalesce on StrictArrayParamDimFetchRector ([#&#8203;4589](https://github.com/rectorphp/rector-src/pull/4589)) - Bump to phpdoc-parser 1.23 and fill construct() attributes ([#&#8203;4590](https://github.com/rectorphp/rector-src/pull/4590)) - \[TypeDeclaration] Skip override string on StrictArrayParamDimFetchRector ([#&#8203;4591](https://github.com/rectorphp/rector-src/pull/4591)) - \[Autoloading] Using SimpleParameterProvider on BootstrapFilesIncluder ([#&#8203;4592](https://github.com/rectorphp/rector-src/pull/4592)) - \[Php81] Fix regression skip call by ref on ReadOnlyPropertyRector ([#&#8203;4593](https://github.com/rectorphp/rector-src/pull/4593)) - \[PHPStanStaticTypeMapper] Make use of toPhpDocNode() on ObjectTypeMapper ([#&#8203;4581](https://github.com/rectorphp/rector-src/pull/4581)) - \[PHPStanStaticTypeMapper] Fix IntersectionTypeMapper to make ObjectType have FQCN ([#&#8203;4598](https://github.com/rectorphp/rector-src/pull/4598)) - \[Php81] Skip re-assign with AssignOp on ReadOnlyPropertyRector ([#&#8203;4600](https://github.com/rectorphp/rector-src/pull/4600)) - Reduce ConstExprClassNameDecorator overhead ([#&#8203;4603](https://github.com/rectorphp/rector-src/pull/4603)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Resolve native return-type from native union-type in short ternary ([#&#8203;4606](https://github.com/rectorphp/rector-src/pull/4606)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Strict] Skip from docblock [@&#8203;return](https://github.com/return) on DisallowedEmptyRuleFixerRector ([#&#8203;4608](https://github.com/rectorphp/rector-src/pull/4608)) - \[Strict] Skip [@&#8203;return](https://github.com/return) docblock on BooleanInIfConditionRuleFixerRector ([#&#8203;4609](https://github.com/rectorphp/rector-src/pull/4609)) - \[Php81] Fix regression skip call by ref on ReadOnlyPropertyRector on non \_\_construct method ([#&#8203;4614](https://github.com/rectorphp/rector-src/pull/4614)) - \[CodeQuality]\[Strict] Handle infinite loop on SimplifyDeMorganBinaryRector+SimplifyIfReturnBoolRector+DisallowedEmptyRuleFixerRector ([#&#8203;4615](https://github.com/rectorphp/rector-src/pull/4615)) - \[CodingStyle]\[Namespace\_] Support constant imports ([#&#8203;4612](https://github.com/rectorphp/rector-src/pull/4612)), Thanks [@&#8203;natepage](https://github.com/natepage)! - \[Php81] Skip property fetch from new static on ReadOnlyPropertyRector ([#&#8203;4617](https://github.com/rectorphp/rector-src/pull/4617)) - \[CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector ([#&#8203;4618](https://github.com/rectorphp/rector-src/pull/4618)) - Fix string type on StrictArrayParamDimFetchRector ([#&#8203;4623](https://github.com/rectorphp/rector-src/pull/4623)) - \[PHPStanStaticTypeMapper] Handle crash on DowngradeMixedTypeDeclarationRector for PHPStan\Type\ConditionalType ([#&#8203;4625](https://github.com/rectorphp/rector-src/pull/4625)) - \[Php73] Handle crash Type Error on JsonThrowOnErrorRector ([#&#8203;4626](https://github.com/rectorphp/rector-src/pull/4626)) - \[Php81] Skip call by ref on ReadOnlyPropertyRector on FuncCall ([#&#8203;4630](https://github.com/rectorphp/rector-src/pull/4630)) - \[Printer] Fix printing PHPStan AlwaysRememberedExpr with add unwrapper inside BetterStandardPrinter::p ([#&#8203;4629](https://github.com/rectorphp/rector-src/pull/4629)) - \[TypeDeclaration] Skip has parent class method on AddParamTypeFromPropertyTypeRector ([#&#8203;4627](https://github.com/rectorphp/rector-src/pull/4627)) <br> #### Removed :skull: - \[Printer] Remove has InlineHTML node check after apply changes on PhpFileProcessor ([#&#8203;4601](https://github.com/rectorphp/rector-src/pull/4601)) ### [`v0.17.7`](https://github.com/rectorphp/rector/releases/tag/0.17.7): Released Rector 0.17.7 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.6...0.17.7) #### New Features :partying\_face: - \[CodingStyle] Skip filled by construct on AddArrayDefaultToArrayPropertyRector ([#&#8203;4549](https://github.com/rectorphp/rector-src/pull/4549)) - Add constuctor support to ReplaceArgumentDefaultValueRector ([#&#8203;4554](https://github.com/rectorphp/rector-src/pull/4554)) - StaticMapper: added fast path for IdentifierTypeNode ([#&#8203;4565](https://github.com/rectorphp/rector-src/pull/4565)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Add ReturnTypeFromStrictParamRector ([#&#8203;4501](https://github.com/rectorphp/rector-src/pull/4501)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Add TypedPropertyFromStrictConstructorReadonlyClassRector ([#&#8203;4552](https://github.com/rectorphp/rector-src/pull/4552)), Thanks [@&#8203;staabm](https://github.com/staabm)! - ReturnTypeFromStrictTernaryRector: Support complex ternaries ([#&#8203;4515](https://github.com/rectorphp/rector-src/pull/4515)), Thanks [@&#8203;staabm](https://github.com/staabm)! #### Bugfixes :bug: - Support final methods in ClassMethodReturnTypeOverrideGuard ([#&#8203;4509](https://github.com/rectorphp/rector-src/pull/4509)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Support literals in ReturnTypeFromStrictTypedCallRector ([#&#8203;4511](https://github.com/rectorphp/rector-src/pull/4511)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[TypeDeclaration] Null stmts check early on ReturnTypeFromStrictParamRector ([#&#8203;4512](https://github.com/rectorphp/rector-src/pull/4512)) - \[Performance] Use filtered filePaths from ApplicationFileProcessor::configurePHPStanNodeScopeResolver on WorkerRunner::run() ([#&#8203;4513](https://github.com/rectorphp/rector-src/pull/4513)) - \[DX] Show progress bar 100% on RectorConsoleOutputFormatter::report() ([#&#8203;4516](https://github.com/rectorphp/rector-src/pull/4516)) - \[ChangesReporting] Reuse defined errors vairable on ConsoleOutputFormatter ([#&#8203;4517](https://github.com/rectorphp/rector-src/pull/4517)) - \[ApplicationFileProcessor] Refactor ApplicationFileProcessor to filter file paths early before run both parallel and non-parallel ([#&#8203;4519](https://github.com/rectorphp/rector-src/pull/4519)) - \[DX] Fix hang on twice run after all files processed cached ([#&#8203;4521](https://github.com/rectorphp/rector-src/pull/4521)) - \[Application] Move filter files by config extensions to FileFactory ([#&#8203;4522](https://github.com/rectorphp/rector-src/pull/4522)) - \[Php81]\[Php82]\[Privatization] Handle extends non-readonly class on ReadOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector ([#&#8203;4524](https://github.com/rectorphp/rector-src/pull/4524)) - Fix wrong results in RemoveAlwaysElseRector ([#&#8203;4527](https://github.com/rectorphp/rector-src/pull/4527)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - Support class-const-fetch in ReturnTypeFromStrictTypedCallRector ([#&#8203;4520](https://github.com/rectorphp/rector-src/pull/4520)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[EarlyReturn] Skip append variable on PreparedValueToEarlyReturnRector ([#&#8203;4530](https://github.com/rectorphp/rector-src/pull/4530)) - Refactor MyCLabs\Enum\Enum::equals calls to comparisons ([#&#8203;4532](https://github.com/rectorphp/rector-src/pull/4532)), Thanks [@&#8203;rojtjo](https://github.com/rojtjo)! - \[Performance]\[NodeManipulator] Avoid loop on search first variable named on next sliced next stmts on StmtsManipulator ([#&#8203;4537](https://github.com/rectorphp/rector-src/pull/4537)) - \[Performance] \[TypeDeclaration] Reduce resolve ClassReflection on each property on TypedPropertyFromStrictConstructorRector ([#&#8203;4536](https://github.com/rectorphp/rector-src/pull/4536)) - \[Performance]\[TypeDeclaration] Reduce resolve ClassReflection from Property on AllAssignNodePropertyTypeInferer ([#&#8203;4539](https://github.com/rectorphp/rector-src/pull/4539)) - \[Application] Merge process files on both parallel and non-parallel process ([#&#8203;4523](https://github.com/rectorphp/rector-src/pull/4523)) - \[PHPStan] Merge assert phpstan errors to one ([#&#8203;4544](https://github.com/rectorphp/rector-src/pull/4544)) - \[Performance] \[Php74] Reduce ClassReflection lookup from property on PropertyTypeChangeGuard ([#&#8203;4545](https://github.com/rectorphp/rector-src/pull/4545)) - Use instanceof check on ClassReflection resolve ([#&#8203;4547](https://github.com/rectorphp/rector-src/pull/4547)) - \[Reflection] Reduce Scope pulling on ReflectionResolver ([#&#8203;4548](https://github.com/rectorphp/rector-src/pull/4548)) - \[Strict] Skip empty() from param doc on DisallowedEmptyRuleFixerRector ([#&#8203;4550](https://github.com/rectorphp/rector-src/pull/4550)) - Fix space in paths ([#&#8203;4553](https://github.com/rectorphp/rector-src/pull/4553)) - Skip traits in CountOnNullRector ([#&#8203;4556](https://github.com/rectorphp/rector-src/pull/4556)) - Make use of toPhpDocNode() - take [#&#8203;2](https://github.com/rectorphp/rector/issues/2) ([#&#8203;4555](https://github.com/rectorphp/rector-src/pull/4555)) - \[Performance] \[PostRector] Only check phpdocinfo on Stmt and Param on NameImportingPostRector ([#&#8203;4558](https://github.com/rectorphp/rector-src/pull/4558)) - \[CodeQuality] Skip pull property from inner class on CompleteDynamicPropertiesRector ([#&#8203;4561](https://github.com/rectorphp/rector-src/pull/4561)) - Prevent unnecessary scope creation ([#&#8203;4562](https://github.com/rectorphp/rector-src/pull/4562)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NameImportingPhpDocNodeVisitor: Cheap checks first ([#&#8203;4563](https://github.com/rectorphp/rector-src/pull/4563)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Performance]\[Renaming] No need PhpDocInfo refactor on Name node on ClassRenamer ([#&#8203;4566](https://github.com/rectorphp/rector-src/pull/4566)) - \[TypeDeclaration] Deprecate ArrayShapeFromConstantArrayReturnRector as uses docblocks that we move away from since 0.15 ([#&#8203;4571](https://github.com/rectorphp/rector-src/pull/4571)) - Make ReturnTypeFromStrictNewArrayRector handle only single level arrays ([#&#8203;4575](https://github.com/rectorphp/rector-src/pull/4575)) - Fix array mapping ([#&#8203;4576](https://github.com/rectorphp/rector-src/pull/4576)) - \[Performance] \[PostRector] Reduce repetitive resolve uses statements on NameImportingPostRector ([#&#8203;4579](https://github.com/rectorphp/rector-src/pull/4579)) - \[EarlyReturn] Handle multiple statements in else in ChangeIfElseValueAssignToEarlyReturnRector ([#&#8203;4580](https://github.com/rectorphp/rector-src/pull/4580)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! - \[BUGFIX] Ensure proper reprint with attributes for finalized classes ([#&#8203;4585](https://github.com/rectorphp/rector-src/pull/4585)), Thanks [@&#8203;cngJo](https://github.com/cngJo)! <br> #### Removed :skull: - \[DX] Remove AllowEmptyConfigurableRectorInterface to ease interface tree, better handle on particular configure() method inside the rule ([#&#8203;4540](https://github.com/rectorphp/rector-src/pull/4540)) - Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector ([#&#8203;4551](https://github.com/rectorphp/rector-src/pull/4551)) - \[Performance]\[PostRector] Remove alias exists check on NameImporter called from NameImportingPostRector ([#&#8203;4564](https://github.com/rectorphp/rector-src/pull/4564)) - \[Performance]\[BetterPhpDocParser] Remove unused ConstExprNode check on ConstExprClassNameDecorator ([#&#8203;4578](https://github.com/rectorphp/rector-src/pull/4578)) - \[PHPStanStaticTypeMapper] Remove manual type check on PHPStanStaticTypeMapper ([#&#8203;4583](https://github.com/rectorphp/rector-src/pull/4583)) - \[StaticTypeMapper] Remove standalone false handling on StaticTypeMapper ([#&#8203;4582](https://github.com/rectorphp/rector-src/pull/4582)) ### [`v0.17.6`](https://github.com/rectorphp/rector/releases/tag/0.17.6): Released Rector 0.17.6 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.5...0.17.6) In this release, we narrowed rules from PHPUit and Doctrine to their specific version category. We've detected few outdated and never used rules and cleaned them up to make Rector smaller and easier to use :+1: Be use to always use `*SetList` constants over specific rules to use the latest version: ```php use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([ \Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_100, ]); }; ``` #### New Features :partying\_face: - Add PHPUnit to sets ([#&#8203;4495](https://github.com/rectorphp/rector-src/pull/4495)) - \[CI] Add PHPUnit 10 to check rules and sets groups ([#&#8203;4500](https://github.com/rectorphp/rector-src/pull/4500)) - \[CI] Add doctrine rules in set check ([#&#8203;4505](https://github.com/rectorphp/rector-src/pull/4505)) <br> #### Bugfixes :bug: - \[Performance] Only set Attribute on context inside ArrayDimFetch and ArrayItem on specific node used ([#&#8203;4493](https://github.com/rectorphp/rector-src/pull/4493)) - \[Php52] Use instanceof check instead of compare object $newStmt === $caseStmt on ContinueToBreakInSwitchRector ([#&#8203;4494](https://github.com/rectorphp/rector-src/pull/4494)) - Exclude the full docs folder from archives ([#&#8203;4497](https://github.com/rectorphp/rector-src/pull/4497)), Thanks [@&#8203;stof](https://github.com/stof)! - Cleanup RecastingRemovalRector tests ([#&#8203;4498](https://github.com/rectorphp/rector-src/pull/4498)) - Move Rector order test to PHPUnit, as uses its rules ([#&#8203;4499](https://github.com/rectorphp/rector-src/pull/4499)) - let phpunit handle its own empty method rule ([#&#8203;4501](https://github.com/rectorphp/rector-src/pull/4501)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Micro optimizations: cheap checks first ([#&#8203;4510](https://github.com/rectorphp/rector-src/pull/4510)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skip coalsce assign in RemoveUnusedPrivatePropertyRector ([#&#8203;4491](https://github.com/rectorphp/rector-src/pull/4491)) - \[DeadCode] Skip append += assignment on RemoveUnusedPrivatePropertyRector ([#&#8203;4506](https://github.com/rectorphp/rector-src/pull/4506)) - \[AstResolver]\[Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() ([#&#8203;4508](https://github.com/rectorphp/rector-src/pull/4508)) <br> #### Removed :skull: - \[NodeTypeResolver] Remove unused AttributeKey::INSIDE\_ARRAY\_ITEM on ContextNodeVisitor ([#&#8203;4496](https://github.com/rectorphp/rector-src/pull/4496)) - \[NodeTypeResolver] Remove AttributeKey::IS\_RETURN\_EXPR from ContextNodeVisitor ([#&#8203;4502](https://github.com/rectorphp/rector-src/pull/4502)) - \[NodeTypeResolver] Remove AttributeKey::IS\_ISSET\_VAR from ContextNodeVisitor ([#&#8203;4503](https://github.com/rectorphp/rector-src/pull/4503)) - \[NodeTypeResolver] Remove nestedChainMethodCallLimit() for deep method call counter check ([#&#8203;4504](https://github.com/rectorphp/rector-src/pull/4504)) ### [`v0.17.5`](https://github.com/rectorphp/rector/releases/tag/0.17.5): Released Rector 0.17.5 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.4...0.17.5) #### Removed :skull: - \[DeadCode] Skip property not exists on RemoveTypedPropertyDeadInstanceOfRector ([#&#8203;4481](https://github.com/rectorphp/rector-src/pull/4481)) - \[CodeQuality]\[Php80] Handle infite loop swap params on RemoveUnusedVariableInCatchRector + OptionalParametersAfterRequiredRector ([#&#8203;4484](https://github.com/rectorphp/rector-src/pull/4484)) <br> #### Bugfixes :bug: - fix(rules): Skip readonly classes from restoring default null value. ([#&#8203;4479](https://github.com/rectorphp/rector-src/pull/4479)), Thanks [@&#8203;scyzoryck](https://github.com/scyzoryck)! - \[Php80] Handle crash on ClassOnObjectRector + GetDebugTypeRector ([#&#8203;4483](https://github.com/rectorphp/rector-src/pull/4483)) - \[Strict] Fix DisallowedEmptyRuleFixerRector on empty string isset ([#&#8203;4485](https://github.com/rectorphp/rector-src/pull/4485)) - Fix StrictArrayParamDimFetchRector on `is_*` calls ([#&#8203;4486](https://github.com/rectorphp/rector-src/pull/4486)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Fix trait rename in Php4ConsturctorRector ([#&#8203;4487](https://github.com/rectorphp/rector-src/pull/4487)) - Fix StrictArrayParamDimFetchRector on same named property ([#&#8203;4488](https://github.com/rectorphp/rector-src/pull/4488)), Thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v0.17.4`](https://github.com/rectorphp/rector/releases/tag/0.17.4): Released Rector 0.17.4 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.3...0.17.4) #### Bugfixes :bug: - \[CodeQuality]\[EarlyReturn] Handle crash Replace Stmt to Expr on FlipTypeControlToUseExclusiveTypeRector+FlipTypeControlToUseExclusiveTypeRector+ReturnBinaryOrToEarlyReturnRector ([#&#8203;4474](https://github.com/rectorphp/rector-src/pull/4474)) - Fix ReturnBinaryOrToEarlyReturnRector mixing up returned nodes of array, hook into StmtsAwareInterface instead to keep next Rector rules updated ([#&#8203;4476](https://github.com/rectorphp/rector-src/pull/4476)) <br> #### Removed :skull: - Remove duplicated version\_compare ReplaceFuncCallArgumentDefaultValue rule ([#&#8203;4473](https://github.com/rectorphp/rector-src/pull/4473)), Thanks [@&#8203;alexander-schranz](https://github.com/alexander-schranz)! - \[EarlyReturn] Remove ReturnBinaryAndToEarlyReturnRector as creates code hard to read and flips condition ([#&#8203;4478](https://github.com/rectorphp/rector-src/pull/4478)) ### [`v0.17.3`](https://github.com/rectorphp/rector/releases/tag/0.17.3): Released Rector 0.17.3 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.2...0.17.3) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes **removing last parent node** connections, to lower node tree memory consumption 🥳️🥳️🥳️ - \[EarlyReturn] Remove findFirstNext() on InvertedIfFactory ([#&#8203;4399](https://github.com/rectorphp/rector-src/pull/4399)) - \[DX] Remove findParentType() method ([#&#8203;4438](https://github.com/rectorphp/rector-src/pull/4438)) - \[DX] Remove parent node from AbstractRector ([#&#8203;4465](https://github.com/rectorphp/rector-src/pull/4465)) <br> #### New Features :partying_face: - Add float mul integer type to NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4376](https://github.com/rectorphp/rector-src/pull/4376)) - \[TypeDeclaration] Add Encapsed string support to AlwaysStrictScalarExprAnalyzer ([#&#8203;4382](https://github.com/rectorphp/rector-src/pull/4382)) - \[TypeDeclaration] Add StrictArrayParamDimFetchRector ([#&#8203;4384](https://github.com/rectorphp/rector-src/pull/4384)) - \[DX] Kick of SimpleParameterProvider ([#&#8203;4405](https://github.com/rectorphp/rector-src/pull/4405)) <br> #### Bugfixes :bug: - \[DeadCode] Skip non typed param numeric check on RecastingRemovalRector ([#&#8203;4390](https://github.com/rectorphp/rector-src/pull/4390)) - \[Renaming] Handle crash on catch Exception name on RenameClassRector ([#&#8203;4401](https://github.com/rectorphp/rector-src/pull/4401)) - Fix NumericReturnTypeFromStrictScalarReturnsRector for non-natively-typed parameters ([#&#8203;4380](https://github.com/rectorphp/rector-src/pull/4380)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Php82] Skip extends unknown class on ReadonlyClassRector ([#&#8203;4408](https://github.com/rectorphp/rector-src/pull/4408)) - \[TypeDeclaration] Handle crash on no namespace with + operation on DeclareStrictTypesRector ([#&#8203;4414](https://github.com/rectorphp/rector-src/pull/4414)) - \[NodeTypeResolver] Reduce duplicated Scope fill on FuncCall ([#&#8203;4428](https://github.com/rectorphp/rector-src/pull/4428)) - Make JsonThrowOnErrorRector work with local scope to detect error\_json methods ([#&#8203;4451](https://github.com/rectorphp/rector-src/pull/4451)) - Deprecate resolveNextNode() to work only in current node tree context ([#&#8203;4455](https://github.com/rectorphp/rector-src/pull/4455)) - \[Naming] Skip used on next foreach on RenameForeachValueVariableToMatchExprVariableRector ([#&#8203;4469](https://github.com/rectorphp/rector-src/pull/4469)) <br> #### Removed :skull: - Remove duplicate ReturnNeverTypeRector rule ([#&#8203;4381](https://github.com/rectorphp/rector-src/pull/4381)), Thanks [@&#8203;buffcode](https://github.com/buffcode)! - \[MysqlToMysqli] Deprecate set, as dangerous to use, better handle manually ([#&#8203;4448](https://github.com/rectorphp/rector-src/pull/4448)) - \[DX] Make use of SimpleParameterProvider directly, deprecate RectorConfigProvider ([#&#8203;4460](https://github.com/rectorphp/rector-src/pull/4460)) - \[Performance] Immediate remove UnreachableStatementNodeVisitor object after traverse to avoid re-use in next file ([#&#8203;4417](https://github.com/rectorphp/rector-src/pull/4417)) - \[NodeTypeResolver] Remove ArrayItem scope filling from Array\_ and Name filling for Catch types on PHPStanNodeScopeResolver ([#&#8203;4423](https://github.com/rectorphp/rector-src/pull/4423)) - \[PHP 8] Resources object upgrade - remove 2 rules as the upgrade require wholesome manual work ([#&#8203;4442](https://github.com/rectorphp/rector-src/pull/4442)) - \[DeadCode] Remove RemoveJustVariableAssignRector as often done on purpose or with side effect ([#&#8203;4450](https://github.com/rectorphp/rector-src/pull/4450)) - Remove deprecated resolveNextNode() to embrace local scope node ([#&#8203;4456](https://github.com/rectorphp/rector-src/pull/4456)) - \[DX] Remove node connecting traverser from AbstractRector ([#&#8203;4463](https://github.com/rectorphp/rector-src/pull/4463)) - Remove NodeConnectingTraverser ([#&#8203;4464](https://github.com/rectorphp/rector-src/pull/4464)) - \[DX] Remove autowrapping of expr/stmt to make return values in the same type and reliable ([#&#8203;4466](https://github.com/rectorphp/rector-src/pull/4466)) ### [`v0.17.2`](https://github.com/rectorphp/rector/releases/tag/0.17.2): Released Rector 0.17.2 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.1...0.17.2) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes: - removing more parent node connections, to lower node tree memory consumption <br> #### New Features :partying_face: - Add sleep after processPool->quitAll() to give time for all child processes to terminate ([#&#8203;4280](https://github.com/rectorphp/rector-src/pull/4280)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! - \[TypeDeclaration] Add NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4296](https://github.com/rectorphp/rector-src/pull/4296)) - \[Php71] Add Closure support on AssignArrayToStringRector ([#&#8203;4303](https://github.com/rectorphp/rector-src/pull/4303)) - Introduces `AddSensitiveParameterAttributeRector` rule ([#&#8203;4342](https://github.com/rectorphp/rector-src/pull/4342)), Thanks [@&#8203;peterfox](https://github.com/peterfox)! - Bump nikic/php-parser to 4.16.0 ([#&#8203;4343](https://github.com/rectorphp/rector-src/pull/4343)) - Show error when no files will be processed ([#&#8203;4326](https://github.com/rectorphp/rector-src/pull/4326)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Cache unchanged files on dry run v2 ([#&#8203;4281](https://github.com/rectorphp/rector-src/pull/4281)), Thanks [@&#8203;dorrogeray](https://github.com/dorrogeray)! <br> #### Bugfixes :bug: - \[CodeQuality] Handle crash on variable variable on OptionalParametersAfterRequiredRector ([#&#8203;4226](https://github.com/rectorphp/rector-src/pull/4226)) - Fix LocallyCalledStaticMethodToNonStaticRector with method args ([#&#8203;4233](https://github.com/rectorphp/rector-src/pull/4233)), Thanks [@&#8203;toastedghost](https://github.com/toastedghost)! - Use `FunctionLike` contract instead of union of function-like concrete implementations ([#&#8203;4241](https://github.com/rectorphp/rector-src/pull/4241)), Thanks [@&#8203;Wirone](https://github.com/Wirone)! - \[CodeQuality]\[Performance] Reduce repetitive NodeTypeResolver->getType() on ExprBoolCaster ([#&#8203;4279](https://github.com/rectorphp/rector-src/pull/4279)) - Skip rewindable generator ([#&#8203;4282](https://github.com/rectorphp/rector-src/pull/4282)) - \[Php55]\[NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector ([#&#8203;4283](https://github.com/rectorphp/rector-src/pull/4283)) - \[Php55] Clean up FullyQualified assigned to FullyQualified on StringClassNameToClassConstantRector ([#&#8203;4284](https://github.com/rectorphp/rector-src/pull/4284)) - \[TypeDeclaration] Extend NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4297](https://github.com/rectorphp/rector-src/pull/4297)) - Skip divide in NumericReturnTypeFromStrictScalarReturnsRector ([#&#8203;4298](https://github.com/rectorphp/rector-src/pull/4298)) - \[TypeDeclaration] Skip once typed and else return array\_map() on ReturnTypeFromStrictTypedCallRector ([#&#8203;4312](https://github.com/rectorphp/rector-src/pull/4312)) - Fix command to configure rector ([#&#8203;4314](https://github.com/rectorphp/rector-src/pull/4314)), Thanks [@&#8203;bertramakers](https://github.com/bertramakers)! - \[Performance] \[NodeTypeResolver] Reduce callable traverse usage on ContextNodeVisitor ([#&#8203;4317](https://github.com/rectorphp/rector-src/pull/4317)) - \[CodeQuality] Skip not regex on SimplifyRegexPatternRector ([#&#8203;4322](https://github.com/rectorphp/rector-src/pull/4322)) - \[TypeDeclaration] Handle crash on object shape on ArrayShapeFromConstantArrayReturnRector ([#&#8203;4323](https://github.com/rectorphp/rector-src/pull/4323)) - \[Php81] Skip named constructor on ReadOnlyPropertyRector ([#&#8203;4359](https://github.com/rectorphp/rector-src/pull/4359)) - Skip argument if value equals default value ([#&#8203;4368](https://github.com/rectorphp/rector-src/pull/4368)), Thanks [@&#8203;stefantalen](https://github.com/stefantalen)! - \[MysqlToMysqli] Handle infinite loop on MysqlQueryMysqlErrorWithLinkRector when no connection instance on first dept stmt ([#&#8203;4375](https://github.com/rectorphp/rector-src/pull/4375)) <br> #### Removed :skull: - Remove `removeNode()` method from AbstractRector ([#&#8203;4225](https://github.com/rectorphp/rector-src/pull/4225)) - Remove Kind from doc mapper, as used just once ([#&#8203;4234](https://github.com/rectorphp/rector-src/pull/4234)) - Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namespace, to avoid dumping removed static set ([#&#8203;4242](https://github.com/rectorphp/rector-src/pull/4242)) - Restore RemoveMethodCallParamRector as used ([#&#8203;4244](https://github.com/rectorphp/rector-src/pull/4244)) - \[Performance] Remove NODES\_TO\_MATCH constant on RemoveNonExistingVarAnnotationRector ([#&#8203;4267](https://github.com/rectorphp/rector-src/pull/4267)) - Remove VarConstantCommentRector as using unreliable docblocks, better use upcoming PHP 8.3 strict type const ([#&#8203;4307](https://github.com/rectorphp/rector-src/pull/4307)) - \[Naming] Remove BreakingVariableRenameGuard::isUsedInIfAndOtherBranches() to remove previous by types ([#&#8203;4319](https://github.com/rectorphp/rector-src/pull/4319)) - \[Php81] Remove cast check on NullToStrictStringFuncCallArgRector ([#&#8203;4320](https://github.com/rectorphp/rector-src/pull/4320)) - \[PhpParser] Remove BetterNodeFinder::findFirstPreviousOfTypes() ([#&#8203;4327](https://github.com/rectorphp/rector-src/pull/4327)) - Move AddMethodParentCallRector to Symfony Rector ([#&#8203;4301](https://github.com/rectorphp/rector-src/pull/4301)) ### [`v0.17.1`](https://github.com/rectorphp/rector/releases/tag/0.17.1): Released Rector 0.17.1 [Compare Source](https://github.com/rectorphp/rector/compare/0.17.0...0.17.1) In this release we continue preparing for Rector 1.0 release [#&#8203;7854](https://github.com/rectorphp/rector/issues/7854) This includes: - removing more parent node connections, to lower node tree memory consumption - replacing `removeNode()` method with `return NodeTraverser::REMOVE_NODE` direct constant to make changes happen directly in the Rector rule - refactoring node adding from post-process to directly in the rule <br> #### New Features :partying_face: - \[Docblock] Move DocBlockUpdater service usage from AbstractRector to PhpDocTypeChanger ([#&#8203;4215](https://github.com/rectorphp/rector-src/pull/4215)) - Improve string support in Doctrine Annotations ([#&#8203;3645](https://github.com/rectorphp/rector-src/pull/3645)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[Php80] Fix add default nullable type on ClassPropertyAssignToConstructorPromotionRector ([#&#8203;4091](https://github.com/rectorphp/rector-src/pull/4091)) - Add STRICT\_BOOLEANS set ([#&#8203;4116](https://github.com/rectorphp/rector-src/pull/4116)) <br> #### Changes - \[FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor ([#&#8203;4058](https://github.com/rectorphp/rector-src/pull/4058)) - Remove node adding collector ([#&#8203;4095](https://github.com/rectorphp/rector-src/pull/4095)) - Remove propperty to add collector, add them directly or as a constructor dependency ([#&#8203;4131](https://github.com/rectorphp/rector-src/pull/4131)) - Move ReturnArrayClassMethodToYieldRector to PHPUnit Rector ([#&#8203;4213](https://github.com/rectorphp/rector-src/pull/4213)) <br> #### Bugfixes :bug: - \[CodeQuality] Exclude first class callable from IntvalToTypeCastRector ([#&#8203;7962](https://github.com/rectorphp/rector/issues/7962)) ([#&#8203;4040](https://github.com/rectorphp/rector-src/pull/4040)), Thanks [@&#8203;thbley](https://github.com/thbley)! - \[CodingStyle] Skip first class callable on UnSpreadOperatorRector ([#&#8203;4041](https://github.com/rectorphp/rector-src/pull/4041)) - Skip StrvalToType for strval first class callable syntax ([#&#8203;4046](https://github.com/rectorphp/rector-src/pull/4046)), Thanks [@&#8203;NicoImparfait](https://github.com/NicoImparfait)! - Ensure check isFirstClassCallable() before node->getArgs() on CallLike ([#&#8203;4049](https://github.com/rectorphp/rector-src/pull/4049)) - \[CodeQuality] Skip multiple assigns append before foreach on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;4052](https://github.com/rectorphp/rector-src/pull/4052)) - \[CodeQuality] Skip deep append in if foreach before on ForeachItemsAssignToEmptyArrayToAssignRector ([#&#8203;4053](https://github.com/rectorphp/rector-src/pull/4053)) - \[NodeTypeResolver] Handle crash after next exit() on no namespaced code after removal next attribute ([#&#8203;4074](https://github.com/rectorphp/rector-src/pull/4074)) - \[FileProcessor] Show warning on has InlineHTML node if file has changed on PhpFileProcessor ([#&#8203;4079](https://github.com/rectorphp/rector-src/pull/4079)) - Make SimplifyRegexPatternRector work without parent nodes + deprecate BetterNodeFinder and findParent\* methods ([#&#8203;4105](https://github.com/rectorphp/rector-src/pull/4105)) - Fix StaticCallOnNonStaticToInstanceCallRector to skip parent's parent's method calls. ([#&#8203;4098](https://github.com/rectorphp/rector-src/pull/4098)), Thanks [@&#8203;klimslim](https://github.com/klimslim)! - \[CodingStyle] Skip countable object on CountArrayToEmptyArrayComparisonRector ([#&#8203;4108](https://github.com/rectorphp/rector-src/pull/4108)) - \[DeadCode] Skip used on Closure use next stmt on RemoveUnusedVariableAssignRector ([#&#8203;4042](https://github.com/rectorphp/rector-src/pull/4042)) - \[CodeQuality] Handle throw after if on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector ([#&#8203;4107](https://github.com/rectorphp/rector-src/pull/4107)) - \[CodeQuality] Handle return new object and no return on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector ([#&#8203;4112](https://github.com/rectorphp/rector-src/pull/4112)) - Make ConvertStaticPrivateConstantToSelfRector work for non-final classes, make part of code-quality set ([#&#8203;4114](https://github.com/rectorphp/rector-src/pull/4114)) - StringClassNameToClassConstantRector: cheap checks first ([#&#8203;4151](https://github.com/rectorphp/rector-src/pull/4151)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce memory-consumption by simpler skip-patterns ([#&#8203;4152](https://github.com/rectorphp/rector-src/pull/4152)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Skipping: Use plain string functions instead of regex matching ([#&#8203;4153](https://github.com/rectorphp/rector-src/pull/4153)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Split instance of check to 2 rules ([#&#8203;4165](https://github.com/rectorphp/rector-src/pull/4165)) - Performance: Prevent sorting of files in PhpFilesFinder ([#&#8203;4164](https://github.com/rectorphp/rector-src/pull/4164)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Move PreferThisOrSelfMethodCallRector to PHPUnit rector package, to handle exact cases ([#&#8203;4194](https://github.com/rectorphp/rector-src/pull/4194)) - \[Renaming] Handle crash in trait use on RenameClassRector ([#&#8203;4196](https://github.com/rectorphp/rector-src/pull/4196)) - \[Php56] Handle infinite loop on big array method call on AddDefaultValueForUndefinedVariableRector ([#&#8203;4142](https://github.com/rectorphp/rector-src/pull/4142)) - \[Php56] Skip variable variable on AddDefaultValueForUndefinedVariableRector ([#&#8203;4148](https://github.com/rectorphp/rector-src/pull/4148)) <br> #### Removed :skull: - \[DeadCode] Remove removeNode() from RemoveDeadReturnRector, merge RemoveLastReturnRector to RemoveDeadReturnRector ([#&#8203;4085](https://github.com/rectorphp/rector-src/pull/4085)) - \[PHP+HTML cleanup] Remove MixPhpHtmlDecorator ([#&#8203;4054](https://github.com/rectorphp/rector-src/pull/4054)) - Remove HTML + PHP support, as must be handled in php-parser first ([#&#8203;4051](https://github.com/rectorphp/rector-src/pull/4051)) - Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead ([#&#8203;4117](https://github.com/rectorphp/rector-src/pull/4117)) - Remove NormalizeNamespaceByPSR4ComposerAutoloadRector as only moves files to namespaces, does not update any class referenes; better use IDE here ([#&#8203;4057](https://github.com/rectorphp/rector-src/pull/4057)) - Remove MultipleClassFileToPsr4ClassesRector as only PSR4 rule, bit risky and better handled with PHPStan + remove adding/removing files logic, use printer instead ([#&#8203;4117](https://github.com/rectorphp/rector-src/pull/4117)) - Remove AttributeCompatibleAnnotationRector, as only for one-time migration of private project, not suitable for general use ([#&#8203;4064](https://github.com/rectorphp/rector-src/pull/4064)) - Remove RemoveAlwaysTrueConditionSetInConstructor, as overly specific and not practical; better handle with PHPStan ([#&#8203;4065](https://github.com/rectorphp/rector-src/pull/4065)) - Remove deprecated UnionTypesRector and NarrowUnionTypeDocRector, use strict-based rules from TypeDeclaration set instead ([#&#8203;4069](https://github.com/rectorphp/rector-src/pull/4069)) - Remove TargetRemoveClassMethodRector, as IDE specific ([#&#8203;4076](https://github.com/rectorphp/rector-src/pull/4076)) - Remove ArrayKeysAndInArrayToArrayKeyExistsRector as narrow, does not check variable usage and might be on purpose ([#&#8203;4084](https://github.com/rectorphp/rector-src/pull/4084)) - Remove ChangeGlobalVariablesToPropertiesRector as the scope might change after the variable is defined, better handle with PHPStan ([#&#8203;4086](https://github.com/rectorphp/rector-src/pull/4086)) - Remove NewToConstructorInjectionRector as unused and only for demo purposes ([#&#8203;4087](https://github.com/rectorphp/rector-src/pull/4087)) - \[NodeTraverser] Remove double apply FileWithoutNamespace, remove recursive lookup stmts on BetterStandardPrinter ([#&#8203;4097](https://github.com/rectorphp/rector-src/pull/4097)) - Remove ActionInjectionToConstructorInjectionRector as rather for demo purposes, not practical ([#&#8203;4113](https://github.com/rectorphp/rector-src/pull/4113)) - Remove ConstantListClassToEnumRector as custom-made, not practical for enum upgrades ([#&#8203;4115](https://github.com/rectorphp/rector-src/pull/4115)) - Remove RemoveMethodCallParamRector, as unused ([#&#8203;4119](https://github.com/rectorphp/rector-src/pull/4119)) - Remove RemoveAllowDynamicPropertiesAttributeRector as attribute is a comment on lower PHP versions, also rather downgrade rule ([#&#8203;4120](https://github.com/rectorphp/rector-src/pull/4120)) - Remove DoctrineAnnotationClassToAttributeRector as made for custom project, not useful for general use ([#&#8203;4127](https://github.com/rectorphp/rector-src/pull/4127)) - Remove UnsetAndIssetToMethodCallRector as unused ([#&#8203;4123](https://github.com/rectorphp/rector-src/pull/4123)) - Remove MethodCallToMethodCallRector as unused ([#&#8203;4128](https://github.com/rectorphp/rector-src/pull/4128)) - Remove NewArgToMethodCallRector as unused ([#&#8203;4130](https://github.com/rectorphp/rector-src/pull/4130)) - Remove RemoveDelegatingParentCallRector as overly complex and usually on purpose ([#&#8203;4136](https://github.com/rectorphp/rector-src/pull/4136)) - Remove RemoveEmptyMethodCallRector as better handled by PHPStan ([#&#8203;4161](https://github.com/rectorphp/rector-src/pull/4161)) - Remove BetterNodeFinder::findLastInstanceOf() as unused + make resolvePreviousNode() private, as used only locally ([#&#8203;4195](https://github.com/rectorphp/rector-src/pull/4195)) - \[DeadCode] Remove Assign and AssignRef as node types on RemoveNonExistingVarAnnotationRector ([#&#8203;4209](https://github.com/rectorphp/rector-src/pull/4209)) ### [`v0.17.0`](https://github.com/rectorphp/rector/releases/tag/0.17.0): Released Rector 0.17 [Compare Source](https://github.com/rectorphp/rector/compare/0.16.0...0.17.0) #### 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 ([#&#8203;3900](https://github.com/rectorphp/rector-src/pull/3900)) To see how to refactor to `StmtsAwareInterface`, check these PRs: - Remove NEXT\_NODE dependency in ChangeAndIfToEarlyReturnRector, narrow to only closed scope function likes ([#&#8203;3913](https://github.com/rectorphp/rector-src/pull/3913)) - Remove NEXT\_NODE from SimplifyIfReturnBoolRector ([#&#8203;3915](https://github.com/rectorphp/rector-src/pull/3915)) - \[DeadCode] Remove next attribute on RemoveUnusedVariableAssignRector (\[[#&#8203;3917](https://github.com/rectorphp/rector/issues/3917)]\(<https://github.com/rectorphp/> - \[CodingStyle] Refactor CatchExceptionNameMatchingTypeRector to use StmtsAwareInterface ([#&#8203;3788](https://github.com/rectorphp/rector-src/pull/3788)) <br> #### 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 ([#&#8203;4003](https://github.com/rectorphp/rector-src/pull/4003)) - Cleanup removeNodeFromStatements(), removeArg(), removeParam(), removeStmt() methods and remove nodes directly ([#&#8203;4012](https://github.com/rectorphp/rector-src/pull/4012)) - Remove unused addNodeAfterNode(), return nodes instead ([#&#8203;4023](https://github.com/rectorphp/rector-src/pull/4023)) - Remove unused method addNodesBeforeNode() ([#&#8203;4024](https://github.com/rectorphp/rector-src/pull/4024)) <br> #### New Features :partying_face: - \[PHP 7.0] Add `IfIssetToCoalescingRector` ([#&#8203;3878](https://github.com/rectorphp/rector-src/pull/3878)) - Support attributes in `RemoveFinalFromEntityRector` ([#&#8203;3727](https://github.com/rectorphp/rector-src/pull/3727)), Thanks [@&#8203;alexndlm](https://github.com/alexndlm)! - Add `SwapMethodCallArgumentsRector` ([#&#8203;3726](https://github.com/rectorphp/rector-src/pull/3726)), Thanks [@&#8203;gaydamakha](https://github.com/gaydamakha)! - \[CodeQuality] Add `CleanupUnneededNullsafeOperatorRector` ([#&#8203;3767](https://github.com/rectorphp/rector-src/pull/3767)) - Make `ReturnNeverTypeRector` work with type declaration, add it to PHP 8.1 set ([#&#8203;3852](https://github.com/rectorphp/rector-src/pull/3852)) - \[TypeDeclaration] Add `BoolReturnTypeFromStrictScalarReturnsRector` ([#&#8203;3898](https://github.com/rectorphp/rector-src/pull/3898)) - Make ChangeGlobalVariablesToPropertiesRector add properties directly, remove Nette inject methods ([#&#8203;3957](https://github.com/rectorphp/rector-src/pull/3957)) - Utilize MinPhpVersionInterface in more rules ([#&#8203;3752](https://github.com/rectorphp/rector-src/pull/3752)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Dump dependency container and re-use it - 35% faster test-suite ([#&#8203;3809](https://github.com/rectorphp/rector-src/pull/3809)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Defer type-resolving in RemoveJustPropertyFetchRector ([#&#8203;3761](https://github.com/rectorphp/rector-src/pull/3761)), Thanks [@&#8203;staabm](https://github.com/staabm)! <br> #### Bugfixes :bug: - \[TypeDeclaration] Skip Arg unpack on AddMethodCallBasedStrictParamTypeRector ([#&#8203;3787](https://github.com/rectorphp/rector-src/pull/3787)) - \[CodeQuality] Add typed property support to `IssetOnPropertyObjectToPropertyExistsRector` ([#&#8203;3876](https://github.com/rectorphp/rector-src/pull/3876)) - \[CodeQuality] Skip non-array type on SimplifyForeachToArrayFilterRector ([#&#8203;3738](https://github.com/rectorphp/rector-src/pull/3738)) - Fix ShortenedObjectType not resolving to correct class reflection ([#&#8203;3397](https://github.com/rectorphp/rector-src/pull/3397)), Thanks [@&#8203;jackbentley](https://github.com/jackbentley)! - Extend code-quality set ([#&#8203;3773](https://github.com/rectorphp/rector-src/pull/3773)) - Don't neon-decode phpstan configs over and over again ([#&#8203;3796](https://github.com/rectorphp/rector-src/pull/3796)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Console] Allow https url instead of git:// on SetupCICommand ([#&#8203;3799](https://github.com/rectorphp/rector-src/pull/3799)) - Fix integer range phpdoc types being treated as useless ([#&#8203;3825](https://github.com/rectorphp/rector-src/pull/3825)), Thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix nullable param in ClassPropertyAssignToConstructorPromotionRector ([#&#8203;3842](https://github.com/rectorphp/rector-src/pull/3842)) - Fix PrivatesAccessor: use selectFromArgs() instead ([#&#8203;3923](https://github.com/rectorphp/rector-src/pull/3923)), Thanks [@&#8203;staabm](https://github.com/staabm)! <br> #### Removed rules :skull: 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 ([#&#8203;3747](https://github.com/rectorphp/rector-src/pull/3747)) - \[CodeQuality] Remove SimplifyIfExactValueReturnValueRector, as overly defensive + InlineSimplePropertyAnnotationRector as purely coding standard area ([#&#8203;3764](https://github.com/rectorphp/rector-src/pull/3764)) - \[CodingStyle] Remove RemoveDoubleUnderscoreInMethodNameRector, as naming is not handled for breaking reasons ([#&#8203;3765](https://github.com/rectorphp/rector-src/pull/3765)) - Remove RemoveUnusedVariableAssignRector, as could be breaking code in order of excution and hard to do reliable ([#&#8203;3793](https://github.com/rectorphp/rector-src/pull/3793)) - \[CodingStyle] Remove ConsistentPregDelimiterRector as not much practical, importance of regex is a testing it matches expectationg, area of static analysis ([#&#8203;3797](https://github.com/rectorphp/rector-src/pull/3797)) - Remove ToStringToMethodCallRector as not practical and only for demo, FalseReturnClassMethodToNullableRector, as requires detailed custom refactoring ([#&#8203;3854](https://github.com/rectorphp/rector-src/pull/3854)) - Remove ChangeOrIfReturnToEarlyReturnRector as makes code harder to read by duplication, rather use PHSPtan and extract method ([#&#8203;3916](https://github.com/rectorphp/rector-src/pull/3916)) - \[DeadCode] Remove RemoveDuplicatedIfReturnRector as can lead to unexpeced consequences, better use static analysis and contextual handling ([#&#8203;3926](https://github.com/rectorphp/rector-src/pull/3926)) - \[DeadCode] Remove RemoveDuplicatedInstanceOfRector as hardly practical ([#&#8203;3936](https://github.com/rectorphp/rector-src/pull/3936)) - \[CodeQuality] Remove ExplicitMethodCallOverMagicGetSetRector designed for nette smart object migration only, not useful for general projects ([#&#8203;3948](https://github.com/rectorphp/rector-src/pull/3948)) - Remove GetAndSetToMethodCallRector, as not practical and used for single legacy job ([#&#8203;3953](https://github.com/rectorphp/rector-src/pull/3953)) - Remove ChangeReadOnlyVariableWithDefaultValueToConstantRector overly complex and risky, better job for PHPStan ([#&#8203;3954](https://github.com/rectorphp/rector-src/pull/3954)) - Remove IsObjectOnIncompleteClassRector as blindly turns all incomplete checks to negated, better examine manually ([#&#8203;3969](https://github.com/rectorphp/rector-src/pull/3969)) - Remove ReservedObjectRector as requires explicit configuration and is handled by RenameClassRector already ([#&#8203;3975](https://github.com/rectorphp/rector-src/pull/3975)) - Remove ChangeReadOnlyPropertyWithDefaultValueToConstantRector as overly detailed checks, better use PHPStan and refactor individually ([#&#8203;4028](https://github.com/rectorphp/rector-src/pull/4028)) - Remove NewToMethodCallRector as unused core and no other extension, niche to use, better handle by PHPStorm ([#&#8203;4029](https://github.com/rectorphp/rector-src/pull/4029)) - \[CodingStyle] Remove AddFalseDefaultToBoolPropertyRector, as works with unrelaible docblocks ([#&#8203;3856](https://github.com/rectorphp/rector-src/pull/3856)) - Remove UpdateFileNameByClassNameFileSystemRector niche rule that was added just for example sake ([#&#8203;3849](https://github.com/rectorphp/rector-src/pull/3849)) - \[Transform] Remove ArgumentFuncCallToMethodCallRector as never used ([#&#8203;3774](https://github.com/rectorphp/rector-src/pull/3774)) - \[Transform] Remove DimFetchAssignToMethodCallRector as unused ([#&#8203;3775](https://github.com/rectorphp/rector-src/pull/3775)) - \[Transform] Remove FileGetContentsAndJsonDecodeToStaticCallRector as only for demo purposes ([#&#8203;3776](https://github.com/rectorphp/rector-src/pull/3776)) - \[Transform] Remove MethodCallToAnotherMethodCallWithArgumentsRector as unused ([#&#8203;3777](https://github.com/rectorphp/rector-src/pull/3777)) - \[CodeQuality] Remove SimplifyUselessLastVariableAssignRector as overly complex and should be handled individually ([#&#8203;3784](https://github.com/rectorphp/rector-src/pull/3784)) - Remove AddPregQuoteDelimiterRector as very narrow area and has not context awareness, better handle manually ([#&#8203;3927](https://github.com/rectorphp/rector-src/pull/3927)) - Remove TokenGetAllToObjectRector, as rare to use and leaky to handle, better handle in controller manual way ([#&#8203;4001](https://github.com/rectorphp/rector-src/pull/4001)) - Remove ChangeReflectionTypeToStringToGetNameRector as niche and overly detailed, better refactor reflectio na as a whole ([#&#8203;3976](https://github.com/rectorphp/rector-src/pull/3976)) - Remove RenameNamespaceRector, better handle by IDE or explicit RenameClassRector ([#&#8203;3979](https://github.com/rectorphp/rector-src/pull/3979)) - \[CodeQuality] Deprecate NarrowUnionTypeDocRector as focused on docblocks, and moving to type declarations ([#&#8203;3848](https://github.com/rectorphp/rector-src/pull/3848)) - Remove MakeTypedPropertyNullableIfCheckedRector as old fix of TypedPropertyRector rule, removed months ago ([#&#8203;3851](https://github.com/rectorphp/rector-src/pull/3851)) - \[PHP 8.0] Deprecate old UnionTypesRector that is dangerously moving docblocks, use type declaration rules instead ([#&#8203;3846](https://github.com/rectorphp/rector-src/pull/3846)) - \[CodingStyle] Remove OrderAttributesRector, as rather coding standard and does not have specific PSR example ([#&#8203;3838](https://github.com/rectorphp/rector-src/pull/3838)) - Remove unused PregMatchTypeCorrector, the 3rd param in preg\_match\_\* is now handled natively by PHPStan ([#&#8203;3824](https://github.com/rectorphp/rector-src/pull/3824)) - \[Restoration] Remove RemoveFinalFromEntityRector as used only to revert very old Rector bug ([#&#8203;3847](https://github.com/rectorphp/rector-src/pull/3847)) ### [`v0.16.0`](https://github.com/rectorphp/rector/releases/tag/0.16.0): Released Rector 0.16.0 [Compare Source](https://github.com/rectorphp/rector/compare/0.15.25...0.16.0) #### New Features :partying\_face: - \[TypeDeclaration] Add WhileNullableToInstanceofRector ([#&#8203;3680](https://github.com/rectorphp/rector-src/pull/3680)) <br> #### Bugfixes :bug: - Fix SingleInArrayToCompareRector if array item is variadic ([#&#8203;3640](https://github.com/rectorphp/rector-src/pull/3640)), Thanks [@&#8203;raoz](https://github.com/raoz)! - \[Php80] Handle crash leaveNode() returned invalid value of type integer on TokenGetAllToObjectRector ([#&#8203;3644](https://github.com/rectorphp/rector-src/pull/3644)) - \[TypeDeclaration] Handle mix InlineHTML on FileWithoutNamespace ([#&#8203;3648](https://github.com/rectorphp/rector-src/pull/3648)) - Simplify PhpFilesFinder ([#&#8203;3649](https://github.com/rectorphp/rector-src/pull/3649)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Test] Rename fixture and refactor to solve random error ([#&#8203;3677](https://github.com/rectorphp/rector-src/pull/3677)) - \[TypeDeclaration] Refactor UnionTypeMapper::narrowBoolType() to allow bool|int|false converted to bool|int ([#&#8203;3685](https://github.com/rectorphp/rector-src/pull/3685)) - Update phpdoc-parser to ^1.20.3 ([#&#8203;3691](https://github.com/rectorphp/rector-src/pull/3691)) - \[Privatization] Skip variable assign append on ChangeReadOnlyVariableWithDefaultValueToConstantRector ([#&#8203;3687](https://github.com/rectorphp/rector-src/pull/3687)), Thanks [@&#8203;mickeytodd](https://github.com/mickeytodd)! - \[NodeManipulator] clean up multiple instanceof check on AssignManipulator ([#&#8203;3695](https://github.com/rectorphp/rector-src/pull/3695)) - \[CodeQuality] Using local variable $hasChanged on NarrowUnionTypeDocRector ([#&#8203;3697](https://github.com/rectorphp/rector-src/pull/3697)) - Cache on successful file processing ([#&#8203;3614](https://github.com/rectorphp/rector-src/pull/3614)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[CodingStyle] Skip concat on first arg on ConsistentImplodeRector ([#&#8203;3702](https://github.com/rectorphp/rector-src/pull/3702)), Thanks [@&#8203;nerones](https://github.com/nerones)! - Fix ExplicitMethodCallOverMagicGetSetRector with a protected method ([#&#8203;3732](https://github.com/rectorphp/rector-src/pull/3732)), Thanks [@&#8203;pierredup](https://github.com/pierredup)! - \[TypeDeclaration] Handle infinite loop on array\_reverse with index on AddMethodCallBasedStrictParamTypeRector on php8+ feature ([#&#8203;3678](https://github.com/rectorphp/rector-src/pull/3678)) - \[TypeDeclaration] Handle regression multiple params no longer working on AddMethodCallBasedStrictParamTypeRector ([#&#8203;3681](https://github.com/rectorphp/rector-src/pull/3681)) - \[TypeDeclaration] Add do { } while support on WhileNullableToInstanceofRector ([#&#8203;3682](https://github.com/rectorphp/rector-src/pull/3682)) - \[Php56]\[Php70]\[Php74] Handle infinite loop on AddDefaultValueForUndefinedVariableRector+IfToSpaceshipRector+ClosureToArrowFunctionRector ([#&#8203;3701](https://github.com/rectorphp/rector-src/pull/3701)) <br> #### Performance Improvements :rocket: - \[Performance] Using findFirst() for cast to (bool) so no need search all found nodes ([#&#8203;3642](https://github.com/rectorphp/rector-src/pull/3642)) - \[Performance] Using cheap chekc first on UndefinedVariableResolver::shouldSkipVariable() ([#&#8203;3643](https://github.com/rectorphp/rector-src/pull/3643)) - \[CodeQuality] Improve SimplifyIfElseToTernaryRector performance ([#&#8203;3721](https://github.com/rectorphp/rector-src/pull/3721)) - \[Renaming] Prevent overly greed type resolving in RenamePropertyRector ([#&#8203;3700](https://github.com/rectorphp/rector-src/pull/3700)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Don't calculate diffs when `--no-diffs` is given ([#&#8203;3710](https://github.com/rectorphp/rector-src/pull/3710)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Calculate diff only once per file after refactoring ([#&#8203;3711](https://github.com/rectorphp/rector-src/pull/3711)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve PropertyFetchAnalyzer performance ([#&#8203;3654](https://github.com/rectorphp/rector-src/pull/3654)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve LocalMethodCallFinder performance ([#&#8203;3651](https://github.com/rectorphp/rector-src/pull/3651)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve LocalConstantFinder performance ([#&#8203;3652](https://github.com/rectorphp/rector-src/pull/3652)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve NodeComparator performance ([#&#8203;3659](https://github.com/rectorphp/rector-src/pull/3659)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve ReflectionResolver performance ([#&#8203;3658](https://github.com/rectorphp/rector-src/pull/3658)), Thanks [@&#8203;staabm](https://github.com/staabm)! - Improve ParentClassMethodTypeOverrideGuard performance ([#&#8203;3660](https://github.com/rectorphp/rector-src/pull/3660)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[PHPStanStaticTypeMapper] Improve UnionTypeMapper performance ([#&#8203;3686](https://github.com/rectorphp/rector-src/pull/3686)) - \[PHPStanStaticTypeMapper] Improve UnionTypeMapper performance take 2 ([rectorphp/rector-src@`931e6e2`](https://github.com/rectorphp/rector-src/commit/931e6e24502a70dd19cd93c0ef10510b23213f87)) - \[PHPStanStaticTypeMapper] Improve performance of UnionTypeMapper take 3 ([#&#8203;3690](https://github.com/rectorphp/rector-src/pull/3690)) - \[Renaming] Improve performance of RenameFunctionRector ([#&#8203;3699](https://github.com/rectorphp/rector-src/pull/3699)) - Add e2e tests for consecutive changing runs ([#&#8203;3666](https://github.com/rectorphp/rector-src/pull/3666)), Thanks [@&#8203;yguedidi](https://github.com/yguedidi)! - \[Renaming] Improve performance of RenamePropertyRector ([#&#8203;3698](https://github.com/rectorphp/rector-src/pull/3698)) - \[Naming] Improve performance by using findFirst() for casted to (bool) on BreakingVariableRenameGuard ([#&#8203;3703](https://github.com/rectorphp/rector-src/pull/3703)) - \[PostRector] Improve performance NameImportingPostRector ([#&#8203;3708](https://github.com/rectorphp/rector-src/pull/3708)) - \[Ast] Improve AstResolver and ClassLikeAstResolver performance ([#&#8203;3714](https://github.com/rectorphp/rector-src/pull/3714)) - \[NodeManipulator] Improve IfManipulator::collectNestedIfsWithNonBreaking() performance ([#&#8203;3720](https://github.com/rectorphp/rector-src/pull/3720)) - Prevent unnecessary IO in ChangedFilesDetector ([#&#8203;3650](https://github.com/rectorphp/rector-src/pull/3650)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[BetterPhpDocParser] Simplify BetterTokenIterator ([#&#8203;3656](https://github.com/rectorphp/rector-src/pull/3656)), Thanks [@&#8203;staabm](https://github.com/staabm)! - \[Skipper] Prevent unnecessary IO ([#&#8203;3664](https://github.com/rectorphp/rector-src/pull/3664)), Thanks [@&#8203;staabm](https://github.com/staabm)! - NodeTypeResolver: prevent unncessary reflection calls ([#&#8203;3647](https://github.com/rectorphp/rector-src/pull/3647)), Thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v0.15.25`](https://github.com/rectorphp/rector/compare/0.15.24...0.15.25) [Compare Source](https://github.com/rectorphp/rector/compare/0.15.24...0.15.25) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 3am every weekday,every weekend" in timezone Europe/Amsterdam, 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45OS4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTkuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
chore(deps): update dependency rector/rector to v2
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
84518bae22
Author
Collaborator

⚠️ 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.4.2 --with-dependencies --ignore-platform-req=ext-* --ignore-platform-req=lib-* --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins --minimal-changes
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/proxy-manager-bridge is locked to version v6.2.7 and an update of this package was not requested.
    - friendsofphp/proxy-manager-lts v1.0.14 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[4.10.0].
    - laminas/laminas-code 4.10.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.5.5) does not satisfy that requirement.
    - symfony/proxy-manager-bridge v6.2.7 requires friendsofphp/proxy-manager-lts ^1.0.2 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.14].


### ⚠️ 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.4.2 --with-dependencies --ignore-platform-req=ext-* --ignore-platform-req=lib-* --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins --minimal-changes Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - symfony/proxy-manager-bridge is locked to version v6.2.7 and an update of this package was not requested. - friendsofphp/proxy-manager-lts v1.0.14 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[4.10.0]. - laminas/laminas-code 4.10.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.5.5) does not satisfy that requirement. - symfony/proxy-manager-bridge v6.2.7 requires friendsofphp/proxy-manager-lts ^1.0.2 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.14]. ```
Some checks failed
renovate/artifacts Artifact file update failure
renovate/stability-days Updates have met minimum release age requirement
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/rector-rector-2.x:renovate/rector-rector-2.x
git switch renovate/rector-rector-2.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff renovate/rector-rector-2.x
git switch renovate/rector-rector-2.x
git rebase master
git switch master
git merge --ff-only renovate/rector-rector-2.x
git switch renovate/rector-rector-2.x
git rebase master
git switch master
git merge --no-ff renovate/rector-rector-2.x
git switch master
git merge --squash renovate/rector-rector-2.x
git switch master
git merge --ff-only renovate/rector-rector-2.x
git switch master
git merge renovate/rector-rector-2.x
git push origin master
Sign in to join this conversation.
No description provided.