8000 Merge branch '7.0' into 7.1 · kzorluoglu/symfony@50d613a · GitHub
[go: up one dir, main page]

Skip to content

Commit 50d613a

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fix lowest deps synchronize RelayProxy [Form] Adding more `@var` PHPDoc's to silence psalm [Validator] added missing Hungarian translation [Validator] add missing lv translation fix the exception being thrown fix syntax error fix redis messenger scheme comparison [Scheduler] Separate id and description in message providers [Form] Adding `@var` PHPDoc to silence psalm append instead of replacing potentially non-existent named-arguments [Validator] added missing Polish translation add translations for the MacAddress constraint remove invalid changelog entry Added missing Serbian (sr_Latn) translations [Cache][DependencyInjection][Lock][Mailer][Messenger][Notifier][Translation] Url decode username and passwords from `parse_url()` results [Security] added missing Albanian translations [Validator] Add missing Hungarian translation [Serializer] Fix using deserialization path [Validator] Add missing hr translation
2 parents 82e0eff + 388897d commit 50d613a

File tree

38 files changed

+310
-148
lines changed

38 files changed

+310
-148
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,27 +2782,27 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
27822782

27832783
if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', NotifierBridge\Mercure\MercureTransportFactory::class, $parentPackages) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages) && \in_array(MercureBundle::class, $container->getParameter('kernel.bundles'), true)) {
27842784
$container->getDefinition($classToServices[NotifierBridge\Mercure\MercureTransportFactory::class])
2785-
->replaceArgument('$registry', new Reference(HubRegistry::class))
2786-
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2787-
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
2785+
->replaceArgument(0, new Reference(HubRegistry::class))
2786+
->replaceArgument(1, new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2787+
->addArgument(new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
27882788
} elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', NotifierBridge\Mercure\MercureTransportFactory::class, $parentPackages)) {
27892789
$container->removeDefinition($classToServices[NotifierBridge\Mercure\MercureTransportFactory::class]);
27902790
}
27912791

