Skip to content

Commit

Permalink
Merge pull request #465 from timacdonald/style_binary_operator_spaces
Browse files Browse the repository at this point in the history
Coding style: binary_operator_spaces
  • Loading branch information
calcinai authored Feb 6, 2019
2 parents 0a3b384 + b9a8d9f commit b3734ba
Show file tree
Hide file tree
Showing 59 changed files with 550 additions and 550 deletions.
14 changes: 7 additions & 7 deletions examples/config-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

$config = [
'oauth' => [
'callback' => 'http://localhost/',
'callback' => 'http://localhost/',

'consumer_key' => 'k',
'consumer_secret' => 's',
'consumer_key' => 'k',
'consumer_secret' => 's',

],
'curl' => [
CURLOPT_CAINFO => 'certs/ca-bundle.crt',
CURLOPT_SSLCERT => 'certs/entrust-cert-RQ3.pem',
CURLOPT_SSLKEYPASSWD => '1234',
CURLOPT_SSLKEY => 'certs/entrust-private-RQ3.pem'
CURLOPT_CAINFO => 'certs/ca-bundle.crt',
CURLOPT_SSLCERT => 'certs/entrust-cert-RQ3.pem',
CURLOPT_SSLKEYPASSWD => '1234',
CURLOPT_SSLKEY => 'certs/entrust-private-RQ3.pem'
]
];

Expand Down
12 changes: 6 additions & 6 deletions examples/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
],

'oauth' => [
'callback' => 'oob',
'callback' => 'oob',

'consumer_key' => 'k',
'consumer_secret' => 's',
'consumer_key' => 'k',
'consumer_secret' => 's',

//If you have issues passing the Authorization header, you can set it to append to the query string
//'signature_location' => \XeroPHP\Remote\OAuth\Client::SIGN_LOCATION_QUERY


//For certs on disk or a string - allows anything that is valid with openssl_pkey_get_(private|public)
'rsa_private_key' => 'file://certs/private.pem',
'rsa_public_key' => 'file://certs/public.pem'
'rsa_private_key' => 'file://certs/private.pem',
'rsa_public_key' => 'file://certs/public.pem'
],

//These are raw curl options. I didn't see the need to obfuscate these through methods
'curl' => [
CURLOPT_USERAGENT => 'XeroPHP Test App',
CURLOPT_USERAGENT => 'XeroPHP Test App',

//Only for partner apps - unfortunately need to be files on disk only.
//CURLOPT_CAINFO => 'certs/ca-bundle.crt',
Expand Down
12 changes: 6 additions & 6 deletions examples/partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
//These are the minimum settings - for more options, refer to examples/config.php
$config = [
'oauth' => [
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'consumer_secret' => 's',
'rsa_private_key' => 'file://certs/privatekey.pem',
'signature_location' => \XeroPHP\Remote\OAuth\Client::SIGN_LOCATION_QUERY
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'consumer_secret' => 's',
'rsa_private_key' => 'file://certs/privatekey.pem',
'signature_location' => \XeroPHP\Remote\OAuth\Client::SIGN_LOCATION_QUERY
],
'curl' => [
CURLOPT_CAINFO => 'certs/ca-bundle.crt'
CURLOPT_CAINFO => 'certs/ca-bundle.crt'
]
];

Expand Down
8 changes: 4 additions & 4 deletions examples/private.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
//These are the minimum settings - for more options, refer to examples/config.php
$config = [
'oauth' => [
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'consumer_secret' => 's',
'rsa_private_key' => 'file://certs/private.pem',
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'consumer_secret' => 's',
'rsa_private_key' => 'file://certs/private.pem',
],
];

Expand Down
4 changes: 2 additions & 2 deletions examples/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//These are the minimum settings - for more options, refer to examples/config.php
$config = [
'oauth' => [
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'callback' => 'http://localhost/',
'consumer_key' => 'k',
'consumer_secret' => 's',
],
'curl' => [
Expand Down
28 changes: 14 additions & 14 deletions src/XeroPHP/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@
abstract class Application
{
protected static $_config_defaults = [
'xero' => [
'site' => 'https://api.xero.com',
'base_url' => 'https://api.xero.com',
'core_version' => '2.0',
'xero' => [
'site' => 'https://api.xero.com',
'base_url' => 'https://api.xero.com',
'core_version' => '2.0',
'payroll_version' => '1.0',
'file_version' => '1.0',
'file_version' => '1.0',
'model_namespace' => '\\XeroPHP\\Models'
],
//OAuth config
'oauth' => [
'signature_method' => Client::SIGNATURE_RSA_SHA1,
'signature_method' => Client::SIGNATURE_RSA_SHA1,
'signature_location' => Client::SIGN_LOCATION_HEADER,
'authorize_url' => 'https://api.xero.com/oauth/Authorize',
'authorize_url' => 'https://api.xero.com/oauth/Authorize',
'request_token_path' => 'oauth/RequestToken',
'access_token_path' => 'oauth/AccessToken'
'access_token_path' => 'oauth/AccessToken'
],
'curl' => [
CURLOPT_USERAGENT => 'XeroPHP',
'curl' => [
CURLOPT_USERAGENT => 'XeroPHP',
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_TIMEOUT => 20,
CURLOPT_TIMEOUT => 20,
CURLOPT_SSL_VERIFYPEER => 2,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_PROXY => false,
CURLOPT_PROXYUSERPWD => false,
CURLOPT_ENCODING => '',
CURLOPT_PROXY => false,
CURLOPT_PROXYUSERPWD => false,
CURLOPT_ENCODING => '',
]
];

Expand Down
50 changes: 25 additions & 25 deletions src/XeroPHP/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ public static function XMLToArray(\SimpleXMLElement $sxml)
public static function singularize($string)
{
$singular = [
'/(vert|ind)ices$/i' => "$1ex",
'/(alias)es$/i' => "$1",
'/(x|ch|ss|sh)es$/i' => "$1",
'/(s)eries$/i' => "$1eries",
'/(s)tatus$/i' => "$1tatus",
'/(vert|ind)ices$/i' => "$1ex",
'/(alias)es$/i' => "$1",
'/(x|ch|ss|sh)es$/i' => "$1",
'/(s)eries$/i' => "$1eries",
'/(s)tatus$/i' => "$1tatus",
'/([^aeiouy]|qu)ies$/i' => "$1y",
'/([lr])ves$/i' => "$1f",
'/([ti])a$/i' => "$1um",
'/(us)es$/i' => "$1",
'/(basis)$/i' => "$1",
'/([^s])s$/i' => "$1"
'/([lr])ves$/i' => "$1f",
'/([ti])a$/i' => "$1um",
'/(us)es$/i' => "$1",
'/(basis)$/i' => "$1",
'/([^s])s$/i' => "$1"
];

// check for matches using regular expressions
Expand All @@ -129,22 +129,22 @@ public static function singularize($string)
public static function pluralize($string)
{
$plural = [
'/(quiz)$/i' => "$1zes",
'/(matr|vert|ind)ix|ex$/i' => "$1ices",
'/(x|ch|ss|sh)$/i' => "$1es",
'/([^aeiouy]|qu)y$/i' => "$1ies",
'/(hive)$/i' => "$1s",
'/(?:([^f])fe|([lr])f)$/i' => "$1$2ves",
'/(shea|lea|loa|thie)f$/i' => "$1ves",
'/sis$/i' => "ses",
'/([ti])um$/i' => "$1a",
'/(quiz)$/i' => "$1zes",
'/(matr|vert|ind)ix|ex$/i' => "$1ices",
'/(x|ch|ss|sh)$/i' => "$1es",
'/([^aeiouy]|qu)y$/i' => "$1ies",
'/(hive)$/i' => "$1s",
'/(?:([^f])fe|([lr])f)$/i' => "$1$2ves",
'/(shea|lea|loa|thie)f$/i' => "$1ves",
'/sis$/i' => "ses",
'/([ti])um$/i' => "$1a",
'/(tomat|potat|ech|her|vet)o$/i' => "$1oes",
'/(bu)s$/i' => "$1ses",
'/(alias)$/i' => "$1es",
'/(ax|test)is$/i' => "$1es",
'/(us)$/i' => "$1es",
'/s$/i' => "s",
'/$/' => "s"
'/(bu)s$/i' => "$1ses",
'/(alias)$/i' => "$1es",
'/(ax|test)is$/i' => "$1es",
'/(us)$/i' => "$1es",
'/s$/i' => "s",
'/$/' => "s"
];

// check for matches using regular expressions
Expand Down
84 changes: 42 additions & 42 deletions src/XeroPHP/Models/Accounting/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,55 +121,55 @@ class Account extends Remote\Model
*/


const ACCOUNT_CLASS_TYPE_ASSET = 'ASSET';
const ACCOUNT_CLASS_TYPE_EQUITY = 'EQUITY';
const ACCOUNT_CLASS_TYPE_EXPENSE = 'EXPENSE';
const ACCOUNT_CLASS_TYPE_ASSET = 'ASSET';
const ACCOUNT_CLASS_TYPE_EQUITY = 'EQUITY';
const ACCOUNT_CLASS_TYPE_EXPENSE = 'EXPENSE';
const ACCOUNT_CLASS_TYPE_LIABILITY = 'LIABILITY';
const ACCOUNT_CLASS_TYPE_REVENUE = 'REVENUE';

const ACCOUNT_TYPE_BANK = 'BANK';
const ACCOUNT_TYPE_CURRENT = 'CURRENT';
const ACCOUNT_TYPE_CURRLIAB = 'CURRLIAB';
const ACCOUNT_TYPE_DEPRECIATN = 'DEPRECIATN';
const ACCOUNT_TYPE_DIRECTCOSTS = 'DIRECTCOSTS';
const ACCOUNT_TYPE_EQUITY = 'EQUITY';
const ACCOUNT_TYPE_EXPENSE = 'EXPENSE';
const ACCOUNT_TYPE_FIXED = 'FIXED';
const ACCOUNT_TYPE_INVENTORY = 'INVENTORY';
const ACCOUNT_TYPE_LIABILITY = 'LIABILITY';
const ACCOUNT_TYPE_NONCURRENT = 'NONCURRENT';
const ACCOUNT_TYPE_OTHERINCOME = 'OTHERINCOME';
const ACCOUNT_TYPE_OVERHEADS = 'OVERHEADS';
const ACCOUNT_TYPE_PREPAYMENT = 'PREPAYMENT';
const ACCOUNT_TYPE_REVENUE = 'REVENUE';
const ACCOUNT_TYPE_SALES = 'SALES';
const ACCOUNT_TYPE_TERMLIAB = 'TERMLIAB';
const ACCOUNT_TYPE_PAYGLIABILITY = 'PAYGLIABILITY';
const ACCOUNT_TYPE_SUPERANNUATIONEXPENSE = 'SUPERANNUATIONEXPENSE';
const ACCOUNT_CLASS_TYPE_REVENUE = 'REVENUE';

const ACCOUNT_TYPE_BANK = 'BANK';
const ACCOUNT_TYPE_CURRENT = 'CURRENT';
const ACCOUNT_TYPE_CURRLIAB = 'CURRLIAB';
const ACCOUNT_TYPE_DEPRECIATN = 'DEPRECIATN';
const ACCOUNT_TYPE_DIRECTCOSTS = 'DIRECTCOSTS';
const ACCOUNT_TYPE_EQUITY = 'EQUITY';
const ACCOUNT_TYPE_EXPENSE = 'EXPENSE';
const ACCOUNT_TYPE_FIXED = 'FIXED';
const ACCOUNT_TYPE_INVENTORY = 'INVENTORY';
const ACCOUNT_TYPE_LIABILITY = 'LIABILITY';
const ACCOUNT_TYPE_NONCURRENT = 'NONCURRENT';
const ACCOUNT_TYPE_OTHERINCOME = 'OTHERINCOME';
const ACCOUNT_TYPE_OVERHEADS = 'OVERHEADS';
const ACCOUNT_TYPE_PREPAYMENT = 'PREPAYMENT';
const ACCOUNT_TYPE_REVENUE = 'REVENUE';
const ACCOUNT_TYPE_SALES = 'SALES';
const ACCOUNT_TYPE_TERMLIAB = 'TERMLIAB';
const ACCOUNT_TYPE_PAYGLIABILITY = 'PAYGLIABILITY';
const ACCOUNT_TYPE_SUPERANNUATIONEXPENSE = 'SUPERANNUATIONEXPENSE';
const ACCOUNT_TYPE_SUPERANNUATIONLIABILITY = 'SUPERANNUATIONLIABILITY';
const ACCOUNT_TYPE_WAGESEXPENSE = 'WAGESEXPENSE';
const ACCOUNT_TYPE_WAGESPAYABLELIABILITY = 'WAGESPAYABLELIABILITY';
const ACCOUNT_TYPE_WAGESEXPENSE = 'WAGESEXPENSE';
const ACCOUNT_TYPE_WAGESPAYABLELIABILITY = 'WAGESPAYABLELIABILITY';

const ACCOUNT_STATUS_ACTIVE = 'ACTIVE';
const ACCOUNT_STATUS_ACTIVE = 'ACTIVE';
const ACCOUNT_STATUS_ARCHIVED = 'ARCHIVED';

const BANK_ACCOUNT_TYPE_BANK = 'BANK';
const BANK_ACCOUNT_TYPE_BANK = 'BANK';
const BANK_ACCOUNT_TYPE_CREDITCARD = 'CREDITCARD';
const BANK_ACCOUNT_TYPE_PAYPAL = 'PAYPAL';

const SYSTEM_ACCOUNT_DEBTORS = 'DEBTORS';
const SYSTEM_ACCOUNT_CREDITORS = 'CREDITORS';
const SYSTEM_ACCOUNT_BANKCURRENCYGAIN = 'BANKCURRENCYGAIN';
const SYSTEM_ACCOUNT_GST = 'GST';
const SYSTEM_ACCOUNT_GSTONIMPORTS = 'GSTONIMPORTS';
const SYSTEM_ACCOUNT_HISTORICAL = 'HISTORICAL';
const SYSTEM_ACCOUNT_REALISEDCURRENCYGAIN = 'REALISEDCURRENCYGAIN';
const SYSTEM_ACCOUNT_RETAINEDEARNINGS = 'RETAINEDEARNINGS';
const SYSTEM_ACCOUNT_ROUNDING = 'ROUNDING';
const SYSTEM_ACCOUNT_TRACKINGTRANSFERS = 'TRACKINGTRANSFERS';
const SYSTEM_ACCOUNT_UNPAIDEXPCLM = 'UNPAIDEXPCLM';
const BANK_ACCOUNT_TYPE_PAYPAL = 'PAYPAL';

const SYSTEM_ACCOUNT_DEBTORS = 'DEBTORS';
const SYSTEM_ACCOUNT_CREDITORS = 'CREDITORS';
const SYSTEM_ACCOUNT_BANKCURRENCYGAIN = 'BANKCURRENCYGAIN';
const SYSTEM_ACCOUNT_GST = 'GST';
const SYSTEM_ACCOUNT_GSTONIMPORTS = 'GSTONIMPORTS';
const SYSTEM_ACCOUNT_HISTORICAL = 'HISTORICAL';
const SYSTEM_ACCOUNT_REALISEDCURRENCYGAIN = 'REALISEDCURRENCYGAIN';
const SYSTEM_ACCOUNT_RETAINEDEARNINGS = 'RETAINEDEARNINGS';
const SYSTEM_ACCOUNT_ROUNDING = 'ROUNDING';
const SYSTEM_ACCOUNT_TRACKINGTRANSFERS = 'TRACKINGTRANSFERS';
const SYSTEM_ACCOUNT_UNPAIDEXPCLM = 'UNPAIDEXPCLM';
const SYSTEM_ACCOUNT_UNREALISEDCURRENCYGAIN = 'UNREALISEDCURRENCYGAIN';
const SYSTEM_ACCOUNT_WAGEPAYABLES = 'WAGEPAYABLES';
const SYSTEM_ACCOUNT_WAGEPAYABLES = 'WAGEPAYABLES';


/**
Expand Down
4 changes: 2 additions & 2 deletions src/XeroPHP/Models/Accounting/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class Address extends Remote\Model
*/


const ADDRESS_TYPE_POBOX = 'POBOX';
const ADDRESS_TYPE_STREET = 'STREET';
const ADDRESS_TYPE_POBOX = 'POBOX';
const ADDRESS_TYPE_STREET = 'STREET';
const ADDRESS_TYPE_DELIVERY = 'DELIVERY';


Expand Down
16 changes: 8 additions & 8 deletions src/XeroPHP/Models/Accounting/BankTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ class BankTransaction extends Remote\Model
*/


const TYPE_RECEIVE = 'RECEIVE';
const TYPE_RECEIVE = 'RECEIVE';
const TYPE_RECEIVE_OVERPAYMENT = 'RECEIVE-OVERPAYMENT';
const TYPE_RECEIVE_PREPAYMENT = 'RECEIVE-PREPAYMENT';
const TYPE_SPEND = 'SPEND';
const TYPE_SPEND_OVERPAYMENT = 'SPEND-OVERPAYMENT';
const TYPE_SPEND_PREPAYMENT = 'SPEND-PREPAYMENT';
const TYPE_RECEIVE_TRANSFER = 'RECEIVE-TRANSFER';
const TYPE_SPEND_TRANSFER = 'SPEND-TRANSFER';
const TYPE_RECEIVE_PREPAYMENT = 'RECEIVE-PREPAYMENT';
const TYPE_SPEND = 'SPEND';
const TYPE_SPEND_OVERPAYMENT = 'SPEND-OVERPAYMENT';
const TYPE_SPEND_PREPAYMENT = 'SPEND-PREPAYMENT';
const TYPE_RECEIVE_TRANSFER = 'RECEIVE-TRANSFER';
const TYPE_SPEND_TRANSFER = 'SPEND-TRANSFER';

const BANK_TRANSACTION_STATUS_AUTHORISED = 'AUTHORISED';
const BANK_TRANSACTION_STATUS_DELETED = 'DELETED';
const BANK_TRANSACTION_STATUS_DELETED = 'DELETED';


/**
Expand Down
2 changes: 1 addition & 1 deletion src/XeroPHP/Models/Accounting/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Contact extends Remote\Model
*/


const CONTACT_STATUS_ACTIVE = 'ACTIVE';
const CONTACT_STATUS_ACTIVE = 'ACTIVE';
const CONTACT_STATUS_ARCHIVED = 'ARCHIVED';


Expand Down
4 changes: 2 additions & 2 deletions src/XeroPHP/Models/Accounting/ExpenseClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class ExpenseClaim extends Remote\Model
*/


const EXPENSE_CLAIM_STATUS_SUBMITTED = 'SUBMITTED';
const EXPENSE_CLAIM_STATUS_SUBMITTED = 'SUBMITTED';
const EXPENSE_CLAIM_STATUS_AUTHORISED = 'AUTHORISED';
const EXPENSE_CLAIM_STATUS_PAID = 'PAID';
const EXPENSE_CLAIM_STATUS_PAID = 'PAID';


/**
Expand Down
8 changes: 4 additions & 4 deletions src/XeroPHP/Models/Accounting/ExternalLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

class ExternalLink
{
const EXTERNAL_LINK_TYPE_FACEBOOK = 'Facebook';
const EXTERNAL_LINK_TYPE_FACEBOOK = 'Facebook';
const EXTERNAL_LINK_TYPE_GOOGLEPLUS = 'GooglePlus';
const EXTERNAL_LINK_TYPE_LINKEDIN = 'LinkedIn';
const EXTERNAL_LINK_TYPE_TWITTER = 'Twitter';
const EXTERNAL_LINK_TYPE_WEBSITE = 'Website';
const EXTERNAL_LINK_TYPE_LINKEDIN = 'LinkedIn';
const EXTERNAL_LINK_TYPE_TWITTER = 'Twitter';
const EXTERNAL_LINK_TYPE_WEBSITE = 'Website';
}
Loading

0 comments on commit b3734ba

Please sign in to comment.