original_string: public function getRedirectLocation($url, $query = [])
      {
          $url = $this->buildUrl($url, $query);
  
          $request = $this->requestFactory->createRequest('GET', $url);
  
          try {
              $response = $this->request($request);
          } catch (ResourceNotFound $e) {
              return;
          }
  
          $locations = $response->getHeader('Location');
  
          return count($locations) ? $locations[0] : null;
      }
code: public function getRedirectLocation($url, $query = [])
      {
          $url = $this->buildUrl($url, $query);
  
          $request = $this->requestFactory->createRequest('GET', $url);
  
          try {
              $response = $this->request($request);
          } catch (ResourceNotFound $e) {
              return;
          }
  
          $locations = $response->getHeader('Location');
  
          return count($locations) ? $locations[0] : null;
      }
code_tokens: public function getRedirectLocation ( $ url , $ query = [ ] ) { $ url = $ this -> buildUrl ( $ url , $ query ) ; $ request = $ this -> requestFactory -> createRequest ( 'GET' , $ url ) ; try { $ response = $ this -> request ( $ request ) ; } catch ( ResourceNotFound $ e ) { return ; } $ locations = $ response -> getHeader ( 'Location' ) ; return count ( $ locations ) ? $ locations [ 0 ] : null ; }
docstring: Get the redirect target location of an URL, or null if not a redirect.
  
  @param string $url
  @param array  $query
  
  @return string|null
docstring_tokens: Get the redirect target location of an URL or null if not a redirect .