From 67cd01f515c6545ac3ea442e4a6ac28dac785b37 Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Tue, 3 Jun 2025 09:38:07 +0200 Subject: [PATCH 1/8] Fix deprecation warnings and modifications for php8.4 - fixed response for Limit - updated github tests --- .github/workflows/redis-tests.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- src/Limit.php | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/redis-tests.yml b/.github/workflows/redis-tests.yml index d42b7e6..3cf2507 100644 --- a/.github/workflows/redis-tests.yml +++ b/.github/workflows/redis-tests.yml @@ -18,7 +18,7 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest ] - php: [ 8.1, 8.2 ] + php: [ 8.1, 8.2 , 8.3 , 8.4 ] stability: [ prefer-lowest, prefer-stable ] services: # Label used to access the service container @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 821e41d..c908e0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,14 +18,14 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.1, 8.2 ] + php: [ 8.1, 8.2, 8.3, 8.4 ] stability: [ prefer-lowest, prefer-stable ] name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/src/Limit.php b/src/Limit.php index dc5fbe0..90cacd9 100644 --- a/src/Limit.php +++ b/src/Limit.php @@ -40,7 +40,7 @@ class Limit /** * The threshold that should be used when determining if a limit has been reached * - * Must be between 0 and 1. For example if you want the limiter to kick in at 85% + * Must be between 0 and 1. For example, if you want the limiter to kick in at 85% * you must set the threshold to 0.85 */ protected float $threshold = 1; @@ -73,11 +73,11 @@ final public function __construct(int $allow, float $threshold = 1, callable $re { $this->allow = $allow; $this->threshold = $threshold; - $this->responseHandler = isset($responseHandler) ? $responseHandler(...) : null; + $this->responseHandler = $responseHandler; } /** - * Construct a limiter's allow and threshold + * Construct a limiter's allowing and threshold */ public static function allow(int $requests, float $threshold = 1): static { @@ -89,7 +89,7 @@ public static function allow(int $requests, float $threshold = 1): static */ public static function custom(callable $responseHandler): static { - return (new static(1, 1, $responseHandler(...)))->everySeconds(60, 'custom'); + return (new static(1, 1, $responseHandler))->everySeconds(60, 'custom'); } /** @@ -281,7 +281,7 @@ public function handleResponse(Response $response): void * * @return $this * @throws \JsonException - * @throws \Saloon\RateLimitPlugin\Exceptions\LimitException + * @throws LimitException */ public function update(RateLimitStore $store): static { @@ -316,14 +316,14 @@ public function update(RateLimitStore $store): static return $this; } - // If our expiry hasn't passed, yet then we'll set the expiry timestamp - // and, we'll also update the hits so the current instance has the + // If our expiry hasn't passed yet, then we'll set the expiry timestamp, + // and we'll also update the hits so the current instance has the // number of previous hits. $this->setExpiryTimestamp($expiry); $this->hit($hits); - // If this is a fromResponse limiter then we should apply the "allow" which will + // If this is a fromResponse limiter, then we should apply the "allow" which will // be useful to check if we have reached our rate limit if ($this->usesResponse()) { @@ -338,7 +338,7 @@ public function update(RateLimitStore $store): static * * @return $this * @throws \JsonException - * @throws \Saloon\RateLimitPlugin\Exceptions\LimitException + * @throws LimitException */ public function save(RateLimitStore $store, int $resetHits = 1): static { From 942af76c235b40c02af21c66d91cf14ca7c48f61 Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Tue, 3 Jun 2025 09:45:24 +0200 Subject: [PATCH 2/8] php 8.4 fix --- .github/workflows/redis-tests.yml | 2 +- .phpunit.cache/test-results | 1 + src/Limit.php | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .phpunit.cache/test-results diff --git a/.github/workflows/redis-tests.yml b/.github/workflows/redis-tests.yml index 3cf2507..9e54899 100644 --- a/.github/workflows/redis-tests.yml +++ b/.github/workflows/redis-tests.yml @@ -18,7 +18,7 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest ] - php: [ 8.1, 8.2 , 8.3 , 8.4 ] + php: [ 8.1, 8.2, 8.3, 8.4 ] stability: [ prefer-lowest, prefer-stable ] services: # Label used to access the service container diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..c3bd172 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.36.0","defects":{"P\\Tests\\Feature\\Stores\\PredisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":8,"P\\Tests\\Feature\\Stores\\RedisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":8},"times":{"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_making_a_request_with_the_HasRateLimits_trait_added_it_will_record_the_hits_and_throw_exceptions":0.022,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_making_a_request_with_the_HasRateLimits_trait_added_it_will_record_the_hits_and_can_sleep":5.003,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_create_a_limiter_that_listens_for_429_and_will_automatically_back_off_for_the_Retry_After_duration":0.002,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#(null)":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#('not-working')":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#('01\/01\/2023')":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_customise_when_the_too_many_requests_limit_is_applied":0.003,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_disable_the_429_error_detection":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_rate_limiter_can_be_used_on_a_request":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_the_the_rate_limiter_is_used_on_both_the_connector_or_request_all_the_limits_are_used":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_rate_limiter_can_be_used_on_a_solo_request":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_specify_a_custom_closure_to_determine_the_limiter_based_on_response":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_a_connector_has_the_AlwaysThrowOnError_trait_then_the_limiter_will_take_priority":0.002,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_limit_is_given_the_correct_prefix_even_with_custom_names":0,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_customise_the_prefix":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_programmatically_disable_the_rate_limiting":0,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_it_will_fail_if_you_dont_configure_a_limiter_properly":0,"P\\Tests\\Feature\\Stores\\FileStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.004,"P\\Tests\\Feature\\Stores\\MemoryStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0,"P\\Tests\\Feature\\Stores\\PredisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.007,"P\\Tests\\Feature\\Stores\\PsrStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.002,"P\\Tests\\Feature\\Stores\\RedisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0,"P\\Tests\\Laravel\\Feature\\JobMiddlewareTest::__pest_evaluable_the_api_rate_limited_job_will_release_a_job_onto_the_queue_if_a_limit_is_reached":0.026,"P\\Tests\\Laravel\\Feature\\LaravelStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.001,"P\\Tests\\Unit\\DestructTest::__pest_evaluable_the_connector_can_still_be_destructed_properly":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#(null, null)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('0', 0)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('120', 120)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('2030-01-01 00:00:00', Closure)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('Wed, 23 Oct 2030 06:28:00 GMT', Closure)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('Unknown', null)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_limit_helper_clones_the_limits":0.001,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_limit_helper_throws_an_exception_if_two_of_the_same_limits_have_the_same_name":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_the_rate_limiter_store_instance_is_reused_on_the_connector":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_the_limit_does_not_contain_the_timestamp_or_hits_then_an_exception_is_thrown_while_updating_the_limit":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_a_custom_limit_does_not_contain_the_allow_key_then_an_exception_is_thrown_while_updating_the_limit":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_the_current_timestamp_is_after_the_expiry_then_the_limit_will_not_update":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_when_saving_the_limit_if_the_expiry_time_is_less_than_a_second_away_then_the_hits_will_be_set_back_to_1":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_and_specify_an_allow_and_threshold":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 60)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 300)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 1800)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 3600)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 21600)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 43200)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 86400)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_until_the_end_of_the_current_month":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_until_midnight":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_to_release_every_day_at_a_specific_time":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_if_the_expiry_timestamp_is_empty_then_the_current_timestamp_will_be_used":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_get_the_remaining_seconds_left_on_the_limiter":0}} \ No newline at end of file diff --git a/src/Limit.php b/src/Limit.php index 90cacd9..b8313b3 100644 --- a/src/Limit.php +++ b/src/Limit.php @@ -58,8 +58,10 @@ class Limit /** * Custom response handler + * + * @var null|callable(): mixed */ - protected ?Closure $responseHandler = null; + protected $responseHandler = null; /** * Determines if we should sleep or not @@ -69,7 +71,7 @@ class Limit /** * @param (callable(): mixed)|null $responseHandler */ - final public function __construct(int $allow, float $threshold = 1, callable $responseHandler = null) + final public function __construct(int $allow, float $threshold = 1, ?callable $responseHandler = null) { $this->allow = $allow; $this->threshold = $threshold; @@ -123,7 +125,7 @@ public function hit(int $amount = 1): static /** * Set the limit as exceeded */ - public function exceeded(int $releaseInSeconds = null): void + public function exceeded(?int $releaseInSeconds = null): void { $this->exceeded = true; From d1bd91001f09841e78231d305bcb76bfde6896b0 Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Tue, 3 Jun 2025 09:47:10 +0200 Subject: [PATCH 3/8] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d655ba..a11142a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ # Caches, externally stored stuff, etc .php-cs-fixer.cache .phpunit.result.cache +.phpunit.cache tests/Fixtures/Saloon # environments/configs From 476fd8822f5d19ded6ac2afcca9427232577af5e Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Tue, 3 Jun 2025 09:47:44 +0200 Subject: [PATCH 4/8] Delete .phpunit.cache directory --- .phpunit.cache/test-results | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index c3bd172..0000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":"pest_2.36.0","defects":{"P\\Tests\\Feature\\Stores\\PredisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":8,"P\\Tests\\Feature\\Stores\\RedisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":8},"times":{"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_making_a_request_with_the_HasRateLimits_trait_added_it_will_record_the_hits_and_throw_exceptions":0.022,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_making_a_request_with_the_HasRateLimits_trait_added_it_will_record_the_hits_and_can_sleep":5.003,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_create_a_limiter_that_listens_for_429_and_will_automatically_back_off_for_the_Retry_After_duration":0.002,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#(null)":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#('not-working')":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_the_Retry_After_header_is_missing_or_cannot_be_parsed_then_the_default_retry_is_60_seconds#('01\/01\/2023')":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_customise_when_the_too_many_requests_limit_is_applied":0.003,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_disable_the_429_error_detection":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_rate_limiter_can_be_used_on_a_request":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_when_the_the_rate_limiter_is_used_on_both_the_connector_or_request_all_the_limits_are_used":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_rate_limiter_can_be_used_on_a_solo_request":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_specify_a_custom_closure_to_determine_the_limiter_based_on_response":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_if_a_connector_has_the_AlwaysThrowOnError_trait_then_the_limiter_will_take_priority":0.002,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_the_limit_is_given_the_correct_prefix_even_with_custom_names":0,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_customise_the_prefix":0.001,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_you_can_programmatically_disable_the_rate_limiting":0,"P\\Tests\\Feature\\HasRateLimitsTest::__pest_evaluable_it_will_fail_if_you_dont_configure_a_limiter_properly":0,"P\\Tests\\Feature\\Stores\\FileStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.004,"P\\Tests\\Feature\\Stores\\MemoryStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0,"P\\Tests\\Feature\\Stores\\PredisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.007,"P\\Tests\\Feature\\Stores\\PsrStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.002,"P\\Tests\\Feature\\Stores\\RedisStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0,"P\\Tests\\Laravel\\Feature\\JobMiddlewareTest::__pest_evaluable_the_api_rate_limited_job_will_release_a_job_onto_the_queue_if_a_limit_is_reached":0.026,"P\\Tests\\Laravel\\Feature\\LaravelStoreTest::__pest_evaluable_it_records_and_can_check_exceeded_limits":0.001,"P\\Tests\\Unit\\DestructTest::__pest_evaluable_the_connector_can_still_be_destructed_properly":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#(null, null)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('0', 0)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('120', 120)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('2030-01-01 00:00:00', Closure)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('Wed, 23 Oct 2030 06:28:00 GMT', Closure)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_retry_after_helper_can_parse_different_values#('Unknown', null)":0,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_limit_helper_clones_the_limits":0.001,"P\\Tests\\Unit\\HelperTest::__pest_evaluable_the_limit_helper_throws_an_exception_if_two_of_the_same_limits_have_the_same_name":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_the_rate_limiter_store_instance_is_reused_on_the_connector":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_the_limit_does_not_contain_the_timestamp_or_hits_then_an_exception_is_thrown_while_updating_the_limit":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_a_custom_limit_does_not_contain_the_allow_key_then_an_exception_is_thrown_while_updating_the_limit":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_if_the_current_timestamp_is_after_the_expiry_then_the_limit_will_not_update":0,"P\\Tests\\Unit\\LimitStoreTest::__pest_evaluable_when_saving_the_limit_if_the_expiry_time_is_less_than_a_second_away_then_the_hits_will_be_set_back_to_1":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_and_specify_an_allow_and_threshold":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 60)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 300)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 1800)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 3600)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 21600)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 43200)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_use_different_intervals_to_specify_seconds#(Closure, 86400)":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_until_the_end_of_the_current_month":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_until_midnight":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_create_a_limiter_to_release_every_day_at_a_specific_time":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_if_the_expiry_timestamp_is_empty_then_the_current_timestamp_will_be_used":0,"P\\Tests\\Unit\\LimitTest::__pest_evaluable_you_can_get_the_remaining_seconds_left_on_the_limiter":0}} \ No newline at end of file From 4752c2978951f23fe33b725014c867eefc80822e Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Fri, 20 Jun 2025 15:57:14 +0200 Subject: [PATCH 5/8] Update composer.json --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 05181d6..b0bc2aa 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "mockery/mockery": "^1.5", "orchestra/testbench": "^8.5" }, - "minimum-stability": "stable", + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "Saloon\\RateLimitPlugin\\": "src/", From 04f4908ebad06f336c34e697175f8a2caaf375e7 Mon Sep 17 00:00:00 2001 From: Sirik Koster Date: Fri, 20 Jun 2025 16:30:09 +0200 Subject: [PATCH 6/8] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b0bc2aa..b47efdb 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "mockery/mockery": "^1.5", "orchestra/testbench": "^8.5" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true, "autoload": { "psr-4": { From d2f531b349b108e3cd82971f5b0b4817fc8153e3 Mon Sep 17 00:00:00 2001 From: Sammyjo20 <29132017+Sammyjo20@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:40:41 +0100 Subject: [PATCH 7/8] Bumped phpstan --- .github/FUNDING | 2 +- .github/workflows/phpstan.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/FUNDING b/.github/FUNDING index 0dcac02..7635e8b 100644 --- a/.github/FUNDING +++ b/.github/FUNDING @@ -1 +1 @@ -ko_fi: sammyjo20 +github: sammyjo20 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8ad0db3..c1e626f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -18,7 +18,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.4' coverage: none - name: Install composer dependencies From 949d9ec63600e3e69d14cd05ca0a3899515b2bfe Mon Sep 17 00:00:00 2001 From: Sammyjo20 <29132017+Sammyjo20@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:43:16 +0100 Subject: [PATCH 8/8] Run php-cs-fixer --- src/Limit.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Limit.php b/src/Limit.php index b8313b3..41ccc54 100644 --- a/src/Limit.php +++ b/src/Limit.php @@ -4,7 +4,6 @@ namespace Saloon\RateLimitPlugin; -use Closure; use DateInterval; use DateTimeImmutable; use Saloon\Http\Response;