Skip to content

Commit eb80ac7

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Bump license year Bump license year Bump license year [Form] fix passing null $pattern to IntlDateFormatter [Notifier] Add missing LICENSE file Add reference link [Validator] Update Isin message to match the translation files. Update README.md Add AuthenticationTokenCreatedEvent to be propagated
2 parents 7ec3380 + e2bb990 commit eb80ac7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

DateFormatter/IntlDateFormatter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public function __construct(?string $locale, ?int $datetype, ?int $timetype, $ti
147147
$this->datetype = null !== $datetype ? $datetype : self::FULL;
148148
$this->timetype = null !== $timetype ? $timetype : self::FULL;
149149

150+
if ('' === ($pattern ?? '')) {
151+
$pattern = $this->getDefaultPattern();
152+
}
153+
150154
$this->setPattern($pattern);
151155
$this->setTimeZone($timezone);
152156
}
@@ -486,7 +490,7 @@ public function setLenient(bool $lenient)
486490
/**
487491
* Set the formatter's pattern.
488492
*
489-
* @param string|null $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
493+
* @param string $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
490494
*
491495
* @return bool true on success or false on failure
492496
*
@@ -495,11 +499,7 @@ public function setLenient(bool $lenient)
495499
*/
496500
public function setPattern(?string $pattern)
497501
{
498-
if (null === $pattern) {
499-
$pattern = $this->getDefaultPattern();
500-
}
501-
502-
$this->pattern = $pattern;
502+
$this->pattern = (string) $pattern;
503503

504504
return true;
505505
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2020 Fabien Potencier
1+
Copyright (c) 2004-2021 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)