8000 Merge branch '5.4' into 6.2 · andersmateusz/symfony@e267665 · GitHub
[go: up one dir, main page]

Skip to content

Commit e267665

Browse files
Merge branch '5.4' into 6.2
* 5.4: [Security] Allow custom scheme to be used as redirection URIs [Validator] Do not mock metadata factory on debug command tests [HttpKernel][WebProfilerBundle] Fix search feature update Intl component to take into account B-variant when converting Alpha3 to Alpha2. fixing issue with Darwin. [VarDumper] Fix dumping `ArrayObject` with `DumpDataCollector` [VarDumper] Add tests to demonstrate a bug when dumping ArrayObject with full stack fmk [DebugBundle][FrameworkBundle] Fix using the framework without the Console component [FrameworkBundle] Add missing monolog channel tag to the `messenger:failed:retry` command fetch all known ChoiceType values at once [RateLimiter] fix incorrect retryAfter of FixedWindow Fix Finder phpdoc
2 parents 6cb2647 + 6eff7f0 commit e267665

File tree

24 files changed

+317
-170
lines changed

24 files changed

+317
-170
lines changed

src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bridge\Monolog\Command\ServerLogCommand;
1515
use Symfony\Bundle\DebugBundle\Command\ServerDumpPlaceholderCommand;
1616
use Symfony\Component\Config\FileLocator;
17+
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
1819
use Symfony\Component\DependencyInjection\Extension\Extension;
1920
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
@@ -89,7 +90,7 @@ public function load(array $configs, ContainerBuilder $container)
8990
;
9091
}
9192

92-
if (!class_exists(ServerLogCommand::class)) {
93+
if (!class_exists(Command::class) || !class_exists(ServerLogCommand::class)) {
9394
$container->removeDefinition('monolog.command.server_log');
9495
}
9596
}

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,12 +2189,14 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
21892189
}
21902190

21912191
if (\count($failureTransports) > 0) {
2192-
$container->getDefinition('console.command.messenger_failed_messages_retry')
2193-
->replaceArgument(0, $config['failure_transport']);
2194-
$container->getDefinition('console.command.messenger_failed_messages_show')
2195-
->replaceArgument(0, $config['failure_transport']);
2196-
$container->getDefinition('console.command.messenger_failed_messages_remove')
2197-
->replaceArgument(0, $config['failure_transport']);
2192+
if ($this->hasConsole()) {
2193+
$container->getDefinition('console.command.messenger_failed_messages_retry')
2194+
->replaceArgument(0, $config['failure_transport']);
2195+
$container->getDefinition('console.command.messenger_failed_messages_show')
2196+
->replaceArgument(0, $config['failure_transport']);
2197+
$container->getDefinition('console.command.messenger_failed_messages_remove')
2198+
->replaceArgument(0, $config['failure_transport']);
2199+
}
21982200

21992201
$failureTransportsByTransportNameServiceLocator = ServiceLocatorTagPass::register($container, $failureTransportReferencesByTransportName);
22002202
$container->getDefinition('messenger.failure.send_failed_message_to_failure_transport_listener')

src/Symfony/Bundle/FrameworkBundle/Resources/config/console.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@
190190
abstract_arg('Receivers'),
191191
service('messenger.routable_message_bus'),
192192
service('event_dispatcher'),
193-
service('logger'),
193+
service('logger')->nullOnInvalid(),
194194
service('messenger.transport.native_php_serializer')->nullOnInvalid(),
195195
])
196196
->tag('console.command')
197+
->tag('monolog.logger', ['channel' => 'messenger'])
197198

