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
[7.x] Changed fixed value, used laravel string helper function #31080
Conversation
I found that most of the changes made the code less readable. |
Is this necessary? At most I could see a comment being added to clarify what the numbers mean, but they're pretty self-explanatory in most cases. I also don't like the introduction of the |
Hi @jmarcher & @36864 the code would be more readable. As let's take an example
In the example above, it doesn't make sense to keep the value as fixed: 7. Now the change in this PR like:
Also defining the variable @jmarcher I'm open to update this if you feels any portion of code you feels not readable. Please point me there I'll update. FYI, the requested changes based on the previous #31069 |
My concern here is that we're hindering performance for a subjective increase in readability that could be achieved with a simple comment. Yes, it's a minor performance hit, but it's also a minor increase in readability. The one point where a change would be useful, in my opinion, is in the
As for the referenced PR, I also disagree with the changes on the same terms, but wasn't around to voice my opinions before it got merged. That one is even worse because the encryption provider is registered on every request, while the files changed in this PR are less used. Also for some additional context, I offer #30960 which was merged as a strict micro-optimization, arguably at the cost of readability according to some people. |
@36864 I'm checking this for 10k requests and it's producing me the similar result for both of the case. There would be some very minnor impact for this change... but not as much as in terms of readability it may acceptable. |
If nothing is broken I think it's fine. |
This PR is about remove fixed counter ( like 7 for 'base64:') and used laravel
Str:after()
helper function to improve code readability.Edited:
This PR is based on #31069