Skip to content

Commit 2100ad5

Browse files
AC-988:: Changed ternary to null coalescing operator
1 parent 59ad154 commit 2100ad5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public function afterSave()
7777
$frequency = $this->getData('groups/productalert_cron/fields/frequency/value');
7878

7979
$cronExprArray = [
80-
is_array($time) ? (int)$time[1] : 0, //Minute
81-
is_array($time) ? (int)$time[0] : 0, //Hour
80+
(int)($time[1] ?? 0), //Minute
81+
(int)($time[0] ?? 0), //Hour
8282
$frequency == \Magento\Cron\Model\Config\Source\Frequency::CRON_MONTHLY ? '1' : '*', //Day of the Month
8383
'*', //Month of the Year
8484
$frequency == \Magento\Cron\Model\Config\Source\Frequency::CRON_WEEKLY ? '1' : '*', //Day of the Week

app/code/Magento/Cron/Model/Config/Backend/Sitemap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public function afterSave()
7777
$frequency = $this->getData('groups/generate/fields/frequency/value');
7878

7979
$cronExprArray = [
80-
is_array($time) ? (int)$time[1] : 0, //Minute
81-
is_array($time) ? (int)$time[0] : 0, //Hour
80+
(int)$time[1] ?? 0, //Minute
81+
(int)$time[0] ?? 0, //Hour
8282
$frequency == \Magento\Cron\Model\Config\Source\Frequency::CRON_MONTHLY ? '1' : '*', //Day of the Month
8383
'*', //Month of the Year
8484
$frequency == \Magento\Cron\Model\Config\Source\Frequency::CRON_WEEKLY ? '1' : '*', //# Day of the Week

0 commit comments

Comments
 (0)