Skip to content

Commit

Permalink
Merge pull request #186 from picqer/cleanup
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
stephangroen committed Oct 6, 2017
2 parents f1682ed + 4567a60 commit 573569c
Show file tree
Hide file tree
Showing 61 changed files with 291 additions and 231 deletions.
7 changes: 4 additions & 3 deletions src/Picqer/Financials/Exact/Account.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class Account
Expand Down Expand Up @@ -249,9 +251,8 @@ class Account extends Model
'Type',
'VATLiability',
'VATNumber',
'Website'
'Website',
];

protected $url = 'crm/Accounts';

}
4 changes: 3 additions & 1 deletion src/Picqer/Financials/Exact/AccountClassification.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class AccountClassification
Expand Down
4 changes: 3 additions & 1 deletion src/Picqer/Financials/Exact/AccountItem.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class AccountItem
Expand Down
6 changes: 3 additions & 3 deletions src/Picqer/Financials/Exact/Address.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class Address
Expand Down Expand Up @@ -62,7 +64,6 @@
*/
class Address extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand Down Expand Up @@ -123,5 +124,4 @@ class Address extends Model
];

protected $url = 'crm/Addresses';

}
4 changes: 3 additions & 1 deletion src/Picqer/Financials/Exact/ApiException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class ApiException
Expand Down
8 changes: 4 additions & 4 deletions src/Picqer/Financials/Exact/BankAccount.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class BankAccount
Expand Down Expand Up @@ -31,7 +33,6 @@
*/
class BankAccount extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand All @@ -57,9 +58,8 @@ class BankAccount extends Model
'Modifier',
'ModifierFullName',
'Type',
'TypeDescription'
'TypeDescription',
];

protected $url = 'crm/BankAccounts';

}
8 changes: 3 additions & 5 deletions src/Picqer/Financials/Exact/BankEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@
*/
class BankEntry extends Model
{

use Query\Findable;
use Persistance\Storable;

protected $primaryKey = 'EntryID';

protected $bankEntryLines = [ ];
protected $bankEntryLines = [];

protected $fillable = [
'EntryID',
Expand All @@ -60,12 +59,11 @@ class BankEntry extends Model

public function addItem(array $array)
{
if ( ! isset( $this->attributes['BankEntryLines'] ) || $this->attributes['BankEntryLines'] == null) {
$this->attributes['BankEntryLines'] = [ ];
if (! isset($this->attributes['BankEntryLines']) || $this->attributes['BankEntryLines'] == null) {
$this->attributes['BankEntryLines'] = [];
}
$this->attributes['BankEntryLines'][] = $array;
}

protected $url = 'financialtransaction/BankEntries';

}
2 changes: 0 additions & 2 deletions src/Picqer/Financials/Exact/BankEntryLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
*/
class BankEntryLine extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand Down Expand Up @@ -107,5 +106,4 @@ class BankEntryLine extends Model
];

protected $url = 'financialtransaction/BankEntryLines';

}
23 changes: 11 additions & 12 deletions src/Picqer/Financials/Exact/CashEntry.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class CashEntry
*
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=financialtransactionCashEntries
*
* Class CashEntry
*
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=financialtransactionCashEntries
*
* @property Guid $EntryID Primary key (read-only)
* @property Double $ClosingBalanceFC Closing balance in the currency of the transaction
* @property DateTime $Created Creation date (read-only)
Expand All @@ -21,10 +24,8 @@
* @property Int16 $Status Status: 5 = Rejected, 20 = Open, 50 = Processed (read-only)
* @property String $StatusDescription Description of Status (read-only)
*/

class CashEntry extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand All @@ -46,19 +47,17 @@ class CashEntry extends Model
'Modified',
'OpeningBalanceFC',
'Status',
'StatusDescription'
'StatusDescription',
];


public function addItem(array $array)
{
if (!isset($this->attributes['CashEntryLines']) || $this->attributes['CashEntryLines'] == null) {
if (! isset($this->attributes['CashEntryLines']) || $this->attributes['CashEntryLines'] == null) {
$this->attributes['CashEntryLines'] = [];
}
$this->attributes['CashEntryLines'][] = $array;
}


protected $url = 'financialtransaction/CashEntries';
}

