original_string: public function build()
      {
          $response = $this->_response;
          if (empty($this->_origin)) {
              return $response;
          }
  
          if (isset($this->_headers['Access-Control-Allow-Origin'])) {
              foreach ($this->_headers as $key => $value) {
                  $response = $response->withHeader($key, $value);
              }
          }
  
          return $response;
      }
code: public function build()
      {
          $response = $this->_response;
          if (empty($this->_origin)) {
              return $response;
          }
  
          if (isset($this->_headers['Access-Control-Allow-Origin'])) {
              foreach ($this->_headers as $key => $value) {
                  $response = $response->withHeader($key, $value);
              }
          }
  
          return $response;
      }
code_tokens: public function build ( ) { $ response = $ this -> _response ; if ( empty ( $ this -> _origin ) ) { return $ response ; } if ( isset ( $ this -> _headers [ 'Access-Control-Allow-Origin' ] ) ) { foreach ( $ this -> _headers as $ key => $ value ) { $ response = $ response -> withHeader ( $ key , $ value ) ; } } return $ response ; }
docstring: Apply the queued headers to the response.
  
  If the builder has no Origin, or if there are no allowed domains,
  or if the allowed domains do not match the Origin header no headers will be applied.
  
  @return \Psr\Http\Message\MessageInterface A new instance of the response with new headers.
docstring_tokens: Apply the queued headers to the response .