From ce759abba3e98d5d8f6bcaa4131a79519cc7ddc3 Mon Sep 17 00:00:00 2001 From: Jack Wohlfert Date: Wed, 7 Apr 2021 16:28:55 -0400 Subject: [PATCH 1/2] Support PHP 8 --- src/Client.php | 2 +- src/Methods.php | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Client.php b/src/Client.php index ed4774c..b018e05 100644 --- a/src/Client.php +++ b/src/Client.php @@ -54,7 +54,7 @@ class AvaTaxClientBase * * @throws \Exception */ - public function __construct($appName, $appVersion, $machineName="", $environment, $guzzleParams = []) + public function __construct($appName, $appVersion, $machineName="", $environment=null, $guzzleParams = []) { // app name and app version are mandatory fields. if ($appName == "" || $appName == null || $appVersion == "" || $appVersion == null) { diff --git a/src/Methods.php b/src/Methods.php index 070d173..670aad4 100644 --- a/src/Methods.php +++ b/src/Methods.php @@ -4192,7 +4192,7 @@ public function listPreferredPrograms($filter=null, $top=null, $skip=null, $orde * @param string $countryCode If not null, return all records with this code. * @return FetchResult */ - public function listProductClassificationSystems($filter=null, $top=null, $skip=null, $orderBy=null, $countryCode) { + public function listProductClassificationSystems($filter=null, $top=null, $skip=null, $orderBy=null, $countryCode=null) { $path = "/api/v2/definitions/productclassificationsystems"; $guzzleParams = [ 'query' => ['$filter' => $filter, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy, '$countryCode' => $countryCode], @@ -4218,7 +4218,7 @@ public function listProductClassificationSystems($filter=null, $top=null, $skip= * @param string $countryCode If not null, return all records with this code. * @return FetchResult */ - public function listProductClassificationSystemsByCompany($companyCode, $filter=null, $top=null, $skip=null, $orderBy=null, $countryCode) { + public function listProductClassificationSystemsByCompany($companyCode, $filter=null, $top=null, $skip=null, $orderBy=null, $countryCode=null) { $path = "/api/v2/definitions/productclassificationsystems/bycompany/{$companyCode}"; $guzzleParams = [ 'query' => ['$filter' => $filter, '$top' => $top, '$skip' => $skip, '$orderBy' => $orderBy, '$countryCode' => $countryCode], @@ -6383,7 +6383,7 @@ public function validateLocation($companyId, $id) { * @param AdjustMultiDocumentModel $model The adjust request you wish to execute * @return MultiDocumentModel */ - public function adjustMultiDocumentTransaction($code, $type, $include=null, $model) { + public function adjustMultiDocumentTransaction($code, $type, $include=null, $model=null) { $path = "/api/v2/transactions/multidocument/{$code}/type/{$type}/adjust"; $guzzleParams = [ 'query' => ['include' => $include], @@ -6529,7 +6529,7 @@ public function commitMultiDocumentTransaction($model) { * @param CreateMultiDocumentModel $model the multi document transaction model * @return MultiDocumentModel */ - public function createMultiDocumentTransaction($include=null, $model) { + public function createMultiDocumentTransaction($include=null, $model=null) { $path = "/api/v2/transactions/multidocument"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -6747,7 +6747,7 @@ public function listMultiDocumentTransactions($filter=null, $include=null, $top= * @param RefundTransactionModel $model Information about the refund to create * @return MultiDocumentModel */ - public function refundMultiDocumentTransaction($code, $type, $include=null, $model) { + public function refundMultiDocumentTransaction($code, $type, $include=null, $model=null) { $path = "/api/v2/transactions/multidocument/{$code}/type/{$type}/refund"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -8870,7 +8870,7 @@ public function updateTaxRule($companyId, $id, $model) { * @param AddTransactionLineModel $model information about the transaction and lines to be added * @return TransactionModel */ - public function addLines($include=null, $model) { + public function addLines($include=null, $model=null) { $path = "/api/v2/companies/transactions/lines/add"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -8925,7 +8925,7 @@ public function addLines($include=null, $model) { * @param AdjustTransactionModel $model The adjustment you wish to make * @return TransactionModel */ - public function adjustTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function adjustTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/adjust"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9102,7 +9102,7 @@ public function bulkLockTransaction($model) { * @param ChangeTransactionCodeModel $model The code change request you wish to execute * @return TransactionModel */ - public function changeTransactionCode($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function changeTransactionCode($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/changecode"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9155,7 +9155,7 @@ public function changeTransactionCode($companyCode, $transactionCode, $documentT * @param CommitTransactionModel $model The commit request you wish to execute * @return TransactionModel */ - public function commitTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function commitTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/commit"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9211,7 +9211,7 @@ public function commitTransaction($companyCode, $transactionCode, $documentType, * @param CreateOrAdjustTransactionModel $model The transaction you wish to create or adjust * @return TransactionModel */ - public function createOrAdjustTransaction($include=null, $model) { + public function createOrAdjustTransaction($include=null, $model=null) { $path = "/api/v2/transactions/createoradjust"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -9274,7 +9274,7 @@ public function createOrAdjustTransaction($include=null, $model) { * @param CreateTransactionModel $model The transaction you wish to create * @return TransactionModel */ - public function createTransaction($include=null, $model) { + public function createTransaction($include=null, $model=null) { $path = "/api/v2/transactions/create"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -9314,7 +9314,7 @@ public function createTransaction($include=null, $model) { * @param RemoveTransactionLineModel $model information about the transaction and lines to be removed * @return TransactionModel */ - public function deleteLines($include=null, $model) { + public function deleteLines($include=null, $model=null) { $path = "/api/v2/companies/transactions/lines/delete"; $guzzleParams = [ 'query' => ['$include' => $include], @@ -9551,7 +9551,7 @@ public function listTransactionsByCompany($companyCode, $dataSourceId, $include= * @param LockTransactionModel $model The lock request you wish to execute * @return TransactionModel */ - public function lockTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function lockTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/lock"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9617,7 +9617,7 @@ public function lockTransaction($companyCode, $transactionCode, $documentType, $ * @param RefundTransactionModel $model Information about the refund to create * @return TransactionModel */ - public function refundTransaction($companyCode, $transactionCode, $include=null, $documentType, $useTaxDateOverride, $model) { + public function refundTransaction($companyCode, $transactionCode, $include=null, $documentType=null, $useTaxDateOverride=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/refund"; $guzzleParams = [ 'query' => ['$include' => $include, 'documentType' => $documentType, 'useTaxDateOverride' => $useTaxDateOverride], @@ -9670,7 +9670,7 @@ public function refundTransaction($companyCode, $transactionCode, $include=null, * @param SettleTransactionModel $model The data from an external system to reconcile against AvaTax * @return TransactionModel */ - public function settleTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function settleTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/settle"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9813,7 +9813,7 @@ public function unvoidTransaction($companyCode, $transactionCode, $documentType, * @param VerifyTransactionModel $model The data from an external system to reconcile against AvaTax * @return TransactionModel */ - public function verifyTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function verifyTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/verify"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], @@ -9867,7 +9867,7 @@ public function verifyTransaction($companyCode, $transactionCode, $documentType, * @param VoidTransactionModel $model The void request you wish to execute. To void a transaction the code must be set to 'DocVoided' * @return TransactionModel */ - public function voidTransaction($companyCode, $transactionCode, $documentType, $include=null, $model) { + public function voidTransaction($companyCode, $transactionCode, $documentType, $include=null, $model=null) { $path = "/api/v2/companies/{$companyCode}/transactions/{$transactionCode}/void"; $guzzleParams = [ 'query' => ['documentType' => $documentType, '$include' => $include], From c01103491de325531b62051b690a03054475497e Mon Sep 17 00:00:00 2001 From: Jack Wohlfert Date: Wed, 7 Apr 2021 16:30:39 -0400 Subject: [PATCH 2/2] Allow guzzle 7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2ffc646..f31a5a3 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "type": "library", "require": { "php": ">=5.5.9", - "guzzlehttp/guzzle": "~6" + "guzzlehttp/guzzle": "~6|~7" }, "require-dev": { "phpunit/phpunit": "5.7"