EP117 - Get ready for Symfony 6 - How To Code Well Podcast

preview_player
Показать описание
------
. Today I am going to talk about Symfony 6 and discuss why PHP developers should be aware of it.

What about Symfony 5.4 LTS?
- It will be released in November 2021
- End of bug fixes November 2024
- End of security fixes 2025
- So you still have over 3 years before Symfony 5 will be end of life

When will Symfony 6 be released
- Release November 2021
- End of support: July 2022

When will the LTS 6.4 version be ready and for how long
- Release: November 2023
- End of bug fixes: November 2026
- End of security fixes: November 2027

What is happening
- Symfony 5.4 requires PHP 7.2.5 or higher
- Symfony 6 Requires PHP 8.0.2 or higher
- This gives us
- Union types
- Static return types
- Constructor property promotion
- Match statement
- Null safe operator
- Etc….
- Symfony 6 will be the biggest change to the Symfony framework since Symfony 2.
- Unlike Symfony 1 to 2 it will not require a full re write.
- Fully typed where possible
- There is a patch-type-declarations script in Symfony 5.4 + that will make your code compatible.
- They may postpone certain type safe changes to Symfony 7 as this could cause some pain for maintainers of open source projects

What will be effected
- Adding return types may have a big impact on the Symfony components used by other frameworks and other tools.
- This may cause major versions to be created and roadmaps to be altered. If this isn’t handled carefully we may see BC breaks and there could even be situations where a BC break is unavoidable.
- This will cause some short term pain but I believe this will push the PHP community as a whole forward. Which is no bad thing.
How can I get my web app ready?
- Write unit tests and increase code coverage
- Write acceptance tests
- Run Static analysis and at a high level.
- Upgrade to PHP 5.4 if you haven’t already done so
- Run the patch-type-declarations script
- Document the return types
- Fix any missing return types
- Use PHP 8 docker images
- Add parameter types when Symfony 6 is installed
- Keep running static analysis and tests to ensure nothing has broken
- Fix any issues

Recommended Book

📖 Related programming courses:

PHP Array Course

PHP OOP Course

JavaScript Array Course

✉️ Get my weekly newsletter

⏰ My current live coding schedule
Tuesdays 07:00
Sundays 14:30 All times are BST

➡️ Follow How To Code Well:

#podcast #symfony #php
Рекомендации по теме
Комментарии
Автор

I agree PHP 8+ is great. Anyone with a TS background will love it.

KeganVanSickle
Автор

This was very helpful & interesting. I'm an experience PHP dev migrating from using an internal framework to Symfony ... so this was a nice intro to how the versions work, etc.

Subscribed to the podcast too. 😊

SyntaxSeed
Автор

What can be done if the "composer req api" command does not work in symfony 6 ?

uraljonjurayev
Автор

Why do you think that now is a great time to be a PHP developer? Isn't PHP losing to .NET?

humanyoda