Skip to content

Released Rector 2.5.9

Latest

Choose a tag to compare

@TomasVotruba TomasVotruba released this 30 Jul 22:13

Bugfixes 🐛

  • [DeadCode] Remove unreachable class-like checks in Class_-only rules (#8217)
  • [CodingStyle] Use native php-parser node API over class reflection (#8218)
  • [Php80] Remove AstResolver usage on AddParamBasedOnParentClassMethodRector (#8196)
  • Wire RichParser node visitors via DI factory instead of private property hack (#8215)
  • [Php80] Skip promoting a property the parent declares without a native type in ClassPropertyAssignToConstructorPromotionRector (#8232)
  • [DeadCode] Keep empty __construct() in anonymous class that extends parent on RemoveEmptyClassMethodRector (#8219)
  • [DeadCode] Skip negative zero on RemoveDeadZeroAndOneOperationRector (#8213)
  • [DeadCode] Skip protected property on non-final class on RemoveDefaultValueFromAssignedPropertyRector (#8214)
  • [DeadCode] Skip array dim fetch assign on RemoveDefaultValueFromAssignedPropertyRector (#8212)
  • [DeadCode] Skip if/else in loop on RemoveDefaultValueFromAssignedPropertyRector (#8211)
  • [DeadCode] Skip early return in constructor on RemoveDefaultValueFromAssignedPropertyRector (#8209)

Set changes 🗑️

NullToStrictStringFuncCallArgRector out of the PHP 8.1 set (#8234)

The rule and all its fixtures stay, so it can still be opted into:

->withRules([NullToStrictStringFuncCallArgRector::class])

Deprecations 💀

TypeDeclarationDocblocks: 3 data provider docblock rules (#8235)

Data provider docblock typing is not relevant to code quality — it increases maintenance cost and decreases readability of the test class.

Deprecated rules:

  • AddReturnArrayDocblockFromDataProviderParamRector
  • AddReturnDocblockDataProviderRector
  • AddParamArrayDocblockFromDataProviderRector

rectorphp/rector-symfony 🎵

  • [Symfony72] Match push() to its own RequestStack variable in PushRequestToRequestStackConstructorRector (#971)
  • [Symfony44] Skip custom isGranted() service calls in controllers in AuthorizationCheckerIsGrantedExtractorRector (#973)
  • [Symfony42] Update Cookie fixture after NewToStaticCallRector config removal (#974)
  • Drop rector/type-perfect, its rules ship in tomasvotruba/type-coverage 2.3 now (#972)
  • Bump dev dependencies, PHPUnit 13 (#976)
  • [deps] Bump symfony/config to ^8.1 (#977)

Deprecated: SimplifyFormRenderingRector (#975)

The rule removed the explicit ->createView() call when a form was passed to render():

Symfony supports passing the FormInterface directly, but the shorthand is ambiguous and breaks dynamic forms: forms modified in PRE_SET_DATA/POST_SUBMIT listeners and submitted over AJAX end up with a 422 response and no clear error. Keeping the explicit ->createView() call is the reliable form. See symfony/symfony#50542.


rectorphp/rector-phpunit 🧪

  • [PHPUnit 13] Fix class in expectExceptionMessage() rename to TestCase (#735)

rectorphp/rector-downgrade-php ⬇️

  • [DowngradePhp81] Reference MHASH_* constants by name in DowngradeHashAlgorithmXxHashRector to fix PHP 8.5 deprecation (#386)