function RestAuthenticationController::__construct

Same name and namespace in other branches
  1. main core/modules/rest/src/Controller/RestAuthenticationController.php \Drupal\rest\Controller\RestAuthenticationController::__construct()

Parameters

\Drupal\user\UserFloodControlInterface $userFloodControl: The user flood control service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Access\CsrfTokenGenerator $csrfToken: The CSRF token generator.

\Drupal\user\UserAuthenticationInterface|\Drupal\user\UserAuthInterface $userAuth: The user authentication.

\Drupal\Core\Routing\RouteProviderInterface $routeProvider: The route provider.

\Symfony\Component\Serializer\Serializer $serializer: The serializer.

array $serializerFormats: The available serialization formats.

\Psr\Log\LoggerInterface $logger: A logger instance.

File

core/modules/rest/src/Controller/RestAuthenticationController.php, line 59

Class

RestAuthenticationController
Provides controllers for login, login status and logout via HTTP requests.

Namespace

Drupal\rest\Controller

Code

public function __construct(protected UserFloodControlInterface $userFloodControl, EntityTypeManagerInterface $entity_type_manager, protected CsrfTokenGenerator $csrfToken, protected UserAuthenticationInterface|UserAuthInterface $userAuth, protected RouteProviderInterface $routeProvider, protected Serializer $serializer, protected array $serializerFormats, protected LoggerInterface $logger) {
  $this->entityTypeManager = $entity_type_manager;
  if (!$userAuth instanceof UserAuthenticationInterface) {
    @trigger_error('The $userAuth parameter implementing UserAuthInterface is deprecated in drupal:10.3.0 and will be removed in drupal:12.0.0. Implement UserAuthenticationInterface instead. See https://www.drupal.org/node/3411040');
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.