Skip to content
Snippets Groups Projects
Commit 4da5d87c authored by Miha Wagner's avatar Miha Wagner
Browse files

Apply rector patch from issue #3286060.

parent 425700ff
Branches 1.0.x
Tags 1.0.1
1 merge request!10Drupal 10 compatibility
......@@ -13,7 +13,7 @@ use Drupal\menu_link_content\Entity\MenuLinkContent;
*/
function amazon_product_widget_post_update_install_view(&$sandbox) {
// Import the product overview view.
$configPath = drupal_get_path('module', 'amazon_product_widget') . '/config/install';
$configPath = \Drupal::service('extension.list.module')->getPath('amazon_product_widget') . '/config/install';
$source = new FileStorage($configPath);
/** @var \Drupal\Core\Config\StorageInterface $configStorage */
$configStorage = \Drupal::service('config.storage');
......@@ -43,7 +43,7 @@ function amazon_product_widget_post_update_install_view(&$sandbox) {
*/
function amazon_product_widget_post_update_install_unavailable_products_view(&$sandbox) {
// Import the product overview view.
$configPath = drupal_get_path('module', 'amazon_product_widget') . '/config/install';
$configPath = \Drupal::service('extension.list.module')->getPath('amazon_product_widget') . '/config/install';
$source = new FileStorage($configPath);
/** @var \Drupal\Core\Config\StorageInterface $configStorage */
$configStorage = \Drupal::service('config.storage');
......
......@@ -2,12 +2,12 @@
namespace Drupal\amazon_product_widget\EventSubscriber;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Drupal\Core\Cache\CacheableResponseInterface;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
......@@ -57,12 +57,12 @@ class AmazonApiSubscriber implements EventSubscriberInterface {
/**
* Unset cookie so the whole request acts as anonymous for everybody.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The event to process.
*
* @see \Drupal\Core\EventSubscriber\FinishResponseSubscriber::onRespond()
*/
public function onRequest(GetResponseEvent $event) {
public function onRequest(RequestEvent $event) {
if (!$event->isMasterRequest()) {
return;
}
......@@ -83,12 +83,12 @@ class AmazonApiSubscriber implements EventSubscriberInterface {
/**
* Sets proper cache control header.
*
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process.
*
* @see \Drupal\Core\EventSubscriber\FinishResponseSubscriber::onRespond()
*/
public function onRespond(FilterResponseEvent $event) {
public function onRespond(ResponseEvent $event) {
if (!$event->isMasterRequest()) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment