From 9aa7df73bfee5bb776410d1b00f66114729785ad Mon Sep 17 00:00:00 2001 From: Vincent Casse Date: Thu, 17 Dec 2015 18:14:11 +0100 Subject: [PATCH] Fix timeout and guzzle 6 Fix copyrights Signed-off-by: Vincent Casse --- composer.json | 5 ----- src/Api.php | 11 +++++------ src/Exceptions/ApiException.php | 3 +-- src/Exceptions/InvalidParameterException.php | 3 +-- src/Exceptions/NotLoggedException.php | 3 +-- tests/ApiFunctionalTest.php | 4 +--- tests/ApiTest.php | 4 +--- 7 files changed, 10 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index 7ace00a..8edcdb1 100644 --- a/composer.json +++ b/composer.json @@ -5,11 +5,6 @@ "require": { "guzzlehttp/guzzle": "^6.0" }, - "authors": [ - { - "name": "Vincent Cassé" - } - ], "autoload": { "psr-4": {"Ovh\\": "src/"} }, diff --git a/src/Api.php b/src/Api.php index 6b4a5c6..9179113 100644 --- a/src/Api.php +++ b/src/Api.php @@ -1,5 +1,5 @@ - * @author Thierry Goettelmann */ class Api { @@ -144,9 +142,10 @@ class Api } if (!isset($http_client)) { - $http_client = new Client(); - $http_client->setDefaultOption('timeout', 30); - $http_client->setDefaultOption('connect_timeout', 5); + $http_client = new Client([ + 'timeout' => 30, + 'connect_timeout' => 5, + ]); } $this->application_key = $application_key; diff --git a/src/Exceptions/ApiException.php b/src/Exceptions/ApiException.php index 5b902bc..7411528 100644 --- a/src/Exceptions/ApiException.php +++ b/src/Exceptions/ApiException.php @@ -1,5 +1,5 @@ */ class ApiException extends Exception { diff --git a/src/Exceptions/InvalidParameterException.php b/src/Exceptions/InvalidParameterException.php index 97f0322..7b10bdf 100644 --- a/src/Exceptions/InvalidParameterException.php +++ b/src/Exceptions/InvalidParameterException.php @@ -1,5 +1,5 @@ */ class InvalidParameterException extends Exception { diff --git a/src/Exceptions/NotLoggedException.php b/src/Exceptions/NotLoggedException.php index f8a2908..6107a9a 100644 --- a/src/Exceptions/NotLoggedException.php +++ b/src/Exceptions/NotLoggedException.php @@ -1,5 +1,5 @@ */ class NotLoggedException extends Exception { diff --git a/tests/ApiFunctionalTest.php b/tests/ApiFunctionalTest.php index 61ddb02..651dd8c 100644 --- a/tests/ApiFunctionalTest.php +++ b/tests/ApiFunctionalTest.php @@ -1,5 +1,5 @@ - * @author Thierry Goettelmann */ class ApiFunctionalTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 6a4c8da..a1375bc 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -1,5 +1,5 @@ - * @author Thierry Goettelmann */ class ApiTest extends \PHPUnit_Framework_TestCase {