198199
->set('console.command.messenger_failed_messages_show', FailedMessagesShowCommand::class)
199200
->args([

src/Symfony/Component/Finder/Finder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ public function date(string|array $dates): static
162162
*
163163
* You can use patterns (delimited with / sign), globs or simple strings.
164164
*
165-
* $finder->name('*.php')
166-
* $finder->name('/\.php$/') // same as above
165+
* $finder->name('/\.php$/')
166+
* $finder->name('*.php') // same as above, without dot files
167167
* $finder->name('test.php')
168168
* $finder->name(['test.py', 'test.php'])
169169
*

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
144144
}
145145
}
146146
} else {
147-
foreach ($data as $value) {
148-
if ($choiceList->getChoicesForValues([$value])) {
149-
$knownValues[] = $value;
150-
unset($unknownValues[$value]);
151-
}
147+
foreach ($choiceList->getChoicesForValues($data) as $key => $choice) {
148+
$knownValues[] = $data[$key];
149+
unset($unknownValues[$data[$key]]);
152150
}
153151
}
154152

src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ public function find(?string $ip, ?string $url, ?int $limit, ?string $method, in
5656
$result = [];
5757
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
5858
$values = str_getcsv($line);
59+
60+
if (7 !== \count($values)) {
61+
// skip invalid lines
62+
continue;
63+
}
64+
5965
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
6066
$csvTime = (int) $csvTime;
6167

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private function generateAlpha3ToAlpha2Mapping(ArrayAccessibleResourceBundle $me
225225

226226
foreach ($metadataBundle['alias']['language'] as $alias => $data) {
227227
$language = $data['replacement'];
228-
if (2 === \strlen($language) && 3 === \strlen($alias) && 'overlong' === $data['reason']) {
228+
if (2 === \strlen($language) && 3 === \strlen($alias) && \in_array($data['reason'], ['overlong', 'bibliographic'], true)) {
229229
$alpha3ToAlpha2[$alias] = $language;
230230
}
231231
}

src/Symfony/Component/Intl/Resources/bin/update-data.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@
160160
}
161161

162162
$genrb = $buildDir.'/bin/genrb';
163-
$genrbEnv = 'LD_LIBRARY_PATH='.$buildDir.'/lib ';
163+
if (\PHP_OS === 'Darwin') {
164+
$genrbEnv = 'DYLD_LIBRARY_PATH='.$buildDir.'/lib ';
165+
} else {
166+
$genrbEnv = 'LD_LIBRARY_PATH='.$buildDir.'/lib ';
167+
}
164168

165169
echo "Using $genrb.\n";
166170

src/Symfony/Component/Intl/Resources/data/languages/meta.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,7 @@
14831483
'bam' => 'bm',
14841484
'ben' => 'bn',
14851485
'bod' => 'bo',
1486+
'tib' => 'bo',
14861487
'bre' => 'br',
14871488
'bos' => 'bs',
14881489
'cat' => 'ca',
@@ -1491,26 +1492,33 @@
14911492
'cos' => 'co',
14921493
'cre' => 'cr',
14931494
'ces' => 'cs',
1495+
'cze' => 'cs',
14941496
'chu' => 'cu',
14951497
'chv' => 'cv',
14961498
'cym' => 'cy',
1499+
'wel' => 'cy',
14971500
'dan' => 'da',
14981501
'deu' => 'de',
1502+
'ger' => 'de',
14991503
'div' => 'dv',
15001504
'dzo' => 'dz',
15011505
'ewe' => 'ee',
15021506
'ell' => 'el',
1507+
'gre' => 'el',
15031508
'eng' => 'en',
15041509
'epo' => 'eo',
15051510
'spa' => 'es',
15061511
'est' => 'et',
1512+
'baq&# 10000 39; => 'eu',
15071513
'eus' => 'eu',
15081514
'fas' => 'fa',
1515+
'per' => 'fa',
15091516
'ful' => 'ff',
15101517
'fin' => 'fi',
15111518
'fij' => 'fj',
15121519
'fao' => 'fo',
15131520
'fra' => 'fr',
1521+
'fre' => 'fr',
15141522
'fry' => 'fy',
15151523
'gle' => 'ga',
15161524
'gla' => 'gd',
@@ -1525,6 +1533,7 @@
15251533
'hrv' => 'hr',
15261534
'hat' => 'ht',
15271535
'hun' => 'hu',
1536+
'arm' => 'hy',
15281537
'hye' => 'hy',
15291538
'her' => 'hz',
15301539
'ina' => 'ia',
@@ -1534,11 +1543,13 @@
15341543
'iii' => 'ii',
15351544
'ipk' => 'ik',
15361545
'ido' => 'io',
1546+
'ice' => 'is',
15371547
'isl' => 'is',
15381548
'ita' => 'it',
15391549
'iku' => 'iu',
15401550
'jpn' => 'ja',
15411551
'jav' => 'jv',
1552+
'geo' => 'ka',
15421553
'kat' => 'ka',
15431554
'kon' => 'kg',
15441555
'kik' => 'ki',
@@ -1565,19 +1576,24 @@
15651576
'lav' => 'lv',
15661577
'mlg' => 'mg',
15671578
'mah' => 'mh',
1579+
'mao' => 'mi',
15681580
'mri' => 'mi',
1581+
'mac' => 'mk',
15691582
'mkd' => 'mk',
15701583
'mal' => 'ml',
15711584
'mon' => 'mn',
15721585
'mar' => 'mr',
1586+
'may' => 'ms',
15731587
'msa' => 'ms',
15741588
'mlt' => 'mt',
1589+
'bur' => 'my',
15751590
'mya' => 'my',
15761591
'nau' => 'na',
15771592
'nob' => 'nb',
15781593
'nde' => 'nd',
15791594
'nep' => 'ne',
15801595
'ndo' => 'ng',
1596+
'dut' => 'nl',
15811597
'nld' => 'nl',
15821598
'nno' => 'nn',
15831599
'nor' => 'no',
@@ -1599,6 +1615,7 @@
15991615
'run' => 'rn',
16001616
'mol' => 'ro',
16011617
'ron' => 'ro',
1618+
'rum' => 'ro',
16021619
'rus' => 'ru',
16031620
'kin' => 'rw',
16041621
'san' => 'sa',
@@ -1608,10 +1625,12 @@
16081625
'sag' => 'sg',
16091626
'sin' => 'si',
16101627
'slk' => 'sk',
1628+
'slo' => 'sk',
16111629
'slv' => 'sl',
16121630
'smo' => 'sm',
16131631
'sna' => 'sn',
16141632
'som' => 'so',
1633+
'alb' => 'sq',
16151634
'sqi' => 'sq',
16161635
'srp' => 'sr',
16171636
'ssw' => 'ss',
@@ -1644,6 +1663,7 @@
16441663
'yid' => 'yi',
16451664
'yor' => 'yo',
16461665
'zha' => 'za',
1666+
'chi' => 'zh',
16471667
'zho' => 'zh',
16481668
'zul' => 'zu',
16491669
],

src/Symfony/Component/Intl/Tests/LanguagesTest.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ class LanguagesTest extends ResourceBundleTestCase
15061506
'bam' => 'bm',
15071507
'ben' => 'bn',
15081508
'bod' => 'bo',
1509+
'tib' => 'bo',
15091510
'bre' => 'br',
15101511
'bos' => 'bs',
15111512
'cat' => 'ca',
@@ -1514,26 +1515,33 @@ class LanguagesTest extends ResourceBundleTestCase
15141515
'cos' => 'co',
15151516
'cre' => 'cr',
15161517
'ces' => 'cs',
1518+
'cze' => 'cs',
15171519
'chu' => 'cu',
15181520
'chv' => 'cv',
15191521
'cym' => 'cy',
1522+
'wel' => 'cy',
15201523
'dan' => 'da',
15211524
'deu' => 'de',
1525+
'ger' => 'de',
15221526
'div' => 'dv',
15231527
'dzo' => 'dz',
15241528
'ewe' => 'ee',
15251529
'ell' => 'el',
1530+
'gre' => 'el',
15261531
'eng' => 'en',
15271532
'epo' => 'eo',
15281533
'spa' => 'es',
15291534
'est' => 'et',
1535+
'baq' => 'eu',
15301536
'eus' => 'eu',
15311537
'fas' => 'fa',
1538+
'per' => 'fa',
15321539
'ful' => 'ff',
15331540
'fin' => 'fi',
15341541
'fij' => 'fj',
15351542
'fao' => 'fo',
15361543
'fra' => 'fr',
1544+
'fre' => 'fr',
15371545
'fry' => 'fy',
15381546
'gle' => 'ga',
15391547
'gla' => 'gd',
@@ -1548,6 +1556,7 @@ class LanguagesTest extends ResourceBundleTestCase
15481556
'hrv' => 'hr',
15491557
'hat' => 'ht',
15501558
'hun' => 'hu',
1559+
'arm' => 'hy',
15511560
'hye' => 'hy',
15521561
'her' => 'hz',
15531562
'ina' => 'ia',
@@ -1557,11 +1566,13 @@ class LanguagesTest extends ResourceBundleTestCase
15571566
'iii' => 'ii',
15581567
'ipk' => 'ik',
15591568
'ido' => 'io',
1569+
'ice' => 'is',
15601570
'isl' => 'is',
15611571
'ita' => 'it',
15621572
'iku' => 'iu',
15631573
'jpn' => 'ja',
15641574
'jav' => 'jv',
1575+
'geo' => 'ka',
15651576
'kat' => 'ka',
15661577
'kon' => 'kg',
15671578
'kik' => 'ki',
@@ -1588,22 +1599,27 @@ class LanguagesTest extends ResourceBundleTestCase
15881599
'lav' => 'lv',
15891600
'mlg' => 'mg',
15901601
'mah' => 'mh',
1602+
'mao' => 'mi',
15911603
'mri' => 'mi',
1604+
'mac' => 'mk',
15921605
'mkd' => 'mk',
15931606
'mal' => 'ml',
15941607
'mon' => 'mn',
15951608
'mar' => 'mr',
1609+
'may' => 'ms',
15961610
'msa' => 'ms',
15971611
'mlt' => 'mt',
1612+
'bur' => 'my',
15981613
'mya' => 'my',
15991614
'nau' => 'na',
16001615
'nob' => 'nb',
1601-
'nor' => 'no',
16021616
'nde' => 'nd',
16031617
'nep' => 'ne',
16041618
'ndo' => 'ng',
1619+
'dut' => 'nl',
16051620
'nld' => 'nl',
16061621
'nno' => 'nn',
1622+
'nor' => 'no',
16071623
'nbl' => 'nr',
16081624
'nav' => 'nv',
16091625
'nya' => 'ny',
@@ -1622,6 +1638,7 @@ class LanguagesTest extends ResourceBundleTestCase
16221638
'run' => 'rn',
16231639
'mol' => 'ro',
16241640
'ron' => 'ro',
1641+
'rum' => 'ro',
16251642
'rus' => 'ru',
16261643
'kin' => 'rw',
16271644
'san' => 'sa',
@@ -1631,10 +1648,12 @@ class LanguagesTest extends ResourceBundleTestCase
16311648
'sag' => 'sg',
16321649
'sin' => 'si',
16331650
'slk' => 'sk',
1651+
'slo' => 'sk',
16341652
'slv' => 'sl',
16351653
'smo' => 'sm',
16361654
'sna' => 'sn',
16371655
'som' => 'so',
1656+
'alb' => 'sq',
16381657
'sqi' => 'sq',
16391658
'srp' => 'sr',
16401659
'ssw' => 'ss',
@@ -1667,6 +1686,7 @@ class LanguagesTest extends ResourceBundleTestCase
16671686
'yid' => 'yi',
16681687
'yor' => 'yo',
16691688
'zha' => 'za',
1689+
'chi' => 'zh',
16701690
'zho' => 'zh',
16711691
'zul' => 'zu',
16721692
];

0 commit comments

Comments
 (0)
0