Skip to content

Commit

Permalink
Support for PHP 8.4 (#33)
Browse files Browse the repository at this point in the history
* Parameters with null default must be nullable

* Add .phpunit.result.cache to .gitignore

* Add testing for PHP 8.1 -> 8.4
  • Loading branch information
phpfui authored Dec 2, 2024
1 parent 8360415 commit 0969667
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
docs
vendor
coverage
.phpunit.result.cache
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ php:
- 7.2
- 7.3
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4

env:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions src/RateLimiterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private function __construct(RateLimiter $rateLimiter)
$this->rateLimiter = $rateLimiter;
}

public static function perSecond(int $limit, Store $store = null, Deferrer $deferrer = null): RateLimiterMiddleware
public static function perSecond(int $limit, ?Store $store = null, ?Deferrer $deferrer = null): RateLimiterMiddleware
{
$rateLimiter = new RateLimiter(
$limit,
Expand All @@ -26,7 +26,7 @@ public static function perSecond(int $limit, Store $store = null, Deferrer $defe
return new static($rateLimiter);
}

public static function perMinute(int $limit, Store $store = null, Deferrer $deferrer = null): RateLimiterMiddleware
public static function perMinute(int $limit, ?Store $store = null, ?Deferrer $deferrer = null): RateLimiterMiddleware
{
$rateLimiter = new RateLimiter(
$limit,
Expand Down

0 comments on commit 0969667

Please sign in to comment.