Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct @property syntax for all models (fixes #926) #927

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 20 additions & 110 deletions src/XeroPHP/Models/Accounting/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,120 +5,30 @@
use XeroPHP\Remote;
use XeroPHP\Traits\AttachmentTrait;

/**
* @property string $Code Customer defined alpha numeric account code e.g 200 or SALES (max length = 10).
* @property string $Name Name of account (max length = 150).
* @property string $Type See Account Types.
* @property string $BankAccountNumber For bank accounts only (Account Type BANK).
* @property string $Status Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes.
* @property string $Description Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000).
* @property string $BankAccountType For bank accounts only. See Bank Account types.
* @property string $CurrencyCode For bank accounts only.
* @property string $TaxType See Tax Types.
* @property bool $EnablePaymentsToAccount Boolean – describes whether account can have payments applied to it.
* @property bool $ShowInExpenseClaims Boolean – describes whether account code is available for use with expense claims.
* @property string $AccountID The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9.
* @property string $Class See Account Class Types.
* @property string $SystemAccount If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null.
* @property string $ReportingCode Shown if set.
* @property string $ReportingCodeName Shown if set.
* @property bool $HasAttachments boolean to indicate if an account has an attachment (read only).
* @property \DateTimeInterface $UpdatedDateUTC Last modified date UTC format.
*/
class Account extends Remote\Model
{
use AttachmentTrait;

/**
* Customer defined alpha numeric account code e.g 200 or SALES (max length = 10).
*
* @property string Code
*/

/**
* Name of account (max length = 150).
*
* @property string Name
*/

/**
* See Account Types.
*
* @property string Type
*/

/**
* For bank accounts only (Account Type BANK).
*
* @property string BankAccountNumber
*/

/**
* Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes.
*
* @property string Status
*/

/**
* Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000).
*
* @property string Description
*/

/**
* For bank accounts only. See Bank Account types.
*
* @property string BankAccountType
*/

/**
* For bank accounts only.
*
* @property string CurrencyCode
*/

/**
* See Tax Types.
*
* @property string TaxType
*/

/**
* Boolean – describes whether account can have payments applied to it.
*
* @property bool EnablePaymentsToAccount
*/

/**
* Boolean – describes whether account code is available for use with expense claims.
*
* @property bool ShowInExpenseClaims
*/

/**
* The Xero identifier for an account – specified as a string following the endpoint name
* e.g.
* /297c2dc5-cc47-4afd-8ec8-74990b8761e9.
*
* @property string AccountID
*/

/**
* See Account Class Types.
*
* @property string Class
*/

/**
* If this is a system account then this element is returned. See System Account types. Note that
* non-system accounts may have this element set as either “” or null.
*
* @property string SystemAccount
*/

/**
* Shown if set.
*
* @property string ReportingCode
*/

/**
* Shown if set.
*
* @property string ReportingCodeName
*/

/**
* boolean to indicate if an account has an attachment (read only).
*
* @property bool HasAttachments
*/

/**
* Last modified date UTC format.
*
* @property \DateTimeInterface UpdatedDateUTC
*/
const ACCOUNT_CLASS_TYPE_ASSET = 'ASSET';

const ACCOUNT_CLASS_TYPE_EQUITY = 'EQUITY';
Expand Down
69 changes: 12 additions & 57 deletions src/XeroPHP/Models/Accounting/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,20 @@

use XeroPHP\Remote;

/**
* @property string $AddressType
* @property string $AddressLine1 max length = 500.
* @property string $AddressLine2 max length = 500.
* @property string $AddressLine3 max length = 500.
* @property string $AddressLine4 max length = 500.
* @property string $City max length = 255.
* @property string $Region max length = 255.
* @property string $PostalCode max length = 50.
* @property string $Country max length = 50, [A-Z], [a-z] only.
* @property string $AttentionTo max length = 255.
*/
class Address extends Remote\Model
{
/**
* @property string AddressType
*/

/**
* max length = 500.
*
* @property string AddressLine1
*/

/**
* max length = 500.
*
* @property string AddressLine2
*/

/**
* max length = 500.
*
* @property string AddressLine3
*/

/**
* max length = 500.
*
* @property string AddressLine4
*/

/**
* max length = 255.
*
* @property string City
*/

/**
* max length = 255.
*
* @property string Region
*/

/**
* max length = 50.
*
* @property string PostalCode
*/

/**
* max length = 50, [A-Z], [a-z] only.
*
* @property string Country
*/

/**
* max length = 255.
*
* @property string AttentionTo
*/
const ADDRESS_TYPE_POBOX = 'POBOX';

const ADDRESS_TYPE_STREET = 'STREET';
Expand Down
29 changes: 7 additions & 22 deletions src/XeroPHP/Models/Accounting/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,15 @@
use XeroPHP\Remote\Model;
use XeroPHP\Remote\Request;

/**
* @property string $AttachmentID Xero Unique Identifier.
* @property string $FileName
* @property string $Url
* @property string $MimeType
* @property int $ContentLength
*/
class Attachment extends Model
{
/**
* Xero Unique Identifier.
*
* @property string AttachmentID
*/

/**
* @property string FileName
*/

/**
* @property string Url
*/

/**
* @property string MimeType
*/

/**
* @property int ContentLength
*/

/**
* Actual file content (binary).
*
Expand Down
Loading