Skip to content

Comments

♻️ Modernize codebase for PHP 8.4#1024

Merged
0x46616c6b merged 2 commits intomainfrom
php84-modernization
Feb 8, 2026
Merged

♻️ Modernize codebase for PHP 8.4#1024
0x46616c6b merged 2 commits intomainfrom
php84-modernization

Conversation

@0x46616c6b
Copy link
Member

Summary

  • Apply PHP 8.4 language features across 98 files using Rector with php84: true
  • Remove dead ErrorController and orphaned Exception/show.html.twig template
  • Update tooling configs (Rector, Psalm, PHP-CS-Fixer) for PHP 8.4

Changes

PHP 8.4 Language Features (via Rector)

  • Typed constants (AddTypeToConstRector): ~40 files — public const NAME =public const string NAME =
  • Readonly classes (ReadOnlyClassRector): ~20 files — final classfinal readonly class where all properties are already readonly
  • Constructor promotion (ClassPropertyAssignToConstructorPromotionRector): 6 Entity files (Setting, Voucher, ApiToken, WebhookDelivery, WebhookEndpoint, UserNotification)
  • New without parentheses (NewMethodCallWithoutParenthesesRector): 3 files — (new Foo())->bar()new Foo()->bar()
  • Arrow functions (ClosureToArrowFunctionRector): 4 files
  • Various minor rules: ReadOnlyPropertyRector, PrivatizeFinalClassPropertyRector, NullToStrictStringFuncCallArgRector, ClassConstantToSelfClassRector, etc.

Dead Code Removal

  • Deleted src/Controller/ErrorController.php (dead since Symfony 6 upgrade — no longer registered in framework config)
  • Deleted templates/Exception/show.html.twig (orphaned template)

Tooling Config Updates

  • rector.php: Added ->withPhpSets(php84: true) + skip rules for SonataAdmin controllers
  • psalm.xml: phpVersion="8.2"phpVersion="8.4"
  • .php-cs-fixer.dist.php: Added 'new_expression_parentheses' => true

Verification

All tools pass cleanly:

  • Rector: No pending changes
  • PHP-CS-Fixer: 0 files to fix
  • Psalm: No errors at phpVersion 8.4
  • PHPUnit: 607 tests, 2776 assertions — all passed
  • Behat: 174 scenarios, 1712 steps — all passed

This PR was generated by OpenCode.

Apply PHP 8.4 language features using Rector and update tooling configs:

- Add typed constants (AddTypeToConstRector) across ~40 files
- Convert eligible classes to readonly (ReadOnlyClassRector) in ~20 files
- Use constructor promotion in 6 Entity classes
- Apply new-without-parentheses syntax in 3 files
- Convert closures to arrow functions in 4 files
- Apply various minor Rector rules (ReadOnlyPropertyRector, etc.)
- Remove dead ErrorController and orphaned Exception template
- Update rector.php (php84: true), psalm.xml (phpVersion 8.4),
  .php-cs-fixer.dist.php (new_expression_parentheses)

All tests pass: 607 PHPUnit tests, 174 Behat scenarios.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Test sending welcome emails including locale forwarding to builder
and behavior when no default domain is configured.

Co-Authored-By: OpenCode <noreply@opencode.ai>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
78.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@0x46616c6b 0x46616c6b marked this pull request as ready for review February 8, 2026 19:39
@0x46616c6b 0x46616c6b merged commit 8f5e31d into main Feb 8, 2026
9 of 10 checks passed
@0x46616c6b 0x46616c6b deleted the php84-modernization branch February 8, 2026 19:40
y3n4 pushed a commit that referenced this pull request Feb 10, 2026
* ♻️ Modernize codebase for PHP 8.4

Apply PHP 8.4 language features using Rector and update tooling configs:

- Add typed constants (AddTypeToConstRector) across ~40 files
- Convert eligible classes to readonly (ReadOnlyClassRector) in ~20 files
- Use constructor promotion in 6 Entity classes
- Apply new-without-parentheses syntax in 3 files
- Convert closures to arrow functions in 4 files
- Apply various minor Rector rules (ReadOnlyPropertyRector, etc.)
- Remove dead ErrorController and orphaned Exception template
- Update rector.php (php84: true), psalm.xml (phpVersion 8.4),
  .php-cs-fixer.dist.php (new_expression_parentheses)

All tests pass: 607 PHPUnit tests, 174 Behat scenarios.

Co-Authored-By: OpenCode <noreply@opencode.ai>

* ✅ Add tests for WelcomeMessageSender

Test sending welcome emails including locale forwarding to builder
and behavior when no default domain is configured.

Co-Authored-By: OpenCode <noreply@opencode.ai>

---------

Co-authored-by: OpenCode <noreply@opencode.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant