public static function create(array $options = [], $logger = Client::LOG_NONE)
    {
        $oauth = new Oauth1([
            'token_secret' => '',
            'consumer_key' => $options['consumerKey'],
            'consumer_secret' => $options['consumerSecret']
        ]);

        $stack = HandlerStack::create();
        $stack->push($oauth);

        if (!empty($logger)) {
            $stack->push(
                Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG))
            );
        }

        $client = new \GuzzleHttp\Client([
            'base_uri' => self::$url,
            'handler' => $stack,
            'auth' => 'oauth'
        ]);

        $mapper = new ResultObjectMapper();

        return new self(
            new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)),
            new Validator(Validation::createValidator()),
            $mapper
        );
    }
public static function create(array $options = [], $logger = Client::LOG_NONE)
    {
        $oauth = new Oauth1([
            'token_secret' => '',
            'consumer_key' => $options['consumerKey'],
            'consumer_secret' => $options['consumerSecret']
        ]);

        $stack = HandlerStack::create();
        $stack->push($oauth);

        if (!empty($logger)) {
            $stack->push(
                Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG))
            );
        }

        $client = new \GuzzleHttp\Client([
            'base_uri' => self::$url,
            'handler' => $stack,
            'auth' => 'oauth'
        ]);

        $mapper = new ResultObjectMapper();

        return new self(
            new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)),
            new Validator(Validation::createValidator()),
            $mapper
        );
    }
public static function create ( array $ options = [ ] , $ logger = Client :: LOG_NONE ) { $ oauth = new Oauth1 ( [ 'token_secret' => '' , 'consumer_key' => $ options [ 'consumerKey' ] , 'consumer_secret' => $ options [ 'consumerSecret' ] ] ) ; $ stack = HandlerStack :: create ( ) ; $ stack -> push ( $ oauth ) ; if ( ! empty ( $ logger ) ) { $ stack -> push ( Middleware :: log ( $ logger , new MessageFormatter ( MessageFormatter :: DEBUG ) ) ) ; } $ client = new \ GuzzleHttp \ Client ( [ 'base_uri' => self :: $ url , 'handler' => $ stack , 'auth' => 'oauth' ] ) ; $ mapper = new ResultObjectMapper ( ) ; return new self ( new Guzzle \ ClientAdapter ( $ client , new Guzzle \ ExceptionMapper ( $ mapper ) ) , new Validator ( Validation :: createValidator ( ) ) , $ mapper ) ; }
Public factory method to create instance of Client.

@param array $options Available properties: [
'consumerKey' => 'foo',
'consumerSecret' => 'bar',
]
@param LoggerInterface $logger Logs messages.
@return self
Public factory method to create instance of Client .