FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

feat: apply rector rules for PHP 8.3 with typeDeclarations

Open shakaran opened this issue 1 year ago • 2 comments

Applied rules:

  • LongArrayToShortArrayRector
  • StringClassNameToClassConstantRector (https://wiki.php.net/rfc/class_name_scalars https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form)
  • ListToArrayDestructRector (https://wiki.php.net/rfc/short_list_syntax https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring)
  • AddMethodCallBasedStrictParamTypeRector (https://github.com/symplify/phpstan-rules/blob/master/docs/rules_overview.md#checktypehintcallertyperule)
  • AddParamTypeBasedOnPHPUnitDataProviderRector
  • AddVoidReturnTypeWhereNoReturnRector
  • ReturnTypeFromReturnDirectArrayRector
  • ReturnTypeFromReturnNewRector
  • ReturnTypeFromStrictScalarReturnExprRector
  • ReturnTypeFromStrictTypedCallRector
  • AddTestsVoidReturnTypeWhereNoReturnRector
  • AddClosureVoidReturnTypeWhereNoReturnRector

shakaran avatar Mar 13 '24 20:03 shakaran

I would suggest just closing this and submitting smaller pull requests if you want to pursue these types of changes. One pull request touching nearly 100 files in a single commit is asking too much of the folks who will ultimately be reviewing that work. Not to mention that some of these changes look to have potential B/C concerns or break compatibility in full with older PHP versions (some PHP 7 branches are still supported, yet I see a union typehint in one of the changed files, which is a PHP 8 feature).

mbabker avatar Mar 13 '24 21:03 mbabker

ok, I will do smaller ones if makes more easy to merge it, but the idea here is make a B/C in a new release (maybe 4.0 or so).

But most important, the project should really support PHP <8.0 versions? Mostly considering that PHP 8.0 is EOL currently, it doesnt make sense keep supporting PHP 7 branches IHMO

shakaran avatar Mar 13 '24 22:03 shakaran