Exemplo n.º 1
0
 public function testDefaultHandlerCurlMulti()
 {
     if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
         $this->markTestSkipped('Could be tested only on PHP < 5.5.0');
     }
     $builder = ClientBuilder::defaultHandler();
     $this->assertInstanceOf('\\GuzzleHttp\\Ring\\Client\\CurlMultiHandler', $builder);
 }
Exemplo n.º 2
0
 /**
  * @return Client
  */
 public function build()
 {
     $this->validate();
     if (null === $this->logger) {
         $this->logger = new NullLogger();
     }
     if (null === $this->handler) {
         $this->handler = ClientBuilder::defaultHandler();
     }
     $this->handler = Middleware::signRequest($this->handler, $this->clientKey, $this->clientSecret);
     $this->handler = Middleware::processResponse($this->handler, $this->logger);
     if (null === $this->transport) {
         $this->transport = new Transport($this->handler, new RequestBuilder($this->baseUrl));
     }
     return new Client($this->transport);
 }