Symfony is evolving and you may ask yourself whether your application can keep up. This presentation aims to show coding techniques and design patterns that will make future Symfony upgrades much easier, even if we don't know what the future holds!
minor or major, big gap • Features used: experimental, deprecated • Coupling with Symfony • Automation: tests, tools to fix • Runtime environment neglect (including PHP) ⟡
support for PHP templates1 • Need to use Twig for those templates ⟡ 1 https://symfony.com/blog/new-in-symfony-4-3-deprecated-the-templating- component-integration
in 4.3 • Can see in deprecation log: Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead. • 6 months until 5.0 to start migrating to Twig ⟡
and documented • First clear upcoming removal signal in a blog1 • A month before 4.3 release ⟡ 1 https://symfony.com/blog/new-in-symfony-4-3-deprecated-the-templating- component-integration
@return int|null • Stabilized as @return int since 4.4 • Tool to scan and patch return types since 4.41 Method " [...]\Command::execute()" will return "int" as of its next major version. • 4 years until 7.0 to fix code ⟡ 1 https://github.com/symfony/symfony/pull/33283
type declarations1 ./vendor/bin/patch-type-declarations • Fix body if needed (manual) • Unit tests for internal logic • Integration tests with CommandTester2 ⟡ 1 https://wouterj.nl/2021/09/symfony-6-native-typing 2 https://symfony.com/doc/current/console.html
• Shows up in Symfony profile bar • Also @param mismatch → highlight in PHPStorm • Also reported if you use PHPStan or similar • Also shows up in error log • Also shows up in tests ⟡