Skip to content

Commit c7c679c

Browse files
committed
CS: Apply ternary_to_null_coalescing fixer
1 parent a2515c7 commit c7c679c

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
@@ -114,7 +114,7 @@ public function asort(&$array, $sortFlag = self::SORT_REGULAR)
114114
self::SORT_STRING => \SORT_STRING,
115115
];
116116

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

119119
return asort($array, $plainSortFlag);
120120
}

DateFormatter/DateFormat/FullTransformer.php

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

NumberFormatter/NumberFormatter.php

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

403403
/**

0 commit comments

Comments
 (0)