public function getAuthenticationUri(?string $state = null, array $options = []): string
    {
        $query = array_merge($options, [
            'response_type' => 'code',
            'client_id' => $this->clientId,
        ]);

        if (!isset($query['redirect_uri'])) {
            $query['redirect_uri'] = $this->redirectUri;
        }

        if (!isset($query['scope']) && null !== $this->scope) {
            $query['scope'] = $this->scope;
        }

        if (isset($query['scope']) && is_array($query['scope'])) {
            $query['scope'] = implode(' ', $query['scope']);
        }

        if (null !== $state) {
            $query['state'] = $state;
        }

        return $this->getAuthEndpoint().'?'.http_build_query($query);
    }
public function getAuthenticationUri(?string $state = null, array $options = []): string
    {
        $query = array_merge($options, [
            'response_type' => 'code',
            'client_id' => $this->clientId,
        ]);

        if (!isset($query['redirect_uri'])) {
            $query['redirect_uri'] = $this->redirectUri;
        }

        if (!isset($query['scope']) && null !== $this->scope) {
            $query['scope'] = $this->scope;
        }

        if (isset($query['scope']) && is_array($query['scope'])) {
            $query['scope'] = implode(' ', $query['scope']);
        }

        if (null !== $state) {
            $query['state'] = $state;
        }

        return $this->getAuthEndpoint().'?'.http_build_query($query);
    }
{@inheritdoc}