Find a Rector rule

Find the best Rector rule to solve your problem. Searching through 1085 rules.

Found 1 rule. That's the one: Clear

symfony/rate-limiter 1 match

Change removed autowired RateLimiterFactory to RateLimiterFactoryInterface, if only create() is called on it

-use Symfony\Component\RateLimiter\RateLimiterFactory;
+use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;

 final class SomeService
 {
     public function __construct(
-        private RateLimiterFactory $anonymousApiLimiter
+        private RateLimiterFactoryInterface $anonymousApiLimiter
     ) {
     }

     public function run(string $ip): void
     {
         $this->anonymousApiLimiter->create($ip)->consume();
     }
 }