From 6df59f83823535b9a1fdcb46f516953909c30209 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 19 Mar 2015 16:39:23 +0100 Subject: [PATCH] Update the phpdoc to make it valid Types were missing everywhere in the phpdoc. Signed-off-by: Christophe Coevoet --- src/Api.php | 54 ++++++++++++-------- src/Exceptions/ApiException.php | 2 +- src/Exceptions/InvalidParameterException.php | 2 +- src/Exceptions/NotLoggedException.php | 2 +- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/Api.php b/src/Api.php index 214eae9..5489558 100644 --- a/src/Api.php +++ b/src/Api.php @@ -34,7 +34,7 @@ use GuzzleHttp\Client as GClient; use GuzzleHttp\Stream\Stream; /** - * Wrapper to manage login and exchanges with simpliest Ovh API + * Wrapper to manage login and exchanges with simplest Ovh API * * This class manage how works connections to the simple Ovh API with * login method and call wrapper @@ -93,15 +93,15 @@ class Api /** * Construct a new wrapper instance * - * @param $application_key key of your application. + * @param string $application_key key of your application. * For OVH APIs, you can create a application's credentials on https://api.ovh.com/createApp/ - * @param $application_secret secret of your application. - * @param $api_endpoint name of api selected - * @param $consumer_key If you have already a consumer key, this parameter prevent to do a + * @param string $application_secret secret of your application. + * @param string $api_endpoint name of api selected + * @param string|null $consumer_key If you have already a consumer key, this parameter prevent to do a * new authentication - * @param $http_client instance of http client + * @param GClient|null $http_client instance of http client * - * @throws InvalidParameterException if one parameter is missing or with bad value + * @throws Exceptions\InvalidParameterException if one parameter is missing or with bad value */ public function __construct( $application_key, @@ -157,8 +157,10 @@ class Api * Request a consumer key from the API and the validation link to * authorize user to validate this consumer key * - * @param $accessRules list of rules your application need. - * @param $redirection url to redirect on your website after authentication + * @param array $accessRules list of rules your application need. + * @param string|null $redirection url to redirect on your website after authentication + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ @@ -186,10 +188,12 @@ class Api * This is the main method of this wrapper. It will * sign a given query and return its result. * - * @param $method HTTP method of request (GET,POST,PUT,DELETE) - * @param $path relative url of API request - * @param $content body of the request - * @param $is_authenticated if the request use authentication + * @param string $method HTTP method of request (GET,POST,PUT,DELETE) + * @param string $path relative url of API request + * @param array|\stdClass|null $content body of the request + * @param bool $is_authenticated if the request use authentication + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ @@ -244,8 +248,10 @@ class Api /** * Wrap call to Ovh APIs for GET requests * - * @param $path path ask inside api - * @param $content content to send inside body of request + * @param string $path path ask inside api + * @param array\\stdClass|null $content content to send inside body of request + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ @@ -259,8 +265,10 @@ class Api /** * Wrap call to Ovh APIs for POST requests * - * @param $path path ask inside api - * @param $content content to send inside body of request + * @param string $path path ask inside api + * @param array\\stdClass|null $content content to send inside body of request + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ @@ -274,8 +282,10 @@ class Api /** * Wrap call to Ovh APIs for PUT requests * - * @param $path path ask inside api - * @param $content content to send inside body of request + * @param string $path path ask inside api + * @param array\\stdClass|null $content content to send inside body of request + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ @@ -289,8 +299,10 @@ class Api /** * Wrap call to Ovh APIs for DELETE requests * - * @param $path path ask inside api - * @param $content content to send inside body of request + * @param string $path path ask inside api + * @param array\\stdClass|null $content content to send inside body of request + * + * @return array * * @throws \GuzzleHttp\Exception\ClientException if http request is an error */ diff --git a/src/Exceptions/ApiException.php b/src/Exceptions/ApiException.php index a7c15ee..5b902bc 100644 --- a/src/Exceptions/ApiException.php +++ b/src/Exceptions/ApiException.php @@ -33,7 +33,7 @@ namespace Ovh\Exceptions; use Exception; /** - * ApiException exception is throwed when a request to OVH API failed + * ApiException exception is thrown when a request to OVH API failed * * ApiException appears when the request to OVH API return an error (HTTP * code < 100 or >= 400) diff --git a/src/Exceptions/InvalidParameterException.php b/src/Exceptions/InvalidParameterException.php index f55042d..97f0322 100644 --- a/src/Exceptions/InvalidParameterException.php +++ b/src/Exceptions/InvalidParameterException.php @@ -33,7 +33,7 @@ namespace Ovh\Exceptions; use Exception; /** - * InvalidParameterException exception is throwed when a request failed because of a bad client configuration + * InvalidParameterException exception is thrown when a request failed because of a bad client configuration * * InvalidParameterException appears when the request failed because of a bad parameter from * the client request. diff --git a/src/Exceptions/NotLoggedException.php b/src/Exceptions/NotLoggedException.php index cd05012..f8a2908 100644 --- a/src/Exceptions/NotLoggedException.php +++ b/src/Exceptions/NotLoggedException.php @@ -33,7 +33,7 @@ namespace Ovh\Exceptions; use Exception; /** - * NotLoggedException exception is throwed when there is no credentials defined + * NotLoggedException exception is thrown when there is no credentials defined * * NotLoggedException appears when there is no credentials defined in openstack *