Skip to content

Commit

Permalink
add phpdoc to public properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared King committed May 25, 2020
1 parent defa9e0 commit 2bd2fea
Showing 1 changed file with 43 additions and 11 deletions.
54 changes: 43 additions & 11 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,53 @@ class Client
const CONNECT_TIMEOUT = 30;
const READ_TIMEOUT = 60;

/** @deprecated */
/**
* @deprecated
*
* @var CatalogItem
*/
public $CatalogItem;

/** @var Coupon */
public $Coupon;

/** @var CreditNote */
public $CreditNote;

/** @var Customer */
public $Customer;

/** @var Estimate */
public $Estimate;

/** @var Event */
public $Event;

/** @var File */
public $File;

/** @var Invoice */
public $Invoice;

/** @var Item */
public $Item;

/** @var Note */
public $Note;

/** @var Plan */
public $Plan;

/** @var Subscription */
public $Subscription;

/** @var Task */
public $Task;

/** @var TaxRate */
public $TaxRate;

/** @var Transaction */
public $Transaction;

/**
Expand Down Expand Up @@ -84,7 +116,7 @@ public function __construct($apiKey, $sandbox = false, $ssoKey = false, $handler

$this->client = new GuzzleClient([
'base_uri' => $this->endpoint(),
'handler' => $handlerStack,
'handler' => $handlerStack,
]);

// object endpoints
Expand Down Expand Up @@ -142,13 +174,13 @@ public function request($method, $endpoint, array $params = [], array $opts = []
$method = strtolower($method);

$request = [
'auth' => [$this->apiKey, ''],
'headers' => $this->buildHeaders($opts),
'query' => [],
'http_errors' => false,
'verify' => $this->caBundleFile,
'auth' => [$this->apiKey, ''],
'headers' => $this->buildHeaders($opts),
'query' => [],
'http_errors' => false,
'verify' => $this->caBundleFile,
'connect_timeout' => self::CONNECT_TIMEOUT,
'read_timeout' => self::READ_TIMEOUT,
'read_timeout' => self::READ_TIMEOUT,
];

// these methods have no request body
Expand Down Expand Up @@ -187,9 +219,9 @@ public function request($method, $endpoint, array $params = [], array $opts = []
}

return [
'code' => $code,
'code' => $code,
'headers' => $parsedHeaders,
'body' => $parsed,
'body' => $parsed,
];
} else {
$error = json_decode($body, true);
Expand Down Expand Up @@ -223,7 +255,7 @@ private function buildHeaders(array $opts)
{
$headers = [
'Content-Type' => 'application/json',
'User-Agent' => 'Invoiced PHP/'.self::VERSION,
'User-Agent' => 'Invoiced PHP/'.self::VERSION,
];

if (isset($opts['idempotency_key']) && $opts['idempotency_key']) {
Expand Down

0 comments on commit 2bd2fea

Please sign in to comment.