Skip to content

Commit

Permalink
Merge pull request #34 from pizcadesaber/ignore-args
Browse files Browse the repository at this point in the history
Ignores args
  • Loading branch information
danharrin authored Jan 22, 2025
2 parents 0d9c189 + 10f7b6a commit 18680be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/WithRateLimiting.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait WithRateLimiting
{
protected function clearRateLimiter($method = null, $component = null)
{
$method ??= debug_backtrace(limit: 2)[1]['function'];
$method ??= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, limit: 2)[1]['function'];

$component ??= static::class;

Expand All @@ -20,7 +20,7 @@ protected function clearRateLimiter($method = null, $component = null)

protected function getRateLimitKey($method, $component = null)
{
$method ??= debug_backtrace(limit: 2)[1]['function'];
$method ??= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, limit: 2)[1]['function'];

$component ??= static::class;

Expand All @@ -29,7 +29,7 @@ protected function getRateLimitKey($method, $component = null)

protected function hitRateLimiter($method = null, $decaySeconds = 60, $component = null)
{
$method ??= debug_backtrace(limit: 2)[1]['function'];
$method ??= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, limit: 2)[1]['function'];

$component ??= static::class;

Expand All @@ -40,7 +40,7 @@ protected function hitRateLimiter($method = null, $decaySeconds = 60, $component

protected function rateLimit($maxAttempts, $decaySeconds = 60, $method = null, $component = null)
{
$method ??= debug_backtrace(limit: 2)[1]['function'];
$method ??= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, limit: 2)[1]['function'];

$component ??= static::class;

Expand Down
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace DanHarrin\LivewireRateLimiting\Tests;

use Livewire\LivewireServiceProvider;
use Livewire\Volt\Volt;
use Livewire\Volt\VoltServiceProvider;

class TestCase extends \Orchestra\Testbench\TestCase
Expand Down

0 comments on commit 18680be

Please sign in to comment.