From f27ed9b9bdcb171e29f9a935df2afc6043560a33 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 28 Oct 2022 18:13:32 +0200 Subject: [PATCH 01/54] [DependencyInjection] Don't autoconfigure tag when it's already set with attributes --- .../Compiler/ResolveInstanceofConditionalsPass.php | 2 +- .../DependencyInjection/Tests/Compiler/IntegrationTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php index b211b84e1336d..426fe651a6ada 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php @@ -129,7 +129,7 @@ private function processDefinition(ContainerBuilder $container, string $id, Defi foreach ($instanceofTags[$i] as $k => $v) { if (null === $definition->getDecoratedService() || \in_array($k, $tagsToKeep, true)) { foreach ($v as $v) { - if ($definition->hasTag($k) && \in_array($v, $definition->getTag($k))) { + if ($definition->hasTag($k) && (!$v || \in_array($v, $definition->getTag($k)))) { continue; } $definition->addTag($k, $v); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php index 6624f74901320..eddf1c36882fb 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -860,6 +860,7 @@ static function (ChildDefinition $definition, CustomAutoconfiguration $attribute $definition->addTag('app.custom_tag', get_object_vars($attribute) + ['class' => $reflector->getName()]); } ); + $container->registerForAutoconfiguration(TaggedService1::class)->addTag('app.custom_tag'); $container->register('one', TaggedService1::class) ->setPublic(true) From a34dc7fb59535cacb3886495674205ed16987b90 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 18:49:00 +0200 Subject: [PATCH 02/54] Update CHANGELOG for 4.4.48 --- CHANGELOG-4.4.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG-4.4.md b/CHANGELOG-4.4.md index c16001b9e6c21..a265a13db9965 100644 --- a/CHANGELOG-4.4.md +++ b/CHANGELOG-4.4.md @@ -7,6 +7,17 @@ in 4.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.4.0...v4.4.1 +* 4.4.48 (2022-10-28) + + * bug #47907 [Console] Update Application.php (aleksandr-shevchenko) + * bug #47932 Throw LogicException instead of Error when trying to generate logout-… (addiks) + * bug #47857 [HttpKernel] Fix empty request stack when terminating with exception (krzyc) + * bug #47878 [HttpKernel] Remove EOL when using error_log() in HttpKernel Logger (cyve) + * bug #47883 [Console] Fix error output on windows cli (Maximilian.Beckers) + * bug #47884 [Cache] Reserve numeric keys when doing memory leak prevention (simoheinonen) + * bug #47822 [Mailer] fix: use message object from event (rogamoore) + * bug #47858 [DoctrineBridge] Implement `EventManager::getAllListeners()` (derrabus) + * 4.4.47 (2022-10-12) * bug #47621 [Serializer] Allow getting discriminated type by class name (TamasSzigeti) From 79ecc46bbfa2dfbd742fdea9848f83fbb94a9b50 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 18:49:17 +0200 Subject: [PATCH 03/54] Update CONTRIBUTORS for 4.4.48 --- CONTRIBUTORS.md | 58 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index baf049c540d1d..72ef68321528f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -47,9 +47,9 @@ The Symfony Connect username in parenthesis allows to get more information - Jean-François Simon (jfsimon) - Benjamin Eberlei (beberlei) - Igor Wiedler + - HypeMC (hypemc) - Valentin Udaltsov (vudaltsov) - Vasilij Duško (staff) - - HypeMC (hypemc) - Matthias Pigulla (mpdude) - Laurent VOULLEMIER (lvo) - Antoine Makdessi (amakdessi) @@ -64,6 +64,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alexander Schranz (alexander-schranz) - ornicar - Dany Maillard (maidmaid) + - Mathieu Santostefano (welcomattic) - Eriksen Costa - Diego Saint Esteben (dosten) - stealth35 ‏ (stealth35) @@ -72,7 +73,6 @@ The Symfony Connect username in parenthesis allows to get more information - Francis Besset (francisbesset) - Alexandre Daubois (alexandre-daubois) - Vasilij Dusko | CREATION - - Mathieu Santostefano (welcomattic) - Bulat Shakirzyanov (avalanche123) - Iltar van der Berg - Miha Vrhovnik (mvrhov) @@ -112,17 +112,17 @@ The Symfony Connect username in parenthesis allows to get more information - Przemysław Bogusz (przemyslaw-bogusz) - Henrik Westphal (snc) - Dariusz Górecki (canni) + - Mathieu Lechat (mat_the_cat) - Maxime Helias (maxhelias) - Ener-Getick - Ruud Kamphuis (ruudk) - - Mathieu Lechat (mat_the_cat) + - Antoine Lamirault - Sebastiaan Stok (sstok) - Jérôme Vasseur (jvasseur) - Ion Bazan (ionbazan) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) - - Antoine Lamirault - Daniel Holmes (dholmes) - Toni Uebernickel (havvg) - Bart van den Burg (burgov) @@ -177,12 +177,13 @@ The Symfony Connect username in parenthesis allows to get more information - HeahDude - Richard van Laak (rvanlaak) - Paráda József (paradajozsef) + - Christopher Hertel (chertel) - Alessandro Lai (jean85) - Alexander Schwenn (xelaris) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - François-Xavier de Guillebon (de-gui_f) - - Christopher Hertel (chertel) + - Andreas Schempp (aschempp) - Gabriel Caruso - Anthony GRASSIOT (antograssiot) - Jan Rosier (rosier) @@ -196,7 +197,6 @@ The Symfony Connect username in parenthesis allows to get more information - Tigran Azatyan (tigranazatyan) - Eric GELOEN (gelo) - Matthieu Napoli (mnapoli) - - Andreas Schempp (aschempp) - Tomáš Votruba (tomas_votruba) - Joshua Thijssen - Stefano Sala (stefano.sala) @@ -223,16 +223,17 @@ The Symfony Connect username in parenthesis allows to get more information - Daniel Gomes (danielcsgomes) - Michael Käfer (michael_kaefer) - Hidenori Goto (hidenorigoto) + - Dāvis Zālītis (k0d3r1s) - Albert Casademont (acasademont) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - Chi-teck - Michael Voříšek + - Farhad Safarov (safarov) - SpacePossum - Pablo Godel (pgodel) - Romaric Drigon (romaricdrigon) - Andréia Bohner (andreia) - - Dāvis Zālītis (k0d3r1s) - Jannik Zschiesche - Rafael Dohms (rdohms) - George Mponos (gmponos) @@ -243,7 +244,6 @@ The Symfony Connect username in parenthesis allows to get more information - David Prévot - Vincent Touzet (vincenttouzet) - Fabien Bourigault (fbourigault) - - Farhad Safarov (safarov) - Jérémy Derussé - Nicolas Philippe (nikophil) - Hubert Lenoir (hubert_lenoir) @@ -262,6 +262,7 @@ The Symfony Connect username in parenthesis allows to get more information - Andre Rømcke (andrerom) - Dmitrii Poddubnyi (karser) - soyuka + - Sergey (upyx) - Rouven Weßling (realityking) - BoShurik - Zmey @@ -287,13 +288,13 @@ The Symfony Connect username in parenthesis allows to get more information - Artur Kotyrba - Tyson Andre - Thomas Landauer (thomas-landauer) + - Phil Taylor (prazgod) - GDIBass - Samuel NELA (snela) - dFayet - Karoly Gossler (connorhu) - Vincent AUBERT (vincent) - Sebastien Morel (plopix) - - Sergey (upyx) - Yoann RENARD (yrenard) - Thomas Lallement (raziel057) - Timothée Barray (tyx) @@ -334,6 +335,7 @@ The Symfony Connect username in parenthesis allows to get more information - Islam Israfilov (islam93) - Oleg Andreyev (oleg.andreyev) - Daniel Gorgan + - Sébastien Alfaiate (seb33300) - Hendrik Luup (hluup) - Martin Herndl (herndlm) - Ruben Gonzalez (rubenrua) @@ -361,7 +363,6 @@ The Symfony Connect username in parenthesis allows to get more information - Philipp Wahala (hifi) - Nikolay Labinskiy (e-moe) - Martin Schuhfuß (usefulthink) - - Phil Taylor (prazgod) - apetitpa - Vladyslav Loboda - Pierre Minnieur (pminnieur) @@ -399,7 +400,6 @@ The Symfony Connect username in parenthesis allows to get more information - Tristan Darricau (tristandsensio) - Fabien S (bafs) - Victor Bocharsky (bocharsky_bw) - - Sébastien Alfaiate (seb33300) - Jan Sorgalla (jsor) - henrikbjorn - Alex Bowers @@ -409,6 +409,7 @@ The Symfony Connect username in parenthesis allows to get more information - Craig Duncan (duncan3dc) - Mantis Development - Pablo Lozano (arkadis) + - Romain Monteil (ker0x) - quentin neyrat (qneyrat) - Antonio Jose Cerezo (ajcerezo) - Marcin Szepczynski (czepol) @@ -496,7 +497,6 @@ The Symfony Connect username in parenthesis allows to get more information - Thomas Schulz (king2500) - Benjamin Morel - Bernd Stellwag - - Romain Monteil (ker0x) - Frank de Jonge - Chris Tanaskoski - julien57 @@ -531,6 +531,7 @@ The Symfony Connect username in parenthesis allows to get more information - Giso Stallenberg (gisostallenberg) - Blanchon Vincent (blanchonvincent) - William Arslett (warslett) + - Jérémy REYNAUD (babeuloula) - Christian Schmidt - Gonzalo Vilaseca (gonzalovilaseca) - Vadim Borodavko (javer) @@ -721,7 +722,6 @@ The Symfony Connect username in parenthesis allows to get more information - Guillaume Verstraete - vladimir.panivko - Jason Tan (jt2k) - - Jérémy REYNAUD (babeuloula) - Costin Bereveanu (schniper) - kick-the-bucket - Marek Kalnik (marekkalnik) @@ -834,12 +834,15 @@ The Symfony Connect username in parenthesis allows to get more information - Daniel González (daniel.gonzalez) - Renan (renanbr) - Webnet team (webnet) + - Tobias Bönner - Berny Cantos (xphere81) - Mátyás Somfai (smatyas) - Jan Schumann + - Matheo Daninos (mathdns) - Niklas Fiekas - Mark Challoner (markchalloner) - Markus Bachmann (baachi) + - Philippe SEGATORI (tigitz) - Roger Guasch (rogerguasch) - Luis Tacón (lutacon) - Alex Hofbauer (alexhofbauer) @@ -933,11 +936,13 @@ The Symfony Connect username in parenthesis allows to get more information - Vicent Soria Durá (vicentgodella) - Michael Moravec - Anthony Ferrara + - Glodzienski - Christian Gripp (core23) - Marcel Hernandez - Ioan Negulescu - Jakub Škvára (jskvara) - Andrew Udvare (audvare) + - Volodymyr Panivko - alexpods - Dennis Langen (nijusan) - Adam Szaraniec @@ -1051,7 +1056,6 @@ The Symfony Connect username in parenthesis allows to get more information - Grégoire Hébert (gregoirehebert) - alcaeus - Fred Cox - - Matheo Daninos (mathdns) - Iliya Miroslavov Iliev (i.miroslavov) - Safonov Nikita (ns3777k) - Simon DELICATA @@ -1081,7 +1085,6 @@ The Symfony Connect username in parenthesis allows to get more information - pizzaminded - Matthieu Calie (matth--) - Stéphane Escandell (sescandell) - - Philippe SEGATORI (tigitz) - ivan - linh - Oleg Krasavin (okwinza) @@ -1353,7 +1356,6 @@ The Symfony Connect username in parenthesis allows to get more information - Grinbergs Reinis (shima5) - Ruud Arentsen - Harald Tollefsen - - Tobias Bönner - Arend-Jan Tetteroo - Mbechezi Nawo - Andre Eckardt (korve) @@ -1433,6 +1435,7 @@ The Symfony Connect username in parenthesis allows to get more information - Gladhon - Kai - Bartłomiej Zając + - Maximilian.Beckers - Grégoire Penverne (gpenverne) - Venu - Jonatan Männchen @@ -1545,7 +1548,6 @@ The Symfony Connect username in parenthesis allows to get more information - Vitali Tsyrkin - Juga Paazmaya - afaricamp - - Glodzienski - riadh26 - Konstantinos Alexiou - Dilek Erkut @@ -1737,7 +1739,6 @@ The Symfony Connect username in parenthesis allows to get more information - Antoine M - Frank Jogeleit - Ondřej Frei - - Volodymyr Panivko - Jenne van der Meer - Storkeus - Anton Zagorskii @@ -1793,6 +1794,7 @@ The Symfony Connect username in parenthesis allows to get more information - Morgan Auchede - Christian Morgan - Alexander Miehe + - Simon (kosssi) - Sascha Dens (saschadens) - Maxime Aknin (3m1x4m) - Geordie @@ -1976,6 +1978,7 @@ The Symfony Connect username in parenthesis allows to get more information - Anton Dyshkant - Kirill Nesmeyanov (serafim) - Reece Fowell (reecefowell) + - Muhammad Aakash - Guillaume Gammelin - Valérian Galliat - d-ph @@ -2064,6 +2067,7 @@ The Symfony Connect username in parenthesis allows to get more information - Ariel J. Birnbaum - Danijel Obradović - Pablo Borowicz + - Ondřej Frei - Máximo Cuadros (mcuadros) - Lukas Mencl - EXT - THERAGE Kevin @@ -2207,6 +2211,7 @@ The Symfony Connect username in parenthesis allows to get more information - David de Boer (ddeboer) - Eno Mullaraj (emullaraj) - Stephan Vock (glaubinix) + - Guillem Fondin (guillemfondin) - Ryan Rogers - Arnaud - Klaus Purer @@ -2258,6 +2263,7 @@ The Symfony Connect username in parenthesis allows to get more information - gndk - Alberto Aldegheri - Dalibor Karlović + - Cyril Vermandé (cyve) - Dmitri Petmanson - heccjj - Alexandre Melard @@ -2331,6 +2337,7 @@ The Symfony Connect username in parenthesis allows to get more information - Clément LEFEBVRE (nemoneph) - Walter Dal Mut (wdalmut) - abluchet + - PabloKowalczyk - Matthieu - Albin Kerouaton - Sébastien HOUZÉ @@ -2372,6 +2379,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sandro Hopf (senaria) - ChrisC - jack.shpartko + - Willem Verspyck - Kim Laï Trinh - Jason Desrosiers - m.chwedziak @@ -2386,6 +2394,7 @@ The Symfony Connect username in parenthesis allows to get more information - Ilya Biryukov (ibiryukov) - Roma (memphys) - Giorgio Premi + - Krzysztof Pyrkosz - ncou - Ian Carroll - caponica @@ -2418,6 +2427,7 @@ The Symfony Connect username in parenthesis allows to get more information - Emmanuel Vella (emmanuel.vella) - Guillaume BRETOU (guiguiboy) - Ibon Conesa (ibonkonesa) + - Yoann Chocteau (kezaweb) - nuryagdy mustapayev (nueron) - Carsten Nielsen (phreaknerd) - Jay Severson @@ -2443,6 +2453,7 @@ The Symfony Connect username in parenthesis allows to get more information - Pieter Jordaan - Tournoud (damientournoud) - Michael Dowling (mtdowling) + - Arnaud POINTET (oipnet) - Karlos Presumido (oneko) - Tony Vermeiren (tony) - Thomas Counsell @@ -2490,6 +2501,7 @@ The Symfony Connect username in parenthesis allows to get more information - James Cowgill - sensio - Julien Menth (cfjulien) + - Lyubomir Grozdanov (lubo13) - Nicolas Schwartz (nicoschwartz) - Tim Jabs (rubinum) - Stéphane Seng (stephaneseng) @@ -2541,6 +2553,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alex Teterin (errogaht) - Gunnar Lium (gunnarlium) - Malte Wunsch (maltewunsch) + - Simo Heinonen (simoheinonen) - Tiago Garcia (tiagojsag) - Artiom - Jakub Simon @@ -2571,6 +2584,7 @@ The Symfony Connect username in parenthesis allows to get more information - Boris Betzholz - Eric Caron - Arnau González + - GurvanVgx - 2manypeople - Wing - Thomas Bibb @@ -2713,6 +2727,7 @@ The Symfony Connect username in parenthesis allows to get more information - Milos Colakovic (project2481) - Rénald Casagraude (rcasagraude) - Robin Duval (robin-duval) + - Mohammad Ali Sarbanha (sarbanha) - Artem Lopata (bumz) - alex - Roman Orlov @@ -2849,6 +2864,7 @@ The Symfony Connect username in parenthesis allows to get more information - Jelle Kapitein - Jochen Mandl - Marin Nicolae + - Gerrit Addiks - Albert Prat - Alessandro Loffredo - Ian Phillips @@ -2910,6 +2926,7 @@ The Symfony Connect username in parenthesis allows to get more information - Tomáš Polívka (draczris) - Dennis Smink (dsmink) - Franz Liedke (franzliedke) + - Alex (garrett) - Gaylord Poillon (gaylord_p) - gondo (gondo) - Joris Garonian (grifx) @@ -2955,6 +2972,7 @@ The Symfony Connect username in parenthesis allows to get more information - Francois Martin - Saem Ghani - Stefan Oderbolz + - Tamás Szigeti - Gabriel Moreira - Alexey Popkov - ChS @@ -2975,7 +2993,6 @@ The Symfony Connect username in parenthesis allows to get more information - HADJEDJ Vincent (hadjedjvincent) - Daniele Cesarini (ijanki) - Ismail Asci (ismailasci) - - Simon (kosssi) - Ondřej Mirtes (mirtes) - Paulius Jarmalavičius (pjarmalavicius) - Ramon Ornelas (ramonornela) @@ -3020,6 +3037,7 @@ The Symfony Connect username in parenthesis allows to get more information - Vyacheslav Slinko - Benjamin Laugueux - Jakub Chábek + - William Pinaud (DocFX) - Johannes - Jörg Rühl - wesleyh @@ -3067,6 +3085,7 @@ The Symfony Connect username in parenthesis allows to get more information - Skorney - Lucas Matte - fmarchalemisys + - MGatner - mieszko4 - Steve Preston - ibasaw @@ -3265,6 +3284,7 @@ The Symfony Connect username in parenthesis allows to get more information - Konstantin Scheumann - Michael - fh-github@fholzhauer.de + - rogamoore - AbdElKader Bouadjadja - DSeemiller - Jan Emrich From c58bd31f094d127d4bb06d369c1c1eb47fc30d0e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 18:49:22 +0200 Subject: [PATCH 04/54] Update VERSION for 4.4.48 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 13636cc09fd1a..54ea465379ba1 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.48-DEV'; + public const VERSION = '4.4.48'; public const VERSION_ID = 40448; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 48; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 6303708a5ee6ed5bc9c051ef2b56991df5eb1080 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:50:38 +0200 Subject: [PATCH 05/54] Bump Symfony version to 4.4.49 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 54ea465379ba1..ce28585fe154b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.48'; - public const VERSION_ID = 40448; + public const VERSION = '4.4.49-DEV'; + public const VERSION_ID = 40449; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 48; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 49; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From b44410669f40dc7ff794d15642bec519f3c91170 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:52:12 +0200 Subject: [PATCH 06/54] Update CHANGELOG for 5.4.15 --- CHANGELOG-5.4.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG-5.4.md b/CHANGELOG-5.4.md index 4eab46a4a882f..3d048eff41097 100644 --- a/CHANGELOG-5.4.md +++ b/CHANGELOG-5.4.md @@ -7,6 +7,24 @@ in 5.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v5.4.0...v5.4.1 +* 5.4.15 (2022-10-28) + + * bug #47990 [HttpClient] Fix retrying requests when the content is used by the strategy (nicolas-grekas) + * bug #48005 [ErrorHandler] s/
/
(PhilETaylor) + * bug #47907 [Console] Update Application.php (aleksandr-shevchenko) + * bug #47955 [Security][Serializer] Add missing args to trigger_deprecation (alamirault) + * bug #47932 Throw LogicException instead of Error when trying to generate logout-… (addiks) + * bug #47918 [Intl] Update the ICU data to 72.1 - 5.4 (jderusse) + * bug #47857 [HttpKernel] Fix empty request stack when terminating with exception (krzyc) + * bug #47879 [HttpClient] Fix buffering after calling AsyncContext::passthru() (nicolas-grekas, lubo13) + * bug #47878 [HttpKernel] Remove EOL when using error_log() in HttpKernel Logger (cyve) + * bug #47883 [Console] Fix error output on windows cli (Maximilian.Beckers) + * bug #47884 [Cache] Reserve numeric keys when doing memory leak prevention (simoheinonen) + * bug #47831 [Messenger] Fix amqp socket lost (GurvanVgx) + * bug #47855 [Routing] TypeError in Router when using UrlGenerator (Maximilian.Beckers) + * bug #47822 [Mailer] fix: use message object from event (rogamoore) + * bug #47858 [DoctrineBridge] Implement `EventManager::getAllListeners()` (derrabus) + * 5.4.14 (2022-10-12) * bug #47621 [Serializer] Allow getting discriminated type by class name (TamasSzigeti) From cd80d4bee63d80a30143b3b3a63e3bd550764da3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:52:18 +0200 Subject: [PATCH 07/54] Update VERSION for 5.4.15 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 700f16d3ce718..ee902ea21c25b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.15-DEV'; + public const VERSION = '5.4.15'; public const VERSION_ID = 50415; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From f9eaefa677b8b6bf35eecb11487b3f730d3e1c91 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 19:59:25 +0200 Subject: [PATCH 08/54] Bump Symfony version to 5.4.16 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index ee902ea21c25b..7b47f6812b144 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.15'; - public const VERSION_ID = 50415; + public const VERSION = '5.4.16-DEV'; + public const VERSION_ID = 50416; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 16; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From d8eb393954d81f0ebafc41952aa40a96c0453e57 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Oct 2022 20:04:55 +0200 Subject: [PATCH 09/54] Bump Symfony version to 6.0.16 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index c59e058e28cb9..c9b6213279146 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.15'; - public const VERSION_ID = 60015; + public const VERSION = '6.0.16-DEV'; + public const VERSION_ID = 60016; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 15; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 16; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023'; From f56107c7d238156f9ab02951ba36acb43f9729fd Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Sat, 29 Oct 2022 14:00:53 +0200 Subject: [PATCH 10/54] Run tests with UTC to avoid daylight saving time messing with assertions --- .github/workflows/integration-tests.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index cf869eea173cd..cb2425d7da942 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -92,7 +92,7 @@ jobs: with: coverage: "none" extensions: "memcached,redis-5.3.4,xsl,ldap" - ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 + ini-values: date.timezone=UTC,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 php-version: "${{ matrix.php }}" - name: Load fixtures diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 42d2f02fbd24f..0030dab8466ea 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -48,7 +48,7 @@ jobs: uses: shivammathur/setup-php@v2 with: coverage: "none" - ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 + ini-values: date.timezone=UTC,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 php-version: "${{ matrix.php }}" extensions: "${{ env.extensions }}" tools: flex From 2b7ff1112a88a3d1153b522d7d2df0010c8519d5 Mon Sep 17 00:00:00 2001 From: "Phil E. Taylor" Date: Sun, 30 Oct 2022 11:27:32 +0000 Subject: [PATCH 11/54] [HttpFoundation] Check IPv6 is valid before comparing it --- src/Symfony/Component/HttpFoundation/IpUtils.php | 9 +++++++++ .../Component/HttpFoundation/Tests/IpUtilsTest.php | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/IpUtils.php b/src/Symfony/Component/HttpFoundation/IpUtils.php index 8f30ee099164f..de2112cfc7028 100644 --- a/src/Symfony/Component/HttpFoundation/IpUtils.php +++ b/src/Symfony/Component/HttpFoundation/IpUtils.php @@ -124,6 +124,15 @@ public static function checkIp6($requestIp, $ip) throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); } + // Check to see if we were given a IP4 $requestIp or $ip by mistake + if (str_contains($requestIp, '.') || str_contains($ip, '.')) { + return self::$checkedIps[$cacheKey] = false; + } + + if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { + return self::$checkedIps[$cacheKey] = false; + } + if (str_contains($ip, '/')) { [$address, $netmask] = explode('/', $ip, 2); diff --git a/src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php b/src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php index 48509f9667cd7..8de4b4d7bd472 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/IpUtilsTest.php @@ -73,6 +73,10 @@ public function getIpv6Data() [false, '2a01:198:603:0:396e:4789:8e99:890f', 'unknown'], [false, '', '::1'], [false, null, '::1'], + [false, '127.0.0.1', '::1'], + [false, '0.0.0.0/8', '::1'], + [false, '::1', '127.0.0.1'], + [false, '::1', '0.0.0.0/8'], ]; } From 4d5996d170c2b1e92554e6c49b7e7d7f774058ba Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 1 Nov 2022 07:46:18 +0100 Subject: [PATCH 12/54] Use 6.3 for new features --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 00a686580d01f..6d7bf0b140608 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ | Q | A | ------------- | --- -| Branch? | 6.2 for features / 4.4, 5.4, 6.0 or 6.1 for bug fixes +| Branch? | 6.3 for features / 4.4, 5.4, 6.0, 6.1, or 6.2 for bug fixes | Bug fix? | yes/no | New feature? | yes/no | Deprecations? | yes/no From 5cff81d0be3ee730bbc3faa7ac28e1fe44bed8b8 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 2 Nov 2022 16:49:01 +0100 Subject: [PATCH 13/54] Update actions in the CI to move away from the deprecated runtime --- .github/workflows/integration-tests.yml | 2 +- .github/workflows/intl-data-tests.yml | 2 +- .github/workflows/phpunit-bridge.yml | 2 +- .github/workflows/psalm.yml | 4 ++-- .github/workflows/unit-tests.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index cb2425d7da942..5cd8a425eb58a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -72,7 +72,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install system dependencies run: | diff --git a/.github/workflows/intl-data-tests.yml b/.github/workflows/intl-data-tests.yml index 477278e416c4d..fef1dd1140374 100644 --- a/.github/workflows/intl-data-tests.yml +++ b/.github/workflows/intl-data-tests.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install system dependencies run: | diff --git a/.github/workflows/phpunit-bridge.yml b/.github/workflows/phpunit-bridge.yml index d10098d119114..210029074f83e 100644 --- a/.github/workflows/phpunit-bridge.yml +++ b/.github/workflows/phpunit-bridge.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 96f34721f4a46..7b5fc5a4c8bbd 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -29,12 +29,12 @@ jobs: coverage: none - name: Checkout target branch - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.base_ref }} - name: Checkout PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0030dab8466ea..767141eab5bfe 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 From 42f8a42c2f384df28b0f854902f2ebf01a644c50 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 2 Nov 2022 17:30:38 +0100 Subject: [PATCH 14/54] Update the CI setup to use the new output file --- .github/workflows/package-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml index 40c0e66c573ea..859e1e6328380 100644 --- a/.github/workflows/package-tests.yml +++ b/.github/workflows/package-tests.yml @@ -21,7 +21,7 @@ jobs: - name: Find packages id: find-packages - run: echo "::set-output name=packages::$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))" + run: echo "packages=$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))" >> $GITHUB_OUTPUT - name: Verify meta files are correct run: | From 4b843d1eeae5e3b8b62affbcc08fa9e9acf72b0a Mon Sep 17 00:00:00 2001 From: Kris Buist Date: Thu, 3 Nov 2022 10:41:56 +0100 Subject: [PATCH 15/54] Fix the notification email theme for asynchronously dispatched emails When the `\Symfony\Component\Mailer\Messenger\SendEmailMessage` is dispatched asynchronously, the email message is serialised and unserialised. The theme that was set on the `NotificationEmail` was not included in the serialisation, causing the value to return back to the default after deserialisation. --- src/Symfony/Bridge/Twig/Mime/NotificationEmail.php | 9 +++++++-- .../Bridge/Twig/Tests/Mime/NotificationEmailTest.php | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Mime/NotificationEmail.php b/src/Symfony/Bridge/Twig/Mime/NotificationEmail.php index 1a58aa5e5e5bc..382928a982da2 100644 --- a/src/Symfony/Bridge/Twig/Mime/NotificationEmail.php +++ b/src/Symfony/Bridge/Twig/Mime/NotificationEmail.php @@ -210,7 +210,7 @@ private function getExceptionAsString($exception): string */ public function __serialize(): array { - return [$this->context, parent::__serialize()]; + return [$this->context, $this->theme, parent::__serialize()]; } /** @@ -218,7 +218,12 @@ public function __serialize(): array */ public function __unserialize(array $data): void { - [$this->context, $parentData] = $data; + if (3 === \count($data)) { + [$this->context, $this->theme, $parentData] = $data; + } else { + // Backwards compatibility for deserializing data structures that were serialized without the theme + [$this->context, $parentData] = $data; + } parent::__unserialize($parentData); } diff --git a/src/Symfony/Bridge/Twig/Tests/Mime/NotificationEmailTest.php b/src/Symfony/Bridge/Twig/Tests/Mime/NotificationEmailTest.php index 6c5b4a4bf579e..0b55ca01d6b3e 100644 --- a/src/Symfony/Bridge/Twig/Tests/Mime/NotificationEmailTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Mime/NotificationEmailTest.php @@ -46,6 +46,7 @@ public function testSerialize() ->importance(NotificationEmail::IMPORTANCE_HIGH) ->action('Bar', 'http://example.com/') ->context(['a' => 'b']) + ->theme('example') )); $this->assertEquals([ 'importance' => NotificationEmail::IMPORTANCE_HIGH, @@ -57,6 +58,8 @@ public function testSerialize() 'raw' => true, 'a' => 'b', ], $email->getContext()); + + $this->assertSame('@email/example/notification/body.html.twig', $email->getHtmlTemplate()); } public function testTheme() From c305722f0248ba5e86294fb3d542aa48663dcec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Obradovi=C4=87?= Date: Thu, 3 Nov 2022 15:43:07 +0100 Subject: [PATCH 16/54] Fix search scope when performing fallback mapping driver detection --- .../AbstractDoctrineExtension.php | 4 +- .../AnnotatedEntity/Person.php | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/Symfony/Bridge/Doctrine/Tests/Fixtures/Bundles/AttributesBundle/AnnotatedEntity/Person.php diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index ad4ba455919fe..a3083d2b1e07d 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -279,8 +279,8 @@ protected function detectMetadataDriver(string $dir, ContainerBuilder $container } $container->fileExists($resource, false); - if ($container->fileExists($dir.'/'.$this->getMappingObjectDefaultName(), false)) { - return $this->detectMappingType($dir, $container); + if ($container->fileExists($discoveryPath = $dir.'/'.$this->getMappingObjectDefaultName(), false)) { + return $this->detectMappingType($discoveryPath, $container); } return null; diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Bundles/AttributesBundle/AnnotatedEntity/Person.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Bundles/AttributesBundle/AnnotatedEntity/Person.php new file mode 100644 index 0000000000000..0ec41bb096861 --- /dev/null +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Bundles/AttributesBundle/AnnotatedEntity/Person.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Fixtures\Bundles\AttributesBundle\AnnotatedEntity; + +use Doctrine\ORM\Mapping\Column; +use Doctrine\ORM\Mapping\Entity; +use Doctrine\ORM\Mapping\Id; + +/** + * @Entity + */ +class Person +{ + /** @Id @Column(type="integer") */ + protected $id; + + /** @Column(type="string") */ + public $name; + + public function __construct($id, $name) + { + $this->id = $id; + $this->name = $name; + } + + public function __toString(): string + { + return (string) $this->name; + } +} From 3c7dbb4f134de26c7913f3f50c6f9ff98503102b Mon Sep 17 00:00:00 2001 From: Robert Meijers Date: Thu, 3 Nov 2022 18:26:28 +0100 Subject: [PATCH 17/54] [DependencyInjection] don't move locator tag for service subscriber Decorators move tags applied to the decorated service to the decorating service. But this (sometimes) breaks when the decorated service is a service subscriber, which has the argument for the container explicitly set. This mostly works because the locator for the service subscriber is applied twice. The RegisterServiceSubscriberPass which creates the locator also sets a binding on the service. The ResolveServiceSubscriberPass replaces the arguments referencing the ContainerInterface or ServiceProviderInterface for those services tagged with the container.service_subscriber.locator tag. So when the argument isn't provided in the service definition it will automatically be set using the binding. And in case the argument is set, it will be replaced by the Resolver pass based on the tag. But this thus breaks in case a service explicitly sets the argument (which means the binding isn't applied) and the service being decorated (meaning the locator tag is "lost"). So add the locator tag to the list of tags to keep on the original service. --- .../Compiler/DecoratorServicePass.php | 2 +- .../Compiler/DecoratorServicePassTest.php | 4 +-- .../Tests/Compiler/IntegrationTest.php | 33 ++++++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php b/src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php index 3b8086d0931e6..185a097ebe20b 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php @@ -42,7 +42,7 @@ public function process(ContainerBuilder $container) $tagsToKeep = $container->hasParameter('container.behavior_describing_tags') ? $container->getParameter('container.behavior_describing_tags') - : ['container.do_not_inline', 'container.service_locator', 'container.service_subscriber']; + : ['container.do_not_inline', 'container.service_locator', 'container.service_subscriber', 'container.service_subscriber.locator']; foreach ($definitions as [$id, $definition]) { $decoratedService = $definition->getDecoratedService(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php index 9a456335569d4..2ec9b41ba9f53 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php @@ -249,7 +249,7 @@ public function testProcessLeavesServiceSubscriberTagOnOriginalDefinition() $container = new ContainerBuilder(); $container ->register('foo') - ->setTags(['container.service_subscriber' => [], 'bar' => ['attr' => 'baz']]) + ->setTags(['container.service_subscriber' => [], 'container.service_subscriber.locator' => [], 'bar' => ['attr' => 'baz']]) ; $container ->register('baz') @@ -259,7 +259,7 @@ public function testProcessLeavesServiceSubscriberTagOnOriginalDefinition() $this->process($container); - $this->assertEquals(['container.service_subscriber' => []], $container->getDefinition('baz.inner')->getTags()); + $this->assertEquals(['container.service_subscriber' => [], 'container.service_subscriber.locator' => []], $container->getDefinition('baz.inner')->getTags()); $this->assertEquals(['bar' => ['attr' => 'baz'], 'foobar' => ['attr' => 'bar']], $container->getDefinition('baz')->getTags()); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php index 5a2b603d41f56..713f1b859ebfe 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; +use Psr\Container\ContainerInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; @@ -129,7 +130,7 @@ public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDe $this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.'); } - public function testCanDecorateServiceSubscriber() + public function testCanDecorateServiceSubscriberUsingBinding() { $container = new ContainerBuilder(); $container->register(ServiceSubscriberStub::class) @@ -137,11 +138,33 @@ public function testCanDecorateServiceSubscriber() ->setPublic(true); $container->register(DecoratedServiceSubscriber::class) + ->setProperty('inner', new Reference(DecoratedServiceSubscriber::class.'.inner')) ->setDecoratedService(ServiceSubscriberStub::class); $container->compile(); $this->assertInstanceOf(DecoratedServiceSubscriber::class, $container->get(ServiceSubscriberStub::class)); + $this->assertInstanceOf(ServiceSubscriberStub::class, $container->get(ServiceSubscriberStub::class)->inner); + $this->assertInstanceOf(ServiceLocator::class, $container->get(ServiceSubscriberStub::class)->inner->container); + } + + public function testCanDecorateServiceSubscriberReplacingArgument() + { + $container = new ContainerBuilder(); + $container->register(ServiceSubscriberStub::class) + ->setArguments([new Reference(ContainerInterface::class)]) + ->addTag('container.service_subscriber') + ->setPublic(true); + + $container->register(DecoratedServiceSubscriber::class) + ->setProperty('inner', new Reference(DecoratedServiceSubscriber::class.'.inner')) + ->setDecoratedService(ServiceSubscriberStub::class); + + $container->compile(); + + $this->assertInstanceOf(DecoratedServiceSubscriber::class, $container->get(ServiceSubscriberStub::class)); + $this->assertInstanceOf(ServiceSubscriberStub::class, $container->get(ServiceSubscriberStub::class)->inner); + $this->assertInstanceOf(ServiceLocator::class, $container->get(ServiceSubscriberStub::class)->inner->container); } public function testCanDecorateServiceLocator() @@ -515,6 +538,13 @@ public function testTaggedServiceLocatorWithDefaultIndex() class ServiceSubscriberStub implements ServiceSubscriberInterface { + public $container; + + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + public static function getSubscribedServices(): array { return []; @@ -523,6 +553,7 @@ public static function getSubscribedServices(): array class DecoratedServiceSubscriber { + public $inner; } class DecoratedServiceLocator implements ServiceProviderInterface From 5f7004db6268815e42878008db70b22488446cc5 Mon Sep 17 00:00:00 2001 From: Lukas Mencl Date: Thu, 3 Nov 2022 20:03:45 +0100 Subject: [PATCH 18/54] don not set http_version instead of setting it to null --- src/Symfony/Component/HttpClient/HttplugClient.php | 11 ++++++++--- src/Symfony/Component/HttpClient/Psr18Client.php | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpClient/HttplugClient.php b/src/Symfony/Component/HttpClient/HttplugClient.php index 86c72e4daf085..a91d738a9a8e7 100644 --- a/src/Symfony/Component/HttpClient/HttplugClient.php +++ b/src/Symfony/Component/HttpClient/HttplugClient.php @@ -246,12 +246,17 @@ private function sendPsr7Request(RequestInterface $request, bool $buffer = null) $body->seek(0); } - return $this->client->request($request->getMethod(), (string) $request->getUri(), [ + $options = [ 'headers' => $request->getHeaders(), 'body' => $body->getContents(), - 'http_version' => '1.0' === $request->getProtocolVersion() ? '1.0' : null, 'buffer' => $buffer, - ]); + ]; + + if ('1.0' === $request->getProtocolVersion()) { + $options['http_version'] = '1.0'; + } + + return $this->client->request($request->getMethod(), (string) $request->getUri(), $options); } catch (\InvalidArgumentException $e) { throw new RequestException($e->getMessage(), $request, $e); } catch (TransportExceptionInterface $e) { diff --git a/src/Symfony/Component/HttpClient/Psr18Client.php b/src/Symfony/Component/HttpClient/Psr18Client.php index 7f79af16426a1..230b05aa0e987 100644 --- a/src/Symfony/Component/HttpClient/Psr18Client.php +++ b/src/Symfony/Component/HttpClient/Psr18Client.php @@ -90,11 +90,16 @@ public function sendRequest(RequestInterface $request): ResponseInterface $body->seek(0); } - $response = $this->client->request($request->getMethod(), (string) $request->getUri(), [ + $options = [ 'headers' => $request->getHeaders(), 'body' => $body->getContents(), - 'http_version' => '1.0' === $request->getProtocolVersion() ? '1.0' : null, - ]); + ]; + + if ('1.0' === $request->getProtocolVersion()) { + $options['http_version'] = '1.0'; + } + + $response = $this->client->request($request->getMethod(), (string) $request->getUri(), $options); $psrResponse = $this->responseFactory->createResponse($response->getStatusCode()); From 486f2c5a2ba9e8de1fbac94b4ce2d814957765e0 Mon Sep 17 00:00:00 2001 From: Sezil <72402109+Sezil@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:25:27 +0100 Subject: [PATCH 19/54] [Mailer] Stream timeout not detected due to checking only string result of function fgets --- .../Component/Mailer/Transport/Smtp/Stream/AbstractStream.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php b/src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php index 2b8afd4c6fa67..804b339503161 100644 --- a/src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php +++ b/src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php @@ -75,7 +75,7 @@ public function readLine(): string } $line = fgets($this->out); - if ('' === $line) { + if ('' === $line || false === $line) { $metas = stream_get_meta_data($this->out); if ($metas['timed_out']) { throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription())); From c40af2db9fc689c74841ea61d534497f1860e22a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 4 Nov 2022 08:27:04 +0100 Subject: [PATCH 20/54] [Messenger] Use :memory: for SQLite tests --- .../Doctrine/Tests/Transport/DoctrineIntegrationTest.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php index 2c3556fbd3d30..5eee8270fbcb2 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php @@ -28,13 +28,10 @@ class DoctrineIntegrationTest extends TestCase private $driverConnection; /** @var Connection */ private $connection; - /** @var string */ - private $sqliteFile; protected function setUp(): void { - $this->sqliteFile = sys_get_temp_dir().'/symfony.messenger.sqlite'; - $dsn = getenv('MESSENGER_DOCTRINE_DSN') ?: 'sqlite:///'.$this->sqliteFile; + $dsn = getenv('MESSENGER_DOCTRINE_DSN') ?: 'sqlite://:memory:'; $this->driverConnection = DriverManager::getConnection(['url' => $dsn]); $this->connection = new Connection([], $this->driverConnection); } @@ -42,9 +39,6 @@ protected function setUp(): void protected function tearDown(): void { $this->driverConnection->close(); - if (file_exists($this->sqliteFile)) { - @unlink($this->sqliteFile); - } } public function testConnectionSendAndGet() From 0cc736829a1d27058727df95138a90276275941a Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 4 Nov 2022 17:17:57 +0100 Subject: [PATCH 21/54] [HttpFoundation] Compare cookie with null value as empty string in ResponseCookieValueSame --- .../Test/Constraint/ResponseCookieValueSame.php | 2 +- .../Tests/Test/Constraint/ResponseCookieValueSameTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Test/Constraint/ResponseCookieValueSame.php b/src/Symfony/Component/HttpFoundation/Test/Constraint/ResponseCookieValueSame.php index 554e1a1602dd6..eb9c26a3b7ee8 100644 --- a/src/Symfony/Component/HttpFoundation/Test/Constraint/ResponseCookieValueSame.php +++ b/src/Symfony/Component/HttpFoundation/Test/Constraint/ResponseCookieValueSame.php @@ -59,7 +59,7 @@ protected function matches($response): bool return false; } - return $this->value === $cookie->getValue(); + return $this->value === (string) $cookie->getValue(); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Test/Constraint/ResponseCookieValueSameTest.php b/src/Symfony/Component/HttpFoundation/Tests/Test/Constraint/ResponseCookieValueSameTest.php index fc195309a4b29..1b68b20bddf59 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Test/Constraint/ResponseCookieValueSameTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Test/Constraint/ResponseCookieValueSameTest.php @@ -41,4 +41,12 @@ public function testConstraint() $this->fail(); } + + public function testCookieWithNullValueIsComparedAsEmptyString() + { + $response = new Response(); + $response->headers->setCookie(Cookie::create('foo', null, 0, '/path')); + + $this->assertTrue((new ResponseCookieValueSame('foo', '', '/path'))->evaluate($response, '', true)); + } } From 0aad8c8892f04bac43004088e8e56d83df5307f3 Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Sat, 5 Nov 2022 16:41:26 +0100 Subject: [PATCH 22/54] Allow to disable lock without defining a resource --- .../DependencyInjection/Configuration.php | 5 +++- .../DependencyInjection/ConfigurationTest.php | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 3875db646ff21..3cef369a44347 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -1117,12 +1117,15 @@ private function addLockSection(ArrayNodeDefinition $rootNode) }) ->end() ->addDefaultsIfNotSet() + ->validate() + ->ifTrue(static function (array $config) { return $config['enabled'] && !$config['resources']; }) + ->thenInvalid('At least one resource must be defined.') + ->end() ->fixXmlConfig('resource') ->children() ->arrayNode('resources') ->normalizeKeys(false) ->useAttributeAsKey('name') - ->requiresAtLeastOneElement() ->defaultValue(['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]) ->beforeNormalization() ->ifString()->then(function ($v) { return ['default' => $v]; }) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index e4d36c522fbf2..861e161f6792d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -378,6 +378,31 @@ public function testItErrorsWhenDefaultBusDoesNotExist() ]); } + public function testLockCanBeDisabled() + { + $processor = new Processor(); + $configuration = new Configuration(true); + + $config = $processor->processConfiguration($configuration, [ + ['lock' => ['enabled' => false]], + ]); + + $this->assertFalse($config['lock']['enabled']); + } + + public function testEnabledLockNeedsResources() + { + $processor = new Processor(); + $configuration = new Configuration(true); + + $this->expectException(InvalidConfigurationException::class); + $this->expectExceptionMessage('Invalid configuration for path "framework.lock": At least one resource must be defined.'); + + $processor->processConfiguration($configuration, [ + ['lock' => ['enabled' => true]], + ]); + } + protected static function getBundleDefaultConfig() { return [ From 0e4455b3cfd6183623fedd8e826e1a1c39655a6f Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sat, 5 Nov 2022 17:57:55 +0100 Subject: [PATCH 23/54] [Messenger] Do not throw 'no handlers' exception when skipping due to duplicate handling --- .../Middleware/HandleMessageMiddleware.php | 4 +++- .../Middleware/HandleMessageMiddlewareTest.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php b/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php index eaf6b9508017b..f22a866322968 100644 --- a/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php @@ -53,8 +53,10 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope ]; $exceptions = []; + $alreadyHandled = false; foreach ($this->handlersLocator->getHandlers($envelope) as $handlerDescriptor) { if ($this->messageHasAlreadyBeenHandled($envelope, $handlerDescriptor)) { + $alreadyHandled = true; continue; } @@ -68,7 +70,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope } } - if (null === $handler) { + if (null === $handler && !$alreadyHandled) { if (!$this->allowNoHandlers) { throw new NoHandlerForMessageException(sprintf('No handler for message "%s".', $context['class'])); } diff --git a/src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php b/src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php index c33bad5137d8c..f6e944199b947 100644 --- a/src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php +++ b/src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php @@ -123,6 +123,24 @@ public function testThrowsNoHandlerException() $middleware->handle(new Envelope(new DummyMessage('Hey')), new StackMiddleware()); } + public function testMessageAlreadyHandled() + { + $handler = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']); + + $middleware = new HandleMessageMiddleware(new HandlersLocator([ + DummyMessage::class => [$handler], + ])); + + $envelope = new Envelope(new DummyMessage('Hey')); + + $envelope = $middleware->handle($envelope, $this->getStackMock()); + $handledStamp = $envelope->all(HandledStamp::class); + + $envelope = $middleware->handle($envelope, $this->getStackMock()); + + $this->assertSame($envelope->all(HandledStamp::class), $handledStamp); + } + public function testAllowNoHandlers() { $middleware = new HandleMessageMiddleware(new HandlersLocator([]), true); From cca8bcd4dd1c613d96cbfae0f6564f2cef02d59e Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Wed, 2 Nov 2022 18:15:44 +0100 Subject: [PATCH 24/54] Tell about messenger:consume invalid limit options --- .../Exception/InvalidOptionException.php | 2 +- .../Command/ConsumeMessagesCommand.php | 11 +++++- .../StopWorkerOnTimeLimitListener.php | 5 +++ .../Command/ConsumeMessagesCommandTest.php | 34 +++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Exception/InvalidOptionException.php b/src/Symfony/Component/Console/Exception/InvalidOptionException.php index b2eec61658d33..5cf62792e43c8 100644 --- a/src/Symfony/Component/Console/Exception/InvalidOptionException.php +++ b/src/Symfony/Component/Console/Exception/InvalidOptionException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Console\Exception; /** - * Represents an incorrect option name typed in the console. + * Represents an incorrect option name or value typed in the console. * * @author Jérôme Tamarelle */ diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index defa1a4385b64..43babe5f96a3a 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -14,6 +14,7 @@ use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidOptionException; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -163,7 +164,11 @@ protected function execute(InputInterface $input, OutputInterface $output) } $stopsWhen = []; - if ($limit = $input->getOption('limit')) { + if (null !== ($limit = $input->getOption('limit'))) { + if (!is_numeric($limit) || 0 >= $limit) { + throw new InvalidOptionException(sprintf('Option "limit" must be a positive integer, "%s" passed.', $limit)); + } + $stopsWhen[] = "processed {$limit} messages"; $this->eventDispatcher->addSubscriber(new StopWorkerOnMessageLimitListener($limit, $this->logger)); } @@ -174,6 +179,10 @@ protected function execute(InputInterface $input, OutputInterface $output) } if (null !== ($timeLimit = $input->getOption('time-limit'))) { + if (!is_numeric($timeLimit) || 0 >= $limit) { + throw new InvalidOptionException(sprintf('Option "time-limit" must be a positive integer, "%s" passed.', $timeLimit)); + } + $stopsWhen[] = "been running for {$timeLimit}s"; $this->eventDispatcher->addSubscriber(new StopWorkerOnTimeLimitListener($timeLimit, $this->logger)); } diff --git a/src/Symfony/Component/Messenger/EventListener/StopWorkerOnTimeLimitListener.php b/src/Symfony/Component/Messenger/EventListener/StopWorkerOnTimeLimitListener.php index a3f982dff88d3..247982f8a8865 100644 --- a/src/Symfony/Component/Messenger/EventListener/StopWorkerOnTimeLimitListener.php +++ b/src/Symfony/Component/Messenger/EventListener/StopWorkerOnTimeLimitListener.php @@ -15,6 +15,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Event\WorkerRunningEvent; use Symfony\Component\Messenger\Event\WorkerStartedEvent; +use Symfony\Component\Messenger\Exception\InvalidArgumentException; /** * @author Simon Delicata @@ -30,6 +31,10 @@ public function __construct(int $timeLimitInSeconds, LoggerInterface $logger = n { $this->timeLimitInSeconds = $timeLimitInSeconds; $this->logger = $logger; + + if ($timeLimitInSeconds <= 0) { + throw new InvalidArgumentException('Time limit must be greater than zero.'); + } } public function onWorkerStarted(): void diff --git a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php index 7b56e74fb2984..a7b10edde3e3f 100644 --- a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php +++ b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; +use Symfony\Component\Console\Exception\InvalidOptionException; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ServiceLocator; @@ -172,4 +173,37 @@ public function testRunWithBusOptionAndBusLocator() $this->assertSame(0, $tester->getStatusCode()); $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); } + + /** + * @dataProvider getInvalidOptions + */ + public function testRunWithInvalidOption(string $option, string $value, string $expectedMessage) + { + $receiverLocator = $this->createMock(ContainerInterface::class); + $receiverLocator->expects($this->once())->method('has')->with('dummy-receiver')->willReturn(true); + + $busLocator = $this->createMock(ContainerInterface::class); + + $command = new ConsumeMessagesCommand(new RoutableMessageBus($busLocator), $receiverLocator, new EventDispatcher()); + + $application = new Application(); + $application->add($command); + $tester = new CommandTester($application->get('messenger:consume')); + + $this->expectException(InvalidOptionException::class); + $this->expectExceptionMessage($expectedMessage); + $tester->execute([ + 'receivers' => ['dummy-receiver'], + $option => $value, + ]); + } + + public function getInvalidOptions() + { + yield 'Zero message limit' => ['--limit', '0', 'Option "limit" must be a positive integer, "0" passed.']; + yield 'Non-numeric message limit' => ['--limit', 'whatever', 'Option "limit" must be a positive integer, "whatever" passed.']; + + yield 'Zero second time limit' => ['--time-limit', '0', 'Option "time-limit" must be a positive integer, "0" passed.']; + yield 'Non-numeric time limit' => ['--time-limit', 'whatever', 'Option "time-limit" must be a positive integer, "whatever" passed.']; + } } From d91121f7944f6760931e90f1b7d861c65e09092c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sun, 6 Nov 2022 21:56:17 +0100 Subject: [PATCH 25/54] fix typo in PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 58caff2209f37..51e0d9902a771 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ | Bug fix? | yes/no | New feature? | yes/no | Deprecations? | yes/no -| Tickets | Fix #... +| Tickets | Fix #... | License | MIT | Doc PR | symfony/symfony-docs#... ------------------------]'). + "\nProcessing \"foobar\"...". + $this->generateOutput("[----->----------------------]\nProcessing \"foobar\"..."), + stream_get_contents($output->getStream()) + ); + } } From eebfd6eb0a59272c7d513cefebe157bb360ce384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 14 Nov 2022 00:00:47 +0100 Subject: [PATCH 33/54] Fix signal handlers called after event listeners and skip exit --- src/Symfony/Component/Console/Application.php | 8 ++++---- .../Console/Tests/ApplicationTest.php | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 53be6d05541c1..29951e9c1a164 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -1012,10 +1012,6 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI }); } } - - foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); - } } if (null !== $this->dispatcher) { @@ -1034,6 +1030,10 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI }); } } + + foreach ($commandSignals as $signal) { + $this->signalRegistry->register($signal, [$command, 'handleSignal']); + } } if (null === $this->dispatcher) { diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 641415d28c497..fdb9b3f335d8a 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -1975,6 +1975,21 @@ public function testSignalableCommandInterfaceWithoutSignals() $this->assertSame(0, $application->run(new ArrayInput(['signal']))); } + public function testSignalableCommandHandlerCalledAfterEventListener() + { + $command = new SignableCommand(); + + $subscriber = new SignalEventSubscriber(); + + $dispatcher = new EventDispatcher(); + $dispatcher->addSubscriber($subscriber); + + $application = $this->createSignalableApplication($command, $dispatcher); + $application->setSignalsToDispatchEvent(\SIGUSR1); + $this->assertSame(1, $application->run(new ArrayInput(['signal']))); + $this->assertSame([SignalEventSubscriber::class, SignableCommand::class], $command->signalHandlers); + } + /** * @group tty */ @@ -2076,6 +2091,7 @@ public function isEnabled(): bool class BaseSignableCommand extends Command { public $signaled = false; + public $signalHandlers = []; public $loop = 1000; private $emitsSignal; @@ -2116,6 +2132,7 @@ public function getSubscribedSignals(): array public function handleSignal(int $signal): void { $this->signaled = true; + $this->signalHandlers[] = __CLASS__; } } @@ -2127,6 +2144,7 @@ public function onSignal(ConsoleSignalEvent $event): void { $this->signaled = true; $event->getCommand()->signaled = true; + $event->getCommand()->signalHandlers[] = __CLASS__; } public static function getSubscribedEvents(): array From a13b41adacdcd48d411c44632dc90b0309538fb2 Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Fri, 11 Nov 2022 19:07:25 +0100 Subject: [PATCH 34/54] [Messenger] Fix time-limit check exception --- .../Command/ConsumeMessagesCommand.php | 2 +- .../Command/ConsumeMessagesCommandTest.php | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index 43babe5f96a3a..51210c05c3ce7 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -179,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } if (null !== ($timeLimit = $input->getOption('time-limit'))) { - if (!is_numeric($timeLimit) || 0 >= $limit) { + if (!is_numeric($timeLimit) || 0 >= $timeLimit) { throw new InvalidOptionException(sprintf('Option "time-limit" must be a positive integer, "%s" passed.', $timeLimit)); } diff --git a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php index a7b10edde3e3f..a0014d932fa6d 100644 --- a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php +++ b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php @@ -206,4 +206,35 @@ public function getInvalidOptions() yield 'Zero second time limit' => ['--time-limit', '0', 'Option "time-limit" must be a positive integer, "0" passed.']; yield 'Non-numeric time limit' => ['--time-limit', 'whatever', 'Option "time-limit" must be a positive integer, "whatever" passed.']; } + + public function testRunWithTimeLimit() + { + $envelope = new Envelope(new \stdClass(), [new BusNameStamp('dummy-bus')]); + + $receiver = $this->createMock(ReceiverInterface::class); + $receiver->method('get')->willReturn([$envelope]); + + $receiverLocator = $this->createMock(ContainerInterface::class); + $receiverLocator->method('has')->with('dummy-receiver')->willReturn(true); + $receiverLocator->method('get')->with('dummy-receiver')->willReturn($receiver); + + $bus = $this->createMock(MessageBusInterface::class); + + $busLocator = $this->createMock(ContainerInterface::class); + $busLocator->method('has')->with('dummy-bus')->willReturn(true); + $busLocator->method('get')->with('dummy-bus')->willReturn($bus); + + $command = new ConsumeMessagesCommand(new RoutableMessageBus($busLocator), $receiverLocator, new EventDispatcher()); + + $application = new Application(); + $application->add($command); + $tester = new CommandTester($application->get('messenger:consume')); + $tester->execute([ + 'receivers' => ['dummy-receiver'], + '--time-limit' => 1, + ]); + + $this->assertSame(0, $tester->getStatusCode()); + $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + } } From 627660b2c10519386c5f5ad2961623dbdf0a42ed Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 14 Nov 2022 11:08:49 +0100 Subject: [PATCH 35/54] [Messenger] cs fix --- .../Messenger/Command/ConsumeMessagesCommand.php | 10 +++++----- .../Tests/Command/ConsumeMessagesCommandTest.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index 51210c05c3ce7..d0d36a5c625f6 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -119,7 +119,7 @@ protected function interact(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - if ($this->receiverNames && 0 === \count($input->getArgument('receivers'))) { + if ($this->receiverNames && !$input->getArgument('receivers')) { $io->block('Which transports/receivers do you want to consume?', null, 'fg=white;bg=blue', ' ', true); $io->writeln('Choose which receivers you want to consume messages from in order of priority.'); @@ -133,7 +133,7 @@ protected function interact(InputInterface $input, OutputInterface $output) $input->setArgument('receivers', $io->askQuestion($question)); } - if (0 === \count($input->getArgument('receivers'))) { + if (!$input->getArgument('receivers')) { throw new RuntimeException('Please pass at least one receiver.'); } } @@ -164,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $stopsWhen = []; - if (null !== ($limit = $input->getOption('limit'))) { + if (null !== $limit = $input->getOption('limit')) { if (!is_numeric($limit) || 0 >= $limit) { throw new InvalidOptionException(sprintf('Option "limit" must be a positive integer, "%s" passed.', $limit)); } @@ -178,7 +178,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->eventDispatcher->addSubscriber(new StopWorkerOnMemoryLimitListener($this->convertToBytes($memoryLimit), $this->logger)); } - if (null !== ($timeLimit = $input->getOption('time-limit'))) { + if (null !== $timeLimit = $input->getOption('time-limit')) { if (!is_numeric($timeLimit) || 0 >= $timeLimit) { throw new InvalidOptionException(sprintf('Option "time-limit" must be a positive integer, "%s" passed.', $timeLimit)); } @@ -190,7 +190,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $stopsWhen[] = 'received a stop signal via the messenger:stop-workers command'; $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - $io->success(sprintf('Consuming messages from transport%s "%s".', \count($receivers) > 0 ? 's' : '', implode(', ', $receiverNames))); + $io->success(sprintf('Consuming messages from transport%s "%s".', \count($receivers) > 1 ? 's' : '', implode(', ', $receiverNames))); if ($stopsWhen) { $last = array_pop($stopsWhen); diff --git a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php index a0014d932fa6d..a6540bd55eac9 100644 --- a/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php +++ b/src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php @@ -65,7 +65,7 @@ public function testBasicRun() ]); $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + $this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay()); } public function testRunWithBusOption() @@ -98,7 +98,7 @@ public function testRunWithBusOption() ]); $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + $this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay()); } /** @@ -134,7 +134,7 @@ public function testBasicRunWithBusLocator() ]); $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + $this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay()); } /** @@ -171,7 +171,7 @@ public function testRunWithBusOptionAndBusLocator() ]); $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + $this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay()); } /** @@ -235,6 +235,6 @@ public function testRunWithTimeLimit() ]); $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay()); + $this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay()); } } From 152cafb3f7b7f98e27835bba2085621ae06b0760 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 15 Nov 2022 12:00:03 +0100 Subject: [PATCH 36/54] ensure docblock compatibility with PhpStan's docblock parser In their next releases both packages phpdocumentor/reflection-docblock and phpdocumentor/type-resolver will start using the docblock parser from PhpStan. --- src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php index 420cdddae9768..9333bc74e00bf 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php @@ -84,7 +84,7 @@ class Dummy extends ParentDummy public $h; /** - * @var ?string|int + * @var string|int|null */ public $i; From 7534fb1944030bdcb4bf5ca93a23be53663782e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 15 Nov 2022 21:39:33 +0100 Subject: [PATCH 37/54] Improve message when shell is not detected --- .../Console/Command/DumpCompletionCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Command/DumpCompletionCommand.php b/src/Symfony/Component/Console/Command/DumpCompletionCommand.php index dc0cfaef7b589..518d606a0cf43 100644 --- a/src/Symfony/Component/Console/Command/DumpCompletionCommand.php +++ b/src/Symfony/Component/Console/Command/DumpCompletionCommand.php @@ -93,8 +93,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!file_exists($completionFile)) { $supportedShells = $this->getSupportedShells(); - ($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output) - ->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + if ($shell) { + $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + } else { + $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); + } return self::INVALID; } From 62c8b0af3d5b802b2b8199ed4aba9715874a87f7 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Wed, 16 Nov 2022 14:25:27 +0100 Subject: [PATCH 38/54] [Translation][Lokalize] Configure `replace_breaks` to prevent issues with multilines translations --- .../Component/Translation/Bridge/Lokalise/LokaliseProvider.php | 1 + .../Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php b/src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php index aeada30847cea..06a95dc2e8759 100644 --- a/src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php @@ -151,6 +151,7 @@ private function exportFiles(array $locales, array $domains): array 'filter_langs' => array_values($locales), 'filter_filenames' => array_map([$this, 'getLokaliseFilenameFromDomain'], $domains), 'export_empty_as' => 'skip', + 'replace_breaks' => false, ], ]); diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php b/src/Symfony/Component/Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php index 5df996e94327b..0c3b7d511aa43 100644 --- a/src/Symfony/Component/Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php @@ -562,6 +562,7 @@ public function testReadForOneLocaleAndOneDomain(string $locale, string $domain, 'filter_langs' => [$locale], 'filter_filenames' => [$domain.'.xliff'], 'export_empty_as' => 'skip', + 'replace_breaks' => false, ]); $this->assertSame('POST', $method); From 81d085897a1b8598cd4d5f1b0cec633fbe648997 Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Wed, 16 Nov 2022 15:28:59 +0100 Subject: [PATCH 39/54] [DependencyInjection] Process bindings in ServiceLocatorTagPass --- .../Compiler/ServiceLocatorTagPass.php | 4 ++++ .../Tests/Compiler/ServiceLocatorTagPassTest.php | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php index 5fdbe5686dbfa..72b093043bf15 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php @@ -39,6 +39,10 @@ protected function processValue($value, $isRoot = false) return self::register($this->container, $value->getValues()); } + if ($value instanceof Definition) { + $value->setBindings(parent::processValue($value->getBindings())); + } + if (!$value instanceof Definition || !$value->hasTag('container.service_locator')) { return parent::processValue($value, $isRoot); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php index 25063d35ff3b5..bf6428ee2de47 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\BoundArgument; +use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; @@ -143,4 +144,16 @@ public function testBindingsAreCopied() $this->assertSame(['foo'], array_keys($locator->getBindings())); $this->assertInstanceOf(BoundArgument::class, $locator->getBindings()['foo']); } + + public function testBindingsAreProcessed() + { + $container = new ContainerBuilder(); + + $definition = $container->register('foo') + ->setBindings(['foo' => new ServiceLocatorArgument()]); + + (new ServiceLocatorTagPass())->process($container); + + $this->assertInstanceOf(Reference::class, $definition->getBindings()['foo']->getValues()[0]); + } } From 13212789fdd454f5415fe8a096dc8b01bfa3e706 Mon Sep 17 00:00:00 2001 From: Chi-teck Date: Wed, 9 Nov 2022 22:12:42 +0500 Subject: [PATCH 40/54] Support completion for bash functions --- src/Symfony/Component/Console/Resources/completion.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Console/Resources/completion.bash b/src/Symfony/Component/Console/Resources/completion.bash index bf3edf511b2cb..64b87ccf7c7d5 100644 --- a/src/Symfony/Component/Console/Resources/completion.bash +++ b/src/Symfony/Component/Console/Resources/completion.bash @@ -11,13 +11,14 @@ _sf_{{ COMMAND_NAME }}() { local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it - if [[ $(type -t $sf_cmd) == "alias" ]]; then + sf_cmd_type=$(type -t $sf_cmd) + if [[ $sf_cmd_type == "alias" ]]; then sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") - else + elif [[ $sf_cmd_type == "file" ]]; then sf_cmd=$(type -p $sf_cmd) fi - if [ ! -x "$sf_cmd" ]; then + if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then return 1 fi From be5b76abcd5ee351528e3317c4357250f97e7607 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 19 Nov 2022 18:35:30 +0100 Subject: [PATCH 41/54] ignore const expressions read by phpdocumentor With the upcoming release, phpdocumentator will use the PhpStan docblock parser to extract type information. This change ensure that constant expressions are ignored when extracting types (as we did before when phpdocumentor failed to extract the type) as we do not evaluate them inside the PhpDocExtractor. --- .../Component/PropertyInfo/Util/PhpDocTypeHelper.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php index cafbaaf231b52..c4a2edb174900 100644 --- a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php +++ b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php @@ -11,6 +11,7 @@ namespace Symfony\Component\PropertyInfo\Util; +use phpDocumentor\Reflection\PseudoTypes\ConstExpression; use phpDocumentor\Reflection\PseudoTypes\List_; use phpDocumentor\Reflection\Type as DocType; use phpDocumentor\Reflection\Types\Array_; @@ -39,6 +40,11 @@ final class PhpDocTypeHelper */ public function getTypes(DocType $varType): array { + if ($varType instanceof ConstExpression) { + // It's safer to fall back to other extractors here, as resolving const types correctly is not easy at the moment + return []; + } + $types = []; $nullable = false; @@ -64,6 +70,11 @@ public function getTypes(DocType $varType): array for ($typeIndex = 0; $varType->has($typeIndex); ++$typeIndex) { $type = $varType->get($typeIndex); + if ($type instanceof ConstExpression) { + // It's safer to fall back to other extractors here, as resolving const types correctly is not easy at the moment + return []; + } + // If null is present, all types are nullable if ($type instanceof Null_) { $nullable = true; From a379c354ac145a44f926dfedf9bbeec861ef8e94 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 21 Nov 2022 18:37:52 +0100 Subject: [PATCH 42/54] [HttpKernel] Fix message for unresovable arguments of invokable controllers --- .../NotTaggedControllerValueResolver.php | 5 +++-- .../NotTaggedControllerValueResolverTest.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php b/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php index d4971cc1a5074..48ea6e742d519 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php @@ -69,8 +69,9 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable } if (!$this->container->has($controller)) { - $i = strrpos($controller, ':'); - $controller = substr($controller, 0, $i).strtolower(substr($controller, $i)); + $controller = (false !== $i = strrpos($controller, ':')) + ? substr($controller, 0, $i).strtolower(substr($controller, $i)) + : $controller.'::__invoke'; } $what = sprintf('argument $%s of "%s()"', $argument->getName(), $controller); diff --git a/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php b/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php index 3cf2f0f18562e..4577b5a6d2384 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php @@ -98,6 +98,17 @@ public function testControllerNameIsAnArray() $resolver->resolve($request, $argument); } + public function testInvokableController() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Could not resolve argument $dummy of "App\Controller\Mine::__invoke()", maybe you forgot to register the controller as a service or missed tagging it with the "controller.service_arguments"?'); + $resolver = new NotTaggedControllerValueResolver(new ServiceLocator([])); + $argument = new ArgumentMetadata('dummy', \stdClass::class, false, false, null); + $request = $this->requestWithAttributes(['_controller' => 'App\Controller\Mine']); + $this->assertTrue($resolver->supports($request, $argument)); + $resolver->resolve($request, $argument); + } + private function requestWithAttributes(array $attributes) { $request = Request::create('/'); From cd7e4d64b78ac0ac26cd346434277a124dfb951d Mon Sep 17 00:00:00 2001 From: Vasilij Dusko Date: Sun, 20 Nov 2022 21:43:58 +0200 Subject: [PATCH 43/54] [Notifier] [SMSBiuras] `true`/`false` mismatch for `test_mode` option --- .../Bridge/SmsBiuras/SmsBiurasTransport.php | 2 +- .../Tests/SmsBiurasTransportTest.php | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransport.php b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransport.php index b47c5c216eba0..79b3268016f36 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransport.php @@ -85,7 +85,7 @@ protected function doSend(MessageInterface $message): SentMessage 'apikey' => $this->apiKey, 'message' => $message->getSubject(), 'from' => $this->from, - 'test' => $this->testMode ? 0 : 1, + 'test' => $this->testMode ? 1 : 0, 'to' => $message->getPhone(), ], ]); diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php index 494e66c3bca23..6e0461b9828e6 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Notifier\Bridge\SmsBiuras\Tests; +use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\Notifier\Bridge\SmsBiuras\SmsBiurasTransport; use Symfony\Component\Notifier\Message\ChatMessage; use Symfony\Component\Notifier\Message\MessageInterface; @@ -18,6 +19,7 @@ use Symfony\Component\Notifier\Test\TransportTestCase; use Symfony\Component\Notifier\Transport\TransportInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; +use Symfony\Contracts\HttpClient\ResponseInterface; final class SmsBiurasTransportTest extends TransportTestCase { @@ -44,4 +46,80 @@ public function unsupportedMessagesProvider(): iterable yield [new ChatMessage('Hello!')]; yield [$this->createMock(MessageInterface::class)]; } + + /** + * @dataProvider provideTestMode() + */ + public function testTestMode(array $expected, array $provided) + { + $message = new SmsMessage($provided['phone'], $provided['message']); + + $response = $this->createMock(ResponseInterface::class); + $response->expects($this->atLeast(1)) + ->method('getStatusCode') + ->willReturn(200); + $response->expects($this->atLeast(1)) + ->method('getContent') + ->willReturn('OK: 519545'); + + $client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($response, $expected): ResponseInterface { + $this->assertSame('GET', $method); + $this->assertSame(sprintf( + 'https://savitarna.smsbiuras.lt/api?uid=uid&apikey=api_key&message=%s&from=from&test=%s&to=%s', + rawurlencode($expected['message']), + $expected['transport']['test_mode'], + rawurlencode($expected['phone']), + ), $url); + $this->assertSame($expected['transport']['test_mode'], $options['query']['test']); + + $this->assertSame(200, $response->getStatusCode()); + $this->assertSame('OK: 519545', $response->getContent()); + + return $response; + }); + + $transport = new SmsBiurasTransport('uid', 'api_key', 'from', $provided['transport']['test_mode'], $client); + + $sentMessage = $transport->send($message); + + $this->assertSame('519545', $sentMessage->getMessageId()); + } + + public static function provideTestMode(): array + { + return [ + [ + [ + 'phone' => '+37012345678', + 'message' => 'Hello world!', + 'transport' => [ + 'test_mode' => 0, + ], + ], + [ + 'phone' => '+37012345678', + 'message' => 'Hello world!', + 'transport' => [ + 'test_mode' => 0, + ], + ], + ], + [ + [ + 'phone' => '+37012345678', + 'message' => 'Hello world!', + 'transport' => [ + 'test_mode' => 1, + ], + ], + [ + 'phone' => '+37012345678', + 'message' => 'Hello world!', + 'transport' => [ + 'test_mode' => 1, + ], + ], + ], + ]; + } } From 9221451b6c1156c240dcbb937bc034a63f38f300 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 22 Nov 2022 08:28:33 +0100 Subject: [PATCH 44/54] [Notifier][SmsBiuras] Simplify test and data provider Follows * #48262 --- .../Tests/SmsBiurasTransportTest.php | 54 ++++--------------- 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php index 6e0461b9828e6..7a232ca856cc1 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php @@ -50,9 +50,9 @@ public function unsupportedMessagesProvider(): iterable /** * @dataProvider provideTestMode() */ - public function testTestMode(array $expected, array $provided) + public function testTestMode(int $expected, bool $testMode) { - $message = new SmsMessage($provided['phone'], $provided['message']); + $message = new SmsMessage('+37012345678', 'Hello World!'); $response = $this->createMock(ResponseInterface::class); $response->expects($this->atLeast(1)) @@ -62,15 +62,15 @@ public function testTestMode(array $expected, array $provided) ->method('getContent') ->willReturn('OK: 519545'); - $client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($response, $expected): ResponseInterface { + $client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($response, $message, $testMode, $expected): ResponseInterface { $this->assertSame('GET', $method); $this->assertSame(sprintf( 'https://savitarna.smsbiuras.lt/api?uid=uid&apikey=api_key&message=%s&from=from&test=%s&to=%s', - rawurlencode($expected['message']), - $expected['transport']['test_mode'], - rawurlencode($expected['phone']), + rawurlencode($message->getSubject()), + $expected, + rawurlencode($message->getPhone()), ), $url); - $this->assertSame($expected['transport']['test_mode'], $options['query']['test']); + $this->assertSame($expected, $options['query']['test']); $this->assertSame(200, $response->getStatusCode()); $this->assertSame('OK: 519545', $response->getContent()); @@ -78,48 +78,16 @@ public function testTestMode(array $expected, array $provided) return $response; }); - $transport = new SmsBiurasTransport('uid', 'api_key', 'from', $provided['transport']['test_mode'], $client); + $transport = new SmsBiurasTransport('uid', 'api_key', 'from', $testMode, $client); $sentMessage = $transport->send($message); $this->assertSame('519545', $sentMessage->getMessageId()); } - public static function provideTestMode(): array + public static function provideTestMode(): iterable { - return [ - [ - [ - 'phone' => '+37012345678', - 'message' => 'Hello world!', - 'transport' => [ - 'test_mode' => 0, - ], - ], - [ - 'phone' => '+37012345678', - 'message' => 'Hello world!', - 'transport' => [ - 'test_mode' => 0, - ], - ], - ], - [ - [ - 'phone' => '+37012345678', - 'message' => 'Hello world!', - 'transport' => [ - 'test_mode' => 1, - ], - ], - [ - 'phone' => '+37012345678', - 'message' => 'Hello world!', - 'transport' => [ - 'test_mode' => 1, - ], - ], - ], - ]; + yield [1, true]; + yield [0, false]; } } From b79d6fd13768a941387eb5fafcdba7eaf0249549 Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Wed, 23 Nov 2022 10:25:03 +0100 Subject: [PATCH 45/54] Fix SmsBiurasTransportTest::testTestMode --- .../Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php index 7a232ca856cc1..4a9d084129d52 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php @@ -68,7 +68,7 @@ public function testTestMode(int $expected, bool $testMode) 'https://savitarna.smsbiuras.lt/api?uid=uid&apikey=api_key&message=%s&from=from&test=%s&to=%s', rawurlencode($message->getSubject()), $expected, - rawurlencode($message->getPhone()), + rawurlencode($message->getPhone()) ), $url); $this->assertSame($expected, $options['query']['test']); From 712f057b0f894b722781ac92ad162dcb62b2f04e Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 23 Nov 2022 12:53:39 +0100 Subject: [PATCH 46/54] [Notifier][SMSBiuras] Fix CS --- .../Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php index 4a9d084129d52..51c15c56d4a08 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php @@ -52,7 +52,7 @@ public function unsupportedMessagesProvider(): iterable */ public function testTestMode(int $expected, bool $testMode) { - $message = new SmsMessage('+37012345678', 'Hello World!'); + $message = new SmsMessage('+37012345678', 'Hello World!'); $response = $this->createMock(ResponseInterface::class); $response->expects($this->atLeast(1)) @@ -62,7 +62,7 @@ public function testTestMode(int $expected, bool $testMode) ->method('getContent') ->willReturn('OK: 519545'); - $client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($response, $message, $testMode, $expected): ResponseInterface { + $client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($response, $message, $expected): ResponseInterface { $this->assertSame('GET', $method); $this->assertSame(sprintf( 'https://savitarna.smsbiuras.lt/api?uid=uid&apikey=api_key&message=%s&from=from&test=%s&to=%s', From 60edb5d7796c06a91bd5eb6d41b33617e7049021 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 25 Nov 2022 12:02:30 +0100 Subject: [PATCH 47/54] skip a test if the signal to be sent is not available --- src/Symfony/Component/Console/Tests/ApplicationTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index fdb9b3f335d8a..aa4901be66300 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -1945,6 +1945,10 @@ public function testSignalSubscriber() */ public function testSetSignalsToDispatchEvent() { + if (!\defined('SIGUSR1')) { + $this->markTestSkipped('SIGUSR1 not available'); + } + $command = new BaseSignableCommand(); $subscriber = new SignalEventSubscriber(); From 2ada813500bb58f3be2cd6842c5d73704e1c3ded Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 25 Nov 2022 15:09:27 +0100 Subject: [PATCH 48/54] skip tests if the signal to be sent is not available --- src/Symfony/Component/Console/Tests/ApplicationTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index aa4901be66300..9f85975ad8dd0 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -1981,6 +1981,10 @@ public function testSignalableCommandInterfaceWithoutSignals() public function testSignalableCommandHandlerCalledAfterEventListener() { + if (!\defined('SIGUSR1')) { + $this->markTestSkipped('SIGUSR1 not available'); + } + $command = new SignableCommand(); $subscriber = new SignalEventSubscriber(); From 275d2cd5a344d70b7990833034ce692fa92c3c9a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 25 Nov 2022 15:23:13 +0100 Subject: [PATCH 49/54] do not wire the MercureTransportFactory if the MercureBundle is not enabled --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 77d8a9d27e9a7..a20f2a3ddb4d5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -2587,7 +2587,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $ } } - if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages, true) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages, true)) { + if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages, true) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages, true) && \in_array(MercureBundle::class, $container->getParameter('kernel.bundles'), true)) { $container->getDefinition($classToServices[MercureTransportFactory::class]) ->replaceArgument('$registry', new Reference(HubRegistry::class)); } elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages, true)) { From da327c74a50e8fb43479df79ba479e2f4e7636ce Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 25 Nov 2022 16:40:49 +0100 Subject: [PATCH 50/54] parse unquoted digits in tag values as integers --- src/Symfony/Component/Yaml/Inline.php | 3 +-- .../Component/Yaml/Tests/DumperTest.php | 9 +-------- .../Fixtures/YtsSpecificationExamples.yml | 2 +- .../Component/Yaml/Tests/InlineTest.php | 19 +++++++++++++++++++ .../Component/Yaml/Tests/ParserTest.php | 12 ++++-------- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index d8994cb34cc21..f93f59676d9a4 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -86,7 +86,7 @@ public static function parse(string $value = null, int $flags = 0, array &$refer ++$i; break; default: - $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); + $result = self::parseScalar($value, $flags, null, $i, true, $references); } // some comments are allowed at the end @@ -657,7 +657,6 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer } return octdec($value); - // Optimize for returning strings. case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]): if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { $scalar = str_replace('_', '', $scalar); diff --git a/src/Symfony/Component/Yaml/Tests/DumperTest.php b/src/Symfony/Component/Yaml/Tests/DumperTest.php index 59a47a8130f31..4b9c74c2609de 100644 --- a/src/Symfony/Component/Yaml/Tests/DumperTest.php +++ b/src/Symfony/Component/Yaml/Tests/DumperTest.php @@ -492,8 +492,6 @@ public function testDumpingTaggedValueSequenceWithInlinedTagValues() YAML; $this->assertSame($expected, $yaml); - // @todo Fix the parser, preserve numbers. - $data[2] = new TaggedValue('number', '5'); $this->assertSameData($data, $this->parser->parse($expected, Yaml::PARSE_CUSTOM_TAGS)); } @@ -522,8 +520,6 @@ public function testDumpingTaggedValueMapRespectsInlineLevel() YAML; $this->assertSame($expected, $yaml); - // @todo Fix the parser, preserve numbers. - $data['count'] = new TaggedValue('number', '5'); $this->assertSameData($data, $this->parser->parse($expected, Yaml::PARSE_CUSTOM_TAGS)); } @@ -577,9 +573,6 @@ public function testDumpingNotInlinedNullTaggedValue() YAML; $this->assertSame($expected, $this->dumper->dump($data, 2)); - - // @todo Fix the parser, don't stringify null. - $data['foo'] = new TaggedValue('bar', 'null'); $this->assertSameData($data, $this->parser->parse($expected, Yaml::PARSE_CUSTOM_TAGS | Yaml::PARSE_CONSTANT)); } @@ -696,7 +689,7 @@ public function testDumpMultiLineStringAsScalarBlock() nested_inlined_multi_line_string: { inlined_multi_line: "foo\nbar\r\nempty line:\n\nbaz" } YAML -); + ); $this->assertSame($expected, $yml); $this->assertSame($data, $this->parser->parse($yml)); } diff --git a/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml index b5f41a2b1eccc..2acc4998e207e 100644 --- a/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml +++ b/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml @@ -913,7 +913,7 @@ yaml: | no int: ! 12 string: !!str 12 php: | - [ 'integer' => 12, 'no int' => '12', 'string' => '12' ] + [ 'integer' => 12, 'no int' => 12, 'string' => '12' ] --- test: Private types todo: true diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 5d338a41faa62..f71509d28f35c 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -743,6 +743,24 @@ public function testTagWithEmptyValueInMapping() $this->assertSame('', $value['foo']->getValue()); } + public function testTagWithQuotedInteger() + { + $value = Inline::parse('!number "5"', Yaml::PARSE_CUSTOM_TAGS); + + $this->assertInstanceOf(TaggedValue::class, $value); + $this->assertSame('number', $value->getTag()); + $this->assertSame('5', $value->getValue()); + } + + public function testTagWithUnquotedInteger() + { + $value = Inline::parse('!number 5', Yaml::PARSE_CUSTOM_TAGS); + + $this->assertInstanceOf(TaggedValue::class, $value); + $this->assertSame('number', $value->getTag()); + $this->assertSame(5, $value->getValue()); + } + public function testUnfinishedInlineMap() { $this->expectException(ParseException::class); @@ -769,6 +787,7 @@ public function getTestsForOctalNumbers() /** * @group legacy + * * @dataProvider getTestsForOctalNumbersYaml11Notation */ public function testParseOctalNumbersYaml11Notation(int $expected, string $yaml, string $replacement) diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 228c2f2ee9c69..0941075b10b57 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -54,8 +54,7 @@ public function testTaggedValueTopLevelNumber() { $yml = '!number 5'; $data = $this->parser->parse($yml, Yaml::PARSE_CUSTOM_TAGS); - // @todo Preserve the number, don't turn into string. - $expected = new TaggedValue('number', '5'); + $expected = new TaggedValue('number', 5); $this->assertSameData($expected, $data); } @@ -63,9 +62,8 @@ public function testTaggedValueTopLevelNull() { $yml = '!tag null'; $data = $this->parser->parse($yml, Yaml::PARSE_CUSTOM_TAGS); - // @todo Preserve literal null, don't turn into string. - $expected = new TaggedValue('tag', 'null'); - $this->assertSameData($expected, $data); + + $this->assertSameData(new TaggedValue('tag', null), $data); } public function testTaggedValueTopLevelString() @@ -1555,8 +1553,6 @@ public function testParseDateAsMappingValue() } /** - * @param $lineNumber - * @param $yaml * @dataProvider parserThrowsExceptionWithCorrectLineNumberProvider */ public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yaml) @@ -2310,7 +2306,7 @@ public function taggedValuesProvider() public function testNonSpecificTagSupport() { - $this->assertSame('12', $this->parser->parse('! 12')); + $this->assertSame(12, $this->parser->parse('! 12')); } public function testCustomTagsDisabled() From 8a503039390f8d1be0215a09aa2906771d1e7433 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 20 Nov 2022 20:08:10 +0100 Subject: [PATCH 51/54] Run tests with doctrine/collections 2 --- composer.json | 2 +- src/Symfony/Bridge/Doctrine/composer.json | 2 +- src/Symfony/Component/Form/composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index ffe1e31ef4341..600df1683b5a1 100644 --- a/composer.json +++ b/composer.json @@ -126,7 +126,7 @@ "cache/integration-tests": "dev-master", "doctrine/annotations": "^1.13.1", "doctrine/cache": "^1.11|^2.0", - "doctrine/collections": "~1.0", + "doctrine/collections": "^1.0|^2.0", "doctrine/data-fixtures": "^1.1", "doctrine/dbal": "^2.13.1|^3.0", "doctrine/orm": "^2.7.4", diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index d1445b164c5e5..3c10df7d6b2bf 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -44,7 +44,7 @@ "symfony/translation": "^4.4|^5.0|^6.0", "symfony/var-dumper": "^4.4|^5.0|^6.0", "doctrine/annotations": "^1.10.4", - "doctrine/collections": "~1.0", + "doctrine/collections": "^1.0|^2.0", "doctrine/data-fixtures": "^1.1", "doctrine/dbal": "^2.13.1|^3.0", "doctrine/orm": "^2.7.4", diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index ff9e6b9af6aa7..e6be770b8b277 100644 --- a/src/Symfony/Component/Form/composer.json +++ b/src/Symfony/Component/Form/composer.json @@ -29,7 +29,7 @@ "symfony/service-contracts": "^1.1|^2|^3" }, "require-dev": { - "doctrine/collections": "~1.0", + "doctrine/collections": "^1.0|^2.0", "symfony/validator": "^4.4.17|^5.1.9|^6.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", From 913783562ffdb0736ff2e889bed6868ff20c9cce Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Sat, 26 Nov 2022 17:54:11 +0100 Subject: [PATCH 52/54] [Mime] Rename SMimeEncryptorTest to SMimeEncrypterTest --- .../Crypto/{SMimeEncryptorTest.php => SMimeEncrypterTest.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/Symfony/Component/Mime/Tests/Crypto/{SMimeEncryptorTest.php => SMimeEncrypterTest.php} (98%) diff --git a/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php b/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncrypterTest.php similarity index 98% rename from src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php rename to src/Symfony/Component/Mime/Tests/Crypto/SMimeEncrypterTest.php index 92df05e391c7e..75f3f3c4eb866 100644 --- a/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php +++ b/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncrypterTest.php @@ -19,7 +19,7 @@ /** * @requires extension openssl */ -class SMimeEncryptorTest extends SMimeTestCase +class SMimeEncrypterTest extends SMimeTestCase { public function testEncryptMessage() { From ea5a9584cb948790b10f9070180d45b573247e93 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:15:41 +0100 Subject: [PATCH 53/54] Update CHANGELOG for 6.0.16 --- CHANGELOG-6.0.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG-6.0.md b/CHANGELOG-6.0.md index ee6636841aa4a..d0024faa6a47d 100644 --- a/CHANGELOG-6.0.md +++ b/CHANGELOG-6.0.md @@ -7,6 +7,35 @@ in 6.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.0.0...v6.0.1 +* 6.0.16 (2022-11-28) + + * bug #48333 [Yaml] parse unquoted digits in tag values as integers (xabbuh) + * bug #48330 [FrameworkBundle] do not wire the MercureTransportFactory if the MercureBundle is not enabled (xabbuh) + * bug #48262 [Notifier] [SMSBiuras] `true`/`false` mismatch for `test_mode` option (StaffNowa) + * bug #48273 [HttpKernel] Fix message for unresovable arguments of invokable controllers (fancyweb) + * bug #48251 [PropertyInfo] ignore const expressions read by phpdocumentor (xabbuh) + * bug #48224 [DependencyInjection] Process bindings in `ServiceLocatorTagPass` (MatTheCat) + * bug #48179 [Console] Support completion for bash functions (Chi-teck) + * bug #48217 [Console] Improve error message when shell is not detected in completion command (GromNaN) + * bug #48222 [Translation] [Lokalize] Configure `replace_breaks` to prevent issues with multilines translations (Kocal) + * bug #48210 [Console]  Fix signal handlers called after event listeners and skip exit (GromNaN) + * bug #48198 [Messenger] Fix time-limit check exception (alamirault) + * bug #48122 [PhpUnitBridge] Fix language deprecations incorrectly marked as direct (wouterj) + * bug #47998 [Console] Fix console `ProgressBar::override()` after manual `ProgressBar::cleanup()` (maxbeckers) + * bug #48173 [HttpClient] Handle Amp HTTP client v5 incompatibility gracefully (fancyweb) + * bug #48172 [HttpKernel] Don’t try to wire Response argument with controller.service_arguments (MatTheCat) + * bug #48085 [Messenger] Tell about messenger:consume invalid limit options (MatTheCat) + * bug #48120 [Messenger] Do not throw 'no handlers' exception when skipping handlers due to duplicate handling (wouterj) + * bug #48112 [HttpFoundation] Compare cookie with null value as empty string in ResponseCookieValueSame (fancyweb) + * bug #48119 [FrameworkBundle][Lock] Allow to disable lock without defining a resource (MatTheCat) + * bug #48093 [DependencyInjection] don't move locator tag for service subscriber (RobertMe) + * bug #48075 [Mailer] Stream timeout not detected fgets returns false (Sezil) + * bug #48092 Fix the notification email theme for asynchronously dispatched emails (krisbuist) + * bug #48097 Fix search scope when performing fallback mapping driver detection (spideyfusion) + * bug #48103 [HttpClient] Do not set http_version instead of setting it to null (Tetragramat) + * bug #48027 [DependencyInjection] Don't autoconfigure tag when it's already set with attributes (nicolas-grekas) + * bug #48050 [HttpFoundation] Check IPv6 is valid before comparing it (PhilETaylor) + * 6.0.15 (2022-10-28) * bug #47990 [HttpClient] Fix retrying requests when the content is used by the strategy (nicolas-grekas) From 9d42150da5d95d6aa5780c3d2c9d9c16331d26f2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Nov 2022 19:15:44 +0100 Subject: [PATCH 54/54] Update VERSION for 6.0.16 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index c9b6213279146..c5e600fcb41a7 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.16-DEV'; + public const VERSION = '6.0.16'; public const VERSION_ID = 60016; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 16; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2023'; public const END_OF_LIFE = '01/2023';