Skip to content

Commit 5b93cb1

Browse files
authored
Merge pull request #155 from holtkamp/use-class-constant
Use class constant
2 parents d97ccbb + 7f0e62d commit 5b93cb1

File tree

14 files changed

+145
-31
lines changed

14 files changed

+145
-31
lines changed

src/Picqer/Financials/Moneybird/Actions/BaseTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract protected function getEndpoint();
2626
*
2727
* @see \Picqer\Financials\Moneybird\Model::collectionFromResult()
2828
*/
29-
abstract protected function collectionFromResult($result);
29+
abstract protected function collectionFromResult(array $result);
3030

3131
/**
3232
* Create a new object with the response from the API
@@ -37,6 +37,6 @@ abstract protected function collectionFromResult($result);
3737
*
3838
* @see \Picqer\Financials\Moneybird\Model::makeFromResponse()
3939
*/
40-
abstract protected function makeFromResponse($response);
40+
abstract protected function makeFromResponse(array $response);
4141

4242
}

src/Picqer/Financials/Moneybird/Entities/Contact.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/**
1313
* Class Contact
1414
* @package Picqer\Financials\Moneybird
15+
*
16+
* @property string $id
17+
* @property ContactCustomField[] $custom_fields
1518
*/
1619
class Contact extends Model
1720
{
@@ -76,7 +79,7 @@ class Contact extends Model
7679
*/
7780
protected $multipleNestedEntities = [
7881
'custom_fields' => [
79-
'entity' => 'ContactCustomField',
82+
'entity' => ContactCustomField::class,
8083
'type' => self::NESTING_TYPE_NESTED_OBJECTS,
8184
],
8285
];

src/Picqer/Financials/Moneybird/Entities/ContactCustomField.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
/**
66
* Class ContactCustomField
77
* @package Picqer\Financials\Moneybird\Entities
8+
*
9+
* @property string $id
10+
* @property string $name
11+
* @property string $value
812
*/
913
class ContactCustomField extends Model {
1014

src/Picqer/Financials/Moneybird/Entities/Estimate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ class Estimate extends Model
8181
*/
8282
protected $multipleNestedEntities = [
8383
'custom_fields' => [
84-
'entity' => 'SalesInvoiceCustomField',
84+
'entity' => SalesInvoiceCustomField::class,
8585
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
8686
],
8787
'details' => [
88-
'entity' => 'SalesInvoiceDetail',
88+
'entity' => SalesInvoiceDetail::class,
8989
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
9090
],
9191
'notes' => [
92-
'entity' => 'Note',
92+
'entity' => Note::class,
9393
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
9494
],
9595
];

src/Picqer/Financials/Moneybird/Entities/FinancialMutation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class FinancialMutation extends Model {
7878
*/
7979
protected $multipleNestedEntities = [
8080
'ledger_account_bookings' => [
81-
'entity' => 'LedgerAccountBooking',
81+
'entity' => LedgerAccountBooking::class,
8282
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
8383
],
8484
];

src/Picqer/Financials/Moneybird/Entities/FinancialStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class FinancialStatement extends Model {
4040
*/
4141
protected $multipleNestedEntities = [
4242
'financial_mutations' => [
43-
'entity' => 'FinancialMutation',
43+
'entity' => FinancialMutation::class,
4444
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
4545
],
4646
];

src/Picqer/Financials/Moneybird/Entities/GeneralJournalDocument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GeneralJournalDocument extends Model {
4343
*/
4444
protected $multipleNestedEntities = [
4545
'general_journal_document_entries' => [
46-
'entity' => 'GeneralJournalDocumentEntry',
46+
'entity' => GeneralJournalDocumentEntry::class,
4747
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
4848
],
4949
];

src/Picqer/Financials/Moneybird/Entities/Note.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
/**
66
* Class Note
77
* @package Picqer\Financials\Moneybird\Entities
8+
*
9+
* @property string $id
10+
* @property string $note
11+
* @property boolean $todo
12+
* @property string $assignee_id
813
*/
914
class Note extends Model {
1015
/**

src/Picqer/Financials/Moneybird/Entities/PurchaseInvoice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ class PurchaseInvoice extends Model
6262
* @var array
6363
*/
6464
protected $singleNestedEntities = [
65-
'contact' => 'Contact'
65+
'contact' => Contact::class,
6666
];
6767

6868
/**
6969
* @var array
7070
*/
7171
protected $multipleNestedEntities = [
7272
'details' => [
73-
'entity' => 'PurchaseInvoiceDetail',
73+
'entity' => PurchaseInvoiceDetail::class,
7474
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
7575
],
7676
];

src/Picqer/Financials/Moneybird/Entities/Receipt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Receipt extends Model {
6060
*/
6161
protected $multipleNestedEntities = [
6262
'details' => [
63-
'entity' => 'ReceiptDetail',
63+
'entity' => ReceiptDetail::class,
6464
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
6565
],
6666
];

0 commit comments

Comments
 (0)