Skip to content

Commit

Permalink
fix: fix namespace error when installing module (#246)
Browse files Browse the repository at this point in the history
Resolves #242

Co-authored-by: Mariusz Sienkiewicz <mariusz.sienkiewicz.it@gmail.com>
  • Loading branch information
EdieLemoine and mariuszsienkiewicz committed May 1, 2024
1 parent 9ed47ed commit cf3c9e4
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 40 deletions.
4 changes: 1 addition & 3 deletions src/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

namespace MyParcelNL\PrestaShop\Entity;

use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;

abstract class AbstractEntity implements EntityInterface
{
public function __construct() {}
public function __construct() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Contract;
namespace MyParcelNL\PrestaShop\Entity;

use MyParcelNL\Pdk\Base\Contract\Arrayable;

/**
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Contract namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
*/
interface EntityInterface extends Arrayable
{
public function __construct();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Contract;
namespace MyParcelNL\PrestaShop\Entity;

use DateTime;

/**
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Contract namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
*/
interface EntityWithCreatedTimestampsInterface extends EntityInterface
{
public function getDateAdd(): ?DateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Contract;
namespace MyParcelNL\PrestaShop\Entity;

use DateTime;

/**
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Contract namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
*/
interface EntityWithTimestampsInterface extends EntityWithCreatedTimestampsInterface
{
public function getDateUpd(): ?DateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Concern;
namespace MyParcelNL\PrestaShop\Entity;

use DateTime;
use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithCreatedTimestampsInterface;

/**
* @see \MyParcelNL\PrestaShop\Entity\Contract\EntityWithCreatedTimestampsInterface
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Concern namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
* @see \MyParcelNL\PrestaShop\Entity\EntityWithCreatedTimestampsInterface
*/
trait HasCreatedTimestamps
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Concern;
namespace MyParcelNL\PrestaShop\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Concern namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
*/
trait HasJsonData
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

declare(strict_types=1);

namespace MyParcelNL\PrestaShop\Entity\Concern;
namespace MyParcelNL\PrestaShop\Entity;

use DateTime;
use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @see \MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface
* @see \MyParcelNL\PrestaShop\Entity\Concern\HasCreatedTimestamps
* @TODO Move to \MyParcelNL\PrestaShop\Entity\Concern namespace when possible.
* @see https://github.com/myparcelnl/prestashop/issues/242
* @see \MyParcelNL\PrestaShop\Entity\EntityWithTimestampsInterface
* @see \MyParcelNL\PrestaShop\Entity\HasCreatedTimestamps
*/
trait HasTimestamps
{
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/MyparcelnlAudit.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasCreatedTimestamps;
use MyParcelNL\PrestaShop\Entity\Concern\HasJsonData;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithCreatedTimestampsInterface;

/**
* @ORM\Table
Expand Down
2 changes: 0 additions & 2 deletions src/Entity/MyparcelnlCarrierMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasTimestamps;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @ORM\Table()
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/MyparcelnlCartDeliveryOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasJsonData;
use MyParcelNL\PrestaShop\Entity\Concern\HasTimestamps;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @ORM\Table
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/MyparcelnlOrderData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasJsonData;
use MyParcelNL\PrestaShop\Entity\Concern\HasTimestamps;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @ORM\Table
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/MyparcelnlOrderShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasJsonData;
use MyParcelNL\PrestaShop\Entity\Concern\HasTimestamps;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @ORM\Table
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/MyparcelnlProductSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use Doctrine\ORM\Mapping as ORM;
use MyParcelNL\PrestaShop\Database\Table;
use MyParcelNL\PrestaShop\Entity\Concern\HasJsonData;
use MyParcelNL\PrestaShop\Entity\Concern\HasTimestamps;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;

/**
* @ORM\Table
Expand Down
8 changes: 4 additions & 4 deletions src/Repository/AbstractPsObjectRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
use MyParcelNL\Pdk\Base\Support\Utils;
use MyParcelNL\Pdk\Facade\Pdk;
use MyParcelNL\PrestaShop\Contract\PsObjectRepositoryInterface;
use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;
use MyParcelNL\PrestaShop\Entity\Contract\EntityWithTimestampsInterface;
use MyParcelNL\PrestaShop\Entity\EntityInterface;
use MyParcelNL\PrestaShop\Entity\EntityWithTimestampsInterface;
use MyParcelNL\Sdk\src\Support\Str;
use Throwable;

/**
* @template T of \MyParcelNL\PrestaShop\Entity\Contract\EntityInterface
* @template T of \MyParcelNL\PrestaShop\Entity\EntityInterface
*/
abstract class AbstractPsObjectRepository implements PsObjectRepositoryInterface
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public function createEntity(): EntityInterface
}

/**
* @param \MyParcelNL\PrestaShop\Entity\Contract\EntityInterface $entity
* @param \MyParcelNL\PrestaShop\Entity\EntityInterface $entity
*
* @return void
* @throws \Doctrine\ORM\Exception\ORMException
Expand Down
2 changes: 1 addition & 1 deletion tests/Factory/AbstractPsEntityFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use MyParcelNL\Sdk\src\Support\Str;

/**
* @template T of \MyParcelNL\PrestaShop\Entity\Contract\EntityInterface
* @template T of \MyParcelNL\PrestaShop\Entity\EntityInterface
* @implements PsObjectModelFactoryInterface<T>
* @extends AbstractPsFactory<T>
* @method $this withCreated(string $created)
Expand Down
2 changes: 1 addition & 1 deletion tests/Factory/PsFactoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use MyParcelNL\Pdk\Tests\Factory\Contract\FactoryInterface;
use MyParcelNL\Pdk\Tests\Factory\Exception\InvalidFactoryException;
use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;
use MyParcelNL\PrestaShop\Entity\EntityInterface;
use ObjectModel;
use Throwable;

Expand Down
2 changes: 1 addition & 1 deletion tests/Mock/MockPsEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace MyParcelNL\PrestaShop\Tests\Mock;

use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;
use MyParcelNL\PrestaShop\Entity\EntityInterface;

abstract class MockPsEntity extends BaseMock implements EntityInterface
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Mock/MockPsEntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace MyParcelNL\PrestaShop\Tests\Mock;

use MyParcelNL\Pdk\Base\Support\Collection;
use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;
use MyParcelNL\PrestaShop\Entity\EntityInterface;
use MyParcelNL\Sdk\src\Support\Str;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use MyParcelNL\Pdk\Settings\Model\SettingsFactory;
use MyParcelNL\Pdk\Tests\Bootstrap\TestBootstrapper;
use MyParcelNL\Pdk\Tests\Factory\Collection\FactoryCollection;
use MyParcelNL\PrestaShop\Entity\Contract\EntityInterface;
use MyParcelNL\PrestaShop\Entity\EntityInterface;
use MyParcelNL\PrestaShop\Entity\MyparcelnlCarrierMapping;
use MyParcelNL\PrestaShop\Tests\Factory\PsFactoryFactory;
use ObjectModel;
Expand Down

0 comments on commit cf3c9e4

Please sign in to comment.