Releases: rectorphp/rector
Releases · rectorphp/rector
Released Rector 2.3.4
Released Rector 2.3.3
Bugfixes 🐛
- rectorphp/rector-src@61f8719 Pin PHPStan 2.1.34, as 2.1.35 introduced a complex regression breaking Rector - see rectorphp/rector-src#7847
Released Rector 2.3.2
New Features 🥳
- [dx] Rename
DeprecatedAnnotationToDeprecatedAttributeRectorfor 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 🟢
- fix a class name that should be string (#607)
- Support array_values in ArrayFirstLastRector (#7830), Thanks @Orest-Divintari!
- [Php85] Skip as assigned var/op on ArrayFirstLastRector (#7843)
Released Rector 2.3.1
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
RemoveNextSameValueConditionRectorin 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)
Released Rector 2.3
New Features 🥳
- Introduce
FileNodeto handle file-level changes (#7728) to be used instead ofFileWithoutNamespacenode - see https://github.com/rectorphp/rector-src/blob/main/UPGRADING.md for the upgrade - Add
PrivatizeFinalClassConstantRector(#7753), Thanks @simonschaufi! - [dead-code] Add
RemoveParentDelegatingConstructorRector(#7769)
Bugfixes 🐛
- Manage named arguments in ArgumentAdderRector rule (#7777), Thanks @carlos-granados!
- [compat] Add
SymplifyQuoteEscapeRectordeprecated 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
SortNamedParamRectortoSortCallLikeNamedArgsRectorto 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 🟠
- Make use of
FileNode(#474)
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)
Released Rector 2.2.14
Bugfixes 🐛
- [fix] warn early about deprecated skipped rules, as not neccessary to skip anymore + restore
FirstClassCallableRectorand mark as deprecated to keep BC (#7742)
Released Rector 2.2.13
Bugfixes 🐛
- [fix] restore missing pInterpolatedStringPart(), cover with test (#7741)
Released Rector 2.2.12
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 🎵
Released Rector 2.2.11
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
Released Rector 2.2.10
New Features and Improvements 🥳
- Support Attribute in
SortNamedParamRector(#7684), Thanks @VincentLanglet!
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)