original_string: protected function removeFromControl(Response $response)
      {
          if (!$response->headers->has('Surrogate-Control')) {
              return;
          }
  
          $value = $response->headers->get('Surrogate-Control');
          $upperName = strtoupper($this->getName());
  
          if (sprintf('content="%s/1.0"', $upperName) == $value) {
              $response->headers->remove('Surrogate-Control');
          } elseif (preg_match(sprintf('#,\s*content="%s/1.0"#', $upperName), $value)) {
              $response->headers->set('Surrogate-Control', preg_replace(sprintf('#,\s*content="%s/1.0"#', $upperName), '', $value));
          } elseif (preg_match(sprintf('#content="%s/1.0",\s*#', $upperName), $value)) {
              $response->headers->set('Surrogate-Control', preg_replace(sprintf('#content="%s/1.0",\s*#', $upperName), '', $value));
          }
      }
code: protected function removeFromControl(Response $response)
      {
          if (!$response->headers->has('Surrogate-Control')) {
              return;
          }
  
          $value = $response->headers->get('Surrogate-Control');
          $upperName = strtoupper($this->getName());
  
          if (sprintf('content="%s/1.0"', $upperName) == $value) {
              $response->headers->remove('Surrogate-Control');
          } elseif (preg_match(sprintf('#,\s*content="%s/1.0"#', $upperName), $value)) {
              $response->headers->set('Surrogate-Control', preg_replace(sprintf('#,\s*content="%s/1.0"#', $upperName), '', $value));
          } elseif (preg_match(sprintf('#content="%s/1.0",\s*#', $upperName), $value)) {
              $response->headers->set('Surrogate-Control', preg_replace(sprintf('#content="%s/1.0",\s*#', $upperName), '', $value));
          }
      }
code_tokens: protected function removeFromControl ( Response $ response ) { if ( ! $ response -> headers -> has ( 'Surrogate-Control' ) ) { return ; } $ value = $ response -> headers -> get ( 'Surrogate-Control' ) ; $ upperName = strtoupper ( $ this -> getName ( ) ) ; if ( sprintf ( 'content="%s/1.0"' , $ upperName ) == $ value ) { $ response -> headers -> remove ( 'Surrogate-Control' ) ; } elseif ( preg_match ( sprintf ( '#,\s*content="%s/1.0"#' , $ upperName ) , $ value ) ) { $ response -> headers -> set ( 'Surrogate-Control' , preg_replace ( sprintf ( '#,\s*content="%s/1.0"#' , $ upperName ) , '' , $ value ) ) ; } elseif ( preg_match ( sprintf ( '#content="%s/1.0",\s*#' , $ upperName ) , $ value ) ) { $ response -> headers -> set ( 'Surrogate-Control' , preg_replace ( sprintf ( '#content="%s/1.0",\s*#' , $ upperName ) , '' , $ value ) ) ; } }
docstring: Remove the Surrogate from the Surrogate-Control header.
docstring_tokens: Remove the Surrogate from the Surrogate - Control header .