Skip to content

Commit 412b8f0

Browse files
authored
Merge pull request #99 from Setono/up-deps
Upgrade Google Analytics related libraries
2 parents 4c2ea0f + 0e0adc1 commit 412b8f0

16 files changed

+27
-27
lines changed

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"psr/event-dispatcher": "^1.0",
2121
"psr/log": "^1.1 || ^2.0 || ^3.0",
2222
"setono/composite-compiler-pass": "^1.1",
23-
"setono/google-analytics-bundle": "^1.0.0-alpha.6",
24-
"setono/google-analytics-measurement-protocol": "^1.0@alpha",
23+
"setono/google-analytics-bundle": "^2.0@alpha",
24+
"setono/google-analytics-events": "^1.0@beta",
25+
"setono/google-analytics-measurement-protocol": "^2.0@beta",
2526
"sylius/channel": "^1.0",
2627
"sylius/channel-bundle": "^1.0",
2728
"sylius/core": "^1.8",

src/Event/ItemResolved.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Setono\SyliusAnalyticsPlugin\Event;
66

7-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\Item\Item;
7+
use Setono\GoogleAnalyticsEvents\Event\Item\Item;
88

99
/**
1010
* Is fired when an item has been resolved. Use this to do common manipulations on the item before it's sent to Google

src/EventSubscriber/AddPaymentInfoSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\AddPaymentInfoEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\AddPaymentInfoEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
@@ -62,7 +62,7 @@ public function track(ResourceControllerEvent $resourceControllerEvent): void
6262
),
6363
);
6464
} catch (\Throwable $e) {
65-
$this->log(AddPaymentInfoEvent::NAME, $e);
65+
$this->log(AddPaymentInfoEvent::getName(), $e);
6666
}
6767
}
6868
}

src/EventSubscriber/AddShippingInfoSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\AddShippingInfoEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\AddShippingInfoEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
@@ -64,7 +64,7 @@ public function track(ResourceControllerEvent $resourceControllerEvent): void
6464
),
6565
);
6666
} catch (\Throwable $e) {
67-
$this->log(AddShippingInfoEvent::NAME, $e);
67+
$this->log(AddShippingInfoEvent::getName(), $e);
6868
}
6969
}
7070
}

src/EventSubscriber/AddToCartSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\AddToCartEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\AddToCartEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Item\ItemResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
@@ -71,7 +71,7 @@ public function track(ResourceControllerEvent $resourceControllerEvent): void
7171
),
7272
);
7373
} catch (\Throwable $e) {
74-
$this->log(AddToCartEvent::NAME, $e);
74+
$this->log(AddToCartEvent::getName(), $e);
7575
}
7676
}
7777
}

src/EventSubscriber/BeginCheckoutSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\BeginCheckoutEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\BeginCheckoutEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Component\Core\Model\OrderInterface;
@@ -70,7 +70,7 @@ public function track(RequestEvent $requestEvent): void
7070
),
7171
);
7272
} catch (\Throwable $e) {
73-
$this->log(BeginCheckoutEvent::NAME, $e);
73+
$this->log(BeginCheckoutEvent::getName(), $e);
7474
}
7575
}
7676
}

src/EventSubscriber/DispatchSendPurchaseRequestSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Setono\SyliusAnalyticsPlugin\EventSubscriber;
66

77
use Setono\GoogleAnalyticsBundle\Context\ClientIdContextInterface;
8-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\PurchaseEvent;
8+
use Setono\GoogleAnalyticsEvents\Event\PurchaseEvent;
99
use Setono\SyliusAnalyticsPlugin\Message\Command\SendPurchaseEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;

src/EventSubscriber/PurchaseSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\PurchaseEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\PurchaseEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Component\Core\Model\OrderInterface;
@@ -87,7 +87,7 @@ public function track(RequestEvent $requestEvent): void
8787
),
8888
);
8989
} catch (\Throwable $e) {
90-
$this->log(PurchaseEvent::NAME, $e);
90+
$this->log(PurchaseEvent::getName(), $e);
9191
}
9292
}
9393
}

src/EventSubscriber/ViewCartSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\ViewCartEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\ViewCartEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Items\ItemsResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Component\Core\Model\OrderInterface;
@@ -70,7 +70,7 @@ public function track(RequestEvent $requestEvent): void
7070
),
7171
);
7272
} catch (\Throwable $e) {
73-
$this->log(ViewCartEvent::NAME, $e);
73+
$this->log(ViewCartEvent::getName(), $e);
7474
}
7575
}
7676
}

src/EventSubscriber/ViewItemListSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\ViewItemListEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\ViewItemListEvent;
1010
use Setono\SyliusAnalyticsPlugin\Event\ItemListViewed;
1111
use Setono\SyliusAnalyticsPlugin\Resolver\Item\ItemResolverInterface;
1212
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
@@ -104,7 +104,7 @@ public function trackNative(ResourceControllerEvent $resourceControllerEvent): v
104104

105105
$this->eventDispatcher->dispatch(new ClientSideEvent($event));
106106
} catch (\Throwable $e) {
107-
$this->log(ViewItemListEvent::NAME, $e);
107+
$this->log(ViewItemListEvent::getName(), $e);
108108
}
109109
}
110110

src/EventSubscriber/ViewItemSubscriber.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
88
use Setono\GoogleAnalyticsBundle\Event\ClientSideEvent;
9-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\ViewItemEvent;
9+
use Setono\GoogleAnalyticsEvents\Event\ViewItemEvent;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Item\ItemResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Util\FormatAmountTrait;
1212
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
@@ -54,7 +54,7 @@ public function track(ResourceControllerEvent $resourceControllerEvent): void
5454
),
5555
);
5656
} catch (\Throwable $e) {
57-
$this->log(ViewItemEvent::NAME, $e);
57+
$this->log(ViewItemEvent::getName(), $e);
5858
}
5959
}
6060
}

src/Message/Command/SendPurchaseEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Setono\SyliusAnalyticsPlugin\Message\Command;
66

7-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\PurchaseEvent;
7+
use Setono\GoogleAnalyticsEvents\Event\PurchaseEvent;
88

99
final class SendPurchaseEvent implements CommandInterface
1010
{

src/Resolver/Item/ItemResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Setono\SyliusAnalyticsPlugin\Resolver\Item;
66

77
use Psr\EventDispatcher\EventDispatcherInterface;
8-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\Item\Item;
8+
use Setono\GoogleAnalyticsEvents\Event\Item\Item;
99
use Setono\SyliusAnalyticsPlugin\Event\ItemResolved;
1010
use Setono\SyliusAnalyticsPlugin\Resolver\Brand\BrandResolverInterface;
1111
use Setono\SyliusAnalyticsPlugin\Resolver\Category\CategoryResolverInterface;

src/Resolver/Item/ItemResolverInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Setono\SyliusAnalyticsPlugin\Resolver\Item;
66

7-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\Item\Item;
7+
use Setono\GoogleAnalyticsEvents\Event\Item\Item;
88
use Sylius\Component\Core\Model\OrderItemInterface;
99
use Sylius\Component\Core\Model\ProductInterface;
1010

src/Resolver/Items/ItemsResolverInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Setono\SyliusAnalyticsPlugin\Resolver\Items;
66

7-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Body\Event\Item\Item;
7+
use Setono\GoogleAnalyticsEvents\Event\Item\Item;
88
use Sylius\Component\Core\Model\OrderInterface;
99

1010
interface ItemsResolverInterface

tests/Application/templates/bundles/SyliusShopBundle/layout.html.twig

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
{{ sylius_template_event('sylius.shop.layout.before_body') }}
2929
<div class="pusher" data-route="{{ app.request.get('_route') }}">
3030
{% block top %}
31-
<div id="menu" class="top-menu">
32-
<a href="#" class="top-menu__link">{{ 'sylius.top_bar'|trans }}</a>
33-
<div class="top-bar">{{ sylius_template_event('sylius.shop.layout.topbar') }}</div>
31+
<div id="menu" class="ui large sticky inverted stackable menu">
32+
{{ sylius_template_event('sylius.shop.layout.topbar') }}
3433
</div>
3534
{% endblock %}
3635

0 commit comments

Comments
 (0)