Skip to content
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

Support for custom rate limits #20

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Support for custom rate limits #20

merged 1 commit into from
Mar 31, 2020

Conversation

virtualize
Copy link
Contributor

@virtualize virtualize commented Mar 30, 2020

Motive: #19

@nikolaposa nikolaposa self-assigned this Mar 30, 2020
@nikolaposa nikolaposa self-requested a review March 30, 2020 13:39
@nikolaposa
Copy link
Owner

@virtualize What do you think about alternative approach, of adding new named constructor that would allow custom values, and keeping built-in constructor as is? For example:

public static function custom(int $operations, int $interval)
{
    return new static($operations, $interval);
}
$rate = Rate::custom(500, 3*3600)

@virtualize virtualize changed the title made Rate constructor public Support for custom rate limits Mar 30, 2020
@virtualize
Copy link
Contributor Author

Like the idea very much and updated the PR. Thanks.

@nikolaposa nikolaposa merged commit 5e3462e into nikolaposa:master Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants