original_string: public function createResponses($headers, $content)
      {
          $indexes = $responses = [];
          foreach ($headers as $i => $header) {
              if (strtoupper(substr($header, 0, 5)) === 'HTTP/') {
                  $indexes[] = $i;
              }
          }
          $last = count($indexes) - 1;
          foreach ($indexes as $i => $start) {
              $end = isset($indexes[$i + 1]) ? $indexes[$i + 1] - $start : null;
              $headerSlice = array_slice($headers, $start, $end);
              $body = $i == $last ? $content : '';
              $responses[] = $this->_buildResponse($headerSlice, $body);
          }
  
          return $responses;
      }
code: public function createResponses($headers, $content)
      {
          $indexes = $responses = [];
          foreach ($headers as $i => $header) {
              if (strtoupper(substr($header, 0, 5)) === 'HTTP/') {
                  $indexes[] = $i;
              }
          }
          $last = count($indexes) - 1;
          foreach ($indexes as $i => $start) {
              $end = isset($indexes[$i + 1]) ? $indexes[$i + 1] - $start : null;
              $headerSlice = array_slice($headers, $start, $end);
              $body = $i == $last ? $content : '';
              $responses[] = $this->_buildResponse($headerSlice, $body);
          }
  
          return $responses;
      }
code_tokens: public function createResponses ( $ headers , $ content ) { $ indexes = $ responses = [ ] ; foreach ( $ headers as $ i => $ header ) { if ( strtoupper ( substr ( $ header , 0 , 5 ) ) === 'HTTP/' ) { $ indexes [ ] = $ i ; } } $ last = count ( $ indexes ) - 1 ; foreach ( $ indexes as $ i => $ start ) { $ end = isset ( $ indexes [ $ i + 1 ] ) ? $ indexes [ $ i + 1 ] - $ start : null ; $ headerSlice = array_slice ( $ headers , $ start , $ end ) ; $ body = $ i == $ last ? $ content : '' ; $ responses [ ] = $ this -> _buildResponse ( $ headerSlice , $ body ) ; } return $ responses ; }
docstring: Create the response list based on the headers & content
  
  Creates one or many response objects based on the number
  of redirects that occurred.
  
  @param array $headers The list of headers from the request(s)
  @param string $content The response content.
  @return \Cake\Http\Client\Response[] The list of responses from the request(s)
docstring_tokens: Create the response list based on the headers & content