protected function make($ctx)
    {
      // ENV or raw args      
      if (!is_object($ctx)) {
        $this->user_id = $ctx['BANDWIDTH_USER_ID'];
        $this->token = $ctx['BANDWIDTH_API_TOKEN'];
        $this->secret = $ctx['BANDWIDTH_API_SECRET'];
        $this->application_id = $ctx->get('BANDWIDTH_APPLICATION_ID');
      } else {
        $this->user_id = $ctx->get('BANDWIDTH_USER_ID');
        $this->token = $ctx->get('BANDWIDTH_API_TOKEN');
        $this->secret = $ctx->get('BANDWIDTH_API_SECRET');
        $this->application_id = $ctx->get('BANDWIDTH_APPLICATION_ID');
      }

      if (!isset($this->user_id)
         ||!isset($this->token)
         ||!isset($this->secret))
              throw new \CatapultApiException("Credentials were improperly configured");

      $this->started = TRUE;

      return (self::$CLIENT = new RESTClient($this->user_id, array($this->token, $this->secret), $this->application_id));
    }
protected function make($ctx)
    {
      // ENV or raw args      
      if (!is_object($ctx)) {
        $this->user_id = $ctx['BANDWIDTH_USER_ID'];
        $this->token = $ctx['BANDWIDTH_API_TOKEN'];
        $this->secret = $ctx['BANDWIDTH_API_SECRET'];
        $this->application_id = $ctx->get('BANDWIDTH_APPLICATION_ID');
      } else {
        $this->user_id = $ctx->get('BANDWIDTH_USER_ID');
        $this->token = $ctx->get('BANDWIDTH_API_TOKEN');
        $this->secret = $ctx->get('BANDWIDTH_API_SECRET');
        $this->application_id = $ctx->get('BANDWIDTH_APPLICATION_ID');
      }

      if (!isset($this->user_id)
         ||!isset($this->token)
         ||!isset($this->secret))
              throw new \CatapultApiException("Credentials were improperly configured");

      $this->started = TRUE;

      return (self::$CLIENT = new RESTClient($this->user_id, array($this->token, $this->secret), $this->application_id));
    }
protected function make ( $ ctx ) { // ENV or raw args       if ( ! is_object ( $ ctx ) ) { $ this -> user_id = $ ctx [ 'BANDWIDTH_USER_ID' ] ; $ this -> token = $ ctx [ 'BANDWIDTH_API_TOKEN' ] ; $ this -> secret = $ ctx [ 'BANDWIDTH_API_SECRET' ] ; $ this -> application_id = $ ctx -> get ( 'BANDWIDTH_APPLICATION_ID' ) ; } else { $ this -> user_id = $ ctx -> get ( 'BANDWIDTH_USER_ID' ) ; $ this -> token = $ ctx -> get ( 'BANDWIDTH_API_TOKEN' ) ; $ this -> secret = $ ctx -> get ( 'BANDWIDTH_API_SECRET' ) ; $ this -> application_id = $ ctx -> get ( 'BANDWIDTH_APPLICATION_ID' ) ; } if ( ! isset ( $ this -> user_id ) || ! isset ( $ this -> token ) || ! isset ( $ this -> secret ) ) throw new \ CatapultApiException ( "Credentials were improperly configured" ) ; $ this -> started = TRUE ; return ( self :: $ CLIENT = new RESTClient ( $ this -> user_id , array ( $ this -> token , $ this -> secret ) , $ this -> application_id ) ) ; }
Makes the client out of either the envorinment,
Credentials object or associative array


@param ctx: Credential | array | Envorinement
Makes the client out of either the envorinment Credentials object or associative array