4 changes: 1 addition & 3 deletions src/Picqer/Financials/Exact/CashEntryLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
*/
class CashEntryLine extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand Down Expand Up @@ -103,9 +102,8 @@ class CashEntryLine extends Model
'VATCode',
'VATCodeDescription',
'VATPercentage',
'VATType'
'VATType',
];

protected $url = 'financialtransaction/CashEntryLine';

}
18 changes: 12 additions & 6 deletions src/Picqer/Financials/Exact/Connection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

use Exception;
use GuzzleHttp\Client;
Expand Down Expand Up @@ -91,7 +93,6 @@ class Connection
*/
protected $middleWares = [];


/**
* @var
*/
Expand Down Expand Up @@ -145,7 +146,7 @@ public function connect()
/**
* @param string $method
* @param $endpoint
* @param null $body
* @param mixed $body
* @param array $params
* @param array $headers
* @return Request
Expand Down Expand Up @@ -199,6 +200,8 @@ public function get($url, array $params = [], array $headers = [])
} catch (Exception $e) {
$this->parseExceptionForErrorMessages($e);
}

return null;
}

/**
Expand All @@ -219,6 +222,8 @@ public function post($url, $body)
} catch (Exception $e) {
$this->parseExceptionForErrorMessages($e);
}

return null;
}

/**
Expand All @@ -239,6 +244,8 @@ public function put($url, $body)
} catch (Exception $e) {
$this->parseExceptionForErrorMessages($e);
}

return null;
}

/**
Expand All @@ -258,6 +265,8 @@ public function delete($url)
} catch (Exception $e) {
$this->parseExceptionForErrorMessages($e);
}

return null;
}

/**
Expand Down Expand Up @@ -312,7 +321,6 @@ public function setRefreshToken($refreshToken)
$this->refreshToken = $refreshToken;
}


/**
*
*/
Expand Down Expand Up @@ -455,7 +463,6 @@ private function acquireAccessToken()
}
}


private function getDateTimeFromExpires($expires)
{
if (!is_numeric($expires)) {
Expand Down Expand Up @@ -535,7 +542,6 @@ public function setTokenUpdateCallback($callback) {
$this->tokenUpdateCallback = $callback;
}


/**
* Parse the reponse in the Exception to return the Exact error messages
* @param Exception $e
Expand Down
7 changes: 4 additions & 3 deletions src/Picqer/Financials/Exact/Contact.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class Contact
Expand Down Expand Up @@ -73,7 +75,6 @@
*/
class Contact extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand Down Expand Up @@ -141,7 +142,7 @@ class Contact extends Model
'SocialSecurityNumber',
'StartDate',
'State',
'Title'
'Title',
];

protected $url = 'crm/Contacts';
Expand Down
7 changes: 4 additions & 3 deletions src/Picqer/Financials/Exact/Costcenter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class Costcenter
Expand All @@ -20,7 +22,6 @@
*/
class Costcenter extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand All @@ -35,7 +36,7 @@ class Costcenter extends Model
'Division',
'Modified',
'Modifier',
'ModifierFullName'
'ModifierFullName',
];

protected $url = 'hrm/Costcenters';
Expand Down
8 changes: 4 additions & 4 deletions src/Picqer/Financials/Exact/DirectDebitMandate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class DirectDebitMandate
Expand All @@ -20,7 +22,6 @@
*/
class DirectDebitMandate extends Model
{

use Query\Findable;
use Persistance\Storable;

Expand All @@ -35,10 +36,9 @@ class DirectDebitMandate extends Model
'PaymentType',
'Reference',
'SignatureDate',
'Type'
'Type',
];

protected $url = 'cashflow/DirectDebitMandates';

}

8 changes: 4 additions & 4 deletions src/Picqer/Financials/Exact/Division.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Picqer\Financials\Exact;
<?php

namespace Picqer\Financials\Exact;

/**
* Class Division
Expand Down Expand Up @@ -30,7 +32,6 @@
*/
class Division extends Model
{

use Query\Findable;

protected $primaryKey = 'Code';
Expand All @@ -56,9 +57,8 @@ class Division extends Model
'TaxOfficeNumber',
'TaxReferenceNumber',
'VATNumber',
'Website'
'Website',
];

protected $url = 'hrm/Divisions';

}

0 comments on commit 573569c

Please sign in to comment.