Skip to content

Commit

Permalink
Adds inheritdocs to the constructor classes and changes addOptions pa…
Browse files Browse the repository at this point in the history
…rameter to mixed.
  • Loading branch information
typhonius committed Feb 29, 2020
1 parent e643cec commit a451914
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 54 deletions.
44 changes: 9 additions & 35 deletions src/Connector/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ public static function factory(ConnectorInterface $connector)
}

/**
* Takes parameters passed in, makes a request to the API, and processes the response.
*
* @param string $verb
* @param string $path
* @param array $options
*
* @return mixed|StreamInterface
* @inheritdoc
*/
public function request(string $verb, string $path, array $options = [])
{
Expand All @@ -72,13 +66,7 @@ public function request(string $verb, string $path, array $options = [])
}

/**
* Makes a request to the API.
*
* @param string $verb
* @param string $path
* @param array $options
*
* @return ResponseInterface
* @inheritdoc
*/
public function makeRequest(string $verb, string $path, array $options = [])
{
Expand All @@ -92,11 +80,7 @@ public function makeRequest(string $verb, string $path, array $options = [])
}

/**
* Processes the returned response from the API.
*
* @param ResponseInterface $response
* @return mixed|StreamInterface
* @throws ApiErrorException
* @inheritdoc
*/
public function processResponse(ResponseInterface $response)
{
Expand All @@ -120,57 +104,47 @@ public function processResponse(ResponseInterface $response)
}

/**
* Get query from Client.
*
* @return array
* @inheritdoc
*/
public function getQuery()
{
return $this->query;
}

/**
* Clear query.
* @inheritdoc
*/
public function clearQuery()
{
$this->query = [];
}

/**
* Add a query parameter to filter results.
*
* @param string $name
* @param string|int $value
* @inheritdoc
*/
public function addQuery($name, $value)
{
$this->query = array_merge_recursive($this->query, [$name => $value]);
}

/**
* Get options from Client.
*
* @return array
* @inheritdoc
*/
public function getOptions()
{
return $this->options;
}

/**
* Clear options.
* @inheritdoc
*/
public function clearOptions()
{
$this->options = [];
}

/**
* Add an option to the Guzzle request object.
*
* @param string $name
* @param string|int|array $value
* @inheritdoc
*/
public function addOption($name, $value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Connector/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ClientInterface
{

/**
* Makes a request to the API.
* Takes parameters passed in, makes a request to the API, and processes the response.
*
* @param string $verb
* @param string $path
Expand Down Expand Up @@ -77,8 +77,8 @@ public function clearOptions();
/**
* Add an option to the Guzzle request object.
*
* @param string $name
* @param string|int|array $value
* @param string $name
* @param mixed $value
*/
public function addOption($name, $value);
}
19 changes: 3 additions & 16 deletions src/Connector/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class Connector implements ConnectorInterface
protected $accessToken;

/**
* Connector constructor.
*
* @param array $config
* @inheritdoc
*/
public function __construct(array $config)
{
Expand All @@ -54,12 +52,7 @@ public function __construct(array $config)
}

/**
* Creates an authenticated Request instance.
*
* @param string $verb
* @param string $path
*
* @return RequestInterface
* @inheritdoc
*/
public function createRequest($verb, $path)
{
Expand All @@ -75,13 +68,7 @@ public function createRequest($verb, $path)
}

/**
* Sends the request to the API using Guzzle.
*
* @param string $verb
* @param string $path
* @param array $options
*
* @return ResponseInterface
* @inheritdoc
*/
public function sendRequest($verb, $path, $options)
{
Expand Down

0 comments on commit a451914

Please sign in to comment.