private function getUserId()
    {
        if (!$this->tokenProvider || null === ($token = $this->tokenProvider->getToken())) {
            return;
        }

        if (!$token->getUser() instanceof UserInterface) {
            return;
        }

        return $token->getUser()->getId();
    }