diff --git a/vendor/magento/module-customer-segment/Model/Layout/DepersonalizePlugin.php b/vendor/magento/module-customer-segment/Model/Layout/DepersonalizePlugin.php index f7760a43c4e..8efa0f07e80 100644 --- a/vendor/magento/module-customer-segment/Model/Layout/DepersonalizePlugin.php +++ b/vendor/magento/module-customer-segment/Model/Layout/DepersonalizePlugin.php @@ -1,70 +1,79 @@ customerSession = $customerSession; $this->request = $request; @@ -75,12 +84,12 @@ class DepersonalizePlugin } /** - * Before layout generate + * Resolve sensitive customer data. * - * @param \Magento\Framework\View\LayoutInterface $subject + * @param LayoutInterface $subject * @return void */ - public function beforeGenerateXml(\Magento\Framework\View\LayoutInterface $subject) + public function beforeGenerateXml(LayoutInterface $subject) { if ($this->moduleManager->isEnabled('Magento_PageCache') && $this->cacheConfig->isEnabled() @@ -92,13 +101,12 @@ class DepersonalizePlugin } /** - * After layout generate + * Change sensitive customer data if the depersonalization is needed. * - * @param \Magento\Framework\View\LayoutInterface $subject - * @param \Magento\Framework\View\LayoutInterface $result - * @return \Magento\Framework\View\LayoutInterface + * @param LayoutInterface $subject + * @return void */ - public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result) + public function afterGenerateElements(LayoutInterface $subject) { if ($this->moduleManager->isEnabled('Magento_PageCache') && $this->cacheConfig->isEnabled() @@ -106,10 +114,7 @@ class DepersonalizePlugin && $subject->isCacheable() ) { $websiteId = $this->storeManager->getWebsite()->getId(); - - $value = isset($this->customerSegmentIds[$websiteId]) - ? $this->customerSegmentIds[$websiteId] - : []; + $value = $this->customerSegmentIds[$websiteId] ?? []; if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) { $this->httpContext->setValue(Data::CONTEXT_SEGMENT, $value, []); @@ -119,6 +124,5 @@ class DepersonalizePlugin $this->customerSession->setCustomerSegmentIds($this->customerSegmentIds); } - return $result; } }