github rectorphp/rector 0.18.3
Released Rector 0.18.3

latest releases: 1.2.5, 1.2.4, 1.2.3...
12 months ago

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)

Don't miss a new rector release

NewReleases is sending notifications on new releases.