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
Removed nullable type hint from $options parameter in routes. #5509
Conversation
While I am in favor of this change, we cannot update the interface without breaking all implementations of it elsewhere. This would be a good PR for version 5, when we are ready to roll up all these backwards-incompatible improvements. |
This interface has only one class implementation. And I can hardly imagine a programmer who will purposefully pass null. I have been hearing excuses about version 5 for over a year now, but there is not even a branch in the repository yet. |
I think calling them "excuses" is not fair. We follow semver which has very clear and strict guidelines on breaking changes. This makes a lot of things way cleaner and easier to handle, but complicates our jobs as framework developers: it is a trade-off. I am not opposed to a conversation about "when to 5", but because major versions are our only chance to make breaking changes it will have to be the panned out very deliberately. This is also the time to make sweeping changes, which will require lots of dev time. My opinion is that our roadmap still has unfinished business for version 4, and that the amount of time it has taken to address those means we are still short on contributors and therefor not ready to begin work on version 5 yet. |
I don't want to upset you but the team doesn't follow semver. If I am not mistaken, at the moment all the points of the roadmap have been fulfilled. The framework fulfills all the basic development needs. Any features can be added in minor versions. I understand that the amount of work for v5 is large, but if you do nothing it will not decrease. But the enthusiasm of contributors can go away. |
Yes, our rule is not Semver. And where is the roadmap? If there is a real roadmap somewhere, it is better to show it. And I think we can try creating |
We fully intend to follow semver. Maybe there is some quibbling over what "features" are, but the intent is to hold all new feature releases for the next minor release (major.minor.patch). For example, 4.2 will not include breaking changes related to PHP 7.4; we will add 7.4-compatible language structures where they won't cause breaking changes. The minimum PHP version will increase from 7.3 to 7.4 but this is not a violation of semver since it does not affect the API, and Composer will handle the dependency calculation. |
I'm not sure what to say to this. I think this is a valid point, but the truth is also that we have a very, very small team of people doing the "necessary work" of the framework (fixing bugs, addressing issues, checking docs consistency, etc) which rarely comes from enthusiasm. We get a lot of "hey here's my great idea, I know I didn't follow the submission guidelines or write any tests, but you all can do that if you like my idea", which I'm grateful for the enthusiasm but it doesn't help with moving the framework forward. (Just to be clear @iRedds I don't consider you in that category, your consistency, thoughtful input, and thorough PRs are very appreciated.) |
If we fully follow semver, patch releases have only bug fixes.
v4.2 is probably not BC in the sense of semver. If application code works without any change (only updates PHP version), it is not BC. |
I have looked at other frameworks and their versions coincide with my vision.
Laravel
CakePHP
By increasing the minimum php version, the major version of the framework is being increased. |
I think that's a fine way to do it, but it is related to different choices. Each framework (and package for that matter) needs to decide:
Both of these will determine whether/how long your software runs on unsupported language versions. For CodeIgniter 4 we have decided not to support legacy PHP versions, at all. This was largely guided by available dev time, since tracking and maintaining multiple versions takes some work. Semver ultimately only cares about your API, and relies on dependency management to handle dependencies. From the FAQ:
I still think this is a good contribution, and the tags we've put on it makes sure it won't get lost when we work on version 5. @iRedds If you want to become a champion for version 5 please feel free to begin some conversations and the Slack and the forums - this is a community project and the maintainers will always heed the community. |
My question is who wants it? At least, there is no one yet who wants us to follow semver. |
I responded. |
Description
I believe there was a error during the design phase. In my opinion the error is that the typehint for the
$options
parameter in the route is nullable and has a default value of null.In fact, the null value is not processed in any way, and the
$options
argument is used only as an array.This PR changes the typehint and default value for the
$options
parameter.Checklist: