Skip to content

Commit fd8231b

Browse files
author
Dmytro Poperechnyy
committed
MAGETWO-33060: Refactor __() to return Phrase object
- DataObjectProcessor->buildOutputDataArray() updated; - Configurable->getSpecifyOptionMessage() modified; - Integration SaveRatesTest updated;
1 parent daa9633 commit fd8231b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ public function checkProductBuyState($product)
847847
*/
848848
public function getSpecifyOptionMessage()
849849
{
850-
return __('Please specify the product\'s option(s).');
850+
return (string)__('Please specify the product\'s option(s).');
851851
}
852852

853853
/**

dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testSaveAction()
5252
$this->dispatch('backend/admin/system_currency/saveRates');
5353

5454
$this->assertSessionMessages(
55-
$this->contains(__('All valid rates have been saved.')),
55+
$this->contains((string)__('All valid rates have been saved.')),
5656
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
5757
);
5858

@@ -84,7 +84,7 @@ public function testSaveWithWarningAction()
8484
$this->dispatch('backend/admin/system_currency/saveRates');
8585

8686
$this->assertSessionMessages(
87-
$this->contains(__('Please correct the input data for %1 => %2 rate', $currencyCode, $currencyTo)),
87+
$this->contains((string)__('Please correct the input data for %1 => %2 rate', $currencyCode, $currencyTo)),
8888
\Magento\Framework\Message\MessageInterface::TYPE_WARNING
8989
);
9090
}

lib/internal/Magento/Framework/Reflection/DataObjectProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function buildOutputDataArray($dataObject, $dataObjectType)
116116
$valueResult = [];
117117
$arrayElementType = substr($returnType, 0, -2);
118118
foreach ($value as $singleValue) {
119-
if (is_object($singleValue)) {
119+
if (is_object($singleValue) && !($singleValue instanceof Phrase)) {
120120
$singleValue = $this->buildOutputDataArray($singleValue, $arrayElementType);
121121
}
122122
$valueResult[] = $this->castValueToType($singleValue, $arrayElementType);

0 commit comments

Comments
 (0)