Skip to content

Commit

Permalink
upgraded guzzle
Browse files Browse the repository at this point in the history
renamed to Thalent
  • Loading branch information
Michiel Thalen committed Oct 20, 2017
1 parent 0534edd commit d6da095
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
composer.phar
composer.lock
.DS_Store
/src/NextTalent/.idea
/src/Thalent/.idea
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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"
},
```

Expand All @@ -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.
```
Expand All @@ -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 =>
Expand Down Expand Up @@ -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 =>
Expand Down Expand Up @@ -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 =>
Expand Down Expand Up @@ -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
Expand All @@ -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();
```

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand All @@ -19,7 +19,7 @@
},
"autoload": {
"psr-0": {
"NextTalent\\AcumulusPhp": "src/"
"Thalent\\AcumulusPhp": "src/"
}
},
"minimum-stability": "stable",
Expand Down
9 changes: 0 additions & 9 deletions src/NextTalent/AcumulusPhp/Exceptions/ValidationError.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 23:06
*/

namespace NextTalent\AcumulusPhp;
namespace Thalent\AcumulusPhp;

use GuzzleHttp;
use NextTalent\AcumulusPhp\Exceptions\NoConfigSuppliedException;
use NextTalent\AcumulusPhp\Exceptions\NoXmlPayloadSuppliedException;
use Thalent\AcumulusPhp\Exceptions\NoConfigSuppliedException;
use Thalent\AcumulusPhp\Exceptions\NoXmlPayloadSuppliedException;

/**
* @property GuzzleHttp\Client client
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;

class AcumulusException extends \Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php


namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;


class ConfigNotAnArrayException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;

class NoConfigSuppliedException extends \Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;

class NoXmlPayloadSuppliedException extends \Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;

class NotAnArrayException extends \Exception
{
Expand Down
9 changes: 9 additions & 0 deletions src/Thalent/AcumulusPhp/Exceptions/ValidationError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php


namespace Thalent\AcumulusPhp\Exceptions;


class ValidationError {

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Exceptions;
namespace Thalent\AcumulusPhp\Exceptions;

class ValidationErrorException extends \Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php namespace NextTalent\AcumulusPhp;
<?php namespace Thalent\AcumulusPhp;

use NextTalent\AcumulusPhp\Exceptions\ValidationErrorException;
use NextTalent\AcumulusPhp\Models\Contact;
use NextTalent\AcumulusPhp\Models\EmailAsPdf;
use NextTalent\AcumulusPhp\Models\Invoice;
use NextTalent\AcumulusPhp\Models\InvoiceLine;
use Thalent\AcumulusPhp\Exceptions\ValidationErrorException;
use Thalent\AcumulusPhp\Models\Contact;
use Thalent\AcumulusPhp\Models\EmailAsPdf;
use Thalent\AcumulusPhp\Models\Invoice;
use Thalent\AcumulusPhp\Models\InvoiceLine;

/**
* Class InvoiceBuilder
* @package NextTalent\AcumulusPhp
* @package Thalent\AcumulusPhp
*/
class InvoiceBuilder
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;

class Contact extends Model {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 1:20 AM
*/

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;


class EmailAsPdf {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 23:52
*/

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;

class Entry extends Model
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;

class Invoice
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;

class InvoiceLine
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 22:04
*/

namespace NextTalent\AcumulusPhp\Models;
namespace Thalent\AcumulusPhp\Models;

abstract class Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 6:02 AM
*/

namespace NextTalent\AcumulusPhp\Models\Response;
namespace Thalent\AcumulusPhp\Models\Response;


abstract class AbstractResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 6:03 AM
*/

namespace NextTalent\AcumulusPhp\Models\Response;
namespace Thalent\AcumulusPhp\Models\Response;


class Warning {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace NextTalent\AcumulusPhp\Models\Response;
namespace Thalent\AcumulusPhp\Models\Response;

class Invoice {
public $invoicenumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 6:03 AM
*/

namespace NextTalent\AcumulusPhp\Models\Response;
namespace Thalent\AcumulusPhp\Models\Response;


class Warning {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace NextTalent\AcumulusPhp\Parsers;
namespace Thalent\AcumulusPhp\Parsers;

use NextTalent\AcumulusPhp\Models\Contact;
use Thalent\AcumulusPhp\Models\Contact;

/**
* Class ContactParser
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
class ContactParser extends Parser implements ParserInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace NextTalent\AcumulusPhp\Parsers;
namespace Thalent\AcumulusPhp\Parsers;

use NextTalent\AcumulusPhp\Models\Contact;
use Thalent\AcumulusPhp\Models\Contact;

/**
* Class ContactsParser
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
class ContactsParser extends Parser implements ParserInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php namespace NextTalent\AcumulusPhp\Parsers;
<?php namespace Thalent\AcumulusPhp\Parsers;

use NextTalent\AcumulusPhp\Models\Entry;
use Thalent\AcumulusPhp\Models\Entry;

/**
* Class EntryParser
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
class EntryParser extends Parser implements ParserInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace NextTalent\AcumulusPhp\Parsers;
use NextTalent\AcumulusPhp\Models\Response\Invoice;
namespace Thalent\AcumulusPhp\Parsers;
use Thalent\AcumulusPhp\Models\Response\Invoice;

/**
* Class InvoiceParser
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
class InvoiceParser implements ParserInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 22:34
*/

namespace NextTalent\AcumulusPhp\Parsers;
namespace Thalent\AcumulusPhp\Parsers;

/**
* Class Parser
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
class Parser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace NextTalent\AcumulusPhp\Parsers;
namespace Thalent\AcumulusPhp\Parsers;

/**
* Interface ParserInterface
* @package NextTalent\AcumulusPhp\Parsers
* @package Thalent\AcumulusPhp\Parsers
*/
interface ParserInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace NextTalent\AcumulusPhp;
use NextTalent\AcumulusPhp\Exceptions\NotAnArrayException;
namespace Thalent\AcumulusPhp;
use Thalent\AcumulusPhp\Exceptions\NotAnArrayException;

/**
* Class Contacts
* Responsible for creating the body for Contacts related API calls
* @link https://apidoc.sielsystems.nl/acumulus-api/contacts
* @package NextTalent\AcumulusPhp
* @package Thalent\AcumulusPhp
*/
class Contacts extends AcumulusConnector
{
Expand Down
Loading

0 comments on commit d6da095

Please sign in to comment.