Skip to content

Commit

Permalink
move cartBlamerListener to proper bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
arti0090 committed Apr 12, 2021
1 parent 34c8357 commit 383467c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-1.10.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# UPGRADE FROM `v1.9.X` TO `v1.10.0`

1. CartBlamerListener has been moved from CoreBundle to ShopBundle and adjusted to work properly when decoupled.

### New API

1. API CartShippingMethod key `cost` has been changed to `price`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ parameters:
sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%"
sylius.security.new_api_user_account_route: "%sylius.security.new_api_shop_route%/account"
sylius.security.new_api_user_account_regex: "^%sylius.security.new_api_user_account_route%"
sylius.new_api_orders_resource_route: "orders"

api_platform:
patch_formats:
Expand Down
10 changes: 1 addition & 9 deletions src/Sylius/Bundle/ApiBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,8 @@

<service id="sylius.api.section_resolver.shop_api_uri_based_section_resolver" class="Sylius\Bundle\ApiBundle\SectionResolver\ShopApiUriBasedSectionResolver">
<argument>%sylius.security.new_api_shop_route%</argument>
<argument>%sylius.new_api_orders_resource_route%</argument>
<argument>orders</argument>
<tag name="sylius.uri_based_section_resolver" priority="40" />
</service>

<service id="sylius.listener.cart_blamer" class="Sylius\Bundle\ApiBundle\EventListener\CartBlamerListener">
<argument type="service" id="sylius.manager.order" />
<argument type="service" id="sylius.context.cart" />
<argument type="service" id="sylius.section_resolver.uri_based_section_resolver" />
<tag name="kernel.event_listener" event="sylius.user.security.implicit_login" method="onImplicitLogin" />
<tag name="kernel.event_listener" event="security.interactive_login" method="onInteractiveLogin" />
</service>
</services>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

declare(strict_types=1);

namespace Sylius\Bundle\CoreBundle\EventListener;
namespace Sylius\Bundle\ShopBundle\EventListener;

use Doctrine\Persistence\ObjectManager;
use Sylius\Bundle\ApiBundle\SectionResolver\ShopApiSection;
use Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface;
use Sylius\Bundle\ShopBundle\SectionResolver\ShopSection;
use Sylius\Bundle\UserBundle\Event\UserEvent;
Expand Down Expand Up @@ -63,7 +62,7 @@ public function onImplicitLogin(UserEvent $userEvent): void
public function onInteractiveLogin(InteractiveLoginEvent $interactiveLoginEvent): void
{
$section = $this->uriBasedSectionContext->getSection();
if (!$section instanceof ShopSection && !$section instanceof ShopApiSection) {
if (!$section instanceof ShopSection) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
<services>
<defaults public="true" />

<service id="sylius.listener.cart_blamer" class="Sylius\Bundle\ShopBundle\EventListener\CartBlamerListener">
<argument type="service" id="sylius.manager.order" />
<argument type="service" id="sylius.context.cart" />
<argument type="service" id="sylius.section_resolver.uri_based_section_resolver" />
<tag name="kernel.event_listener" event="sylius.user.security.implicit_login" method="onImplicitLogin" />
<tag name="kernel.event_listener" event="security.interactive_login" method="onInteractiveLogin" />
</service>

<service id="sylius.listener.email_updater" class="Sylius\Bundle\ShopBundle\EventListener\CustomerEmailUpdaterListener">
<argument type="service" id="sylius.shop_user.token_generator.email_verification" />
<argument type="service" id="sylius.context.channel" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\CoreBundle\EventListener;
namespace spec\Sylius\Bundle\ShopBundle\EventListener;

use Doctrine\Persistence\ObjectManager;
use PhpSpec\ObjectBehavior;
Expand Down

0 comments on commit 383467c

Please sign in to comment.