nikolaposa / rate-limit

🚔 General purpose rate limiter implementation.
MIT License
271 stars 47 forks source link

throw native exceptions #23

Closed juliangut closed 4 years ago

juliangut commented 4 years ago

beberlei/assert is 208KB for two checks and raising \InvalidArgumentException (with some extra data that will hardly ever be used)

Just check lower limit and raise native php exceptions

juliangut commented 4 years ago

Please squash

nikolaposa commented 4 years ago

I care more about the quality than the size of the code, especially when it comes to server-side code. Assertions are a powerful mechanism that greatly facilitates input validation. Until we have them built into the language, I use assertion libraries such as beberlei/assert or webmozart/assert.