Commit cb8fc951 authored by catch's avatar catch
Browse files

Issue #3554714 by alexpott, andypost: Add string typehint to...

Issue #3554714 by alexpott, andypost: Add string typehint to \Drupal\Core\Authentication\AuthenticationCollectorInterface::getProvider()

(cherry picked from commit aa5ede4e)
parent 76737efb
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public function isGlobal($provider_id);
   * @return \Drupal\Core\Authentication\AuthenticationProviderInterface|null
   *   The authentication provider which matches the ID.
   */
  public function getProvider($provider_id);
  public function getProvider(string $provider_id);

  /**
   * Returns the sorted array of authentication providers.
+7 −4
Original line number Diff line number Diff line
@@ -46,15 +46,18 @@ public function applies(Request $request) {
   */
  public function authenticate(Request $request) {
    $provider_id = $this->getProvider($request);
    $provider = $this->authCollector->getProvider($provider_id);

    if ($provider) {
      return $provider->authenticate($request);
    if ($provider_id === NULL) {
      return NULL;
    }

    $provider = $this->authCollector->getProvider($provider_id);
    if ($provider === NULL) {
      return NULL;
    }

    return $provider->authenticate($request);
  }

  /**
   * {@inheritdoc}
   */