From d6da095b13508ca99c264f1b77bc9165e9cc4124 Mon Sep 17 00:00:00 2001 From: Michiel Thalen Date: Fri, 20 Oct 2017 13:32:51 +0200 Subject: [PATCH] upgraded guzzle renamed to Thalent --- .gitignore | 2 +- README.md | 18 ++++++++++-------- composer.json | 8 ++++---- .../AcumulusPhp/Exceptions/ValidationError.php | 9 --------- .../AcumulusPhp/AcumulusConnector.php | 6 +++--- .../Exceptions/AcumulusException.php | 2 +- .../Exceptions/ConfigNotAnArrayException.php | 2 +- .../Exceptions/NoConfigSuppliedException.php | 2 +- .../NoXmlPayloadSuppliedException.php | 2 +- .../Exceptions/NotAnArrayException.php | 2 +- .../AcumulusPhp/Exceptions/ValidationError.php | 9 +++++++++ .../Exceptions/ValidationErrorException.php | 2 +- .../AcumulusPhp/InvoiceBuilder.php | 14 +++++++------- .../AcumulusPhp/Models/Contact.php | 2 +- .../AcumulusPhp/Models/EmailAsPdf.php | 2 +- .../AcumulusPhp/Models/Entry.php | 2 +- .../AcumulusPhp/Models/Invoice.php | 2 +- .../AcumulusPhp/Models/InvoiceLine.php | 2 +- .../AcumulusPhp/Models/Model.php | 2 +- .../Models/Response/AbstractResponse.php | 2 +- .../AcumulusPhp/Models/Response/Error.php | 2 +- .../AcumulusPhp/Models/Response/Invoice.php | 2 +- .../AcumulusPhp/Models/Response/Warning.php | 2 +- .../AcumulusPhp/Parsers/ContactParser.php | 6 +++--- .../AcumulusPhp/Parsers/ContactsParser.php | 6 +++--- .../AcumulusPhp/Parsers/EntryParser.php | 6 +++--- .../AcumulusPhp/Parsers/InvoiceParser.php | 6 +++--- .../AcumulusPhp/Parsers/Parser.php | 4 ++-- .../AcumulusPhp/Parsers/ParserInterface.php | 4 ++-- .../AcumulusPhp/Providers/Contacts.php | 6 +++--- .../AcumulusPhp/Providers/ContactsProvider.php | 8 ++++---- .../AcumulusPhp/Providers/Entries.php | 4 ++-- .../AcumulusPhp/Providers/EntriesProvider.php | 6 +++--- .../AcumulusPhp/Providers/Invoices.php | 4 ++-- .../AcumulusPhp/Providers/InvoicesProvider.php | 8 ++++---- .../AcumulusPhp/Providers/Picklists.php | 4 ++-- .../Providers/PicklistsProvider.php | 6 +++--- .../AcumulusPhp/ResponseParser.php | 14 +++++++------- .../AcumulusPhp/XmlBuilder.php | 6 +++--- 39 files changed, 99 insertions(+), 97 deletions(-) delete mode 100644 src/NextTalent/AcumulusPhp/Exceptions/ValidationError.php rename src/{NextTalent => Thalent}/AcumulusPhp/AcumulusConnector.php (92%) rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/AcumulusException.php (55%) rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/ConfigNotAnArrayException.php (51%) rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/NoConfigSuppliedException.php (58%) rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/NoXmlPayloadSuppliedException.php (59%) rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/NotAnArrayException.php (55%) create mode 100644 src/Thalent/AcumulusPhp/Exceptions/ValidationError.php rename src/{NextTalent => Thalent}/AcumulusPhp/Exceptions/ValidationErrorException.php (57%) rename src/{NextTalent => Thalent}/AcumulusPhp/InvoiceBuilder.php (93%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Contact.php (99%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/EmailAsPdf.php (97%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Entry.php (99%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Invoice.php (99%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/InvoiceLine.php (97%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Model.php (73%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Response/AbstractResponse.php (84%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Response/Error.php (82%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Response/Invoice.php (90%) rename src/{NextTalent => Thalent}/AcumulusPhp/Models/Response/Warning.php (82%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/ContactParser.php (78%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/ContactsParser.php (91%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/EntryParser.php (74%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/InvoiceParser.php (75%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/Parser.php (86%) rename src/{NextTalent => Thalent}/AcumulusPhp/Parsers/ParserInterface.php (62%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/Contacts.php (95%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/ContactsProvider.php (94%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/Entries.php (89%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/EntriesProvider.php (82%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/Invoices.php (95%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/InvoicesProvider.php (91%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/Picklists.php (78%) rename src/{NextTalent => Thalent}/AcumulusPhp/Providers/PicklistsProvider.php (68%) rename src/{NextTalent => Thalent}/AcumulusPhp/ResponseParser.php (83%) rename src/{NextTalent => Thalent}/AcumulusPhp/XmlBuilder.php (91%) diff --git a/.gitignore b/.gitignore index 745537e..32a03c9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ composer.phar composer.lock .DS_Store -/src/NextTalent/.idea +/src/Thalent/.idea diff --git a/README.md b/README.md index 1d0b3f5..af27075 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # Unofficial Acumulus PHP SDK Official Acumulus documentation: https://apidoc.sielsystems.nl/ -This package uses [Guzzle](https://github.com/guzzle/guzzle) to make the cUrl requests to Acumulus. Because of its dependency to Guzzle, this package requires PHP >= 5.4 to function. +Forked of [siegerhansma/acumulus-php](https://github.com/siegerhansma/acumulus) + +This package uses [Guzzle](https://github.com/guzzle/guzzle) to make the cUrl requests to Acumulus. Because of its dependency to Guzzle, this package requires PHP >= 5.6 to function. ## Installation ### Via composer Add the package to your composer.json file ``` "require": { - "nexttalent/acumulus": "~1.0" + "nexttalent/acumulus": "~2.0" }, ``` @@ -24,7 +26,7 @@ You could put these variables in a specific config file. The calls in the API can be called via specific classes corresponding to the categories on the official API docs. To start, create a new instance of the provider class you need. ``` - $client = new \NextTalent\AcumulusPhp\Providers\ContactsProvider($config); + $client = new \Thalent\AcumulusPhp\Providers\ContactsProvider($config); ``` After that, all the calls in that class will be available via the $client variable. ``` @@ -40,7 +42,7 @@ In the example below is the response of the getAvailableContacts method on the C ``` array(3) { [0] => - class NextTalent\AcumulusPhp\Models\Contact#68 (27) { + class Thalent\AcumulusPhp\Models\Contact#68 (27) { protected $contactid => string(7) "1234567" protected $contactname1 => @@ -97,7 +99,7 @@ array(3) { NULL } [1] => - class NextTalent\AcumulusPhp\Models\Contact#91 (27) { + class Thalent\AcumulusPhp\Models\Contact#91 (27) { protected $contactid => string(7) "3216549" protected $contactname1 => @@ -154,7 +156,7 @@ array(3) { NULL } [2] => - class NextTalent\AcumulusPhp\Models\Contact#69 (27) { + class Thalent\AcumulusPhp\Models\Contact#69 (27) { protected $contactid => string(5) "00001" protected $contactname1 => @@ -226,7 +228,7 @@ To (hopefully) make this a little bit easier for you, I made an InvoiceBuilder c $invoiceBuilder = new InvoiceBuilder; // Create a new contact by instantiating a new Contact model or get it from the API - $builder = new \NextTalent\AcumulusPhp\ContactsProvider($config); + $builder = new \Thalent\AcumulusPhp\ContactsProvider($config); $contact = $builder->getContactDetails(123456)->sendRequest(); // Set the customer by passing in the Contact model @@ -251,7 +253,7 @@ To (hopefully) make this a little bit easier for you, I made an InvoiceBuilder c $invoiceBuilder->addLine($invoiceLine); // Pass the InvoiceBuilder into the addInvoice method on the InvoicesProvider and call the build method on it - $invoiceSender = new \NextTalent\AcumulusPhp\InvoicesProvider($config); + $invoiceSender = new \Thalent\AcumulusPhp\InvoicesProvider($config); $response = $invoiceSender->addInvoice($invoiceBuilder->build())->sendRequest(); ``` diff --git a/composer.json b/composer.json index d43b1bc..d5d1842 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,13 @@ "authors": [ { "name": "Michiel Thalen", - "email": "michiel@nexttalent.nl" + "email": "info@thalent.nl" } ], "require": { - "php": ">=5.4.0", + "php": ">=5.6.0", - "guzzlehttp/guzzle": "4.1.*" + "guzzlehttp/guzzle": "^6.3.0" }, "require-dev": { "phpunit/phpunit": "4.1.*", @@ -19,7 +19,7 @@ }, "autoload": { "psr-0": { - "NextTalent\\AcumulusPhp": "src/" + "Thalent\\AcumulusPhp": "src/" } }, "minimum-stability": "stable", diff --git a/src/NextTalent/AcumulusPhp/Exceptions/ValidationError.php b/src/NextTalent/AcumulusPhp/Exceptions/ValidationError.php deleted file mode 100644 index 9ddaff4..0000000 --- a/src/NextTalent/AcumulusPhp/Exceptions/ValidationError.php +++ /dev/null @@ -1,9 +0,0 @@ -