Exemplo n.º 1
0
 /**
  * @return Client
  */
 public static function getHttpClient()
 {
     if (self::$httpClient) {
         return self::$httpClient;
     }
     $client = new Client(['timeout' => self::$defaultTimeout]);
     return self::$httpClient = $client;
 }
Exemplo n.º 2
0
 /**
  * @return HttpClient
  */
 public static function getHttpClient()
 {
     if (self::$httpClient) {
         return self::$httpClient;
     }
     $client = new HttpClient();
     $client->setDefaultOption('timeout', self::$defaultTimeout);
     return self::$httpClient = $client;
 }