Skip to content

Commit

Permalink
Changes for v2.0.4 (#132)
Browse files Browse the repository at this point in the history
* Add Accept-Encoding gzip,deflate to RequestHandler #131
* Test PHP v7.2 #130 
* Declare arrays to remove warning on non-countable types in PHP 7.2 - http://php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types
* Add ext-mbstring requirement to composer.json
* Bump User-Agent to 2.0.4
  • Loading branch information
jimmymcpeter authored Feb 6, 2018
1 parent 496a9cb commit 4b46fbe
Show file tree
Hide file tree
Showing 31 changed files with 44 additions and 49 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 7.0
- 7.1
- 7.2

before_script:
- composer self-update
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"require": {
"php": ">=7.0",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2.3",
"ramsey/uuid": "^3.6.1",
"psr/log": "~1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class AbstractApAdjustment extends AbstractFunction
protected $adjustmentNumber;

/** @var AbstractApAdjustmentLine[] */
protected $lines;
protected $lines = [];

/**
* Get record number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ abstract class AbstractApPaymentRequest extends AbstractFunction
protected $notificationContactName;

/** @var ApPaymentRequestItem[] */
protected $applyToTransactions;
protected $applyToTransactions = [];

/**
* Get record number
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/AccountsPayable/AbstractBill.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ abstract class AbstractBill extends AbstractFunction
protected $attachmentsId;

/** @var AbstractBillLine[] */
protected $lines;
protected $lines = [];

/**
* Get record number
Expand Down
4 changes: 2 additions & 2 deletions src/Intacct/Functions/AccountsPayable/AbstractVendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ abstract class AbstractVendor extends AbstractFunction
protected $restrictionType;

/** @var array */
protected $restrictedLocations;
protected $restrictedLocations = [];

/** @var array */
protected $restrictedDepartments;
protected $restrictedDepartments = [];

/**
* Get vendor ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ abstract class AbstractArAdjustment extends AbstractFunction
protected $adjustmentNumber;

/** @var AbstractArAdjustmentLine[] */
protected $lines;
protected $lines = [];

/**
* Get record number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ abstract class AbstractArPayment extends AbstractFunction
protected $referenceNumber;

/** @var ArPaymentItem[] */
protected $applyToTransactions;
protected $applyToTransactions = [];

/**
* Get record number
Expand Down
4 changes: 2 additions & 2 deletions src/Intacct/Functions/AccountsReceivable/AbstractCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ abstract class AbstractCustomer extends AbstractFunction
protected $restrictionType;

/** @var array */
protected $restrictedLocations;
protected $restrictedLocations = [];

/** @var array */
protected $restrictedDepartments;
protected $restrictedDepartments = [];

/**
* Get customer ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ abstract class AbstractInvoice extends AbstractFunction
protected $attachmentsId;

/** @var AbstractInvoiceLine[] */
protected $lines;
protected $lines = [];

/**
* Get record number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract class AbstractChargeCardTransaction extends AbstractFunction
protected $exchangeRateType;

/** @var AbstractChargeCardTransactionLine[] */
protected $lines;
protected $lines = [];

/**
* Get record number
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/CashManagement/AbstractDeposit.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract class AbstractDeposit extends AbstractFunction
protected $attachmentsId;

/** @var int[] */
protected $transactionsKeysToDeposit;
protected $transactionsKeysToDeposit = [];

/**
* Get bank account ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class AbstractOtherReceipt extends AbstractFunction
protected $exchangeRateType;

/** @var AbstractOtherReceiptLine[] */
protected $lines;
protected $lines = [];

/**
* Get receipt date
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/Company/AbstractAllocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class AbstractAllocation extends AbstractFunction
private $active;

/** @var AbstractAllocationLine[] */
private $lines;
private $lines = [];

/**
* Get allocation ID
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/Company/AbstractAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class AbstractAttachments extends AbstractFunction
protected $description;

/** @var AttachmentInterface[] */
protected $files;
protected $files = [];

/**
* Get attachments ID
Expand Down
24 changes: 8 additions & 16 deletions src/Intacct/Functions/Company/AbstractUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ abstract class AbstractUser extends AbstractFunction
/** @var bool */
protected $webServicesOnly;

/** @var array */
protected $restrictedEntities;
/** @var string[] */
protected $restrictedEntities = [];

/** @var array */
protected $restrictedDepartments;
/** @var string[] */
protected $restrictedDepartments = [];

/** @var bool */
protected $ssoEnabled;
Expand Down Expand Up @@ -171,39 +171,31 @@ public function setWebServicesOnly($webServicesOnly)
}

/**
* Get restricted entities
*
* @return array
* @return string[]
*/
public function getRestrictedEntities()
{
return $this->restrictedEntities;
}

/**
* Set restricted entities
*
* @param array $restrictedEntities
* @param string[] $restrictedEntities
*/
public function setRestrictedEntities($restrictedEntities)
{
$this->restrictedEntities = $restrictedEntities;
}

/**
* Get restricted departments
*
* @return array
* @return string[]
*/
public function getRestrictedDepartments()
{
return $this->restrictedDepartments;
}

/**
* Set restricted departments
*
* @param array $restrictedDepartments
* @param string[] $restrictedDepartments
*/
public function setRestrictedDepartments($restrictedDepartments)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ abstract class AbstractExpenseAdjustment extends AbstractFunction
protected $memo;

/** @var AbstractExpenseAdjustmentLine[] */
protected $lines;
protected $lines = [];

/**
* @return int|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class AbstractExpenseReport extends AbstractFunction
protected $memo;

/** @var AbstractExpenseReportLine[] */
protected $lines;
protected $lines = [];

/**
* @return int|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ abstract class AbstractReimbursementRequest extends AbstractFunction
protected $notificationContactName;

/** @var ReimbursementRequestItem[] */
protected $applyToTransactions;
protected $applyToTransactions = [];

/**
* @return int|string
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/GeneralLedger/AbstractGlBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class AbstractGlBatch extends AbstractFunction
protected $action;

/** @var AbstractGlEntry[] */
protected $lines;
protected $lines = [];

/**
* @return int|string
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/GeneralLedger/AbstractGlEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class AbstractGlEntry
protected $warehouseId;

/** @var CustomAllocationSplit[] */
protected $customAllocationSplits;
protected $customAllocationSplits = [];

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class AbstractConsolidation extends AbstractFunction
protected $reportingPeriodName;

/** @var ConsolidationEntity[] */
protected $entities;
protected $entities = [];

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ abstract class AbstractInventoryTransaction extends AbstractFunction
protected $state;

/** @var AbstractTransactionSubtotal[] */
protected $subtotals;
protected $subtotals = [];

/** @var AbstractInventoryTransactionLine[] */
protected $lines;
protected $lines = [];

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class AbstractInventoryTransactionLine
protected $cost;

/** @var AbstractTransactionItemDetail[] */
protected $itemDetails;
protected $itemDetails = [];

/** @var string */
protected $departmentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ abstract class AbstractOrderEntryTransaction extends AbstractFunction
protected $projectId;

/** @var AbstractTransactionSubtotal[] */
protected $subtotals;
protected $subtotals = [];

/** @var AbstractOrderEntryTransactionLine[] */
protected $lines;
protected $lines = [];

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ abstract class AbstractOrderEntryTransactionLine
protected $billingTemplate;

/** @var AbstractTransactionItemDetail[] */
protected $itemDetails;
protected $itemDetails = [];

/** @var string */
protected $departmentId;
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Functions/Projects/AbstractTimesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class AbstractTimesheet extends AbstractFunction
protected $action;

/** @var AbstractTimesheetEntry[] */
protected $entries;
protected $entries = [];

/**
* @return int|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ abstract class AbstractPurchasingTransaction extends AbstractFunction
protected $projectId;

/** @var AbstractTransactionSubtotal[] */
protected $subtotals;
protected $subtotals = [];

/** @var AbstractPurchasingTransactionLine[] */
protected $lines;
protected $lines = [];

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class AbstractPurchasingTransactionLine
protected $billable;

/** @var AbstractTransactionItemDetail[] */
protected $itemDetails;
protected $itemDetails = [];

/** @var string */
protected $departmentId;
Expand Down
2 changes: 1 addition & 1 deletion src/Intacct/Xml/Request/OperationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function setAuthentication(AuthenticationInterface $authentication)
}

/** @var FunctionInterface[] */
private $content;
private $content = [];

/**
* @return FunctionInterface[]
Expand Down
3 changes: 2 additions & 1 deletion src/Intacct/Xml/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RequestHandler
{

/** @var string */
const VERSION = '2.0';
const VERSION = '2.0.4';

/** @var ClientConfig */
private $clientConfig;
Expand Down Expand Up @@ -251,6 +251,7 @@ private function execute(\XMLWriter $xml): ResponseInterface
'body' => $xml->flush(),
'headers' => [
'content-type' => 'application/xml',
'Accept-Encoding' => 'gzip,deflate',
'User-Agent' => "intacct-sdk-php-client/" . static::VERSION,
],
'timeout' => $this->requestConfig->getMaxTimeout()
Expand Down

0 comments on commit 4b46fbe

Please sign in to comment.