Skip to content

Commit d2c368b

Browse files
committed
Guest print order form fixes - code sniffer fixes
1 parent f3c4042 commit d2c368b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/code/Magento/Sales/Helper/Guest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/**
1616
* Sales module base helper
1717
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1819
*/
1920
class Guest extends \Magento\Framework\App\Helper\AbstractHelper
2021
{
@@ -71,7 +72,7 @@ class Guest extends \Magento\Framework\App\Helper\AbstractHelper
7172
const COOKIE_NAME = 'guest-view';
7273

7374
/**
74-
* Cookie path
75+
* Cookie path value
7576
*/
7677
const COOKIE_PATH = '/';
7778

@@ -225,6 +226,7 @@ private function setGuestViewCookie($cookieValue)
225226
*/
226227
private function loadFromCookie($fromCookie)
227228
{
229+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
228230
$cookieData = explode(':', base64_decode($fromCookie));
229231
$protectCode = isset($cookieData[0]) ? $cookieData[0] : null;
230232
$incrementId = isset($cookieData[1]) ? $cookieData[1] : null;

app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ public function testLoadValidOrderNotEmptyPost($post)
182182
Address::class,
183183
['getLastname', 'getEmail', 'getPostcode']
184184
);
185-
$billingAddressMock->expects($this->once())->method('getLastname')->willReturn(trim($post['oar_billing_lastname']));
185+
$billingAddressMock->expects($this->once())->method('getLastname')
186+
->willReturn(trim($post['oar_billing_lastname']));
186187
$billingAddressMock->expects($this->any())->method('getEmail')->willReturn(trim($post['oar_email']));
187188
$billingAddressMock->expects($this->any())->method('getPostcode')->willReturn(trim($post['oar_zip']));
188189
$this->salesOrderMock->expects($this->once())->method('getBillingAddress')->willReturn($billingAddressMock);

0 commit comments

Comments
 (0)