From 12/100 Legacy Symfony 3.2 to Zero-CVE Symfony 7.4.23 LTS & PHP 8.4.27.
Client and reference repositories remain sealed; live GitHub Pull Request #1 walkthroughs are shared on-screen during technical briefings. Below is the complete open engineering dossier from our internal siwapp billing monolith upgrade.
Abandoned Bundles Blocking Every Major Upgrade Path
At intake, the 9,130-LOC invoicing monolith was pinned to End-of-Life Symfony 3.2.0, FOSUserBundle, SwiftMailer, AsseticBundle, SensioFrameworkExtraBundle docblock annotations, and an unpatched wkhtmltopdf QtWebKit binary, making a naive composer update impossible without breaking authentication and PDF billing.
Native Attributes, Preserved Auth Hashes & Zero-Mock Parity
Across four atomic commits, we migrated all 12 Doctrine entities, 9 controllers, 22 FormTypes, and 32 Twig templates to native PHP 8.4 Attributes and explicit constructor DI, preserving existing fos_user SQL password hashes under native SecurityBundle, swapping wkhtmltopdf for CVE-free Alpine WeasyPrint, and proving parity across 233 PHPUnit assertions.
Inspect Verified AST, SecurityBundle & 3-Stage CI Code Diffs.
--- a/src/Siwapp/InvoiceBundle/Controller/InvoiceController.php (Legacy Symfony 3.2) +++ b/src/Siwapp/InvoiceBundle/Controller/InvoiceController.php (Symfony 7.4.23 LTS · PHP 8.4.27) - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; + use Symfony\Component\Routing\Attribute\Route; + use Symfony\Component\Mailer\MailerInterface; + use Symfony\Component\Mime\Email; - /** @Route("/{id}/show/pdf", name="invoice_show_pdf") */ - public function showPdfAction($id) { $em = $this->getDoctrine()->getManager(); ... } + #[Route('/{id}/show/pdf', name: 'invoice_show_pdf', methods: ['GET'])] + public function showPdf(int $id, EntityManagerInterface $em, Pdf $pdf): Response { // CVE-free Alpine WeasyPrint 68.1 %PDF- stream replacing abandoned wkhtmltopdf QtWebKit return new Response($pdf->getOutputFromHtml($html), 200, ['Content-Type' => 'application/pdf']); }
--- a/src/Siwapp/UserBundle/Entity/User.php (Abandoned FOSUserBundle + Doctrine Annotations) +++ b/src/Siwapp/UserBundle/Entity/User.php (Native SecurityBundle · ORM 3.7.6 · DBAL 4.5.1) - use FOS\UserBundle\Model\User as BaseUser; - /** @ORM\Entity @ORM\Table(name="fos_user") */ - class User extends BaseUser + #[ORM\Entity] + #[ORM\Table(name: 'fos_user')] + class User implements UserInterface, PasswordAuthenticatedUserInterface { // Preserves existing fos_user SQL schema & password hashes across 14/14 auth routes // Zero SwiftMailer, zero AsseticBundle, zero SensioFrameworkExtraBundle dependencies }
$ composer audit && vendor/bin/phpstan analyse -l 6 src tests && vendor/bin/phpunit ✓ composer audit: No security vulnerability advisories found (130 locked packages, Symfony v7.4.23 LTS) ✓ doctrine:schema:validate: [Mapping] OK — All 12 ORM 3.7.6 entities valid on MariaDB 10.6 ✓ lint:twig src & lint:yaml config: 53/53 Twig 3.30 templates & 70/70 YAML configs valid ✓ phpstan --level=6: [OK] No errors (0 ignoreErrors, 0 excludePaths across src/ + tests/) ✓ phpunit 11.5.57: OK (16 tests, 233 assertions, 0 warnings/deprecations) · 49/54 routes & 4 CLI commands zero-mock verified