Skip to content

Commit 1cf017b

Browse files
author
Mohan Ahuja
committed
ACP2E-1001: Customer Zip Code input validation rule not working
- Updated code as per CR comments.
1 parent b035b12 commit 1cf017b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

app/code/Magento/Customer/Model/Metadata/Form/Postcode.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ class Postcode extends Text
2222
*/
2323
protected DirectoryHelper $directoryHelper;
2424

25-
/**
26-
* @var StringUtils
27-
*/
28-
protected $_string;
29-
3025
/**
3126
* @param MagentoTimezone $localeDate
3227
* @param PsrLogger $logger
@@ -50,10 +45,7 @@ public function __construct(
5045
StringUtils $stringHelper = null
5146
) {
5247
$this->directoryHelper = $directoryHelper;
53-
if ($stringHelper === null) {
54-
$stringHelper = \Magento\Framework\App\ObjectManager::getInstance()->get(StringUtils::class);
55-
}
56-
$this->_string = $stringHelper;
48+
$stringHelper = $stringHelper ?? \Magento\Framework\App\ObjectManager::getInstance()->get(StringUtils::class);
5749
parent::__construct(
5850
$localeDate,
5951
$logger,

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/PostcodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class PostcodeTest extends AbstractFormTestCase
1818
{
1919
/** @var StringUtils */
20-
protected StringUtils $stringHelper;
20+
private StringUtils $stringHelper;
2121

2222
/**
2323
* @var DirectoryHelper|MockObject

0 commit comments

Comments
 (0)