Skip to content

Commit 3784197

Browse files
committed
Merge branch '5.2' into 5.3
* 5.2: Simplify some code with null coalesce operator Don't use deprecated TestLogger class
2 parents 474f614 + ce917b6 commit 3784197

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

DateFormatter/IntlDateFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ public function __construct(?string $locale, ?int $datetype, ?int $timetype, $ti
144144
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'calendar', $calendar, 'Only the GREGORIAN calendar is supported');
145145
}
146146

147-
$this->datetype = null !== $datetype ? $datetype : self::FULL;
148-
$this->timetype = null !== $timetype ? $timetype : self::FULL;
147+
$this->datetype = $datetype ?? self::FULL;
148+
$this->timetype = $timetype ?? self::FULL;
149149

150150
if ('' === ($pattern ?? '')) {
151151
$pattern = $this->getDefaultPattern();

Tests/DateFormatter/AbstractIntlDateFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ protected function getDefaultDateFormatter($pattern = null)
935935
protected function getDateTime($timestamp, $timeZone)
936936
{
937937
$dateTime = new \DateTime();
938-
$dateTime->setTimestamp(null === $timestamp ? time() : $timestamp);
938+
$dateTime->setTimestamp($timestamp ?? time());
939939
$dateTime->setTimezone(new \DateTimeZone($timeZone ?: getenv('TZ') ?: 'UTC'));
940940

941941
return $dateTime;

Util/GitRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static function exec(string $command, string $customErrorMessage = null)
9595
exec(sprintf('%s 2>&1', $command), $output, $result);
9696

9797
if (0 !== $result) {
98-
throw new RuntimeException(null !== $customErrorMessage ? $customErrorMessage : sprintf('The "%s" command failed.', $command));
98+
throw new RuntimeException($customErrorMessage ?? sprintf('The "%s" command failed.', $command));
9999
}
100100

101101
return $output;

0 commit comments

Comments
 (0)