github rectorphp/rector 1.2.1
Released Rector 1.2.1

latest releases: 1.2.10, 1.2.9, 1.2.8...
4 months ago

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

  • Fix outdated documentation in README.md (#328), Thanks @alexis-boyer
  • Check is nullable doctrine annotation (#324), Thanks @marcelthole
  • Add return doc block to Collection property's getter method by ToMany annotation (#322), Thanks @jszutkowski
  • Fix for AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector (#321), Thanks @jszutkowski

rectorphp/rector-phpunit

  • Add support for multiple dataProviders for a single test method (#349), Thanks @marcelthole

Don't miss a new rector release

NewReleases is sending notifications on new releases.