-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.6] Parameter has no usage inside the method. So we better remove it. #22202
[5.6] Parameter has no usage inside the method. So we better remove it. #22202
Conversation
@m1guelpf I'm kinda curious about your down vote. Would you please explain it a little bit ? I'm very interested to learn. :) |
Probably because this PR is incomplete, tooManyAttempts is used in a few places, eliminating this parameter would break those parts. Check:
|
Well @jmarcher I don't think this will break anything. Cause passing more arguments than expected to a method is supported from PHP 4. So changing to Beside, this |
So you make a PR deleting one unused parameter but still want to leave unused parameters to this very same method calls? |
Uha.. I never said that @jmarcher. That's different thing and I'm working on that. My point is it wouldn't break anything. But better to clear it everywhere and that's what I'm doing right now. Anyway, thanks for pointing that out and make it clear. |
We cannot remove the calls that sends in a $decayMinutes argument; that would be weird for everyone that has a custom RateLimiter that actually uses the parameter. Are we sure that this isn't a bug where we actually should be using $decayMinutes in the tooManyAttempts() method? |
@themsaid can you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally left the parameter to avoid having a breaking change with people using a custom limiter that extends this one, the change was only 5 days before the release so it made sense back then.
For 5.6 I think it's safe to remove the parameter as it's not used in this method anymore.
I know this may slow down the Framework development speed but I think we should first Deprecate method/parameters/attributes in the first release and remove in the second one. Like discussed here: laravel/ideas#383 This type of changes do take a lot of effort for package developers or people customizing the core for their needs. |
$decayMinutes = 1
parameter has no usage inside the method. So we better remove it.