Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/calcinai/xero-php
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Oct 19, 2016
2 parents 86fa973 + d0341f3 commit c93a687
Show file tree
Hide file tree
Showing 126 changed files with 1,637 additions and 1,633 deletions.
4 changes: 4 additions & 0 deletions generator/generate
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ foreach ($scrape_apis as $scrape_api) {
/** @var Model $current_model */
$current_model = null;

if($last = $crawler->filter('.entry-content')->count() === 0){
continue;
}

$last = $crawler->filter('.entry-content')->children()->last();

$crawler->filter('.entry-content')->children()->each(function (Crawler $node) use ($api, &$current_model, $crawler, $last) {
Expand Down
44 changes: 22 additions & 22 deletions src/XeroPHP/Models/Accounting/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
return [
Remote\Request::METHOD_GET,
Remote\Request::METHOD_PUT,
Remote\Request::METHOD_POST,
Remote\Request::METHOD_DELETE
);
];
}

/**
Expand All @@ -242,26 +242,26 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Type' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'BankAccountNumber' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Status' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'Description' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'BankAccountType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'CurrencyCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'EnablePaymentsToAccount' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false),
'ShowInExpenseClaims' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false),
'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Class' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'SystemAccount' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'ReportingCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'ReportingCodeName' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'HasAttachments' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false),
'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false)
);
return [
'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Type' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'BankAccountNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Status' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'Description' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'BankAccountType' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'CurrencyCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'TaxType' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'EnablePaymentsToAccount' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],
'ShowInExpenseClaims' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],
'AccountID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Class' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'SystemAccount' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'ReportingCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'ReportingCodeName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'HasAttachments' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],
'UpdatedDateUTC' => [false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false]
];
}

public static function isPageable()
Expand Down
28 changes: 14 additions & 14 deletions src/XeroPHP/Models/Accounting/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
);
return [
];
}

/**
Expand All @@ -138,18 +138,18 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'AddressType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'AddressLine1' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AddressLine2' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AddressLine3' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AddressLine4' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'City' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Region' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'PostalCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Country' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AttentionTo' => array (false, self::PROPERTY_TYPE_STRING, null, false, false)
);
return [
'AddressType' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'AddressLine1' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AddressLine2' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AddressLine3' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AddressLine4' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'City' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Region' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'PostalCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Country' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AttentionTo' => [false, self::PROPERTY_TYPE_STRING, null, false, false]
];
}

public static function isPageable()
Expand Down
50 changes: 25 additions & 25 deletions src/XeroPHP/Models/Accounting/BankTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
return [
Remote\Request::METHOD_GET,
Remote\Request::METHOD_PUT,
Remote\Request::METHOD_POST
);
];
}

/**
Expand All @@ -221,28 +221,28 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Type' => array (true, self::PROPERTY_TYPE_ENUM, null, false, false),
'Contact' => array (true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Contact', false, false),
'LineItems' => array (true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransaction\\LineItem', true, false),
'BankAccount' => array (true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransaction\\BankAccount', false, false),
'IsReconciled' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false),
'Date' => array (false, self::PROPERTY_TYPE_DATE, '\\DateTimeInterface', false, false),
'Reference' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'CurrencyCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'CurrencyRate' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'Url' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Status' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'LineAmountTypes' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'SubTotal' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'TotalTax' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'Total' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'BankTransactionID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'PrepaymentID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'OverpaymentID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false),
'HasAttachments' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false)
);
return [
'Type' => [true, self::PROPERTY_TYPE_ENUM, null, false, false],
'Contact' => [true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Contact', false, false],
'LineItems' => [true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransaction\\LineItem', true, false],
'BankAccount' => [true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransaction\\BankAccount', false, false],
'IsReconciled' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],
'Date' => [false, self::PROPERTY_TYPE_DATE, '\\DateTimeInterface', false, false],
'Reference' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'CurrencyCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'CurrencyRate' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'Url' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Status' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'LineAmountTypes' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'SubTotal' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'TotalTax' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'Total' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'BankTransactionID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'PrepaymentID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'OverpaymentID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'UpdatedDateUTC' => [false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false],
'HasAttachments' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false]
];
}

public static function isPageable()
Expand Down Expand Up @@ -304,7 +304,7 @@ public function getLineItems()
public function addLineItem(LineItem $value)
{
$this->propertyUpdated('LineItems', $value);
if(!isset($this->_data['LineItems'])){
if (!isset($this->_data['LineItems'])) {
$this->_data['LineItems'] = new Remote\Collection();
}
$this->_data['LineItems'][] = $value;
Expand Down
12 changes: 6 additions & 6 deletions src/XeroPHP/Models/Accounting/BankTransaction/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
);
return [
];
}

/**
Expand All @@ -86,10 +86,10 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false)
);
return [
'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AccountID' => [false, self::PROPERTY_TYPE_STRING, null, false, false]
];
}

public static function isPageable()
Expand Down
28 changes: 14 additions & 14 deletions src/XeroPHP/Models/Accounting/BankTransaction/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
);
return [
];
}

/**
Expand All @@ -136,17 +136,17 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Description' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Quantity' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'UnitAmount' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'AccountCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'ItemCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'LineItemID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false),
'LineAmount' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'Tracking' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\TrackingCategory', true, false)
);
return [
'Description' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Quantity' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'UnitAmount' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'AccountCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'ItemCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'LineItemID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'TaxType' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],
'LineAmount' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'Tracking' => [false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\TrackingCategory', true, false]
];
}

public static function isPageable()
Expand Down Expand Up @@ -322,7 +322,7 @@ public function getTracking()
public function addTracking(TrackingCategory $value)
{
$this->propertyUpdated('Tracking', $value);
if(!isset($this->_data['Tracking'])){
if (!isset($this->_data['Tracking'])) {
$this->_data['Tracking'] = new Remote\Collection();
}
$this->_data['Tracking'][] = $value;
Expand Down
28 changes: 14 additions & 14 deletions src/XeroPHP/Models/Accounting/BankTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
return [
Remote\Request::METHOD_GET,
Remote\Request::METHOD_PUT
);
];
}

/**
Expand All @@ -141,18 +141,18 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'FromBankAccount' => array (true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransfer\\FromBankAccount', false, false),
'ToBankAccount' => array (true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransfer\\ToBankAccount', false, false),
'Amount' => array (true, self::PROPERTY_TYPE_STRING, null, false, false),
'Date' => array (false, self::PROPERTY_TYPE_DATE, '\\DateTimeInterface', false, false),
'BankTransferID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'CurrencyRate' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false),
'FromBankTransactionID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'ToBankTransactionID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'HasAttachments' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false),
'CreatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false)
);
return [
'FromBankAccount' => [true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransfer\\FromBankAccount', false, false],
'ToBankAccount' => [true, self::PROPERTY_TYPE_OBJECT, 'Accounting\\BankTransfer\\ToBankAccount', false, false],
'Amount' => [true, self::PROPERTY_TYPE_STRING, null, false, false],
'Date' => [false, self::PROPERTY_TYPE_DATE, '\\DateTimeInterface', false, false],
'BankTransferID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'CurrencyRate' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],
'FromBankTransactionID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'ToBankTransactionID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'HasAttachments' => [false, self::PROPERTY_TYPE_BOOLEAN, null, false, false],
'CreatedDateUTC' => [false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false]
];
}

public static function isPageable()
Expand Down
14 changes: 7 additions & 7 deletions src/XeroPHP/Models/Accounting/BankTransfer/FromBankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
);
return [
];
}

/**
Expand All @@ -92,11 +92,11 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false)
);
return [
'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AccountID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false]
];
}

public static function isPageable()
Expand Down
14 changes: 7 additions & 7 deletions src/XeroPHP/Models/Accounting/BankTransfer/ToBankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
);
return [
];
}

/**
Expand All @@ -92,11 +92,11 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false)
);
return [
'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'AccountID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false]
];
}

public static function isPageable()
Expand Down
16 changes: 8 additions & 8 deletions src/XeroPHP/Models/Accounting/BrandingTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public static function getAPIStem()
*/
public static function getSupportedMethods()
{
return array(
return [
Remote\Request::METHOD_GET
);
];
}

/**
Expand All @@ -99,12 +99,12 @@ public static function getSupportedMethods()
*/
public static function getProperties()
{
return array(
'BrandingThemeID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false),
'SortOrder' => array (false, self::PROPERTY_TYPE_INT, null, false, false),
'CreatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false)
);
return [
'BrandingThemeID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false],
'SortOrder' => [false, self::PROPERTY_TYPE_INT, null, false, false],
'CreatedDateUTC' => [false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTimeInterface', false, false]
];
}

public static function isPageable()
Expand Down
Loading

0 comments on commit c93a687

Please sign in to comment.