Skip to content

Commit 96102bf

Browse files
committed
AC-1989: Fix subset of deprecated php usages
- Fixes for php code
1 parent 7900123 commit 96102bf

File tree

4 files changed

+4
-4
lines changed
  • app/code/Magento

4 files changed

+4
-4
lines changed

app/code/Magento/Cron/Model/Config/Converter/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function _processScheduleParam(array $jobConfig, $jobName, array &$res
9292
protected function _processRunModel(array $jobConfig, $jobName, array &$result)
9393
{
9494
if (isset($jobConfig['run']) && is_array($jobConfig['run']) && array_key_exists('model', $jobConfig['run'])) {
95-
$callPath = explode('::', $jobConfig['run']['model']);
95+
$callPath = explode('::', $jobConfig['run']['model'] ?? '');
9696

9797
if (empty($callPath) || empty($callPath[0]) || empty($callPath[1])) {
9898
unset($result[$jobName]['run']);

app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function _prepareRates($array)
107107

108108
foreach ($array as $key => $rate) {
109109
foreach ($rate as $code => $value) {
110-
$parts = explode('.', $value);
110+
$parts = explode('.', $value ?? '');
111111
if (count($parts) == 2) {
112112
$parts[1] = str_pad(rtrim($parts[1], 0), 4, '0', STR_PAD_RIGHT);
113113
$array[$key][$code] = join('.', $parts);

app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function getForm()
216216
*/
217217
public function getJsTemplateName()
218218
{
219-
return addcslashes($this->getModel()->getTemplateCode(), "\"\r\n\\");
219+
return addcslashes($this->getModel()->getTemplateCode() ?? '', "\"\r\n\\");
220220
}
221221

222222
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function fetch(Quote $quote, Total $total)
296296
$description = $total->getDiscountDescription();
297297
$result = [
298298
'code' => $this->getCode(),
299-
'title' => strlen($description) ? __('Discount (%1)', $description) : __('Discount'),
299+
'title' => strlen( is_string($description) ? $description : '') ? __('Discount (%1)', $description) : __('Discount'),
300300
'value' => $amount
301301
];
302302
}

0 commit comments

Comments
 (0)