Skip to content

Commit

Permalink
Merge pull request #3 from Setono/change-namespace
Browse files Browse the repository at this point in the history
Change namespace from Setono\SyliusPeakWMSPlugin to Setono\SyliusPeakPlugin because it looks better
  • Loading branch information
loevgaard authored Jun 20, 2024
2 parents 3aaf30e + 8fdf600 commit 0303ff5
Show file tree
Hide file tree
Showing 80 changed files with 177 additions and 177 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Make sure you add it before `SyliusGridBundle`, otherwise you'll get
<?php
$bundles = [
// ...
Setono\SyliusPeakWMSPlugin\SetonoSyliusPeakWMSPlugin::class => ['all' => true],
Setono\SyliusPeakPlugin\SetonoSyliusPeakPlugin::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
// ...
];
Expand All @@ -31,15 +31,15 @@ $bundles = [
```yaml
# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
resource: "@SetonoSyliusPeakWMSPlugin/Resources/config/routes.yaml"
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes.yaml"
```
or if your app doesn't use locales:
```yaml
# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
resource: "@SetonoSyliusPeakWMSPlugin/Resources/config/routes_no_locale.yaml"
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes_no_locale.yaml"
```
### Add environment variables
Expand All @@ -65,8 +65,8 @@ declare(strict_types=1);
namespace App\Entity\Order;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface as PeakWMSOrderInterface;
use Setono\SyliusPeakWMSPlugin\Model\OrderTrait as PeakWMSOrderTrait;
use Setono\SyliusPeakPlugin\Model\OrderInterface as PeakOrderInterface;
use Setono\SyliusPeakPlugin\Model\OrderTrait as PeakOrderTrait;
use Sylius\Component\Core\Model\Order as BaseOrder;
use Doctrine\ORM\Mapping as ORM;
Expand All @@ -75,9 +75,9 @@ use Doctrine\ORM\Mapping as ORM;
*
* @ORM\Table(name="sylius_order")
*/
class Order extends BaseOrder implements PeakWMSOrderInterface
class Order extends BaseOrder implements PeakOrderInterface
{
use PeakWMSOrderTrait;
use PeakOrderTrait;
}
```

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"Setono\\SyliusPeakWMSPlugin\\": "src/"
"Setono\\SyliusPeakPlugin\\": "src/"
},
"files": [
"src/Resources/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Setono\\SyliusPeakWMSPlugin\\": "tests/"
"Tests\\Setono\\SyliusPeakPlugin\\": "tests/"
},
"classmap": [
"tests/Application/Kernel.php"
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</include>
</coverage>
<testsuites>
<testsuite name="SetonoSyliusPeakWMSPlugin Test Suite">
<testsuite name="SetonoSyliusPeakPlugin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
4 changes: 2 additions & 2 deletions src/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Command;
namespace Setono\SyliusPeakPlugin\Command;

use Setono\SyliusPeakWMSPlugin\Processor\UploadOrderRequestProcessorInterface;
use Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessorInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Command/RegisterWebhooksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Command;
namespace Setono\SyliusPeakPlugin\Command;

use Setono\SyliusPeakWMSPlugin\Message\Command\RegisterWebhooks;
use Setono\SyliusPeakPlugin\Message\Command\RegisterWebhooks;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Controller\Admin;
namespace Setono\SyliusPeakPlugin\Controller\Admin;

use Setono\PeakWMS\Client\ClientInterface;
use Setono\SyliusPeakWMSPlugin\Message\Command\RegisterWebhooks;
use Setono\SyliusPeakWMSPlugin\Registrar\WebhookRegistrarInterface;
use Setono\SyliusPeakPlugin\Message\Command\RegisterWebhooks;
use Setono\SyliusPeakPlugin\Registrar\WebhookRegistrarInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Messenger\MessageBusInterface;

final class PeakWMSController extends AbstractController
final class PeakController extends AbstractController
{
public function __construct(
private readonly MessageBusInterface $commandBus,
Expand All @@ -31,7 +31,7 @@ public function index(): Response
$apiError = 'There was an error connecting to the API. Please check your credentials and try again. If you continue to experience issues, did you forget to enable/disable the sandbox?';
}

return $this->render('@SetonoSyliusPeakWMSPlugin/admin/peak_wms/index.html.twig', [
return $this->render('@SetonoSyliusPeakPlugin/admin/peak_wms/index.html.twig', [
'apiError' => $apiError,
'webhooksShouldBeRegistered' => $this->webhookRegistrar->outOfDate(),
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/HandleWebhookControllerAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Controller;
namespace Setono\SyliusPeakPlugin\Controller;

use Setono\PeakWMS\Parser\WebhookParser;
use Setono\PeakWMS\Parser\WebhookParserInterface;
use Setono\SyliusPeakWMSPlugin\WebhookHandler\WebhookHandlerInterface;
use Setono\SyliusPeakPlugin\WebhookHandler\WebhookHandlerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
6 changes: 3 additions & 3 deletions src/DataMapper/CompositeSalesOrderDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DataMapper;
namespace Setono\SyliusPeakPlugin\DataMapper;

use Psr\EventDispatcher\EventDispatcherInterface;
use Setono\CompositeCompilerPass\CompositeService;
use Setono\PeakWMS\DataTransferObject\SalesOrder\SalesOrder;
use Setono\SyliusPeakWMSPlugin\Event\SalesOrderMappedEvent;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Event\SalesOrderMappedEvent;
use Setono\SyliusPeakPlugin\Model\OrderInterface;

/**
* @extends CompositeService<SalesOrderDataMapperInterface>
Expand Down
4 changes: 2 additions & 2 deletions src/DataMapper/SalesOrderDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DataMapper;
namespace Setono\SyliusPeakPlugin\DataMapper;

use Setono\PeakWMS\DataTransferObject\Address;
use Setono\PeakWMS\DataTransferObject\SalesOrder\SalesOrder;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Core\Model\ShippingMethodInterface;
use Webmozart\Assert\Assert;
Expand Down
4 changes: 2 additions & 2 deletions src/DataMapper/SalesOrderDataMapperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DataMapper;
namespace Setono\SyliusPeakPlugin\DataMapper;

use Setono\PeakWMS\DataTransferObject\SalesOrder\SalesOrder;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;

interface SalesOrderDataMapperInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/DataMapper/SalesOrderLinesSalesOrderDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DataMapper;
namespace Setono\SyliusPeakPlugin\DataMapper;

use Psr\EventDispatcher\EventDispatcherInterface;
use Setono\PeakWMS\DataTransferObject\SalesOrder\OrderLine\SalesOrderLine;
use Setono\PeakWMS\DataTransferObject\SalesOrder\SalesOrder;
use Setono\SyliusPeakWMSPlugin\Event\SalesOrderLineMappedEvent;
use function Setono\SyliusPeakWMSPlugin\formatAmount;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Event\SalesOrderLineMappedEvent;
use function Setono\SyliusPeakPlugin\formatAmount;
use Setono\SyliusPeakPlugin\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemUnitInterface;
use Webmozart\Assert\Assert;

Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DependencyInjection;
namespace Setono\SyliusPeakPlugin\DependencyInjection;

use Setono\SyliusPeakWMSPlugin\Model\RegisteredWebhooks;
use Setono\SyliusPeakWMSPlugin\Model\UploadOrderRequest;
use Setono\SyliusPeakPlugin\Model\RegisteredWebhooks;
use Setono\SyliusPeakPlugin\Model\UploadOrderRequest;
use Sylius\Component\Resource\Factory\Factory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down
8 changes: 4 additions & 4 deletions src/DependencyInjection/SetonoSyliusPeakWMSExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\DependencyInjection;
namespace Setono\SyliusPeakPlugin\DependencyInjection;

use Setono\SyliusPeakWMSPlugin\DataMapper\SalesOrderDataMapperInterface;
use Setono\SyliusPeakWMSPlugin\WebhookHandler\WebhookHandlerInterface;
use Setono\SyliusPeakWMSPlugin\Workflow\UploadOrderRequestWorkflow;
use Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapperInterface;
use Setono\SyliusPeakPlugin\WebhookHandler\WebhookHandlerInterface;
use Setono\SyliusPeakPlugin\Workflow\UploadOrderRequestWorkflow;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use Symfony\Component\Config\FileLocator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Event;
namespace Setono\SyliusPeakPlugin\Event;

use Doctrine\ORM\QueryBuilder;

Expand Down
4 changes: 2 additions & 2 deletions src/Event/SalesOrderLineMappedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Event;
namespace Setono\SyliusPeakPlugin\Event;

use Setono\PeakWMS\DataTransferObject\SalesOrder\OrderLine\SalesOrderLine;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemInterface;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Event/SalesOrderMappedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Event;
namespace Setono\SyliusPeakPlugin\Event;

use Setono\PeakWMS\DataTransferObject\SalesOrder\SalesOrder;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;

/**
* This event is dispatched after payment details has been mapped
Expand Down
8 changes: 4 additions & 4 deletions src/EventSubscriber/AddLinkToPeakSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\EventSubscriber;
namespace Setono\SyliusPeakPlugin\EventSubscriber;

use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakWMSPlugin\Model\UploadOrderRequestInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Model\UploadOrderRequestInterface;
use Sylius\Bundle\AdminBundle\Event\OrderShowMenuBuilderEvent;
use Sylius\Bundle\AdminBundle\Menu\OrderShowMenuBuilder;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand All @@ -28,7 +28,7 @@ public function addLink(OrderShowMenuBuilderEvent $event): void
return;
}

$uploadOrderRequest = $order->getPeakWMSUploadOrderRequest();
$uploadOrderRequest = $order->getPeakUploadOrderRequest();
if ($uploadOrderRequest === null) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/AddMenuSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\EventSubscriber;
namespace Setono\SyliusPeakPlugin\EventSubscriber;

use Knp\Menu\ItemInterface;
use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent;
Expand Down
8 changes: 4 additions & 4 deletions src/EventSubscriber/CreateUploadOrderRequestSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\EventSubscriber;
namespace Setono\SyliusPeakPlugin\EventSubscriber;

use Doctrine\Persistence\ManagerRegistry;
use Setono\Doctrine\ORMTrait;
use Setono\SyliusPeakWMSPlugin\Factory\UploadOrderRequestFactoryInterface;
use Setono\SyliusPeakWMSPlugin\Model\OrderInterface;
use Setono\SyliusPeakPlugin\Factory\UploadOrderRequestFactoryInterface;
use Setono\SyliusPeakPlugin\Model\OrderInterface;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Webmozart\Assert\Assert;
Expand Down Expand Up @@ -36,6 +36,6 @@ public function createUploadOrderRequest(ResourceControllerEvent $event): void
$order = $event->getSubject();
Assert::isInstanceOf($order, OrderInterface::class);

$order->setPeakWMSUploadOrderRequest($this->uploadOrderRequestFactory->createNew());
$order->setPeakUploadOrderRequest($this->uploadOrderRequestFactory->createNew());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\EventSubscriber\Grid;
namespace Setono\SyliusPeakPlugin\EventSubscriber\Grid;

use Sylius\Component\Grid\Definition\Field;
use Sylius\Component\Grid\Event\GridDefinitionConverterEvent;
Expand All @@ -21,9 +21,9 @@ public function add(GridDefinitionConverterEvent $event): void
{
$field = Field::fromNameAndType('peakWMSUploadOrderRequest', 'twig');
$field->setOptions([
'template' => '@SetonoSyliusPeakWMSPlugin/admin/order/grid/field/peak_wms_upload_order_request.html.twig',
'template' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_wms_upload_order_request.html.twig',
'vars' => [
'labels' => '@SetonoSyliusPeakWMSPlugin/admin/order/grid/field/peak_wms_upload_order_request',
'labels' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_wms_upload_order_request',
],
]);
$field->setLabel('setono_sylius_peak_wms.ui.peak_wms_state');
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/UnsupportedWebhookException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Exception;
namespace Setono\SyliusPeakPlugin\Exception;

final class UnsupportedWebhookException extends \RuntimeException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/WebhookRegistrationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Exception;
namespace Setono\SyliusPeakPlugin\Exception;

final class WebhookRegistrationException extends \RuntimeException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Factory/RegisteredWebhooksFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Factory;
namespace Setono\SyliusPeakPlugin\Factory;

use Setono\SyliusPeakWMSPlugin\Model\RegisteredWebhooksInterface;
use Setono\SyliusPeakPlugin\Model\RegisteredWebhooksInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;

final class RegisteredWebhooksFactory implements RegisteredWebhooksFactoryInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Factory/RegisteredWebhooksFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Setono\SyliusPeakWMSPlugin\Factory;
namespace Setono\SyliusPeakPlugin\Factory;

use Setono\PeakWMS\DataTransferObject\Webhook\Webhook;
use Setono\SyliusPeakWMSPlugin\Model\RegisteredWebhooksInterface;
use Setono\SyliusPeakPlugin\Model\RegisteredWebhooksInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;

/**
Expand Down
Loading

0 comments on commit 0303ff5

Please sign in to comment.