Skip to content

Commit 09dbeac

Browse files
Merge branch '6.4' into 7.2
* 6.4: [Intl] Fix locale validator when canonicalize is true Update GitHub PR template [Notifier] Update fake SMS transports to use contracts event dispatcher.
2 parents 12ccba0 + c6f3da1 commit 09dbeac

File tree

5 files changed

+35
-17
lines changed

5 files changed

+35
-17
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 7.4 for features / 6.4, 7.2, or 7.3 for bug fixes <!-- see below -->
3+
| Branch? | 7.4 for features / 6.4, 7.2, or 7.3 for bug fixes
44
| Bug fix? | yes/no
5-
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
6-
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
7-
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
5+
| New feature? | yes/no <!-- if yes, also update src/**/CHANGELOG.md -->
6+
| Deprecations? | yes/no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md -->
7+
| Issues | Fix #... <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below -->
88
| License | MIT
99

1010
<!--
11-
Replace this notice by a description of your feature/bugfix.
12-
This will help reviewers and should be a good start for the documentation.
11+
🛠️ Replace this text with a concise explanation of your change:
12+
- What it does and why it's needed
13+
- A simple example of how it works (include PHP, YAML, etc.)
14+
- If it modifies existing behavior, include a before/after comparison
1315
14-
Additionally (see https://symfony.com/releases):
15-
- Always add tests and ensure they pass.
16-
- Bug fixes must be submitted against the lowest maintained branch where they apply
17-
(lowest branches are regularly merged to upper ones so they get the fixes too).
18-
- Features and deprecations must be submitted against the latest branch.
19-
- For new features, provide some code snippets to help understand usage.
20-
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
21-
- Never break backward compatibility (see https://symfony.com/bc).
16+
Contributor guidelines:
17+
- ✅ Add tests and ensure they pass
18+
- 🐞 Bug fixes must target the **lowest maintained** branch where they apply
19+
https://symfony.com/releases#maintained-symfony-branches
20+
- ✨ New features and deprecations must target the **feature** branch
21+
and must add an entry to the changelog file of the patched component:
22+
https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
23+
- 🔒 Do not break backward compatibility:
24+
https://symfony.com/bc
2225
-->

src/Symfony/Component/Notifier/Bridge/FakeSms/FakeSmsEmailTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Notifier\Bridge\FakeSms;
1313

14-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1514
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
1615
use Symfony\Component\Mailer\MailerInterface;
1716
use Symfony\Component\Mime\Email;
@@ -20,6 +19,7 @@
2019
use Symfony\Component\Notifier\Message\SentMessage;
2120
use Symfony\Component\Notifier\Message\SmsMessage;
2221
use Symfony\Component\Notifier\Transport\AbstractTransport;
22+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2323
use Symfony\Contracts\HttpClient\HttpClientInterface;
2424

2525
/**

src/Symfony/Component/Notifier/Bridge/FakeSms/FakeSmsLoggerTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
namespace Symfony\Component\Notifier\Bridge\FakeSms;
1313

1414
use Psr\Log\LoggerInterface;
15-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1615
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
1716
use Symfony\Component\Notifier\Message\MessageInterface;
1817
use Symfony\Component\Notifier\Message\SentMessage;
1918
use Symfony\Component\Notifier\Message\SmsMessage;
2019
use Symfony\Component\Notifier\Transport\AbstractTransport;
20+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2121
use Symfony\Contracts\HttpClient\HttpClientInterface;
2222

2323
/**

src/Symfony/Component/Validator/Constraints/LocaleValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function validate(mixed $value, Constraint $constraint): void
4444
$value = \Locale::canonicalize($value);
4545
}
4646

47-
if (!Locales::exists($value)) {
47+
if (null === $value || !Locales::exists($value)) {
4848
$this->context->buildViolation($constraint->message)
4949
->setParameter('{{ value }}', $this->formatValue($inputValue))
5050
->setCode(Locale::NO_SUCH_LOCALE_ERROR)

src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,21 @@ public static function getInvalidLocales()
9191
];
9292
}
9393

94+
public function testTooLongLocale()
95+
{
96+
$constraint = new Locale([
97+
'message' => 'myMessage',
98+
]);
99+
100+
$locale = str_repeat('a', (\defined('INTL_MAX_LOCALE_LEN') ? \INTL_MAX_LOCALE_LEN : 85) + 1);
101+
$this->validator->validate($locale, $constraint);
102+
103+
$this->buildViolation('myMessage')
104+
->setParameter('{{ value }}', '"' . $locale . '"')
105+
->setCode(Locale::NO_SUCH_LOCALE_ERROR)
106+
->assertRaised();
107+
}
108+
94109
/**
95110
* @dataProvider getUncanonicalizedLocales
96111
*/

0 commit comments

Comments
 (0)