Skip to content

Commit 2e22671

Browse files
Marcel Haurinmalevanec
authored andcommitted
[task] remove strval()
1 parent 05a7954 commit 2e22671

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

app/code/Magento/Authorizenet/Model/Directpost/Request.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,50 +112,50 @@ public function setDataFromOrder(
112112
sprintf('%.2F', $order->getBaseShippingAmount())
113113
);
114114

115-
//need to use strval() because NULL values IE6-8 decodes as "null" in JSON in JavaScript,
115+
//need to use (string) because NULL values IE6-8 decodes as "null" in JSON in JavaScript,
116116
//but we need "" for null values.
117117
$billing = $order->getBillingAddress();
118118
if (!empty($billing)) {
119-
$this->setXFirstName(strval($billing->getFirstname()))
120-
->setXLastName(strval($billing->getLastname()))
121-
->setXCompany(strval($billing->getCompany()))
122-
->setXAddress(strval($billing->getStreetLine(1)))
123-
->setXCity(strval($billing->getCity()))
124-
->setXState(strval($billing->getRegion()))
125-
->setXZip(strval($billing->getPostcode()))
126-
->setXCountry(strval($billing->getCountryId()))
127-
->setXPhone(strval($billing->getTelephone()))
128-
->setXFax(strval($billing->getFax()))
129-
->setXCustId(strval($billing->getCustomerId()))
130-
->setXCustomerIp(strval($order->getRemoteIp()))
131-
->setXCustomerTaxId(strval($billing->getTaxId()))
132-
->setXEmail(strval($order->getCustomerEmail()))
133-
->setXEmailCustomer(strval($paymentMethod->getConfigData('email_customer')))
134-
->setXMerchantEmail(strval($paymentMethod->getConfigData('merchant_email')));
119+
$this->setXFirstName((string)$billing->getFirstname())
120+
->setXLastName((string)$billing->getLastname())
121+
->setXCompany((string)$billing->getCompany())
122+
->setXAddress((string)$billing->getStreetLine(1))
123+
->setXCity((string)$billing->getCity())
124+
->setXState((string)$billing->getRegion())
125+
->setXZip((string)$billing->getPostcode())
126+
->setXCountry((string)$billing->getCountryId())
127+
->setXPhone((string)$billing->getTelephone())
128+
->setXFax((string)$billing->getFax())
129+
->setXCustId((string)$billing->getCustomerId())
130+
->setXCustomerIp((string)$order->getRemoteIp())
131+
->setXCustomerTaxId((string)$billing->getTaxId())
132+
->setXEmail((string)$order->getCustomerEmail())
133+
->setXEmailCustomer((string)$paymentMethod->getConfigData('email_customer'))
134+
->setXMerchantEmail((string)$paymentMethod->getConfigData('merchant_email'));
135135
}
136136

137137
$shipping = $order->getShippingAddress();
138138
if (!empty($shipping)) {
139139
$this->setXShipToFirstName(
140-
strval($shipping->getFirstname())
140+
(string)$shipping->getFirstname()
141141
)->setXShipToLastName(
142-
strval($shipping->getLastname())
142+
(string)$shipping->getLastname()
143143
)->setXShipToCompany(
144-
strval($shipping->getCompany())
144+
(string)$shipping->getCompany()
145145
)->setXShipToAddress(
146-
strval($shipping->getStreetLine(1))
146+
(string)$shipping->getStreetLine(1)
147147
)->setXShipToCity(
148-
strval($shipping->getCity())
148+
(string)$shipping->getCity()
149149
)->setXShipToState(
150-
strval($shipping->getRegion())
150+
(string)$shipping->getRegion()
151151
)->setXShipToZip(
152-
strval($shipping->getPostcode())
152+
(string)$shipping->getPostcode()
153153
)->setXShipToCountry(
154-
strval($shipping->getCountryId())
154+
(string)$shipping->getCountryId()
155155
);
156156
}
157157

158-
$this->setXPoNum(strval($payment->getPoNumber()));
158+
$this->setXPoNum((string)$payment->getPoNumber());
159159

160160
return $this;
161161
}

app/code/Magento/Config/Model/Config/Backend/Currency/AbstractCurrency.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function _getCurrencyBase()
7171
$this->getScopeId()
7272
);
7373
}
74-
return strval($value);
74+
return (string)$value;
7575
}
7676

7777
/**
@@ -88,7 +88,7 @@ protected function _getCurrencyDefault()
8888
$this->getScopeId()
8989
);
9090
}
91-
return strval($value);
91+
return (string)$value;
9292
}
9393

9494
/**

app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function execute()
5050
$redirectBlock->setData('goto_success_page', true);
5151
} else {
5252
if ($this->checkPaymentMethod($order)) {
53-
$gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG')));
53+
$gotoSection = $this->_cancelPayment((string)$this->getRequest()->getParam('RESPMSG'));
5454
$redirectBlock->setData('goto_section', $gotoSection);
5555
$redirectBlock->setData('error_msg', __('Your payment has been declined. Please try again.'));
5656
} else {

app/code/Magento/Quote/Model/Quote.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ public function addProduct(
16081608
* Error message
16091609
*/
16101610
if (is_string($cartCandidates) || $cartCandidates instanceof \Magento\Framework\Phrase) {
1611-
return strval($cartCandidates);
1611+
return (string)$cartCandidates;
16121612
}
16131613

16141614
/**

lib/internal/Magento/Framework/DB/Select/OrderRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function render(Select $select, $sql = '')
4040
$order = [];
4141
foreach ($select->getPart(Select::ORDER) as $term) {
4242
if (is_array($term)) {
43-
if (is_numeric($term[0]) && strval(intval($term[0])) == $term[0]) {
43+
if (is_numeric($term[0]) && (string)(int)$term[0] == $term[0]) {
4444
$order[] = (int)trim($term[0]) . ' ' . $term[1];
4545
} else {
4646
$order[] = $this->quote->quoteIdentifier($term[0]) . ' ' . $term[1];
4747
}
48-
} elseif (is_numeric($term) && strval(intval($term)) == $term) {
48+
} elseif (is_numeric($term) && (string)(int)$term == $term) {
4949
$order[] = (int)trim($term);
5050
} else {
5151
$order[] = $this->quote->quoteIdentifier($term);

lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ public function getChecked($value)
121121
return;
122122
}
123123
if (!is_array($checked)) {
124-
$checked = [strval($checked)];
124+
$checked = [(string)$checked];
125125
} else {
126126
foreach ($checked as $k => $v) {
127-
$checked[$k] = strval($v);
127+
$checked[$k] = (string)$v;
128128
}
129129
}
130-
if (in_array(strval($value), $checked)) {
130+
if (in_array((string)$value, $checked)) {
131131
return 'checked';
132132
}
133133
return;
@@ -141,13 +141,13 @@ public function getDisabled($value)
141141
{
142142
if ($disabled = $this->getData('disabled')) {
143143
if (!is_array($disabled)) {
144-
$disabled = [strval($disabled)];
144+
$disabled = [(string)$disabled];
145145
} else {
146146
foreach ($disabled as $k => $v) {
147-
$disabled[$k] = strval($v);
147+
$disabled[$k] = (string)$v;
148148
}
149149
}
150-
if (in_array(strval($value), $disabled)) {
150+
if (in_array((string)$value, $disabled)) {
151151
return 'disabled';
152152
}
153153
}

lib/internal/Magento/Framework/Filter/Translit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $
409409
$convertConfig = $config->getValue('url/convert', 'default');
410410
if ($convertConfig) {
411411
foreach ($convertConfig as $configValue) {
412-
$this->convertTable[strval($configValue['from'])] = strval($configValue['to']);
412+
$this->convertTable[(string)$configValue['from']] = (string)$configValue['to'];
413413
}
414414
}
415415
}

lib/internal/Magento/Framework/Phrase/Renderer/Placeholder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ public function render(array $source, array $arguments)
4040
*/
4141
private function keyToPlaceholder($key)
4242
{
43-
return '%' . (is_int($key) ? strval($key + 1) : $key);
43+
return '%' . (is_int($key) ? (string)($key + 1) : $key);
4444
}
4545
}

0 commit comments

Comments
 (0)