original_string: protected function buildRequest(string $method, string $url, array $options = []): array
      {
          if ($this->forcedAcceptJson) {
              $this->headers['accept'] = 'application/json';
          }
          if (count($this->headers) > 0) {
              if (!array_key_exists(RequestOptions::HEADERS, $options) || !is_array($options[RequestOptions::HEADERS])) {
                  $options[RequestOptions::HEADERS] = [];
              }
              foreach ($this->headers as $headerName => $headerValue) {
                  $options[RequestOptions::HEADERS][$headerName] = $headerValue;
              }
          }
  
          $options = $this->addAuthHeader($options);
  
          return [
              self::OPTION_METHOD => $method,
              self::OPTION_URL => $this->buildUrl($url),
              self::OPTION_OPTIONS => $options
          ];
      }
code: protected function buildRequest(string $method, string $url, array $options = []): array
      {
          if ($this->forcedAcceptJson) {
              $this->headers['accept'] = 'application/json';
          }
          if (count($this->headers) > 0) {
              if (!array_key_exists(RequestOptions::HEADERS, $options) || !is_array($options[RequestOptions::HEADERS])) {
                  $options[RequestOptions::HEADERS] = [];
              }
              foreach ($this->headers as $headerName => $headerValue) {
                  $options[RequestOptions::HEADERS][$headerName] = $headerValue;
              }
          }
  
          $options = $this->addAuthHeader($options);
  
          return [
              self::OPTION_METHOD => $method,
              self::OPTION_URL => $this->buildUrl($url),
              self::OPTION_OPTIONS => $options
          ];
      }
code_tokens: protected function buildRequest ( string $ method , string $ url , array $ options = [ ] ) : array { if ( $ this -> forcedAcceptJson ) { $ this -> headers [ 'accept' ] = 'application/json' ; } if ( count ( $ this -> headers ) > 0 ) { if ( ! array_key_exists ( RequestOptions :: HEADERS , $ options ) || ! is_array ( $ options [ RequestOptions :: HEADERS ] ) ) { $ options [ RequestOptions :: HEADERS ] = [ ] ; } foreach ( $ this -> headers as $ headerName => $ headerValue ) { $ options [ RequestOptions :: HEADERS ] [ $ headerName ] = $ headerValue ; } } $ options = $ this -> addAuthHeader ( $ options ) ; return [ self :: OPTION_METHOD => $ method , self :: OPTION_URL => $ this -> buildUrl ( $ url ) , self :: OPTION_OPTIONS => $ options ] ; }
docstring: Builds the options for the request
  @param $method string
  @param $url string
  @param array $options
  @return array
docstring_tokens: Builds the options for the request