original_string: public function onKernelResponse(FilterResponseEvent $event)
      {
          if (!$event->isMasterRequest()) {
              return;
          }
  
          if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
              $this->sendHeaders = false;
              $this->headers = [];
  
              return;
          }
  
          $this->response = $event->getResponse();
          foreach ($this->headers as $header => $content) {
              $this->response->headers->set($header, $content);
          }
          $this->headers = [];
      }
code: public function onKernelResponse(FilterResponseEvent $event)
      {
          if (!$event->isMasterRequest()) {
              return;
          }
  
          if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
              $this->sendHeaders = false;
              $this->headers = [];
  
              return;
          }
  
          $this->response = $event->getResponse();
          foreach ($this->headers as $header => $content) {
              $this->response->headers->set($header, $content);
          }
          $this->headers = [];
      }
code_tokens: public function onKernelResponse ( FilterResponseEvent $ event ) { if ( ! $ event -> isMasterRequest ( ) ) { return ; } if ( ! preg_match ( static :: USER_AGENT_REGEX , $ event -> getRequest ( ) -> headers -> get ( 'User-Agent' ) ) ) { $ this -> sendHeaders = false ; $ this -> headers = [ ] ; return ; } $ this -> response = $ event -> getResponse ( ) ; foreach ( $ this -> headers as $ header => $ content ) { $ this -> response -> headers -> set ( $ header , $ content ) ; } $ this -> headers = [ ] ; }
docstring: Adds the headers to the response once it's created.
docstring_tokens: Adds the headers to the response once it s created .