original_string: protected function getRedirectUrl(array $responseHeaders)
      {
          // Check for the redirect after authentication
          foreach ($responseHeaders as $header) {
              if ( preg_match('/^(Location:|URI:)\s*([^\s]+.*)$/', $header, $matches)
              ) {
                  return trim(array_pop($matches));
              }
          }
          return null;
      }
code: protected function getRedirectUrl(array $responseHeaders)
      {
          // Check for the redirect after authentication
          foreach ($responseHeaders as $header) {
              if ( preg_match('/^(Location:|URI:)\s*([^\s]+.*)$/', $header, $matches)
              ) {
                  return trim(array_pop($matches));
              }
          }
          return null;
      }
code_tokens: protected function getRedirectUrl ( array $ responseHeaders ) { // Check for the redirect after authentication foreach ( $ responseHeaders as $ header ) { if ( preg_match ( '/^(Location:|URI:)\s*([^\s]+.*)$/' , $ header , $ matches ) ) { return trim ( array_pop ( $ matches ) ) ; } } return null ; }
docstring: Answer a redirect URL if a redirect header is found, otherwise null.
  
  @param array $responseHeaders response header to extract a redirect from
  
  @return string or null
docstring_tokens: Answer a redirect URL if a redirect header is found otherwise null .