27922792
if (ContainerBuilder::willBeAvailable('symfony/fake-chat-notifier', NotifierBridge\FakeChat\FakeChatTransportFactory::class, ['symfony/framework-bundle', 'symfony/notifier', 'symfony/mailer'])) {
27932793
$container->getDefinition($classToServices[NotifierBridge\FakeChat\FakeChatTransportFactory::class])
2794-
->replaceArgument('$mailer', new Reference('mailer'))
2795-
->replaceArgument('$logger', new Reference('logger'))
2796-
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2797-
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
2794+
->replaceArgument(0, new Reference('mailer'))
2795+
->replaceArgument(1, new Reference('logger'))
2796+
->addArgument(new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2797+
->addArgument(new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
27982798
}
27992799

28002800
if (ContainerBuilder::willBeAvailable('symfony/fake-sms-notifier', NotifierBridge\FakeSms\FakeSmsTransportFactory::class, ['symfony/framework-bundle', 'symfony/notifier', 'symfony/mailer'])) {
28012801
$container->getDefinition($classToServices[NotifierBridge\FakeSms\FakeSmsTransportFactory::class])
2802-
->replaceArgument('$mailer', new Reference('mailer'))
2803-
->replaceArgument('$logger', new Reference('logger'))
2804-
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2805-
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
2802+
->replaceArgument(0, new Reference('mailer'))
2803+
->replaceArgument(1, new Reference('logger'))
2804+
->addArgument(new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2805+
->addArgument(new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
28062806
}
28072807

28082808
if (isset($config['admin_recipients'])) {

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Messenger/DummyTask.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#[AsCronTask(expression: '0 * * * *', timezone: 'Europe/Berlin', arguments: ['2'], schedule: 'dummy_task', method: 'method2')]
1010
#[AsPeriodicTask(frequency: 5, arguments: [3], schedule: 'dummy_task')]
1111
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', jitter: 60, arguments: ['4'], schedule: 'dummy_task', method: 'method4')]
12+
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', arguments: ['9'], schedule: 'dummy_task', method: 'method5')]
13+
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', arguments: ['9b'], schedule: 'dummy_task', method: 'method5')]
14+
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', arguments: ['named' => '9'], schedule: 'dummy_task', method: 'method5')]
1215
class DummyTask
1316
{
1417
public static array $calls = [];

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SchedulerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public function testAutoconfiguredScheduler()
8484
$this->assertCount(779, $calls['__invoke']);
8585
$this->assertSame([['2']], $calls['method2']);
8686
$this->assertSame([['4']], $calls['method4']);
87+
$this->assertSame([['9'], ['9b'], ['named' => '9']], $calls['method5']);
8788
$this->assertSame([['5', 6], ['7', 8]], $calls['attributesOnMethod']);
8889
}
8990

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"symfony/notifier": "^6.4|^7.0",
5757
"symfony/process": "^6.4|^7.0",
5858
"symfony/rate-limiter": "^6.4|^7.0",
59-
"symfony/scheduler": "^6.4|^7.0",
59+
"symfony/scheduler": "^6.4.3|^7.0.3",
6060
"symfony/security-bundle": "^6.4|^7.0",
6161
"symfony/semaphore": "^6.4|^7.0",
6262
"symfony/serializer": "^6.4|^7.0",
@@ -91,7 +91,7 @@
9191
"symfony/mime": "<6.4",
9292
"symfony/property-info": "<6.4",
9393
"symfony/property-access": "<6.4",
94-
"symfony/scheduler": "<6.4",
94+
"symfony/scheduler": "<6.4.3|>=7.0.0,<7.0.3",
9595
"symfony/serializer": "<6.4",
9696
"symfony/security-csrf": "<6.4",
9797
"symfony/security-core": "<6.4",

src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public static function createConnection(#[\SensitiveParameter] array|string $ser
111111
$params = preg_replace_callback('#^memcached:(//)?(?:([^@]*+)@)?#', function ($m) use (&$username, &$password) {
112112
if (!empty($m[2])) {
113113
[$username, $password] = explode(':', $m[2], 2) + [1 => null];
114+
$username = rawurldecode($username);
115+
$password = null !== $password ? rawurldecode($password) : null;
114116
}
115117

116118
return 'file:'.($m[1] ?? '');

src/Symfony/Component/Cache/Traits/RelayProxy.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ public function info(...$sections): \Relay\Relay|array|false
236236
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args());
237237
}
238238

239-
public function flushdb($async = false): \Relay\Relay|bool
239+
public function flushdb($sync = null): \Relay\Relay|bool
240240
{
241241
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushdb(...\func_get_args());
242242
}
243243

244-
public function flushall($async = false): \Relay\Relay|bool
244+
public function flushall($sync = null): \Relay\Relay|bool
245245
{
246246
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushall(...\func_get_args());
247247
}
@@ -326,6 +326,11 @@ public function lastsave(): \Relay\Relay|false|int
326326
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastsave(...\func_get_args());
327327
}
328328

329+
public function lcs($key1, $key2, $options = null): mixed
330+
{
331+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lcs(...\func_get_args());
332+
}
333+
329334
public function bgsave($schedule = false): \Relay\Relay|bool
330335
{
331336
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgsave(...\func_get_args());

src/Symfony/Component/DependencyInjection/EnvVarProcessor.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
287287
}
288288

289289
if ('url' === $prefix) {
290-
$parsedEnv = parse_url($env);
290+
$params = parse_url($env);
291291

292-
if (false === $parsedEnv) {
292+
if (false === $params) {
293293
throw new RuntimeException(sprintf('Invalid URL in env var "%s".', $name));
294294
}
295-
if (!isset($parsedEnv['scheme'], $parsedEnv['host'])) {
295+
if (!isset($params['scheme'], $params['host'])) {
296296
throw new RuntimeException(sprintf('Invalid URL env var "%s": schema and host expected, "%s" given.', $name, $env));
297297
}
298-
$parsedEnv += [
298+
$params += [
299299
'port' => null,
300300
'user' => null,
301301
'pass' => null,
@@ -304,10 +304,13 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
304304
'fragment' => null,
305305
];
306306

307+
$params['user'] = null !== $params['user'] ? rawurldecode($params['user']) : null;
308+
$params['pass'] = null !== $params['pass'] ? rawurldecode($params['pass']) : null;
309+
307310
// remove the '/' separator
308-
$parsedEnv['path'] = '/' === ($parsedEnv['path'] ?? '/') ? '' : substr($parsedEnv['path'], 1);
311+
$params['path'] = '/' === ($params['path'] ?? '/') ? '' : substr($params['path'], 1);
309312

310-
return $parsedEnv;
313+
return $params;
311314
}
312315

313316
if ('query_string' === $prefix) {

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;
3131
use Symfony\Component\Form\ChoiceList\View\ChoiceListView;
3232
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
33+
use Symfony\Component\Form\Event\PreSubmitEvent;
3334
use Symfony\Component\Form\Exception\TransformationFailedException;
3435
use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper;
3536
use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper;
@@ -98,6 +99,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
9899
// Make sure that scalar, submitted values are converted to arrays
99100
// which can be submitted to the checkboxes/radio buttons
100101
$builder->addEventListener(FormEvents::PRE_SUBMIT, static function (FormEvent $event) use ($choiceList, $options, &$unknownValues) {
102+
/** @var PreSubmitEvent $event */
101103
$form = $event->getForm();
102104
$data = $event->getData();
103105

src/Symfony/Component/Form/Extension/Core/Type/FileType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15+
use Symfony\Component\Form\Event\PreSubmitEvent;
1516
use Symfony\Component\Form\FileUploadError;
1617
use Symfony\Component\Form\FormBuilderInterface;
1718
use Symfony\Component\Form\FormEvent;
@@ -45,6 +46,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
4546
{
4647
// Ensure that submitted data is always an uploaded file or an array of some
4748
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($options) {
49+
/** @var PreSubmitEvent $event */
4850
$form = $event->getForm();
4951
$requestHandler = $form->getConfig()->getRequestHandler();
5052

src/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer;
1919
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
2020
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
21+
use Symfony\Component\Form\Event\PreSubmitEvent;
2122
use Symfony\Component\Form\FormBuilderInterface;
2223
use Symfony\Component\Form\FormEvent;
2324
use Symfony\Component\Form\FormEvents;
@@ -59,6 +60,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5960

6061
if ('single_text' === $options['widget']) {
6162
$builder->addEventListener(FormEvents::PRE_SUBMIT, static function (FormEvent $e) use ($options) {
63+
/** @var PreSubmitEvent $event */
6264
$data = $e->getData();
6365
if ($data && preg_match('/^(?P<hours>\d{2}):(?P<minutes>\d{2})(?::(?P<seconds>\d{2})(?:\.\d+)?)?$/', $data, $matches)) {
6466
if ($options['with_seconds']) {

0 commit comments

Comments
 (0)
0