-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targeting PHP ^8.0 #417
Comments
Maybe it's time to support php >=8.1 only? |
@bladl why not continue to support PHP 8.0? We can still support Symfony 6.1 components with PHP 8.0 support as well. It just means if your target PHP version is PHP 8.0, you won't get Symfony 6.1, but a lower version that we also support. I'm not aware of any BC issues here. I do think we could move forward with updates to target a minimum of PHP 8.0 now though. Security support for PHP 7.4 ends on 28 Nov 2022. |
Features available in php 8.1 could greatly increase code readability and reduce potential bugs. Enums, readonly properties, |
@bladl Enums are already implemented and don't require that we drop 8.0 support. Readonly properties and intersection types are cool, but I don't see any need to implement them requiring an 8.0 drop yet. Being that this is a widely distributed OSS lib, we have to be more accommodating of user's upgrade restrictions. I support following PHP's own version support dates: Security fix support for 7.4 will end Nov 28th. At that point, support should be dropped for 7.4. We should follow the same for all versions, dropping support when security fixes are no longer provided, unless there is a legitimate need to deviate. |
It'd be great to get a PR put together to begin cleaning up for the 8.0 min support if someone wants to take the initiative. |
Will this changes be versioned as minor update? |
This would be a minor update, yes - 5.1 for instance. |
I agree it'd be nice to replace constants with Enums. However, it doesn't change functionality in any meaningful way. Therefore, it's not enough to break support for 8.0 at this time, I feel. I'm in support of being ahead of PHP's dates by some months, but 8.0 is supported for at least another year. Also, there are a lot of updates that can be made moving the codebase to 8.0 min support, alone. Let's focus on those first. |
Shouldn't it be a version 6.1? Current version is 6.0 as I guess. But there is no version 6.0 in CHANGELOG.md |
Yes, 6.1 - sorry. The CHANGELOG looks like it didn't get updated on the last release. Honestly, that file is mostly a duplicate of the release notes. I'm wondering if we should just remove all the content and note to reference the release notes. |
Can annotations like #[Field], #[Type], etc. be abandoned in favor of attributes from now? |
We definitely can. It would obviously be a BC break. I’m, personally, in favor of doing so and removing Doctrine annotation dependencies. It’ll probably require many people to refactor that bit. Luckily Rector has something for refactoring annotations to attributes. Maybe we could provide instructions on how to automate that refactor? |
Maybe Im wrong, but documentation already has section about rector |
Excellent. I probably added that, actually. We can just reference that in the release notes. |
Can I replace |
Does that Assert lib throw exceptions in a non dev env? If the result is the same, I don’t see why not. However, I haven’t looked into it’s intended use. |
Okay! I will replace it with condition + exception if that assertion is important to be user-friendly. |
There are many unnecessary assertions that can be replaced in favor of methods type-safety. So we could remove entire webmozart/assert lib. PR is on the way! |
Right yea, let’s do it |
PHP's So if there is a motivation to get less dependencies, simpler code and less checks for types in non-dev mode - it is OK to replace checks 🙂 |
Those assertions mostly validate data passed and used by internals. So, main purpose of those assertions were to catch errors on unit-testing stage. |
This post is for planning purposes. Sometime in the next year or so, PHP 7 will be unsupported, no longer receiving security updates. It's reasonable that we drop support for PHP 7, only targeting PHP ^8.0, sometime leading up to that date. PHP 7.4 is the only version that's still receiving security updates, at the moment. Users that wish to continue using PHP 7.4, can always target a previous version.
The main motivation and reasoning for this, would be to remove support for annotations, entirely. However, there may be some other refactoring and cleanup that can be done.
MyCLabs\Enum
in favor of native Enums.The text was updated successfully, but these errors were encountered: