protected function _parseApiParams($params)
  {
    $apiparams = [];
    if (count($params) === 0) {
      return $apiparams;
    }

    if (is_array($params[0])) {
      // given parameters are array
      $apiparams = $params[0];
      return $apiparams;
    }

    // user gave us query-style params
    parse_str($params[0], $apiparams);
    if (! is_array($apiparams)) {
      $apiparams = [];
    }

    return $apiparams;
  }
protected function _parseApiParams($params)
  {
    $apiparams = [];
    if (count($params) === 0) {
      return $apiparams;
    }

    if (is_array($params[0])) {
      // given parameters are array
      $apiparams = $params[0];
      return $apiparams;
    }

    // user gave us query-style params
    parse_str($params[0], $apiparams);
    if (! is_array($apiparams)) {
      $apiparams = [];
    }

    return $apiparams;
  }
protected function _parseApiParams ( $ params ) { $ apiparams = [ ] ; if ( count ( $ params ) === 0 ) { return $ apiparams ; } if ( is_array ( $ params [ 0 ] ) ) { // given parameters are array $ apiparams = $ params [ 0 ] ; return $ apiparams ; } // user gave us query-style params parse_str ( $ params [ 0 ] , $ apiparams ) ; if ( ! is_array ( $ apiparams ) ) { $ apiparams = [ ] ; } return $ apiparams ; }
Parse given params, detect query-style params

@param array|string $params Parameters to parse

@return array $apiparams
Parse given params detect query - style params