Can't use exit(0), how else can I terminate a response? Here's my code(using Drupal 8):

public function checkForRedirection(GetResponseEvent $event) {
    $is_authenticated = $this-&gt;currentUser-&gt;isAuthenticated();
    $route_name = $this-&gt;routeMatch-&gt;getRouteName();

    if (!$is_authenticated &amp;&amp; $route_name !== "user.login") {
      header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
      header("Cache-Control: post-check=0, pre-check=0", FALSE);
      header("Pragma: no-cache");
      define("SITE", "www.google.com");
      $response = new RedirectResponse(SITE, $this-&gt;redirectCode);
      $response-&gt;send();
      $exit(0);
    }
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = ["checkForRedirection", 30];
    return $events;
  }


So I'm redirecting an authenticated user away from my site. It works perfectly how I want it to, the only problem is PHP Mess Detector doesn't allow the exit(0) function, so wondering what are my alternatives to produce same functionality that exit(0) does here?
You need to terminate using the kernel. You'll have to generate $currentRequest and $response, which may already be available depending on where your code lies. After you have them, you can terminate the request using:

\Drupal::service('kernel')-&gt;terminate($currentRequest, $response);