Skip to content

Commit 7ec3380

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: CS: Apply ternary_to_null_coalescing fixer
2 parents e280efe + c9843f6 commit 7ec3380

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Collator/Collator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function asort(array &$array, int $sortFlag = self::SORT_REGULAR)
116116
self::SORT_STRING => \SORT_STRING,
117117
];
118118

119-
$plainSortFlag = isset($intlToPlainFlagMap[$sortFlag]) ? $intlToPlainFlagMap[$sortFlag] : self::SORT_REGULAR;
119+
$plainSortFlag = $intlToPlainFlagMap[$sortFlag] ?? self::SORT_REGULAR;
120120

121121
return asort($array, $plainSortFlag);
122122
}

DateFormatter/DateFormat/FullTransformer.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ private function calculateUnixTimestamp(\DateTime $dateTime, array $options)
300300
private function getDefaultValueForOptions(array $options): array
301301
{
302302
return [
303-
'year' => isset($options['year']) ? $options['year'] : 1970,
304-
'month' => isset($options['month']) ? $options['month'] : 1,
305-
'day' => isset($options['day']) ? $options['day'] : 1,
306-
'hour' => isset($options['hour']) ? $options['hour'] : 0,
307-
'hourInstance' => isset($options['hourInstance']) ? $options['hourInstance'] : null,
308-
'minute' => isset($options['minute']) ? $options['minute'] : 0,
309-
'second' => isset($options['second']) ? $options['second'] : 0,
310-
'marker' => isset($options['marker']) ? $options['marker'] : null,
311-
'timezone' => isset($options['timezone']) ? $options['timezone'] : null,
303+
'year' => $options['year'] ?? 1970,
304+
'month' => $options['month'] ?? 1,
305+
'day' => $options['day'] ?? 1,
306+
'hour' => $options['hour'] ?? 0,
307+
'hourInstance' => $options['hourInstance'] ?? null,
308+
'minute' => $options['minute'] ?? 0,
309+
'second' => $options['second'] ?? 0,
310+
'marker' => $options['marker'] ?? null,
311+
'timezone' => $options['timezone'] ?? null,
312312
];
313313
}
314314
}

NumberFormatter/NumberFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function format($value, int $type = self::TYPE_DEFAULT)
396396
*/
397397
public function getAttribute(int $attr)
398398
{
399-
return isset($this->attributes[$attr]) ? $this->attributes[$attr] : null;
399+
return $this->attributes[$attr] ?? null;
400400
}
401401

402402
/**

0 commit comments

Comments
 (0)