Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove src/ from namespace #513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/php-sdk.iml

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

5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
},
"autoload": {
"psr-4": {
"MyParcelNL\\Sdk\\src\\": "src",
"MyParcelNL\\Sdk\\": "src"
"MyParcelNL\\Sdk\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MyParcelNL\\Sdk\\Test\\": "test"
"MyParcelNL\\Sdk\\Test\\": "test/"
}
}
}
12 changes: 6 additions & 6 deletions src/Adapter/ConsignmentAdapter.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter;
namespace MyParcelNL\Sdk\Adapter;

use MyParcelNL\Sdk\src\Helper\Utils;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\src\Model\Consignment\DropOffPoint;
use MyParcelNL\Sdk\Helper\Utils;
use MyParcelNL\Sdk\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Model\Consignment\DropOffPoint;

class ConsignmentAdapter
{
Expand All @@ -20,9 +20,9 @@ class ConsignmentAdapter
* ConsignmentDecode constructor.
*
* @param array $data
* @param \MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment $consignment
* @param \MyParcelNL\Sdk\Model\Consignment\AbstractConsignment $consignment
*
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException
* @throws \MyParcelNL\Sdk\Exception\MissingFieldException
*/
public function __construct(array $data, AbstractConsignment $consignment)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Adapter/DeliveryOptions/AbstractDeliveryOptionsAdapter.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

use MyParcelNL\Sdk\src\Model\Carrier\CarrierFactory;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Model\Carrier\CarrierFactory;
use MyParcelNL\Sdk\Model\Consignment\AbstractConsignment;

abstract class AbstractDeliveryOptionsAdapter
{
Expand All @@ -28,12 +28,12 @@ abstract class AbstractDeliveryOptionsAdapter
protected $packageType;

/**
* @var \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractPickupLocationAdapter
* @var \MyParcelNL\Sdk\Adapter\DeliveryOptions\AbstractPickupLocationAdapter
*/
protected $pickupLocation;

/**
* @var \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractShipmentOptionsAdapter|null
* @var \MyParcelNL\Sdk\Adapter\DeliveryOptions\AbstractShipmentOptionsAdapter|null
*/
protected $shipmentOptions;

Expand Down Expand Up @@ -99,7 +99,7 @@ public function getPackageTypeId(): ?int
}

/**
* @return \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractPickupLocationAdapter|null
* @return \MyParcelNL\Sdk\Adapter\DeliveryOptions\AbstractPickupLocationAdapter|null
*/
public function getPickupLocation(): ?AbstractPickupLocationAdapter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

class AbstractPickupLocationAdapter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

abstract class AbstractShipmentOptionsAdapter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

class DeliveryOptionsFromOrderAdapter extends AbstractDeliveryOptionsAdapter
{
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/DeliveryOptions/DeliveryOptionsV2Adapter.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

use Exception;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Model\Consignment\AbstractConsignment;

class DeliveryOptionsV2Adapter extends AbstractDeliveryOptionsAdapter
{
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DeliveryOptions/DeliveryOptionsV3Adapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

use Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DeliveryOptions/PickupLocationV2Adapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

/**
* Class PickupLocationV2Adapter
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DeliveryOptions/PickupLocationV3Adapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

class PickupLocationV3Adapter extends AbstractPickupLocationAdapter
{
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DeliveryOptions/ShipmentOptionsV2Adapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

/**
* Class ShipmentOptionsV2Adapter
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DeliveryOptions/ShipmentOptionsV3Adapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions;
namespace MyParcelNL\Sdk\Adapter\DeliveryOptions;

class ShipmentOptionsV3Adapter extends AbstractShipmentOptionsAdapter
{
Expand Down
44 changes: 22 additions & 22 deletions src/Collection/Fulfilment/OrderCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Collection\Fulfilment;
namespace MyParcelNL\Sdk\Collection\Fulfilment;

use DateTime;
use MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter;
use MyParcelNL\Sdk\src\Concerns\HasApiKey;
use MyParcelNL\Sdk\src\Concerns\HasCountry;
use MyParcelNL\Sdk\src\Concerns\HasUserAgent;
use MyParcelNL\Sdk\src\Model\Consignment\DropOffPoint;
use MyParcelNL\Sdk\src\Model\Fulfilment\AbstractOrder;
use MyParcelNL\Sdk\src\Model\Fulfilment\Order;
use MyParcelNL\Sdk\src\Model\MyParcelRequest;
use MyParcelNL\Sdk\src\Model\RequestBody;
use MyParcelNL\Sdk\src\Support\Arr;
use MyParcelNL\Sdk\src\Support\Collection;
use MyParcelNL\Sdk\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter;
use MyParcelNL\Sdk\Concerns\HasApiKey;
use MyParcelNL\Sdk\Concerns\HasCountry;
use MyParcelNL\Sdk\Concerns\HasUserAgent;
use MyParcelNL\Sdk\Model\Consignment\DropOffPoint;
use MyParcelNL\Sdk\Model\Fulfilment\AbstractOrder;
use MyParcelNL\Sdk\Model\Fulfilment\Order;
use MyParcelNL\Sdk\Model\MyParcelRequest;
use MyParcelNL\Sdk\Model\RequestBody;
use MyParcelNL\Sdk\Support\Arr;
use MyParcelNL\Sdk\Support\Collection;

/**
* @property \MyParcelNL\Sdk\src\Model\Fulfilment\Order[] $items
* @property \MyParcelNL\Sdk\Model\Fulfilment\Order[] $items
*/
class OrderCollection extends Collection
{
Expand All @@ -31,9 +31,9 @@ class OrderCollection extends Collection
* @param array $parameters
*
* @return self
* @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\src\Exception\ApiException
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException
* @throws \MyParcelNL\Sdk\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\Exception\ApiException
* @throws \MyParcelNL\Sdk\Exception\MissingFieldException
* @throws \Exception
*/
public static function query(string $apiKey, array $parameters = []): self
Expand All @@ -51,9 +51,9 @@ public static function query(string $apiKey, array $parameters = []): self

/**
* @return self
* @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\src\Exception\ApiException
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException
* @throws \MyParcelNL\Sdk\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\Exception\ApiException
* @throws \MyParcelNL\Sdk\Exception\MissingFieldException
* @throws \Exception
*/
public function save(): self
Expand Down Expand Up @@ -104,7 +104,7 @@ function (Order $order) {
}

/**
* @param \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter $deliveryOptions
* @param \MyParcelNL\Sdk\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter $deliveryOptions
*
* @return array
* @throws \Exception
Expand Down Expand Up @@ -145,7 +145,7 @@ private function getShipmentOptions(AbstractDeliveryOptionsAdapter $deliveryOpti
}

/**
* @param \MyParcelNL\Sdk\src\Model\Consignment\DropOffPoint $dropOffPoint
* @param \MyParcelNL\Sdk\Model\Consignment\DropOffPoint $dropOffPoint
*
* @return array
*/
Expand All @@ -164,7 +164,7 @@ private function getDropOffPointAsArray(DropOffPoint $dropOffPoint): array
}

/**
* @param \MyParcelNL\Sdk\src\Model\MyParcelRequest $request
* @param \MyParcelNL\Sdk\Model\MyParcelRequest $request
*
* @return self
*/
Expand Down
24 changes: 12 additions & 12 deletions src/Collection/Fulfilment/OrderNotesCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Collection\Fulfilment;
namespace MyParcelNL\Sdk\Collection\Fulfilment;

use MyParcelNL\Sdk\src\Concerns\HasApiKey;
use MyParcelNL\Sdk\src\Concerns\HasUserAgent;
use MyParcelNL\Sdk\src\Model\Fulfilment\OrderNote;
use MyParcelNL\Sdk\src\Model\MyParcelRequest;
use MyParcelNL\Sdk\src\Model\RequestBody;
use MyParcelNL\Sdk\src\Support\Arr;
use MyParcelNL\Sdk\src\Support\Collection;
use MyParcelNL\Sdk\Concerns\HasApiKey;
use MyParcelNL\Sdk\Concerns\HasUserAgent;
use MyParcelNL\Sdk\Model\Fulfilment\OrderNote;
use MyParcelNL\Sdk\Model\MyParcelRequest;
use MyParcelNL\Sdk\Model\RequestBody;
use MyParcelNL\Sdk\Support\Arr;
use MyParcelNL\Sdk\Support\Collection;
use Throwable;

class OrderNotesCollection extends Collection
Expand Down Expand Up @@ -39,7 +39,7 @@ public function save(): self
}

/**
* @return \MyParcelNL\Sdk\src\Collection\Fulfilment\OrderNotesCollection
* @return \MyParcelNL\Sdk\Collection\Fulfilment\OrderNotesCollection
*/
private function getUniqueOrderUuids(): OrderNotesCollection
{
Expand All @@ -52,9 +52,9 @@ private function getUniqueOrderUuids(): OrderNotesCollection
* @param string $orderUuid
*
* @return array Indexed array holding the saved order notes.
* @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\src\Exception\ApiException
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException
* @throws \MyParcelNL\Sdk\Exception\AccountNotActiveException
* @throws \MyParcelNL\Sdk\Exception\ApiException
* @throws \MyParcelNL\Sdk\Exception\MissingFieldException
* @throws \Exception
*/
private function saveForOrder(string $orderUuid): array
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

use Exception;

Expand Down
10 changes: 5 additions & 5 deletions src/Concerns/HasCheckoutFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @author Reindert Vetter <[email protected]>
*/

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

use MyParcelNL\Sdk\src\Exception\MissingFieldException;
use MyParcelNL\Sdk\src\Helper\CheckoutFields;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Exception\MissingFieldException;
use MyParcelNL\Sdk\Helper\CheckoutFields;
use MyParcelNL\Sdk\Model\Consignment\AbstractConsignment;

/**
* @deprecated
Expand Down Expand Up @@ -75,7 +75,7 @@ public function setDeliveryDateFromCheckout(?string $checkoutData)
* @param string $checkoutData
*
* @return $this
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException
* @throws \MyParcelNL\Sdk\Exception\MissingFieldException
* @deprecated
*
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/HasCountry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

use Exception;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Model\Consignment\AbstractConsignment;

trait HasCountry
{
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasDebugLabels.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

trait HasDebugLabels
{
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

trait HasInstance
{
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasUserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Concerns;
namespace MyParcelNL\Sdk\Concerns;

trait HasUserAgent
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/AccountNotActiveException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Exception;
namespace MyParcelNL\Sdk\Exception;

class AccountNotActiveException extends \Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ApiException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace MyParcelNL\Sdk\src\Exception;
namespace MyParcelNL\Sdk\Exception;

class ApiException extends \Exception
{
Expand Down
Loading