Skip to content

Commit 310cad9

Browse files
committed
CE#34569: Fixed MHI failures
1 parent 461f217 commit 310cad9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

app/code/Magento/Tax/Model/Calculation/RateRepository.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ private function validate(TaxRateInterface $taxRate)
238238
$exception = new InputException();
239239

240240
$countryCode = $taxRate->getTaxCountryId();
241-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
241+
/** @phpstan-ignore-next-line */
242242
if (!\Zend_Validate::is($countryCode, 'NotEmpty')) {
243243
$exception->addError(__('"%fieldName" is required. Enter and try again.', ['fieldName' => 'country_id']));
244-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
244+
/** @phpstan-ignore-next-line */
245245
} elseif (!\Zend_Validate::is(
246246
$this->countryFactory->create()->loadByCode($countryCode)->getId(),
247247
'NotEmpty'
@@ -257,13 +257,11 @@ private function validate(TaxRateInterface $taxRate)
257257

258258
$regionCode = $taxRate->getTaxRegionId();
259259
// if regionCode eq 0 (all regions *), do not validate with existing region list
260-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
261-
if (\Zend_Validate::is($regionCode, 'NotEmpty') &&
262-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
263-
$regionCode != "0" && !\Zend_Validate::is(
264-
$this->regionFactory->create()->load($regionCode)->getId(),
265-
'NotEmpty'
266-
)
260+
/** @phpstan-ignore-next-line */
261+
if (\Zend_Validate::is($regionCode, 'NotEmpty')
262+
&& $regionCode != "0"
263+
/** @phpstan-ignore-next-line */
264+
&& !\Zend_Validate::is($this->regionFactory->create()->load($regionCode)->getId(),'NotEmpty')
267265
) {
268266
$exception->addError(__(
269267
'Invalid value of "%value" provided for the %fieldName field.',
@@ -281,7 +279,7 @@ private function validate(TaxRateInterface $taxRate)
281279
}
282280

283281
if ($taxRate->getCode() === null
284-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
282+
/** @phpstan-ignore-next-line */
285283
|| !\Zend_Validate::is(trim($taxRate->getCode()), 'NotEmpty')
286284
) {
287285
$exception->addError(__('"%fieldName" is required. Enter and try again.', ['fieldName' => 'code']));
@@ -307,7 +305,7 @@ private function validate(TaxRateInterface $taxRate)
307305
}
308306
} else {
309307
if ($taxRate->getTaxPostcode() === null
310-
// phpstan:ignore "File has calls static method. (phpStaticMethodCalls)"
308+
/** @phpstan-ignore-next-line */
311309
|| !\Zend_Validate::is(trim($taxRate->getTaxPostcode()), 'NotEmpty')
312310
) {
313311
$exception->addError(

0 commit comments

Comments
 (0)