Skip to content

Commit d350783

Browse files
committed
Update the serializer to use directly the json version and not just asking for the interface
1 parent 4ddbfc2 commit d350783

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

app/code/Magento/Checkout/Block/Cart/Shipping.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart
2121
protected $layoutProcessors;
2222

2323
/**
24-
* @var \Magento\Framework\Serialize\SerializerInterface
24+
* @var \Magento\Framework\Serialize\Serializer\Json
2525
*/
2626
private $serializer;
2727

@@ -31,7 +31,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart
3131
* @param \Magento\Checkout\Model\Session $checkoutSession
3232
* @param \Magento\Checkout\Model\CompositeConfigProvider $configProvider
3333
* @param array $layoutProcessors
34-
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
34+
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
3535
* @param array $data
3636
* @throws \RuntimeException
3737
*/
@@ -41,15 +41,15 @@ public function __construct(
4141
\Magento\Checkout\Model\Session $checkoutSession,
4242
\Magento\Checkout\Model\CompositeConfigProvider $configProvider,
4343
array $layoutProcessors = [],
44-
\Magento\Framework\Serialize\SerializerInterface $serializer = null,
44+
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
4545
array $data = []
4646
) {
4747
$this->configProvider = $configProvider;
4848
$this->layoutProcessors = $layoutProcessors;
4949
parent::__construct($context, $customerSession, $checkoutSession, $data);
5050
$this->_isScopePrivate = true;
5151
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
52-
->get(\Magento\Framework\Serialize\SerializerInterface::class);
52+
->get(\Magento\Framework\Serialize\Serializer\Json::class);
5353
}
5454

5555
/**

app/code/Magento/Checkout/Block/Cart/Sidebar.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Sidebar extends AbstractCart
2828
protected $imageHelper;
2929

3030
/**
31-
* @var \Magento\Framework\Serialize\SerializerInterface
31+
* @var \Magento\Framework\Serialize\Serializer\Json
3232
*/
3333
private $serializer;
3434

@@ -38,16 +38,17 @@ class Sidebar extends AbstractCart
3838
* @param \Magento\Checkout\Model\Session $checkoutSession
3939
* @param \Magento\Catalog\Helper\Image $imageHelper
4040
* @param \Magento\Customer\CustomerData\JsLayoutDataProviderPoolInterface $jsLayoutDataProvider
41+
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
4142
* @param array $data
42-
* @codeCoverageIgnore
43+
* @throws \RuntimeException
4344
*/
4445
public function __construct(
4546
\Magento\Framework\View\Element\Template\Context $context,
4647
\Magento\Customer\Model\Session $customerSession,
4748
\Magento\Checkout\Model\Session $checkoutSession,
4849
\Magento\Catalog\Helper\Image $imageHelper,
4950
\Magento\Customer\CustomerData\JsLayoutDataProviderPoolInterface $jsLayoutDataProvider,
50-
\Magento\Framework\Serialize\SerializerInterface $serializer = null,
51+
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
5152
array $data = []
5253
) {
5354
if (isset($data['jsLayout'])) {
@@ -60,7 +61,7 @@ public function __construct(
6061
$this->_isScopePrivate = false;
6162
$this->imageHelper = $imageHelper;
6263
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
63-
->get(\Magento\Framework\Serialize\SerializerInterface::class);
64+
->get(\Magento\Framework\Serialize\Serializer\Json::class);
6465
}
6566

6667
/**

app/code/Magento/Checkout/Block/Onepage.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Onepage extends \Magento\Framework\View\Element\Template
3737
protected $layoutProcessors;
3838

3939
/**
40-
* @var \Magento\Framework\Serialize\SerializerInterface
40+
* @var \Magento\Framework\Serialize\Serializer\Json
4141
*/
4242
private $serializer;
4343

@@ -46,7 +46,7 @@ class Onepage extends \Magento\Framework\View\Element\Template
4646
* @param \Magento\Framework\Data\Form\FormKey $formKey
4747
* @param \Magento\Checkout\Model\CompositeConfigProvider $configProvider
4848
* @param array $layoutProcessors
49-
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
49+
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
5050
* @param array $data
5151
* @throws \RuntimeException
5252
*/
@@ -55,7 +55,7 @@ public function __construct(
5555
\Magento\Framework\Data\Form\FormKey $formKey,
5656
\Magento\Checkout\Model\CompositeConfigProvider $configProvider,
5757
array $layoutProcessors = [],
58-
\Magento\Framework\Serialize\SerializerInterface $serializer = null,
58+
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
5959
array $data = []
6060
) {
6161
parent::__construct($context, $data);
@@ -65,7 +65,7 @@ public function __construct(
6565
$this->configProvider = $configProvider;
6666
$this->layoutProcessors = $layoutProcessors;
6767
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
68-
->get(\Magento\Framework\Serialize\SerializerInterface::class);
68+
->get(\Magento\Framework\Serialize\Serializer\Json::class);
6969
}
7070

7171
/**

app/code/Magento/Checkout/Test/Unit/Block/Cart/ShippingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function setUp()
7474

7575
$this->storeManager = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class);
7676
$this->context->expects($this->once())->method('getStoreManager')->willReturn($this->storeManager);
77-
$this->serializer = $this->getMock(\Magento\Framework\Serialize\SerializerInterface::class,[],[],'',false);
77+
$this->serializer = $this->getMock(\Magento\Framework\Serialize\Serializer\Json::class,[],[],'',false);
7878

7979
$this->model = new \Magento\Checkout\Block\Cart\Shipping(
8080
$this->context,

app/code/Magento/Checkout/Test/Unit/Block/Cart/SidebarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function setUp()
9999
->method('getRequest')
100100
->will($this->returnValue($this->requestMock));
101101

102-
$this->serializer = $this->getMock(\Magento\Framework\Serialize\SerializerInterface::class,[],[],'',false);
102+
$this->serializer = $this->getMock(\Magento\Framework\Serialize\Serializer\Json::class,[],[],'',false);
103103

104104
$this->model = $this->_objectManager->getObject(
105105
\Magento\Checkout\Block\Cart\Sidebar::class,

app/code/Magento/Checkout/Test/Unit/Block/OnepageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function setUp()
5959
false
6060
);
6161

62-
$this->serializer = $this->getMock(\Magento\Framework\Serialize\SerializerInterface::class,[],[],'',false);
62+
$this->serializer = $this->getMock(\Magento\Framework\Serialize\Serializer\Json::class,[],[],'',false);
6363

6464
$this->model = new \Magento\Checkout\Block\Onepage(
6565
$contextMock,

0 commit comments

Comments
 (0)