Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Change namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdekeizer committed Dec 7, 2019
1 parent 46485b5 commit 09faacd
Show file tree
Hide file tree
Showing 41 changed files with 136 additions and 135 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ composer require jacobdekeizer/redjepakketje-client
Create the client

```php
$client = new \jacobdekeizer\Client();
$client = new \JacobDeKeizer\RedJePakketje\Client();

$client->setApiKey('api_key');
```

### Create shipment

```php
$shipment = (new \jacobdekeizer\Resources\Shipment())
$shipment = (new \JacobDeKeizer\RedJePakketje\Resources\Shipment())
->setCompanyName('Boeren BV')
->setName('Gijs Boersma')
->setStreet('Lange laan')
Expand All @@ -41,12 +41,12 @@ $shipment = (new \jacobdekeizer\Resources\Shipment())
->setNote('Some note')
->setName('My Company')
->setDeliveryDate(date('Y-m-d'))
->setProduct(\jacobdekeizer\Resources\Shipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setProduct(\JacobDeKeizer\RedJePakketje\Resources\Shipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setPickUpPoint('pick_up_point_uuid');

$shipmentResponse = $client->shipments()->create(
$shipment,
new \jacobdekeizer\Parameters\Shipments\Create() // optional
new \JacobDeKeizer\RedJePakketje\Parameters\Shipments\Create() // optional
);

$label = $shipmentResponse->getLabel();
Expand All @@ -56,7 +56,7 @@ $label = $shipmentResponse->getLabel();

```php
$shipmentsList = $client->shipments()->all(
new \jacobdekeizer\Parameters\Shipments\All() // optional
new \JacobDeKeizer\RedJePakketje\Parameters\Shipments\All() // optional
);
```

Expand All @@ -65,7 +65,7 @@ $shipmentsList = $client->shipments()->all(
```php
$shipmentResponse = $client->shipments()->get(
'your_tracking_code',
new \jacobdekeizer\Parameters\Shipments\GetLabel() // optional
new \JacobDeKeizer\RedJePakketje\Parameters\Shipments\GetLabel() // optional
);
```

Expand All @@ -74,14 +74,14 @@ $shipmentResponse = $client->shipments()->get(
```php
$labelContents = $client->shipments()->getLabel(
'your_tracking_code',
new \jacobdekeizer\Parameters\Shipments\GetLabel() // optional
new \JacobDeKeizer\RedJePakketje\Parameters\Shipments\GetLabel() // optional
);
```

### Create return shipments

```php
$returnShipment = (new \jacobdekeizer\Resources\ReturnShipment())
$returnShipment = (new \JacobDeKeizer\RedJePakketje\Resources\ReturnShipment())
->setName('Gijs Boersma')
->setStreet('Lange laan')
->setHouseNumber(29)
Expand All @@ -94,7 +94,7 @@ $returnShipment = (new \jacobdekeizer\Resources\ReturnShipment())
->setNote('Some note')
->setReceiverName('My company')
->setPickUpPoint('pick_up_point_uuid')
->setProduct(\jacobdekeizer\Resources\ReturnShipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setProduct(\JacobDeKeizer\RedJePakketje\Resources\ReturnShipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setNote('some text');

$returnShipmentResponse = $client->returns()->create($returnShipment);
Expand All @@ -104,7 +104,7 @@ $returnShipmentResponse = $client->returns()->create($returnShipment);

```php
$returnShipmentsList = $client->returns()->all(
new \jacobdekeizer\Parameters\Returns\All() // optional
new \JacobDeKeizer\RedJePakketje\Parameters\Returns\All() // optional
);
```

Expand All @@ -129,12 +129,12 @@ $pickUpPoint = $client->pickUps()->get('pick_up_point_uuid');
### Create contact

```php
$contact = (new \jacobdekeizer\Resources\Contact())
$contact = (new \JacobDeKeizer\RedJePakketje\Resources\Contact())
->setFirstName('John')
->setLastName('Doe')
->setEmail('[email protected]')
->setTelephone('+31612345678')
->setGender(\jacobdekeizer\Resources\Contact::GENDER_MALE)
->setGender(\JacobDeKeizer\RedJePakketje\Resources\Contact::GENDER_MALE)
->setReference('abcdefg');

$contactResponse = $client->contacts()->create($contact);
Expand All @@ -155,13 +155,13 @@ $contact = $client->contacts()->get('3c8a9435-8b68-4d06-847d-4d1cd5f7c27a');
### Update contact

```php
$contact = (new \jacobdekeizer\Resources\Contact())
$contact = (new \JacobDeKeizer\RedJePakketje\Resources\Contact())
->setUuid('uuid_of_contact')
->setFirstName('Jane')
->setLastName('Doe')
->setEmail('[email protected]')
->setTelephone('+31612345678')
->setGender(\jacobdekeizer\Resources\Contact::GENDER_FEMALE)
->setGender(\JacobDeKeizer\RedJePakketje\Resources\Contact::GENDER_FEMALE)
->setReference('abcdefg');

$contactResponse = $client->contacts()->update($contact);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"autoload": {
"psr-4": {
"jacobdekeizer\\": "src/"
"JacobDeKeizer\\RedJePakketje\\": "src/"
}
}
}
5 changes: 3 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace jacobdekeizer;
namespace JacobDeKeizer\RedJePakketje;

use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
use jacobdekeizer\Endpoints;
use jacobdekeizer\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Endpoints;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use Psr\Http\Message\ResponseInterface;

class Client
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/Dto.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Contracts;
namespace JacobDeKeizer\RedJePakketje\Contracts;

interface Dto
{
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/HasLabelFormat.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Contracts;
namespace JacobDeKeizer\RedJePakketje\Contracts;

interface HasLabelFormat
{
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/HasShipmentProduct.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Contracts;
namespace JacobDeKeizer\RedJePakketje\Contracts;

interface HasShipmentProduct
{
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/Parameter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Contracts;
namespace JacobDeKeizer\RedJePakketje\Contracts;

interface Parameter
{
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/ToRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Contracts;
namespace JacobDeKeizer\RedJePakketje\Contracts;

interface ToRequest
{
Expand Down
4 changes: 2 additions & 2 deletions src/Endpoints/Base.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Client;
use JacobDeKeizer\RedJePakketje\Client;

class Base
{
Expand Down
8 changes: 4 additions & 4 deletions src/Endpoints/Contacts.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Exceptions\RedJePakketjeException;
use jacobdekeizer\Resources\Contact;
use jacobdekeizer\Resources\ContactsList;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Resources\Contact;
use JacobDeKeizer\RedJePakketje\Resources\ContactsList;

class Contacts extends Base
{
Expand Down
6 changes: 3 additions & 3 deletions src/Endpoints/CutOffTimes.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Exceptions\RedJePakketjeException;
use jacobdekeizer\Resources\CutOffTime;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Resources\CutOffTime;

class CutOffTimes extends Base
{
Expand Down
8 changes: 4 additions & 4 deletions src/Endpoints/PickUps.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Exceptions\RedJePakketjeException;
use jacobdekeizer\Resources\PickUpPoint;
use jacobdekeizer\Resources\PickUpPointsList;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Resources\PickUpPoint;
use JacobDeKeizer\RedJePakketje\Resources\PickUpPointsList;

class PickUps extends Base
{
Expand Down
12 changes: 6 additions & 6 deletions src/Endpoints/Returns.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Exceptions\RedJePakketjeException;
use jacobdekeizer\Parameters\Returns as Parameters;
use jacobdekeizer\Resources\ReturnShipment;
use jacobdekeizer\Resources\ReturnShipmentResponse;
use jacobdekeizer\Resources\ReturnShipmentsList;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Parameters\Returns as Parameters;
use JacobDeKeizer\RedJePakketje\Resources\ReturnShipment;
use JacobDeKeizer\RedJePakketje\Resources\ReturnShipmentResponse;
use JacobDeKeizer\RedJePakketje\Resources\ReturnShipmentsList;

class Returns extends Base
{
Expand Down
12 changes: 6 additions & 6 deletions src/Endpoints/Shipments.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace jacobdekeizer\Endpoints;
namespace JacobDeKeizer\RedJePakketje\Endpoints;

use jacobdekeizer\Exceptions\RedJePakketjeException;
use jacobdekeizer\Parameters\Shipments as Parameters;
use jacobdekeizer\Resources\Shipment;
use jacobdekeizer\Resources\ShipmentsList;
use jacobdekeizer\Resources\ShipmentResponse;
use JacobDeKeizer\RedJePakketje\Exceptions\RedJePakketjeException;
use JacobDeKeizer\RedJePakketje\Parameters\Shipments as Parameters;
use JacobDeKeizer\RedJePakketje\Resources\Shipment;
use JacobDeKeizer\RedJePakketje\Resources\ShipmentsList;
use JacobDeKeizer\RedJePakketje\Resources\ShipmentResponse;

class Shipments extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/RedJePakketjeException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace jacobdekeizer\Exceptions;
namespace JacobDeKeizer\RedJePakketje\Exceptions;

use Exception;
use Throwable;
Expand Down
10 changes: 5 additions & 5 deletions src/Parameters/Returns/All.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace jacobdekeizer\Parameters\Returns;
namespace JacobDeKeizer\RedJePakketje\Parameters\Returns;

use jacobdekeizer\Contracts\Dto;
use jacobdekeizer\Contracts\Parameter;
use jacobdekeizer\Traits\FromArray;
use jacobdekeizer\Traits\Query;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\Parameter;
use JacobDeKeizer\RedJePakketje\Traits\FromArray;
use JacobDeKeizer\RedJePakketje\Traits\Query;

class All implements Dto, Parameter
{
Expand Down
10 changes: 5 additions & 5 deletions src/Parameters/Shipments/All.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace jacobdekeizer\Parameters\Shipments;
namespace JacobDeKeizer\RedJePakketje\Parameters\Shipments;

use jacobdekeizer\Contracts\Dto;
use jacobdekeizer\Contracts\Parameter;
use jacobdekeizer\Traits\FromArray;
use jacobdekeizer\Traits\Query;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\Parameter;
use JacobDeKeizer\RedJePakketje\Traits\FromArray;
use JacobDeKeizer\RedJePakketje\Traits\Query;

class All implements Dto, Parameter
{
Expand Down
12 changes: 6 additions & 6 deletions src/Parameters/Shipments/Create.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace jacobdekeizer\Parameters\Shipments;
namespace JacobDeKeizer\RedJePakketje\Parameters\Shipments;

use jacobdekeizer\Contracts\Dto;
use jacobdekeizer\Contracts\HasLabelFormat;
use jacobdekeizer\Contracts\Parameter;
use jacobdekeizer\Traits\FromArray;
use jacobdekeizer\Traits\Query;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\HasLabelFormat;
use JacobDeKeizer\RedJePakketje\Contracts\Parameter;
use JacobDeKeizer\RedJePakketje\Traits\FromArray;
use JacobDeKeizer\RedJePakketje\Traits\Query;

class Create implements Dto, Parameter, HasLabelFormat
{
Expand Down
12 changes: 6 additions & 6 deletions src/Parameters/Shipments/GetLabel.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace jacobdekeizer\Parameters\Shipments;
namespace JacobDeKeizer\RedJePakketje\Parameters\Shipments;

use jacobdekeizer\Contracts\Dto;
use jacobdekeizer\Contracts\HasLabelFormat;
use jacobdekeizer\Contracts\Parameter;
use jacobdekeizer\Traits\FromArray;
use jacobdekeizer\Traits\Query;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\HasLabelFormat;
use JacobDeKeizer\RedJePakketje\Contracts\Parameter;
use JacobDeKeizer\RedJePakketje\Traits\FromArray;
use JacobDeKeizer\RedJePakketje\Traits\Query;

class GetLabel implements Dto, Parameter, HasLabelFormat
{
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/BaseList.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace jacobdekeizer\Resources;
namespace JacobDeKeizer\RedJePakketje\Resources;

use jacobdekeizer\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;

abstract class BaseList implements Dto
{
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/BaseSimpleList.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace jacobdekeizer\Resources;
namespace JacobDeKeizer\RedJePakketje\Resources;

use jacobdekeizer\Contracts\Dto;
use JacobDeKeizer\RedJePakketje\Contracts\Dto;

abstract class BaseSimpleList implements Dto
{
Expand Down
Loading

0 comments on commit 09faacd

Please sign in to comment.