generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ent requests, for this `StorageInterface` method `save()` split to `saveIfNotExists()` and `saveCompareAndSwap()`
- Loading branch information
Showing
31 changed files
with
882 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,14 @@ final class CounterState | |
* @param int $limit The maximum number of requests allowed with a time period. | ||
* @param int $remaining The number of remaining requests in the current time period. | ||
* @param int $resetTime Timestamp to wait until the rate limit resets. | ||
* @param bool $isFailStoreUpdatedData If fail to store updated the rate limit data. | ||
*/ | ||
public function __construct(private int $limit, private int $remaining, private int $resetTime) | ||
{ | ||
public function __construct( | ||
private int $limit, | ||
private int $remaining, | ||
private int $resetTime, | ||
private bool $isFailStoreUpdatedData = false | ||
Check warning on line 22 in src/CounterState.php GitHub Actions / mutation / PHP 8.1-ubuntu-latest
|
||
) { | ||
} | ||
|
||
/** | ||
|
@@ -49,4 +54,12 @@ public function isLimitReached(): bool | |
{ | ||
return $this->remaining === 0; | ||
} | ||
|
||
/** | ||
* @return bool If fail to store updated the rate limit data. | ||
*/ | ||
public function isFailStoreUpdatedData(): bool | ||
{ | ||
return $this->isFailStoreUpdatedData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.