Skip to content
Snippets Groups Projects

Issue #3289235: Automated Drupal 10 compatibility fixes

4 files
+ 17
13
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -2,13 +2,13 @@
namespace Drupal\rate_limits\EventSubscriber;
use Drupal\Core\Routing\RouteObjectInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Flood\FloodInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouterInterface;
@@ -60,7 +60,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
/**
* Check the limits on the request.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event.
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
@@ -68,7 +68,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
* @throws \Exception
* When the flood table does not exist.
*/
public function onRequest(GetResponseEvent $event) {
public function onRequest(RequestEvent $event) {
$request = $event->getRequest();
try {
$route_data = $this->router->matchRequest($request);
@@ -157,7 +157,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
* The event name.
* @param array $flood_config
* The configuration with the limits.
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event.
*
* @return bool
@@ -166,7 +166,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
* @throws \Exception
* When the flood table is not created.
*/
protected function checkIp($event_name, $flood_config, GetResponseEvent $event) {
protected function checkIp($event_name, $flood_config, RequestEvent $event) {
$allowed = $this->flood->isAllowed(
$event_name,
$flood_config['ip_limit'],
@@ -189,7 +189,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
* The event name.
* @param array $flood_config
* The configuration with the limits.
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event.
*
* @return bool
@@ -198,7 +198,7 @@ class RequestSubscriberCheckLimits implements EventSubscriberInterface {
* @throws \Exception
* When the flood table is not created.
*/
protected function checkUser($event_name, $flood_config, GetResponseEvent $event) {
protected function checkUser($event_name, $flood_config, RequestEvent $event) {
if ($this->currentUser->isAnonymous()) {
// The user check does not apply to anonymous.
return TRUE;
Loading