From c5f8d71215a079ba579a0641f81fd8c96f5bcfab Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:01:04 +0200 Subject: [PATCH 001/107] updated CHANGELOG for 2.8.42 --- CHANGELOG-2.8.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index 522a83664793c..7d381b890873c 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,20 @@ in 2.8 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/v2.8.0...v2.8.1 +* 2.8.42 (2018-06-25) + + * bug #27669 [Filesystem] fix file lock on SunOS (fritzmg) + * bug #27309 Fix surrogate not using original request (Toflar) + * bug #27630 [Validator][Form] Remove BOM in some xlf files (gautierderuette) + * bug #27591 [VarDumper] Fix dumping ArrayObject and ArrayIterator instances (nicolas-grekas) + * bug #27581 Fix bad method call with guard authentication + session migration (weaverryan) + * bug #27452 Avoid migration on stateless firewalls (weaverryan) + * bug #27514 [Debug] Pass previous exception to FatalErrorException (pmontoya) + * bug #26973 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer. (kmadejski) + * bug #27303 [Process] Consider "executable" suffixes first on Windows (sanmai) + * bug #27297 Triggering RememberMe's loginFail() when token cannot be created (weaverryan) + * bug #27366 [DI] never inline lazy services (nicolas-grekas) + * 2.8.41 (2018-05-25) * bug #27359 [HttpFoundation] Fix perf issue during MimeTypeGuesser intialization (nicolas-grekas) From c02d62b1816d4ce7f747eefec4b06e2fe5aa6ffd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:01:37 +0200 Subject: [PATCH 002/107] update CONTRIBUTORS for 2.8.42 --- CONTRIBUTORS.md | 81 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 672246e7f9da8..21142e2bdea33 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -55,12 +55,12 @@ Symfony is the result of the work of many people who made the code better - Peter Rehm (rpet) - Matthias Pigulla (mpdude) - Saša Stamenković (umpirsky) + - Kevin Bond (kbond) + - Tobias Nyholm (tobias) - Pierre du Plessis (pierredup) - Henrik Bjørnskov (henrikbjorn) - Dany Maillard (maidmaid) - Miha Vrhovnik - - Kevin Bond (kbond) - - Tobias Nyholm (tobias) - Diego Saint Esteben (dii3g0) - Konstantin Kudryashov (everzet) - Alexander M. Turek (derrabus) @@ -70,11 +70,11 @@ Symfony is the result of the work of many people who made the code better - Mathieu Piot (mpiot) - Gábor Egyed (1ed) - Michel Weimerskirch (mweimerskirch) + - Titouan Galopin (tgalopin) - Andrej Hudec (pulzarraider) - Eric Clemmons (ericclemmons) - Jáchym Toušek (enumag) - Charles Sarrazin (csarrazi) - - Titouan Galopin (tgalopin) - Konstantin Myakshin (koc) - Christian Raue - Arnout Boks (aboks) @@ -84,6 +84,7 @@ Symfony is the result of the work of many people who made the code better - Issei Murasawa (issei_m) - Douglas Greenshields (shieldo) - David Maicher (dmaicher) + - Vladimir Reznichenko (kalessil) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) @@ -96,7 +97,6 @@ Symfony is the result of the work of many people who made the code better - Jérôme Tamarelle (gromnan) - John Wards (johnwards) - Fran Moreno (franmomu) - - Vladimir Reznichenko (kalessil) - Antoine Hérault (herzult) - Paráda József (paradajozsef) - Arnaud Le Blanc (arnaud-lb) @@ -109,19 +109,21 @@ Symfony is the result of the work of many people who made the code better - marc.weistroff - lenar - Alexander Schwenn (xelaris) + - gadelat (gadelat) - Włodzimierz Gajda (gajdaw) + - Peter Kokot (maastermedia) - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) - Colin Frei - Adrien Brault (adrienbrault) - Tomáš Votruba (tomas_votruba) - Joshua Thijssen - - Peter Kokot (maastermedia) - David Buchmann (dbu) - excelwebzone - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - Eric GELOEN (gelo) + - Valentin Udaltsov (vudaltsov) - Lars Strojny (lstrojny) - Daniel Wehner (dawehner) - Tugdual Saunier (tucksaun) @@ -131,6 +133,7 @@ Symfony is the result of the work of many people who made the code better - Florian Lonqueu-Brochard (florianlb) - Sebastiaan Stok (sstok) - Stefano Sala (stefano.sala) + - Jérôme Vasseur (jvasseur) - Evgeniy (ewgraf) - Alex Pott - Vincent AUBERT (vincent) @@ -139,9 +142,7 @@ Symfony is the result of the work of many people who made the code better - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - - Jérôme Vasseur (jvasseur) - - Valentin Udaltsov (vudaltsov) - - gadelat (gadelat) + - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - Pablo Godel (pgodel) - Jérémie Augustin (jaugustin) @@ -149,7 +150,6 @@ Symfony is the result of the work of many people who made the code better - Philipp Wahala (hifi) - Julien Falque (julienfalque) - Rafael Dohms (rdohms) - - Arnaud Kleinpeter (nanocom) - jwdeitch - Teoh Han Hui (teohhanhui) - Mikael Pajunen @@ -178,6 +178,7 @@ Symfony is the result of the work of many people who made the code better - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) + - Niels Keurentjes (curry684) - Daniel Espendiller - Possum - Dorian Villet (gnutix) @@ -219,10 +220,12 @@ Symfony is the result of the work of many people who made the code better - Michele Orselli (orso) - Tom Van Looy (tvlooy) - Sven Paulus (subsven) + - Yanick Witschi (toflar) - Thomas Calvet (fancyweb) - Rui Marinho (ruimarinho) - - Niels Keurentjes (curry684) + - Alessandro Chitolina - Eugene Wissner + - Pascal Montoya - Julien Brochet (mewt) - Leo Feyer - Tristan Darricau (nicofuma) @@ -235,6 +238,7 @@ Symfony is the result of the work of many people who made the code better - Rob Frawley 2nd (robfrawley) - julien pauli (jpauli) - Lorenz Schori + - Oskar Stark (oskarstark) - Sébastien Lavoie (lavoiesl) - Gregor Harlan (gharlan) - Dariusz @@ -255,9 +259,7 @@ Symfony is the result of the work of many people who made the code better - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA - Patrick McDougle (patrick-mcdougle) - - Yanick Witschi (toflar) - Alif Rachmawadi - - Alessandro Chitolina - Kristen Gilden (kgilden) - Pierre-Yves LEBECQ (pylebecq) - Jordan Samouh (jordansamouh) @@ -284,7 +286,6 @@ Symfony is the result of the work of many people who made the code better - Bob den Otter (bopp) - Nikita Konstantinov - Wodor Wodorski - - Oskar Stark (oskarstark) - Thomas Lallement (raziel057) - Giorgio Premi - Christian Schmidt @@ -303,6 +304,7 @@ Symfony is the result of the work of many people who made the code better - Marc Weistroff (futurecat) - Christian Schmidt - Maxime Veber (nek-) + - MatTheCat - Edi Modrić (emodric) - Chad Sikorra (chadsikorra) - Chris Smith (cs278) @@ -358,11 +360,11 @@ Symfony is the result of the work of many people who made the code better - Artur Eshenbrener - François-Xavier de Guillebon (de-gui_f) - Damien Alexandre (damienalexandre) + - Thomas Perez (scullwm) - Felix Labrecque - Yaroslav Kiliba - Terje Bråten - Mathieu Lechat - - MatTheCat - Robbert Klarenbeek (robbertkl) - JhonnyL - David Badura (davidbadura) @@ -453,7 +455,6 @@ Symfony is the result of the work of many people who made the code better - Dirk Pahl (dirkaholic) - cedric lombardot (cedriclombardot) - Jonas Flodén (flojon) - - Thomas Perez (scullwm) - Marcin Sikoń (marphi) - Dominik Zogg (dominik.zogg) - Marek Pietrzak @@ -483,6 +484,7 @@ Symfony is the result of the work of many people who made the code better - Miroslav Sustek - Sullivan SENECHAL (soullivaneuh) - Pablo Díez (pablodip) + - Grzegorz (Greg) Zdanowski (kiler129) - Martin Hujer (martinhujer) - Kevin McBride - Sergio Santoro @@ -511,6 +513,7 @@ Symfony is the result of the work of many people who made the code better - Andrew Udvare (audvare) - alexpods - Arjen van der Meijden + - Adam Szaraniec (mimol) - Dariusz Ruminski - Erik Trapman (eriktrapman) - De Cock Xavier (xdecock) @@ -573,6 +576,7 @@ Symfony is the result of the work of many people who made the code better - Sebastian Blum - aubx - Marvin Butkereit + - Colin O'Dell (colinodell) - Ricky Su (ricky) - Gildas Quéméner (gquemener) - Charles-Henri Bruyand @@ -588,6 +592,7 @@ Symfony is the result of the work of many people who made the code better - Nahuel Cuesta (ncuesta) - Chris Boden (cboden) - Christophe Villeger (seragan) + - Bob van de Vijver (bobvandevijver) - Stefan Gehrig (sgehrig) - Hany el-Kerdany - Wang Jingyu @@ -637,6 +642,7 @@ Symfony is the result of the work of many people who made the code better - Richard Bradley - Ulumuddin Yunus (joenoez) - Johann Saunier (prophet777) + - Sergey (upyx) - Michael Devery (mickadoo) - Antoine Corcy - Sascha Grossenbacher @@ -666,21 +672,26 @@ Symfony is the result of the work of many people who made the code better - Thomas Ploch - Benjamin Grandfond (benjamin) - Tiago Brito (blackmx) + - - Richard van den Brand (ricbra) - develop + - flip111 - Greg Anderson - VJ - Delf Tonder (leberknecht) - Mark Sonnabaum + - Massimiliano Braglia (massimilianobraglia) - Richard Quadling - jochenvdv - Arturas Smorgun (asarturas) - Alexander Volochnev (exelenz) - Michael Piecko - yclian + - Aleksey Prilipko - twifty - Indra Gunawan (guind) - Peter Ward + - Davide Borsatto (davide.borsatto) - Julien DIDIER (juliendidier) - Dominik Ritter (dritter) - Sebastian Grodzicki (sgrodzicki) @@ -691,6 +702,7 @@ Symfony is the result of the work of many people who made the code better - Alex Xandra Albert Sim - Craig Duncan (duncan3dc) - Carson Full + - Sergey Yastrebov - Trent Steel (trsteel88) - Yuen-Chi Lian - Besnik Br @@ -717,11 +729,12 @@ Symfony is the result of the work of many people who made the code better - Joschi Kuphal - John Bohn (jbohn) - Marc Morera (mmoreram) + - Smaine Milianni (ismail1432) + - Michael Moravec - Andrew Hilobok (hilobok) - Noah Heck (myesain) - Christian Soronellas (theunic) - Johann Pardanaud - - Adam Szaraniec (mimol) - Yosmany Garcia (yosmanyga) - Wouter de Wild - Antoine M (amakdessi) @@ -770,6 +783,7 @@ Symfony is the result of the work of many people who made the code better - Abhoryo - Fabian Vogler (fabian) - Korvin Szanto + - Stéphan Kochen - Arjan Keeman - Alaattin Kahramanlar (alaattin) - Sergey Zolotov (enleur) @@ -853,6 +867,7 @@ Symfony is the result of the work of many people who made the code better - LOUARDI Abdeltif (ouardisoft) - Robert Gruendler (pulse00) - Simon Terrien (sterrien) + - Tarmo Leppänen (tarlepp) - Benoît Merlet (trompette) - Koen Kuipers - datibbaw @@ -863,6 +878,7 @@ Symfony is the result of the work of many people who made the code better - Sebastien Morel (plopix) - Patrick Kaufmann - Piotr Stankowski + - Anton Dyshkant - Reece Fowell (reecefowell) - Mátyás Somfai (smatyas) - stefan.r @@ -880,7 +896,6 @@ Symfony is the result of the work of many people who made the code better - Sam Malone - Phan Thanh Ha (haphan) - Chris Jones (leek) - - Colin O'Dell (colinodell) - xaav - Mahmoud Mostafa (mahmoud) - Pieter @@ -898,6 +913,7 @@ Symfony is the result of the work of many people who made the code better - Fred Cox - Luciano Mammino (loige) - fabios + - Webnet team (webnet) - Sander Coolen (scoolen) - Nicolas Le Goff (nlegoff) - Ben Oman @@ -934,7 +950,6 @@ Symfony is the result of the work of many people who made the code better - Máximo Cuadros (mcuadros) - tamirvs - julien.galenski - - Bob van de Vijver - Christian Neff - Oliver Hoff - Ole Rößner (basster) @@ -952,6 +967,7 @@ Symfony is the result of the work of many people who made the code better - ilyes kooli - gr1ev0us - mlazovla + - Behnoush norouzali (behnoush) - Max Beutel - Antanas Arvasevicius - Thomas @@ -1017,13 +1033,13 @@ Symfony is the result of the work of many people who made the code better - Alex Bowers - Jeremy Bush - wizhippo + - Thomason, James - Viacheslav Sychov - Helmut Hummel (helhum) - Matt Brunt - Carlos Ortega Huetos - rpg600 - Péter Buri (burci) - - Davide Borsatto (davide.borsatto) - kaiwa - RJ Garcia - Charles Sanquer (csanquer) @@ -1033,7 +1049,6 @@ Symfony is the result of the work of many people who made the code better - Will Donohoe - peter - Jaroslav Kuba - - flip111 - Jérémy Jourdin (jjk801) - BRAMILLE Sébastien (oktapodia) - Artem Kolesnikov (tyomo4ka) @@ -1121,10 +1136,10 @@ Symfony is the result of the work of many people who made the code better - Lars Ambrosius Wallenborn (larsborn) - Oriol Mangas Abellan (oriolman) - Sebastian Göttschkes (sgoettschkes) - - Sergey (upyx) - Tatsuya Tsuruoka - Ross Tuck - Kévin Gomez (kevin) + - Andrei Igna - azine - Dawid Sajdak - Ludek Stepan @@ -1142,7 +1157,6 @@ Symfony is the result of the work of many people who made the code better - Adrien Gallou (agallou) - Maks Rafalko (bornfree) - Karol Sójko (karolsojko) - - Grzegorz Zdanowski (kiler129) - sl_toto (sl_toto) - Walter Dal Mut (wdalmut) - abluchet @@ -1155,10 +1169,10 @@ Symfony is the result of the work of many people who made the code better - Keri Henare (kerihenare) - Cédric Lahouste (rapotor) - Samuel Vogel (samuelvogel) + - Alexey Kopytko (sanmai) - Berat Doğan - Guillaume LECERF - Juanmi Rodriguez Cerón - - Sergey Yastrebov - Andy Raines - Anthony Ferrara - Klaas Cuvelier (kcuvelier) @@ -1187,6 +1201,7 @@ Symfony is the result of the work of many people who made the code better - Lance McNearney - Gonzalo Vilaseca (gonzalovilaseca) - Giorgio Premi + - Andrew Berry - ncou - Ian Carroll - caponica @@ -1209,6 +1224,7 @@ Symfony is the result of the work of many people who made the code better - Romain Geissler - Adrien Moiruad - Tomaz Ahlin + - Philip Ardery - Marcus Stöhr (dafish) - Emmanuel Vella (emmanuel.vella) - Jonathan Johnson (jrjohnson) @@ -1217,7 +1233,6 @@ Symfony is the result of the work of many people who made the code better - Jay Severson - René Kerner - Nathaniel Catchpole - - - Adrien Samson (adriensamson) - Samuel Gordalina (gordalina) - Max Romanovsky (maxromanovsky) @@ -1254,7 +1269,6 @@ Symfony is the result of the work of many people who made the code better - Ergie Gonzaga - Matthew J Mucklo - AnrDaemon - - Smaine Milianni (ismail1432) - fdgdfg (psampaz) - Stéphane Seng - Maxwell Vandervelde @@ -1275,12 +1289,14 @@ Symfony is the result of the work of many people who made the code better - Jonathan Gough - Benjamin Bender - Jared Farrish + - karl.rixon - Konrad Mohrfeldt - Lance Chen - Andrew (drew) - kor3k kor3k (kor3k) - Stelian Mocanita (stelian) - Flavian (2much) + - Gautier Deuette - mike - Kirk Madera - Keith Maika @@ -1372,10 +1388,12 @@ Symfony is the result of the work of many people who made the code better - Manatsawin Hanmongkolchai - Gunther Konig - Maciej Schmidt + - Greg ORIOL - Dennis Væversted - nuncanada - flack - František Bereň + - Kamil Madejski - Jeremiah VALERIE - Mike Francis - Christoph Nissle (derstoffel) @@ -1468,7 +1486,6 @@ Symfony is the result of the work of many people who made the code better - Sam Ward - Walther Lalk - Adam - - Stéphan Kochen - devel - taiiiraaa - Trevor Suarez @@ -1482,8 +1499,10 @@ Symfony is the result of the work of many people who made the code better - Chansig - Tischoi - J Bruni + - Fritz Michael Gschwantner - Alexey Prilipko - Dmitriy Fedorenko + - fritzmg - vlakoff - bertillon - Bertalan Attila @@ -1686,7 +1705,6 @@ Symfony is the result of the work of many people who made the code better - Christian Eikermann - Kai Eichinger - Antonio Angelino - - Pascal Montoya - Matt Fields - Niklas Keller - Vladimir Sazhin @@ -1753,6 +1771,7 @@ Symfony is the result of the work of many people who made the code better - Adam Klvač - Yevgen Kovalienia - Lebnik + - nsbx - Shude - Ondřej Führer - Sema @@ -1765,11 +1784,13 @@ Symfony is the result of the work of many people who made the code better - Norman Soetbeer - zorn - Yuriy Potemkin + - Emilie Lorenzo - Benjamin Long - Matt Janssen - Ben Miller - Peter Gribanov - kwiateusz + - jspee - David Soria Parra - Sergiy Sokolenko - dinitrol @@ -1827,6 +1848,7 @@ Symfony is the result of the work of many people who made the code better - Damon Jones (damon__jones) - Łukasz Giza (destroyer) - Daniel Londero (dlondero) + - Samuele Lilli (doncallisto) - Sebastian Landwehr (dword123) - Adel ELHAIBA (eadel) - Damián Nohales (eagleoneraptor) @@ -1889,6 +1911,7 @@ Symfony is the result of the work of many people who made the code better - scourgen hung (scourgen) - Sébastien Alfaiate (seb33300) - Sebastian Busch (sebu) + - Sepehr Lajevardi (sepehr) - André Filipe Gonçalves Neves (seven) - Bruno Ziegler (sfcoder) - Andrea Giuliano (shark) @@ -1898,12 +1921,13 @@ Symfony is the result of the work of many people who made the code better - Julien Sanchez (sumbobyboys) - Guillermo Gisinger (t3chn0r) - Markus Tacker (tacker) - - Tarmo Leppänen (tarlepp) + - Andrew Clark (tqt_andrew_clark) - Tyler Stroud (tystr) - Moritz Kraft (userfriendly) - Víctor Mateo (victormateo) - Vincent (vincent1870) - Vincent CHALAMON (vincentchalamon) + - David Herrmann (vworldat) - Eugene Babushkin (warl) - Wouter Sioen (wouter_sioen) - Xavier Amado (xamado) @@ -1929,6 +1953,7 @@ Symfony is the result of the work of many people who made the code better - fh-github@fholzhauer.de - AbdElKader Bouadjadja - DSeemiller + - Kyle - Jan Emrich - Mark Topper - Xavier REN From c821f1ae502a04103ce21d8ff1d09243a22cf2ed Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:01:56 +0200 Subject: [PATCH 003/107] updated VERSION for 2.8.42 --- 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 0e298381b9b7f..e628f1f3591fe 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.42-DEV'; + const VERSION = '2.8.42'; const VERSION_ID = 20842; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 42; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From d59f210d43aa6f102ac118355f14fd3e1c61d6f0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:28:20 +0200 Subject: [PATCH 004/107] bumped Symfony version to 2.8.43 --- 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 e628f1f3591fe..10ff79297b6b3 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.42'; - const VERSION_ID = 20842; + const VERSION = '2.8.43-DEV'; + const VERSION_ID = 20843; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 42; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 43; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From 9e3cb5466382c249e8d7f110868859ab5d5a5b67 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:29:07 +0200 Subject: [PATCH 005/107] updated CHANGELOG for 3.4.12 --- CHANGELOG-3.4.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 37f4a76efce85..3c612a6ebd595 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,46 @@ in 3.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/v3.4.0...v3.4.1 +* 3.4.12 (2018-06-25) + + * bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid) + * bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas) + * bug #27690 [DI] Resolve env placeholder in logs (ro0NL) + * bug #26534 allow_extra_attributes does not throw an exception as documented (deviantintegral) + * bug #27668 [Lock] use 'r+' for fopen (fixes issue on Solaris) (fritzmg) + * bug #27669 [Filesystem] fix file lock on SunOS (fritzmg) + * bug #27662 [HttpKernel] fix handling of nested Error instances (xabbuh) + * bug #26845 [Config] Fixing GlobResource when inside phar archive (vworldat) + * bug #27382 [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks (krixon) + * bug #27309 Fix surrogate not using original request (Toflar) + * bug #27467 [HttpKernel] fix session tracking in surrogate master requests (nicolas-grekas) + * bug #27630 [Validator][Form] Remove BOM in some xlf files (gautierderuette) + * bug #27596 [Framework][Workflow] Added support for interfaces (vudaltsov) + * bug #27593 [ProxyManagerBridge] Fixed support of private services (nicolas-grekas) + * bug #27591 [VarDumper] Fix dumping ArrayObject and ArrayIterator instances (nicolas-grekas) + * bug #27581 Fix bad method call with guard authentication + session migration (weaverryan) + * bug #27576 [Cache] Fix expiry comparisons in array-based pools (nicolas-grekas) + * bug #27556 Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener (weaverryan) + * bug #27452 Avoid migration on stateless firewalls (weaverryan) + * bug #27568 [DI] Deduplicate generated proxy classes (nicolas-grekas) + * bug #27326 [Serializer] deserialize from xml: Fix a collection that contains the only one element (webnet-fr) + * bug #27567 [PhpUnitBridge] Fix error on some Windows OS (Nsbx) + * bug #27357 [Lock] Remove released semaphore (jderusse) + * bug #27416 TagAwareAdapter over non-binary memcached connections corrupts memcache (Aleksey Prilipko) + * bug #27514 [Debug] Pass previous exception to FatalErrorException (pmontoya) + * bug #27516 Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)" (nicolas-grekas) + * bug #27318 [Cache] memcache connect should not add duplicate entries on sequential calls (Aleksey Prilipko) + * bug #27389 [Serializer] Fix serializer tries to denormalize null values on nullable properties (ogizanagi) + * bug #27272 [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING (upyx) + * bug #27396 [HttpKernel] fix registering IDE links (nicolas-grekas) + * bug #26973 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer. (kmadejski) + * bug #27303 [Process] Consider "executable" suffixes first on Windows (sanmai) + * bug #27297 Triggering RememberMe's loginFail() when token cannot be created (weaverryan) + * bug #27344 [HttpKernel] reset kernel start time on reboot (kiler129) + * bug #27365 [Serializer] Check the value of enable_max_depth if defined (dunglas) + * bug #27358 [PhpUnitBridge] silence some stderr outputs (ostrolucky) + * bug #27366 [DI] never inline lazy services (nicolas-grekas) + * 3.4.11 (2018-05-25) * bug #27364 [DI] Fix bad exception on uninitialized references to non-shared services (nicolas-grekas) From 88bb4c2e982ebf62e8976904d30988c8d7fdf622 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 14:29:19 +0200 Subject: [PATCH 006/107] updated VERSION for 3.4.12 --- 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 948c30a49544a..3c740e45ef5c1 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.12-DEV'; + const VERSION = '3.4.12'; const VERSION_ID = 30412; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 12; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 2a2a9d89c8701e485a1b04748a0ffc01ecf053ae Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 15:00:40 +0200 Subject: [PATCH 007/107] bumped Symfony version to 3.4.13 --- 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 3c740e45ef5c1..9668b9ecd124d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.12'; - const VERSION_ID = 30412; + const VERSION = '3.4.13-DEV'; + const VERSION_ID = 30413; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 12; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 13; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 91a8af4fe622d27b1e057fbac8bd78e9f8b43248 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 15:02:02 +0200 Subject: [PATCH 008/107] updated CHANGELOG for 4.0.12 --- CHANGELOG-4.0.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 7131036ba4fa8..72d24bf39e62d 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -7,6 +7,46 @@ in 4.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/v4.0.0...v4.0.1 +* 4.0.12 (2018-06-25) + + * bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid) + * bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas) + * bug #27690 [DI] Resolve env placeholder in logs (ro0NL) + * bug #26534 allow_extra_attributes does not throw an exception as documented (deviantintegral) + * bug #27668 [Lock] use 'r+' for fopen (fixes issue on Solaris) (fritzmg) + * bug #27669 [Filesystem] fix file lock on SunOS (fritzmg) + * bug #27662 [HttpKernel] fix handling of nested Error instances (xabbuh) + * bug #26845 [Config] Fixing GlobResource when inside phar archive (vworldat) + * bug #27382 [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks (krixon) + * bug #27309 Fix surrogate not using original request (Toflar) + * bug #27467 [HttpKernel] fix session tracking in surrogate master requests (nicolas-grekas) + * bug #27630 [Validator][Form] Remove BOM in some xlf files (gautierderuette) + * bug #27596 [Framework][Workflow] Added support for interfaces (vudaltsov) + * bug #27593 [ProxyManagerBridge] Fixed support of private services (nicolas-grekas) + * bug #27591 [VarDumper] Fix dumping ArrayObject and ArrayIterator instances (nicolas-grekas) + * bug #27581 Fix bad method call with guard authentication + session migration (weaverryan) + * bug #27576 [Cache] Fix expiry comparisons in array-based pools (nicolas-grekas) + * bug #27556 Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener (weaverryan) + * bug #27452 Avoid migration on stateless firewalls (weaverryan) + * bug #27568 [DI] Deduplicate generated proxy classes (nicolas-grekas) + * bug #27326 [Serializer] deserialize from xml: Fix a collection that contains the only one element (webnet-fr) + * bug #27567 [PhpUnitBridge] Fix error on some Windows OS (Nsbx) + * bug #27357 [Lock] Remove released semaphore (jderusse) + * bug #27416 TagAwareAdapter over non-binary memcached connections corrupts memcache (Aleksey Prilipko) + * bug #27514 [Debug] Pass previous exception to FatalErrorException (pmontoya) + * bug #27516 Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)" (nicolas-grekas) + * bug #27318 [Cache] memcache connect should not add duplicate entries on sequential calls (Aleksey Prilipko) + * bug #27389 [Serializer] Fix serializer tries to denormalize null values on nullable properties (ogizanagi) + * bug #27272 [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING (upyx) + * bug #27396 [HttpKernel] fix registering IDE links (nicolas-grekas) + * bug #26973 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer. (kmadejski) + * bug #27303 [Process] Consider "executable" suffixes first on Windows (sanmai) + * bug #27297 Triggering RememberMe's loginFail() when token cannot be created (weaverryan) + * bug #27344 [HttpKernel] reset kernel start time on reboot (kiler129) + * bug #27365 [Serializer] Check the value of enable_max_depth if defined (dunglas) + * bug #27358 [PhpUnitBridge] silence some stderr outputs (ostrolucky) + * bug #27366 [DI] never inline lazy services (nicolas-grekas) + * 4.0.11 (2018-05-25) * bug #27364 [DI] Fix bad exception on uninitialized references to non-shared services (nicolas-grekas) From 8984efc1ac95de59bc66853e3c0a26ed25cc9ec9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 15:02:08 +0200 Subject: [PATCH 009/107] updated VERSION for 4.0.12 --- 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 385ba0e26969a..4c009f9e06ffe 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -63,12 +63,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.0.12-DEV'; + const VERSION = '4.0.12'; const VERSION_ID = 40012; const MAJOR_VERSION = 4; const MINOR_VERSION = 0; const RELEASE_VERSION = 12; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2018'; const END_OF_LIFE = '01/2019'; From 54bca19bae31711e1bafda18f2f1ac587a45613f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 15:04:35 +0200 Subject: [PATCH 010/107] bumped Symfony version to 4.0.13 --- 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 4c009f9e06ffe..15955af90d231 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -63,12 +63,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.0.12'; - const VERSION_ID = 40012; + const VERSION = '4.0.13-DEV'; + const VERSION_ID = 40013; const MAJOR_VERSION = 4; const MINOR_VERSION = 0; - const RELEASE_VERSION = 12; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 13; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2018'; const END_OF_LIFE = '01/2019'; From e32b9650cb99f5f522096616b52133dc802e6758 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 25 Jun 2018 15:32:41 +0200 Subject: [PATCH 011/107] bumped Symfony version to 4.1.2 --- 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 1d5d2227579d8..05f068673e351 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -63,12 +63,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.1.1'; - const VERSION_ID = 40101; + const VERSION = '4.1.2-DEV'; + const VERSION_ID = 40102; const MAJOR_VERSION = 4; const MINOR_VERSION = 1; - const RELEASE_VERSION = 1; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 2; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2019'; const END_OF_LIFE = '07/2019'; From 660a456d6fbc7177c525f87c5628e4ea8cdc7368 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Mon, 25 Jun 2018 18:22:54 +0200 Subject: [PATCH 012/107] [Serializer] CsvEncoder::AS_COLLECTION_KEY constant --- src/Symfony/Component/Serializer/Encoder/CsvEncoder.php | 3 ++- .../Component/Serializer/Tests/Encoder/CsvEncoderTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php index e03fcc0d7ff63..6d31fb36009b8 100644 --- a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php @@ -28,6 +28,7 @@ class CsvEncoder implements EncoderInterface, DecoderInterface const KEY_SEPARATOR_KEY = 'csv_key_separator'; const HEADERS_KEY = 'csv_headers'; const ESCAPE_FORMULAS_KEY = 'csv_escape_formulas'; + const AS_COLLECTION_KEY = 'as_collection'; private $delimiter; private $enclosure; @@ -157,7 +158,7 @@ public function decode($data, $format, array $context = array()) } fclose($handle); - if ($context['as_collection'] ?? false) { + if ($context[self::AS_COLLECTION_KEY] ?? false) { return $result; } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php index d990d51ec75b3..4a0bc8169b03b 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php @@ -324,7 +324,7 @@ public function testDecodeOnlyOneAsCollection() a CSV - , 'csv', array('as_collection' => true))); + , 'csv', array(CsvEncoder::AS_COLLECTION_KEY => true))); } public function testDecodeToManyRelation() From 251e684fe6e967b1e52910c9c2826884abe9a0b6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 26 Jun 2018 09:38:32 +0200 Subject: [PATCH 013/107] add conflict for non-compatible TwigBridge version --- src/Symfony/Bundle/FrameworkBundle/composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 0c2a3dec226d8..de0fe10f91224 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -71,6 +71,7 @@ "symfony/serializer": "<4.1", "symfony/stopwatch": "<3.4", "symfony/translation": "<3.4", + "symfony/twig-bridge": "<4.1.1", "symfony/validator": "<4.1", "symfony/workflow": "<4.1" }, From 05d4bcb987179e60007fbd6f9378870a2d396ba1 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 25 Jun 2018 17:34:31 +0200 Subject: [PATCH 014/107] fix handling of empty DI extension configs --- .../Compiler/ValidateEnvPlaceholdersPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php index 402aca6378b63..06b655328b43d 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php @@ -65,7 +65,7 @@ public function process(ContainerBuilder $container) $processor = new Processor(); foreach ($extensions as $name => $extension) { - if (!$extension instanceof ConfigurationExtensionInterface || !$config = $container->getExtensionConfig($name)) { + if (!$extension instanceof ConfigurationExtensionInterface || !$config = array_filter($container->getExtensionConfig($name))) { // this extension has no semantic configuration or was not called continue; } From 411be25abaf6dcdcd26a43f3b86a308f245a2500 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 25 Jun 2018 22:27:26 +0200 Subject: [PATCH 015/107] [DI] fix dumping deprecated service in yaml --- src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index db22888d22783..149fd5b33ff20 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -99,7 +99,7 @@ private function addService($id, Definition $definition) } if ($definition->isDeprecated()) { - $code .= sprintf(" deprecated: %s\n", $definition->getDeprecationMessage('%service_id%')); + $code .= sprintf(" deprecated: %s\n", $this->dumper->dump($definition->getDeprecationMessage('%service_id%'))); } if ($definition->isAutowired()) { From 7b9b1b90224472851850af1bf8ff1add3622f010 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 26 Jun 2018 10:45:54 +0200 Subject: [PATCH 016/107] Redesign the Debug error page in prod --- .../Component/Debug/ExceptionHandler.php | 90 +++++++++++-------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index f22b70f6e8c6f..4a324d6fe5b22 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -208,48 +208,54 @@ public function getContent(FlattenException $exception) $title = 'Whoops, looks like something went wrong.'; } + if (!$this->debug) { + return << +

$title

+ +EOF; + } + $content = ''; - if ($this->debug) { - try { - $count = count($exception->getAllPrevious()); - $total = $count + 1; - foreach ($exception->toArray() as $position => $e) { - $ind = $count - $position + 1; - $class = $this->formatClass($e['class']); - $message = nl2br($this->escapeHtml($e['message'])); - $content .= sprintf(<<<'EOF' -
- - - + try { + $count = count($exception->getAllPrevious()); + $total = $count + 1; + foreach ($exception->toArray() as $position => $e) { + $ind = $count - $position + 1; + $class = $this->formatClass($e['class']); + $message = nl2br($this->escapeHtml($e['message'])); + $content .= sprintf(<<<'EOF' +
+
-

- (%d/%d) - %s -

-

%s

-
+ + EOF - , $ind, $total, $class, $message); - foreach ($e['trace'] as $trace) { - $content .= '\n"; + , $ind, $total, $class, $message); + foreach ($e['trace'] as $trace) { + $content .= '\n
+

+ (%d/%d) + %s +

+

%s

+
'; - if ($trace['function']) { - $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); - } - if (isset($trace['file']) && isset($trace['line'])) { - $content .= $this->formatPath($trace['file'], $trace['line']); - } - $content .= "
'; + if ($trace['function']) { + $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); } - - $content .= "
\n
\n"; - } - } catch (\Exception $e) { - // something nasty happened and we cannot throw an exception anymore - if ($this->debug) { - $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $this->escapeHtml($e->getMessage())); - } else { - $title = 'Whoops, looks like something went wrong.'; + if (isset($trace['file']) && isset($trace['line'])) { + $content .= $this->formatPath($trace['file'], $trace['line']); + } + $content .= "\n"; } + + $content .= "\n\n\n"; + } + } catch (\Exception $e) { + // something nasty happened and we cannot throw an exception anymore + if ($this->debug) { + $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $this->escapeHtml($e->getMessage())); + } else { + $title = 'Whoops, looks like something went wrong.'; } } @@ -278,6 +284,14 @@ public function getContent(FlattenException $exception) */ public function getStylesheet(FlattenException $exception) { + if (!$this->debug) { + return <<<'EOF' + body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } + .container { margin: 30px; max-width: 600px; } + h1 { color: #dc3545; font-size: 24px; } +EOF; + } + return <<<'EOF' body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; margin: 0; padding-bottom: 45px; } From 26fc4e683f96b51237fb206f3afbf93525adc49c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Jun 2018 13:18:14 +0200 Subject: [PATCH 017/107] [HttpFoundation] fix session tracking counter --- src/Symfony/Component/HttpFoundation/Session/Session.php | 8 +++----- .../Component/HttpFoundation/Session/SessionBagProxy.php | 4 ---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index f0379c1697b82..31da54c73e215 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -160,7 +160,9 @@ public function getUsageIndex() */ public function isEmpty() { - ++$this->usageIndex; + if ($this->isStarted()) { + ++$this->usageIndex; + } foreach ($this->data as &$data) { if (!empty($data)) { return false; @@ -185,8 +187,6 @@ public function invalidate($lifetime = null) */ public function migrate($destroy = false, $lifetime = null) { - ++$this->usageIndex; - return $this->storage->regenerate($destroy, $lifetime); } @@ -195,8 +195,6 @@ public function migrate($destroy = false, $lifetime = null) */ public function save() { - ++$this->usageIndex; - $this->storage->save(); } diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php b/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php index 88005ee092e2a..d6b242d4ee563 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php @@ -44,8 +44,6 @@ public function getBag() */ public function isEmpty() { - ++$this->usageIndex; - return empty($this->data[$this->bag->getStorageKey()]); } @@ -81,8 +79,6 @@ public function getStorageKey() */ public function clear() { - ++$this->usageIndex; - return $this->bag->clear(); } } From 89ed756462fd4660acfd8ad1c2224dffa0fccf3e Mon Sep 17 00:00:00 2001 From: David Maicher Date: Mon, 25 Jun 2018 20:31:52 +0200 Subject: [PATCH 018/107] failing test to reproduce session problem --- .../TestBundle/Controller/SessionController.php | 8 ++++++++ .../TestBundle/Resources/config/routing.yml | 4 ++++ .../Tests/Functional/SessionTest.php | 16 ++++++++++++++++ .../Component/HttpFoundation/Session/Session.php | 2 -- .../HttpFoundation/Session/SessionBagProxy.php | 5 +++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php index a1d91e7929d65..0c82d8cc73eb2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php @@ -43,6 +43,14 @@ public function welcomeAction(Request $request, $name = null) return new Response(sprintf('Welcome back %s, nice to meet you.', $name)); } + public function cacheableAction() + { + $response = new Response('all good'); + $response->setSharedMaxAge(100); + + return $response; + } + public function logoutAction(Request $request) { $request->getSession()->invalidate(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml index 11b85a86d3299..923204ab0f427 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml @@ -2,6 +2,10 @@ session_welcome: path: /session defaults: { _controller: TestBundle:Session:welcome } +session_cacheable: + path: /cacheable + defaults: { _controller: Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SessionController::cacheableAction } + session_welcome_name: path: /session/{name} defaults: { _controller: TestBundle:Session:welcome } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php index 166d8a33919df..2e1634220c3a5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php @@ -126,6 +126,22 @@ public function testTwoClients($config, $insulate) $this->assertContains('Welcome back client2, nice to meet you.', $crawler2->text()); } + /** + * @dataProvider getConfigs + */ + public function testCorrectCacheControlHeadersForCacheableAction($config, $insulate) + { + $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + if ($insulate) { + $client->insulate(); + } + + $client->request('GET', '/cacheable'); + + $response = $client->getResponse(); + $this->assertSame('public, s-maxage=100', $response->headers->get('cache-control')); + } + public function getConfigs() { return array( diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index 31da54c73e215..c0978d552f197 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -54,8 +54,6 @@ public function __construct(SessionStorageInterface $storage = null, AttributeBa */ public function start() { - ++$this->usageIndex; - return $this->storage->start(); } diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php b/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php index d6b242d4ee563..3504bdfe7b4a6 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php @@ -44,6 +44,11 @@ public function getBag() */ public function isEmpty() { + if (!isset($this->data[$this->bag->getStorageKey()])) { + return true; + } + ++$this->usageIndex; + return empty($this->data[$this->bag->getStorageKey()]); } From 476ef19b4171291f3bf82055ab5262b1c8f3f11b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Jun 2018 23:01:14 +0200 Subject: [PATCH 019/107] Bump ext-mongodb to 1.5 on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 25ca170da93a5..c0367f10720bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,7 +144,7 @@ before_install: tfold ext.apcu tpecl apcu-4.0.11 apcu.so $INI elif [[ ! $skip && $PHP = 7.* ]]; then tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI - tfold ext.mongodb tpecl mongodb-1.4.0RC1 mongodb.so $INI + tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI fi install: From 5ed40c095be3c9387d70a664ab98c289ba53d25b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Jun 2018 17:17:35 +0200 Subject: [PATCH 020/107] [HttpFoundation] fix registration of session proxies --- .../Session/Storage/NativeSessionStorage.php | 2 -- .../Storage/Proxy/SessionHandlerProxy.php | 18 +++++++++- .../Storage/Proxy/SessionHandlerProxyTest.php | 33 +++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index 6416a03fdf4b5..41410bd323d8f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -411,8 +411,6 @@ public function setSaveHandler($saveHandler = null) } if ($this->saveHandler instanceof SessionHandlerProxy) { - session_set_save_handler($this->saveHandler->getHandler(), false); - } elseif ($this->saveHandler instanceof \SessionHandlerInterface) { session_set_save_handler($this->saveHandler, false); } } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php index 53c1209a1c07d..b11cc397a0973 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -14,7 +14,7 @@ /** * @author Drak */ -class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface +class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface { protected $handler; @@ -82,4 +82,20 @@ public function gc($maxlifetime) { return (bool) $this->handler->gc($maxlifetime); } + + /** + * {@inheritdoc} + */ + public function validateId($sessionId) + { + return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler->validateId($sessionId); + } + + /** + * {@inheritdoc} + */ + public function updateTimestamp($sessionId, $data) + { + return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data); + } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php index 682825356a724..0b48250e01010 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php @@ -121,4 +121,37 @@ public function testGc() $this->proxy->gc(86400); } + + /** + * @requires PHPUnit 5.1 + */ + public function testValidateId() + { + $mock = $this->getMockBuilder(array('SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'))->getMock(); + $mock->expects($this->once()) + ->method('validateId'); + + $proxy = new SessionHandlerProxy($mock); + $proxy->validateId('id'); + + $this->assertTrue($this->proxy->validateId('id')); + } + + /** + * @requires PHPUnit 5.1 + */ + public function testUpdateTimestamp() + { + $mock = $this->getMockBuilder(array('SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'))->getMock(); + $mock->expects($this->once()) + ->method('updateTimestamp'); + + $proxy = new SessionHandlerProxy($mock); + $proxy->updateTimestamp('id', 'data'); + + $this->mock->expects($this->once()) + ->method('write'); + + $this->proxy->updateTimestamp('id', 'data'); + } } From e16b3023c00d81beda6cf2cc31d44784054a51ec Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Jun 2018 11:41:32 +0200 Subject: [PATCH 021/107] [Routing] fix too much greediness in host-matching regex --- .../Matcher/Dumper/PhpMatcherDumper.php | 2 +- .../Tests/Fixtures/dumper/url_matcher1.php | 90 +++++++++---------- .../Tests/Fixtures/dumper/url_matcher2.php | 90 +++++++++---------- .../Routing/Tests/Matcher/UrlMatcherTest.php | 10 +++ 4 files changed, 101 insertions(+), 91 deletions(-) diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index adb2b0a1c0148..044638300df9a 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -379,7 +379,7 @@ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHo $hostRegex = '(?i:'.preg_replace_callback('#\?P<([^>]++)>#', $state->getVars, $rx[1]).')\.'; $state->hostVars = $state->vars; } else { - $hostRegex = '(?:(?:[^.]*+\.)++)'; + $hostRegex = '(?:(?:[^./]*+\.)++)'; $state->hostVars = array(); } $state->mark += strlen($rx = ($prev ? ')' : '')."|{$hostRegex}(?"); diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php index b39bc7f2bae0a..c91066a46d281 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php @@ -82,47 +82,47 @@ public function match($rawPathinfo) $matchedPathinfo = $host.'.'.$pathinfo; $regexList = array( 0 => '{^(?' - .'|(?:(?:[^.]*+\\.)++)(?' - .'|/foo/(baz|symfony)(*:46)' + .'|(?:(?:[^./]*+\\.)++)(?' + .'|/foo/(baz|symfony)(*:47)' .'|/bar(?' - .'|/([^/]++)(*:69)' - .'|head/([^/]++)(*:89)' + .'|/([^/]++)(*:70)' + .'|head/([^/]++)(*:90)' .')' .'|/test/([^/]++)/(?' - .'|(*:115)' + .'|(*:116)' .')' - .'|/([\']+)(*:131)' + .'|/([\']+)(*:132)' .'|/a/(?' .'|b\'b/([^/]++)(?' - .'|(*:160)' - .'|(*:168)' + .'|(*:161)' + .'|(*:169)' .')' - .'|(.*)(*:181)' + .'|(.*)(*:182)' .'|b\'b/([^/]++)(?' - .'|(*:204)' - .'|(*:212)' + .'|(*:205)' + .'|(*:213)' .')' .')' - .'|/multi/hello(?:/([^/]++))?(*:248)' + .'|/multi/hello(?:/([^/]++))?(*:249)' .'|/([^/]++)/b/([^/]++)(?' - .'|(*:279)' - .'|(*:287)' + .'|(*:280)' + .'|(*:288)' .')' - .'|/aba/([^/]++)(*:309)' + .'|/aba/([^/]++)(*:310)' .')|(?i:([^\\.]++)\\.example\\.com)\\.(?' .'|/route1(?' - .'|3/([^/]++)(*:371)' - .'|4/([^/]++)(*:389)' + .'|3/([^/]++)(*:372)' + .'|4/([^/]++)(*:390)' .')' .')|(?i:c\\.example\\.com)\\.(?' - .'|/route15/([^/]++)(*:441)' - .')|(?:(?:[^.]*+\\.)++)(?' - .'|/route16/([^/]++)(*:488)' + .'|/route15/([^/]++)(*:442)' + .')|(?:(?:[^./]*+\\.)++)(?' + .'|/route16/([^/]++)(*:490)' .'|/a/(?' - .'|a\\.\\.\\.(*:509)' + .'|a\\.\\.\\.(*:511)' .'|b/(?' - .'|([^/]++)(*:530)' - .'|c/([^/]++)(*:548)' + .'|([^/]++)(*:532)' + .'|c/([^/]++)(*:550)' .')' .')' .')' @@ -132,7 +132,7 @@ public function match($rawPathinfo) foreach ($regexList as $offset => $regex) { while (preg_match($regex, $matchedPathinfo, $matches)) { switch ($m = (int) $matches['MARK']) { - case 115: + case 116: $matches = array('foo' => $matches[1] ?? null); // baz4 @@ -159,7 +159,7 @@ public function match($rawPathinfo) not_bazbaz6: break; - case 160: + case 161: $matches = array('foo' => $matches[1] ?? null); // foo1 @@ -173,14 +173,14 @@ public function match($rawPathinfo) not_foo1: break; - case 204: + case 205: $matches = array('foo1' => $matches[1] ?? null); // foo2 return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array()); break; - case 279: + case 280: $matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null); // foo3 @@ -189,23 +189,23 @@ public function match($rawPathinfo) break; default: $routes = array( - 46 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null), - 69 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null), - 89 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null), - 131 => array(array('_route' => 'quoter'), array('quoter'), null, null), - 168 => array(array('_route' => 'bar1'), array('bar'), null, null), - 181 => array(array('_route' => 'overridden'), array('var'), null, null), - 212 => array(array('_route' => 'bar2'), array('bar1'), null, null), - 248 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null), - 287 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null), - 309 => array(array('_route' => 'foo4'), array('foo'), null, null), - 371 => array(array('_route' => 'route13'), array('var1', 'name'), null, null), - 389 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null), - 441 => array(array('_route' => 'route15'), array('name'), null, null), - 488 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null), - 509 => array(array('_route' => 'a'), array(), null, null), - 530 => array(array('_route' => 'b'), array('var'), null, null), - 548 => array(array('_route' => 'c'), array('var'), null, null), + 47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null), + 70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null), + 90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null), + 132 => array(array('_route' => 'quoter'), array('quoter'), null, null), + 169 => array(array('_route' => 'bar1'), array('bar'), null, null), + 182 => array(array('_route' => 'overridden'), array('var'), null, null), + 213 => array(array('_route' => 'bar2'), array('bar1'), null, null), + 249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null), + 288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null), + 310 => array(array('_route' => 'foo4'), array('foo'), null, null), + 372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null), + 390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null), + 442 => array(array('_route' => 'route15'), array('name'), null, null), + 490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null), + 511 => array(array('_route' => 'a'), array(), null, null), + 532 => array(array('_route' => 'b'), array('var'), null, null), + 550 => array(array('_route' => 'c'), array('var'), null, null), ); list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m]; @@ -231,7 +231,7 @@ public function match($rawPathinfo) return $ret; } - if (548 === $m) { + if (550 === $m) { break; } $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m)); diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php index 79b650eb5b26d..a711dbaf61263 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php @@ -119,47 +119,47 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a $matchedPathinfo = $host.'.'.$pathinfo; $regexList = array( 0 => '{^(?' - .'|(?:(?:[^.]*+\\.)++)(?' - .'|/foo/(baz|symfony)(*:46)' + .'|(?:(?:[^./]*+\\.)++)(?' + .'|/foo/(baz|symfony)(*:47)' .'|/bar(?' - .'|/([^/]++)(*:69)' - .'|head/([^/]++)(*:89)' + .'|/([^/]++)(*:70)' + .'|head/([^/]++)(*:90)' .')' .'|/test/([^/]++)/(?' - .'|(*:115)' + .'|(*:116)' .')' - .'|/([\']+)(*:131)' + .'|/([\']+)(*:132)' .'|/a/(?' .'|b\'b/([^/]++)(?' - .'|(*:160)' - .'|(*:168)' + .'|(*:161)' + .'|(*:169)' .')' - .'|(.*)(*:181)' + .'|(.*)(*:182)' .'|b\'b/([^/]++)(?' - .'|(*:204)' - .'|(*:212)' + .'|(*:205)' + .'|(*:213)' .')' .')' - .'|/multi/hello(?:/([^/]++))?(*:248)' + .'|/multi/hello(?:/([^/]++))?(*:249)' .'|/([^/]++)/b/([^/]++)(?' - .'|(*:279)' - .'|(*:287)' + .'|(*:280)' + .'|(*:288)' .')' - .'|/aba/([^/]++)(*:309)' + .'|/aba/([^/]++)(*:310)' .')|(?i:([^\\.]++)\\.example\\.com)\\.(?' .'|/route1(?' - .'|3/([^/]++)(*:371)' - .'|4/([^/]++)(*:389)' + .'|3/([^/]++)(*:372)' + .'|4/([^/]++)(*:390)' .')' .')|(?i:c\\.example\\.com)\\.(?' - .'|/route15/([^/]++)(*:441)' - .')|(?:(?:[^.]*+\\.)++)(?' - .'|/route16/([^/]++)(*:488)' + .'|/route15/([^/]++)(*:442)' + .')|(?:(?:[^./]*+\\.)++)(?' + .'|/route16/([^/]++)(*:490)' .'|/a/(?' - .'|a\\.\\.\\.(*:509)' + .'|a\\.\\.\\.(*:511)' .'|b/(?' - .'|([^/]++)(*:530)' - .'|c/([^/]++)(*:548)' + .'|([^/]++)(*:532)' + .'|c/([^/]++)(*:550)' .')' .')' .')' @@ -169,7 +169,7 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a foreach ($regexList as $offset => $regex) { while (preg_match($regex, $matchedPathinfo, $matches)) { switch ($m = (int) $matches['MARK']) { - case 115: + case 116: $matches = array('foo' => $matches[1] ?? null); // baz4 @@ -196,7 +196,7 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a not_bazbaz6: break; - case 160: + case 161: $matches = array('foo' => $matches[1] ?? null); // foo1 @@ -210,14 +210,14 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a not_foo1: break; - case 204: + case 205: $matches = array('foo1' => $matches[1] ?? null); // foo2 return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array()); break; - case 279: + case 280: $matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null); // foo3 @@ -226,23 +226,23 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a break; default: $routes = array( - 46 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null), - 69 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null), - 89 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null), - 131 => array(array('_route' => 'quoter'), array('quoter'), null, null), - 168 => array(array('_route' => 'bar1'), array('bar'), null, null), - 181 => array(array('_route' => 'overridden'), array('var'), null, null), - 212 => array(array('_route' => 'bar2'), array('bar1'), null, null), - 248 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null), - 287 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null), - 309 => array(array('_route' => 'foo4'), array('foo'), null, null), - 371 => array(array('_route' => 'route13'), array('var1', 'name'), null, null), - 389 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null), - 441 => array(array('_route' => 'route15'), array('name'), null, null), - 488 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null), - 509 => array(array('_route' => 'a'), array(), null, null), - 530 => array(array('_route' => 'b'), array('var'), null, null), - 548 => array(array('_route' => 'c'), array('var'), null, null), + 47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null), + 70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null), + 90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null), + 132 => array(array('_route' => 'quoter'), array('quoter'), null, null), + 169 => array(array('_route' => 'bar1'), array('bar'), null, null), + 182 => array(array('_route' => 'overridden'), array('var'), null, null), + 213 => array(array('_route' => 'bar2'), array('bar1'), null, null), + 249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null), + 288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null), + 310 => array(array('_route' => 'foo4'), array('foo'), null, null), + 372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null), + 390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null), + 442 => array(array('_route' => 'route15'), array('name'), null, null), + 490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null), + 511 => array(array('_route' => 'a'), array(), null, null), + 532 => array(array('_route' => 'b'), array('var'), null, null), + 550 => array(array('_route' => 'c'), array('var'), null, null), ); list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m]; @@ -268,7 +268,7 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a return $ret; } - if (548 === $m) { + if (550 === $m) { break; } $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m)); diff --git a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php index f0013d7bc3d10..5a34535eb6cc2 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -670,6 +670,16 @@ public function testUtf8AndMethodMatching() $this->assertEquals('c', $matcher->match('/admin/api/package.json')['_route']); } + public function testHostWithDot() + { + $coll = new RouteCollection(); + $coll->add('a', new Route('/foo', array(), array(), array(), 'foo.example.com')); + $coll->add('b', new Route('/bar/{baz}')); + + $matcher = $this->getUrlMatcher($coll); + $this->assertEquals('b', $matcher->match('/bar/abc.123')['_route']); + } + protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null) { return new UrlMatcher($routes, $context ?: new RequestContext()); From 8e0acfc2db92a6576c5f070aafafc1c2109f1704 Mon Sep 17 00:00:00 2001 From: Bonfante Date: Wed, 27 Jun 2018 19:41:44 -0300 Subject: [PATCH 022/107] [HttpFoundation] missing namespace for RedisProxy --- .../Session/Storage/Handler/RedisSessionHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php index 59242ef387f81..bad59332a9c62 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php @@ -12,6 +12,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; use Predis\Response\ErrorInterface; +use Symfony\Component\Cache\Traits\RedisProxy; /** * Redis based session storage handler based on the Redis class From 426fb45cfbdf64110b855031e0e56f7e18988dc9 Mon Sep 17 00:00:00 2001 From: Cyril PASCAL Date: Tue, 26 Jun 2018 13:02:12 +0200 Subject: [PATCH 023/107] [Routing] Disallow object usage inside Route --- .../Routing/Matcher/Dumper/PhpMatcherDumper.php | 4 ++++ .../Tests/Matcher/Dumper/PhpMatcherDumperTest.php | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index 044638300df9a..c5af8c52a3679 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -746,6 +746,10 @@ public static function export($value): string return 'null'; } if (!\is_array($value)) { + if (\is_object($value)) { + throw new \InvalidArgumentException('Symfony\Component\Routing\Route cannot contain objects.'); + } + return str_replace("\n", '\'."\n".\'', var_export($value, true)); } if (!$value) { diff --git a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php index 4bbfe131a7bf9..a1c28ecab4d67 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php @@ -491,6 +491,18 @@ private function generateDumpedMatcher(RouteCollection $collection, $redirectabl return $this->matcherClass; } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Symfony\Component\Routing\Route cannot contain objects + */ + public function testGenerateDumperMatcherWithObject() + { + $routeCollection = new RouteCollection(); + $routeCollection->add('_', new Route('/', array(new \stdClass()))); + $dumper = new PhpMatcherDumper($routeCollection); + $dumper->dump(); + } } abstract class RedirectableUrlMatcherStub extends UrlMatcher implements RedirectableUrlMatcherInterface From fd8fd3df477ff78b194bf5a8e427e1fa14ab1265 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 28 Jun 2018 10:10:40 +0200 Subject: [PATCH 024/107] [HttpFoundation] fix merge --- .../HttpKernel/EventListener/AbstractSessionListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php index 2636c65ff6951..bc02fe0a830f7 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php @@ -62,7 +62,7 @@ public function onKernelRequest(GetResponseEvent $event) } $session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null); - $this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : null; + $this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : 0; } public function onKernelResponse(FilterResponseEvent $event) From e665da0c9a1338608bfee9875535e6317d308843 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 28 Jun 2018 11:33:10 +0200 Subject: [PATCH 025/107] [Lock] fix locale dependent test case --- src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php index 23b90360bea77..70575050722a2 100644 --- a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php @@ -50,7 +50,7 @@ public function testResourceRemoval() private function getOpenedSemaphores() { - $lines = explode(PHP_EOL, trim(`ipcs -su`)); + $lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`)); if ('------ Semaphore Status --------' !== $lines[0]) { throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines)); } From fe7fc4408516421a31e8ca9461e43d2cbc726e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 28 Jun 2018 13:49:38 +0200 Subject: [PATCH 026/107] [Validator] Fix the namespace of RegexTest --- src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php index 3291c77356f23..26ef1b27361ad 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Constraints; +namespace Symfony\Component\Validator\Tests\Constraints; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\Regex; From 2258ce4357fbba00deff7420d7d7760a7e2353f9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 29 Jun 2018 13:03:55 +0200 Subject: [PATCH 027/107] [Form] relax fixtures for forward compat --- .../Fixtures/Descriptor/default_option_with_normalizer.txt | 2 +- .../Descriptor/overridden_option_with_default_closures.txt | 4 ++-- .../Descriptor/required_option_with_allowed_values.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt index c622057cdbdfd..87d656a3fa1eb 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt @@ -15,7 +15,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain ---------------- --------------------%s Allowed values - %s ---------------- --------------------%s - Normalizer Closure { %s + Normalizer Closure%s{ %s parameters: 2 %s file: "%s%eExtension%eCore%eType%eChoiceType.php" line: "%s to %s" %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt index 231d1319bbeff..967d177c7e9c7 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt @@ -8,12 +8,12 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data) Default Value: null %s %s Closure(s): [ %s - Closure { %s + Closure%s{ %s parameters: 1 %s file: "%s%eExtension%eCore%eType%eFormType.php" line: "%s to %s" %s }, %s - Closure { %s + Closure%s{ %s parameters: 2 %s file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt index da3e6c82d8b1a..0d2e7f44d9bb3 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt @@ -16,7 +16,7 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo) "baz" %s ] %s ---------------- --------------------%s - Normalizer Closure { %s + Normalizer Closure%s{ %s parameters: 2 %s file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s From c91b7afe35eee53234463871dc97e9cd23f67dbb Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Fri, 29 Jun 2018 12:43:55 +0100 Subject: [PATCH 028/107] Ensure the class discriminator mechanism works with serialization groups as well --- .../Normalizer/ObjectNormalizer.php | 21 +++++++ .../Tests/Fixtures/DummyMessageInterface.php | 4 +- .../Tests/Fixtures/DummyMessageNumberOne.php | 7 +++ .../Tests/Fixtures/DummyMessageNumberTwo.php | 19 ++++++ .../Serializer/Tests/SerializerTest.php | 62 +++++++++---------- 5 files changed, 79 insertions(+), 34 deletions(-) create mode 100644 src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php index bf463fe5457d3..6c9098528b67e 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php @@ -16,6 +16,7 @@ use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\Serializer\Exception\RuntimeException; +use Symfony\Component\Serializer\Mapping\AttributeMetadata; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; use Symfony\Component\Serializer\NameConverter\NameConverterInterface; @@ -131,4 +132,24 @@ protected function setAttributeValue($object, $attribute, $value, $format = null // Properties not found are ignored } } + + /** + * {@inheritdoc} + */ + protected function getAllowedAttributes($classOrObject, array $context, $attributesAsString = false) + { + if (false === $allowedAttributes = parent::getAllowedAttributes($classOrObject, $context, $attributesAsString)) { + return false; + } + + if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForMappedObject($classOrObject)) { + $allowedAttributes[] = $attributesAsString ? $discriminatorMapping->getTypeProperty() : new AttributeMetadata($discriminatorMapping->getTypeProperty()); + + foreach ($discriminatorMapping->getTypesMapping() as $class) { + $allowedAttributes = array_merge($allowedAttributes, parent::getAllowedAttributes($class, $context, $attributesAsString)); + } + } + + return $allowedAttributes; + } } diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageInterface.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageInterface.php index f0b4c4d128c38..55bb00bc8e253 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageInterface.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageInterface.php @@ -15,8 +15,8 @@ /** * @DiscriminatorMap(typeProperty="type", mapping={ - * "first"="Symfony\Component\Serializer\Tests\Fixtures\AbstractDummyFirstChild", - * "second"="Symfony\Component\Serializer\Tests\Fixtures\AbstractDummySecondChild" + * "one"="Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberOne", + * "two"="Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberTwo" * }) * * @author Samuel Roze diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberOne.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberOne.php index 381f7f8a6c70b..200476b54232d 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberOne.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberOne.php @@ -11,10 +11,17 @@ namespace Symfony\Component\Serializer\Tests\Fixtures; +use Symfony\Component\Serializer\Annotation\Groups; + /** * @author Samuel Roze */ class DummyMessageNumberOne implements DummyMessageInterface { public $one; + + /** + * @Groups({"two"}) + */ + public $two; } diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php new file mode 100644 index 0000000000000..060c10dd7935d --- /dev/null +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Serializer\Tests\Fixtures; + +/** + * @author Samuel Roze + */ +class DummyMessageNumberTwo implements DummyMessageInterface +{ +} diff --git a/src/Symfony/Component/Serializer/Tests/SerializerTest.php b/src/Symfony/Component/Serializer/Tests/SerializerTest.php index 7550b3c9b7ba1..25fbbf38ce584 100644 --- a/src/Symfony/Component/Serializer/Tests/SerializerTest.php +++ b/src/Symfony/Component/Serializer/Tests/SerializerTest.php @@ -11,11 +11,14 @@ namespace Symfony\Component\Serializer\Tests; +use Doctrine\Common\Annotations\AnnotationReader; use PHPUnit\Framework\TestCase; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorMapping; use Symfony\Component\Serializer\Mapping\ClassMetadata; +use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; +use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -398,11 +401,9 @@ public function testDeserializeAndSerializeInterfacedObjectsWithTheClassMetadata $example = new DummyMessageNumberOne(); $example->one = 1; - $jsonData = '{"message-type":"one","one":1}'; - - $discriminatorResolver = new ClassDiscriminatorFromClassMetadata($this->metadataFactoryMockForDummyInterface()); - $serializer = new Serializer(array(new ObjectNormalizer(null, null, null, null, $discriminatorResolver)), array('json' => new JsonEncoder())); + $jsonData = '{"type":"one","one":1,"two":null}'; + $serializer = $this->serializerWithClassDiscriminator(); $deserialized = $serializer->deserialize($jsonData, DummyMessageInterface::class, 'json'); $this->assertEquals($example, $deserialized); @@ -410,51 +411,48 @@ public function testDeserializeAndSerializeInterfacedObjectsWithTheClassMetadata $this->assertEquals($jsonData, $serialized); } + public function testDeserializeAndSerializeInterfacedObjectsWithTheClassMetadataDiscriminatorResolverAndGroups() + { + $example = new DummyMessageNumberOne(); + $example->two = 2; + + $serializer = $this->serializerWithClassDiscriminator(); + $deserialized = $serializer->deserialize('{"type":"one","one":1,"two":2}', DummyMessageInterface::class, 'json', array( + 'groups' => array('two'), + )); + + $this->assertEquals($example, $deserialized); + + $serialized = $serializer->serialize($deserialized, 'json', array( + 'groups' => array('two'), + )); + + $this->assertEquals('{"two":2,"type":"one"}', $serialized); + } + /** * @expectedException \Symfony\Component\Serializer\Exception\RuntimeException * @expectedExceptionMessage The type "second" has no mapped class for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface" */ public function testExceptionWhenTypeIsNotKnownInDiscriminator() { - $discriminatorResolver = new ClassDiscriminatorFromClassMetadata($this->metadataFactoryMockForDummyInterface()); - $serializer = new Serializer(array(new ObjectNormalizer(null, null, null, null, $discriminatorResolver)), array('json' => new JsonEncoder())); - $serializer->deserialize('{"message-type":"second","one":1}', DummyMessageInterface::class, 'json'); + $this->serializerWithClassDiscriminator()->deserialize('{"type":"second","one":1}', DummyMessageInterface::class, 'json'); } /** * @expectedException \Symfony\Component\Serializer\Exception\RuntimeException - * @expectedExceptionMessage Type property "message-type" not found for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface" + * @expectedExceptionMessage Type property "type" not found for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface" */ public function testExceptionWhenTypeIsNotInTheBodyToDeserialiaze() { - $discriminatorResolver = new ClassDiscriminatorFromClassMetadata($this->metadataFactoryMockForDummyInterface()); - $serializer = new Serializer(array(new ObjectNormalizer(null, null, null, null, $discriminatorResolver)), array('json' => new JsonEncoder())); - $serializer->deserialize('{"one":1}', DummyMessageInterface::class, 'json'); + $this->serializerWithClassDiscriminator()->deserialize('{"one":1}', DummyMessageInterface::class, 'json'); } - private function metadataFactoryMockForDummyInterface() + private function serializerWithClassDiscriminator() { - $factoryMock = $this->getMockBuilder(ClassMetadataFactoryInterface::class)->getMock(); - $factoryMock->method('hasMetadataFor')->will($this->returnValueMap(array( - array( - DummyMessageInterface::class, - true, - ), - ))); - - $factoryMock->method('getMetadataFor')->will($this->returnValueMap(array( - array( - DummyMessageInterface::class, - new ClassMetadata( - DummyMessageInterface::class, - new ClassDiscriminatorMapping('message-type', array( - 'one' => DummyMessageNumberOne::class, - )) - ), - ), - ))); + $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); - return $factoryMock; + return new Serializer(array(new ObjectNormalizer($classMetadataFactory, null, null, null, new ClassDiscriminatorFromClassMetadata($classMetadataFactory))), array('json' => new JsonEncoder())); } } From 6e5c15d8aa0babf1da519f56f4bc8770a36e28ee Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 25 Jun 2018 11:39:34 +0200 Subject: [PATCH 029/107] bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [SecurityBundle] Dont throw if "security.http_utils" is not found | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27445 | License | MIT | Doc PR | - The comment + test were misleading, the actual important thing is wiring `AddSessionDomainConstraintPass` before removing passes, which is already the case already. Commits ------- db88330448 [SecurityBundle] Dont throw if "security.http_utils" is not found --- .../Compiler/AddSessionDomainConstraintPass.php | 3 +-- .../Compiler/AddSessionDomainConstraintPassTest.php | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php index ba523382b66ba..3dd18944de9f3 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php @@ -26,7 +26,7 @@ class AddSessionDomainConstraintPass implements CompilerPassInterface */ public function process(ContainerBuilder $container) { - if (!$container->hasParameter('session.storage.options')) { + if (!$container->hasParameter('session.storage.options') || !$container->has('security.http_utils')) { return; } @@ -34,7 +34,6 @@ public function process(ContainerBuilder $container) $domainRegexp = empty($sessionOptions['cookie_domain']) ? '%s' : sprintf('(?:%%s|(?:.+\.)?%s)', preg_quote(trim($sessionOptions['cookie_domain'], '.'))); $domainRegexp = (empty($sessionOptions['cookie_secure']) ? 'https?://' : 'https://').$domainRegexp; - // if the service doesn't exist, an exception must be thrown - ignoring would put security at risk $container->findDefinition('security.http_utils')->addArgument(sprintf('{^%s$}i', $domainRegexp)); } } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php index e12f3a64f31fe..7d49ad3dd4ec6 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php @@ -96,19 +96,6 @@ public function testNoSession() $this->assertTrue($utils->createRedirectResponse($request, 'http://pirate.com/foo')->isRedirect('http://pirate.com/foo')); } - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - * @expectedExceptionMessage You have requested a non-existent service "security.http_utils". - */ - public function testNoHttpUtils() - { - $container = new ContainerBuilder(); - $container->setParameter('session.storage.options', array()); - - $pass = new AddSessionDomainConstraintPass(); - $pass->process($container); - } - private function createContainer($sessionStorageOptions) { $container = new ContainerBuilder(); From 3ca0c86afe12c1b85e0fea9b95fa2c052c361d38 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 29 Jun 2018 16:05:32 +0200 Subject: [PATCH 030/107] [ProxyManagerBridge] Fix support of private services (bis) --- .../Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php | 3 ++- .../ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index 4a54cc7658e6b..1e47f4424b66b 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -15,6 +15,7 @@ use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy; use ProxyManager\Version; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface; @@ -57,7 +58,7 @@ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode = $instantiation = 'return'; if ($definition->isShared()) { - $instantiation .= sprintf(' $this->%s[\'%s\'] =', $definition->isPublic() && !$definition->isPrivate() ? 'services' : 'privates', $id); + $instantiation .= sprintf(' $this->%s[\'%s\'] =', \method_exists(ContainerBuilder::class, 'addClassResource') || ($definition->isPublic() && !$definition->isPrivate()) ? 'services' : 'privates', $id); } if (null === $factoryCode) { diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php index 357b26844c364..8bdc63146605d 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; /** @@ -101,7 +102,7 @@ public function getPrivatePublicDefinitions() array( (new Definition(__CLASS__)) ->setPublic(false), - 'privates', + \method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates', ), array( (new Definition(__CLASS__)) From 9135e18deddbebacd67bd5d3945a566f0af7a01a Mon Sep 17 00:00:00 2001 From: Sir Kane Date: Thu, 28 Jun 2018 18:39:54 +0000 Subject: [PATCH 031/107] [HttpFoundation] update phpdoc of FlashBagInterface::add() --- .../Session/Flash/FlashBagInterface.php | 2 +- .../Tests/Session/Flash/FlashBagTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php index 80e97f17cdff3..f53c9dae6c0aa 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php @@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface * Adds a flash message for type. * * @param string $type - * @param string $message + * @param mixed $message */ public function add($type, $message); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php index b44429d8989d8..3ceb124771d0d 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php @@ -74,6 +74,18 @@ public function testPeek() $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); } + public function testAdd() + { + $tab = array('bar' => 'baz'); + $this->bag->add('string_message', 'lorem'); + $this->bag->add('object_message', new \stdClass()); + $this->bag->add('array_message', $tab); + + $this->assertEquals(array('lorem'), $this->bag->get('string_message')); + $this->assertEquals(array(new \stdClass()), $this->bag->get('object_message')); + $this->assertEquals(array($tab), $this->bag->get('array_message')); + } + public function testGet() { $this->assertEquals(array(), $this->bag->get('non_existing')); From 9055611dc3e5592d30568a4797e8e9391d9c1e28 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Fri, 29 Jun 2018 18:29:00 +0200 Subject: [PATCH 032/107] [Lock] Fix SemaphoreStoreTest on OS X --- .../Lock/Tests/Store/SemaphoreStoreTest.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php index 70575050722a2..38babded2854e 100644 --- a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php @@ -50,13 +50,22 @@ public function testResourceRemoval() private function getOpenedSemaphores() { + if ('Darwin' === PHP_OS) { + $lines = explode(PHP_EOL, trim(`ipcs -s`)); + if (-1 === $start = array_search('Semaphores:', $lines)) { + throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines)); + } + + return \count(\array_slice($lines, ++$start)); + } + $lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`)); if ('------ Semaphore Status --------' !== $lines[0]) { - throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines)); + throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines)); } list($key, $value) = explode(' = ', $lines[1]); if ('used arrays' !== $key) { - throw new \Exception('Failed to extract list of opend semaphores. Expect a used arrays key, got '.implode(PHP_EOL, $lines)); + throw new \Exception('Failed to extract list of opened semaphores. Expected a "used arrays" key, got '.implode(PHP_EOL, $lines)); } return (int) $value; From 97e8d68a05e1457950920c2e1c05d2a20392f918 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 30 Jun 2018 09:08:55 +0200 Subject: [PATCH 033/107] [DI] Fix dumping ignore-on-uninitialized references to synthetic services --- .../DependencyInjection/Dumper/PhpDumper.php | 6 +++-- .../Tests/ContainerBuilderTest.php | 15 ++++++++++++ .../Tests/Dumper/PhpDumperTest.php | 23 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 7c493f62e365c..d7a345bd113a0 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1898,8 +1898,10 @@ private function getServiceCall($id, Reference $reference = null) return '$this'; } - if ($this->container->hasDefinition($id) && ($definition = $this->container->getDefinition($id)) && !$definition->isSynthetic()) { - if (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) { + if ($this->container->hasDefinition($id) && $definition = $this->container->getDefinition($id)) { + if ($definition->isSynthetic()) { + $code = sprintf('$this->get(\'%s\'%s)', $id, null !== $reference ? ', '.$reference->getInvalidBehavior() : ''); + } elseif (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) { $code = 'null'; if (!$definition->isShared()) { return $code; diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index f2e8368455f66..d8e7203028b0a 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -1434,6 +1434,21 @@ public function testArgumentsHaveHigherPriorityThanBindings() $this->assertSame('via-argument', $container->get('foo')->class1->identifier); $this->assertSame('via-bindings', $container->get('foo')->class2->identifier); } + + public function testUninitializedSyntheticReference() + { + $container = new ContainerBuilder(); + $container->register('foo', 'stdClass')->setPublic(true)->setSynthetic(true); + $container->register('bar', 'stdClass')->setPublic(true)->setShared(false) + ->setProperty('foo', new Reference('foo', ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE)); + + $container->compile(); + + $this->assertEquals((object) array('foo' => null), $container->get('bar')); + + $container->set('foo', (object) array(123)); + $this->assertEquals((object) array('foo' => (object) array(123)), $container->get('bar')); + } } class FooClass diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 319561cf38941..161bf18aaf2e5 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -913,6 +913,29 @@ public function testDumpHandlesObjectClassNames() $this->assertInstanceOf('stdClass', $container->get('bar')); } + public function testUninitializedSyntheticReference() + { + $container = new ContainerBuilder(); + $container->register('foo', 'stdClass')->setPublic(true)->setSynthetic(true); + $container->register('bar', 'stdClass')->setPublic(true)->setShared(false) + ->setProperty('foo', new Reference('foo', ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE)); + + $container->compile(); + + $dumper = new PhpDumper($container); + eval('?>'.$dumper->dump(array( + 'class' => 'Symfony_DI_PhpDumper_Test_UninitializedSyntheticReference', + 'inline_class_loader_parameter' => 'inline_requires', + ))); + + $container = new \Symfony_DI_PhpDumper_Test_UninitializedSyntheticReference(); + + $this->assertEquals((object) array('foo' => null), $container->get('bar')); + + $container->set('foo', (object) array(123)); + $this->assertEquals((object) array('foo' => (object) array(123)), $container->get('bar')); + } + /** * @group legacy * @expectedDeprecation The "private" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead. From 582d797b1629ae048198e97acf624b823b8cb1c2 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sat, 30 Jun 2018 11:20:07 +0200 Subject: [PATCH 034/107] [Form] Fix fixtures for forward compat --- .../Descriptor/default_option_with_normalizer.txt | 4 ++-- .../overridden_option_with_default_closures.txt | 8 ++++---- .../Descriptor/required_option_with_allowed_values.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt index 87d656a3fa1eb..391c3e694d974 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt @@ -15,9 +15,9 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain ---------------- --------------------%s Allowed values - %s ---------------- --------------------%s - Normalizer Closure%s{ %s + Normalizer Closure%s{%w parameters: 2 %s - file: "%s%eExtension%eCore%eType%eChoiceType.php" + file: "%s%eExtension%eCore%eType%eChoiceType.php"%w line: "%s to %s" %s } %s ---------------- --------------------%s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt index 967d177c7e9c7..846d6f384684c 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt @@ -8,14 +8,14 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data) Default Value: null %s %s Closure(s): [ %s - Closure%s{ %s + Closure%s{%w parameters: 1 %s - file: "%s%eExtension%eCore%eType%eFormType.php" + file: "%s%eExtension%eCore%eType%eFormType.php"%w line: "%s to %s" %s }, %s - Closure%s{ %s + Closure%s{%w parameters: 2 %s - file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" + file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"%w line: "%s to %s" %s } %s ] %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt index 0d2e7f44d9bb3..8cc88a550ab70 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt @@ -16,9 +16,9 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo) "baz" %s ] %s ---------------- --------------------%s - Normalizer Closure%s{ %s + Normalizer Closure%s{%w parameters: 2 %s - file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" + file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"%w line: "%s to %s" %s } %s ---------------- --------------------%s From ba8b63b195a87a89a3a7dc3cdf777721824adeb9 Mon Sep 17 00:00:00 2001 From: Constantine Shtompel Date: Wed, 27 Jun 2018 23:40:07 +0300 Subject: [PATCH 035/107] [Cache] provider does not respect option maxIdLength with versioning enabled --- .../Tests/Adapter/MaxIdLengthAdapterTest.php | 28 +++++++++++++++++++ .../Component/Cache/Traits/AbstractTrait.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php index cf2384c5f37e6..266e1f850c953 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php @@ -34,6 +34,34 @@ public function testLongKey() $cache->hasItem(str_repeat('-', 39)); } + public function testLongKeyVersioning() + { + $cache = $this->getMockBuilder(MaxIdLengthAdapter::class) + ->setConstructorArgs(array(str_repeat('-', 26))) + ->getMock(); + + $reflectionClass = new \ReflectionClass(AbstractAdapter::class); + + $reflectionMethod = $reflectionClass->getMethod('getId'); + $reflectionMethod->setAccessible(true); + + // No versioning enabled + $this->assertEquals('--------------------------:------------', $reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12)))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12))))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 23))))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 40))))); + + $reflectionProperty = $reflectionClass->getProperty('versioningIsEnabled'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($cache, true); + + // Versioning enabled + $this->assertEquals('--------------------------:1:------------', $reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12)))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12))))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 23))))); + $this->assertLessThanOrEqual(50, strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 40))))); + } + /** * @expectedException \Symfony\Component\Cache\Exception\InvalidArgumentException * @expectedExceptionMessage Namespace must be 26 chars max, 40 given ("----------------------------------------") diff --git a/src/Symfony/Component/Cache/Traits/AbstractTrait.php b/src/Symfony/Component/Cache/Traits/AbstractTrait.php index 7953ae6e8beee..ec60fe79c4a6b 100644 --- a/src/Symfony/Component/Cache/Traits/AbstractTrait.php +++ b/src/Symfony/Component/Cache/Traits/AbstractTrait.php @@ -255,7 +255,7 @@ private function getId($key) return $this->namespace.$this->namespaceVersion.$key; } if (\strlen($id = $this->namespace.$this->namespaceVersion.$key) > $this->maxIdLength) { - $id = $this->namespace.$this->namespaceVersion.substr_replace(base64_encode(hash('sha256', $key, true)), ':', -22); + $id = $this->namespace.$this->namespaceVersion.substr_replace(base64_encode(hash('sha256', $key, true)), ':', -(\strlen($this->namespaceVersion) + 22)); } return $id; From f54d96926acfd29e78205525bb5f3a09d923147a Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Wed, 20 Jun 2018 16:02:10 +0100 Subject: [PATCH 036/107] [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler --- .../AbstractTestSessionListener.php | 7 ++++ .../EventListener/TestSessionListenerTest.php | 34 +++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php index 82061fd6ea0fc..75f810e988345 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php @@ -71,6 +71,13 @@ public function onKernelResponse(FilterResponseEvent $event) if ($session instanceof Session ? !$session->isEmpty() || (null !== $this->sessionId && $session->getId() !== $this->sessionId) : $wasStarted) { $params = session_get_cookie_params(); + + foreach ($event->getResponse()->headers->getCookies() as $cookie) { + if ($session->getName() === $cookie->getName() && $params['path'] === $cookie->getPath() && $params['domain'] == $cookie->getDomain()) { + return; + } + } + $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly'])); $this->sessionId = $session->getId(); } diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php index 22a2b71239874..01f0a3b8641a2 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php @@ -106,6 +106,36 @@ public function testEmptySessionWithNewSessionIdDoesSendCookie() $this->assertNotEmpty($response->headers->getCookies()); } + /** + * @dataProvider anotherCookieProvider + */ + public function testSessionWithNewSessionIdAndNewCookieDoesNotSendAnotherCookie($existing, array $expected) + { + $this->sessionHasBeenStarted(); + $this->sessionIsEmpty(); + $this->fixSessionId('456'); + + $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); + $request = Request::create('/', 'GET', array(), array('MOCKSESSID' => '123')); + $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST); + $this->listener->onKernelRequest($event); + + $response = new Response('', 200, array('Set-Cookie' => $existing)); + + $response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST, $response); + + $this->assertSame($expected, $response->headers->get('Set-Cookie', null, false)); + } + + public function anotherCookieProvider() + { + return array( + 'same' => array('MOCKSESSID=789; path=/', array('MOCKSESSID=789; path=/')), + 'different domain' => array('MOCKSESSID=789; path=/; domain=example.com', array('MOCKSESSID=789; path=/; domain=example.com', 'MOCKSESSID=456; path=/')), + 'different path' => array('MOCKSESSID=789; path=/foo', array('MOCKSESSID=789; path=/foo', 'MOCKSESSID=456; path=/')), + ); + } + public function testUnstartedSessionIsNotSave() { $this->sessionHasNotBeenStarted(); @@ -123,10 +153,10 @@ public function testDoesNotImplementServiceSubscriberInterface() $this->assertFalse(is_subclass_of(TestSessionListener::class, ServiceSubscriberInterface::class, 'Implementing ServiceSubscriberInterface would create a dep on the DI component, which eg Silex cannot afford')); } - private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST) + private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, Response $response = null) { $request->setSession($this->session); - $response = new Response(); + $response = $response ?: new Response(); $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $event = new FilterResponseEvent($kernel, $request, $type, $response); From 38b369be3f47d0964e0af125359e533035225210 Mon Sep 17 00:00:00 2001 From: Oxan van Leeuwen Date: Sun, 17 Jun 2018 12:05:07 +0200 Subject: [PATCH 037/107] [PropertyInfo] added handling of nullable types in PhpDoc While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. ?string), and returns those in a Nullable wrapper. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found"). Correctly parse this syntax into a nullable type. --- composer.json | 2 +- .../Tests/Extractor/PhpDocExtractorTest.php | 9 +++++++++ .../Tests/Extractor/ReflectionExtractorTest.php | 9 +++++++++ .../PropertyInfo/Tests/Fixtures/Dummy.php | 15 +++++++++++++++ .../PropertyInfo/Util/PhpDocTypeHelper.php | 12 +++++++++--- src/Symfony/Component/PropertyInfo/composer.json | 2 +- 6 files changed, 44 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index f38c72fb8ed06..6d5065d4d3084 100644 --- a/composer.json +++ b/composer.json @@ -104,7 +104,7 @@ }, "conflict": { "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", - "phpdocumentor/type-resolver": "<0.2.1", + "phpdocumentor/type-resolver": "<0.3.0", "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "provide": { diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php index 647d4c1072e64..0b769c4531855 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php @@ -94,6 +94,9 @@ public function typesProvider() array('e', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_RESOURCE))), null, null), array('f', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))), null, null), array('g', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)), 'Nullable array.', null), + array('h', array(new Type(Type::BUILTIN_TYPE_STRING, true)), null, null), + array('i', array(new Type(Type::BUILTIN_TYPE_STRING, true), new Type(Type::BUILTIN_TYPE_INT, true)), null, null), + array('j', array(new Type(Type::BUILTIN_TYPE_OBJECT, true, 'DateTime')), null, null), array('donotexist', null, null, null), array('staticGetter', null, null, null), array('staticSetter', null, null, null), @@ -130,6 +133,9 @@ public function typesWithCustomPrefixesProvider() array('e', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_RESOURCE))), null, null), array('f', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))), null, null), array('g', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)), 'Nullable array.', null), + array('h', array(new Type(Type::BUILTIN_TYPE_STRING, true)), null, null), + array('i', array(new Type(Type::BUILTIN_TYPE_STRING, true), new Type(Type::BUILTIN_TYPE_INT, true)), null, null), + array('j', array(new Type(Type::BUILTIN_TYPE_OBJECT, true, 'DateTime')), null, null), array('donotexist', null, null, null), array('staticGetter', null, null, null), array('staticSetter', null, null, null), @@ -165,6 +171,9 @@ public function typesWithNoPrefixesProvider() array('e', null, null, null), array('f', null, null, null), array('g', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)), 'Nullable array.', null), + array('h', array(new Type(Type::BUILTIN_TYPE_STRING, true)), null, null), + array('i', array(new Type(Type::BUILTIN_TYPE_STRING, true), new Type(Type::BUILTIN_TYPE_INT, true)), null, null), + array('j', array(new Type(Type::BUILTIN_TYPE_OBJECT, true, 'DateTime')), null, null), array('donotexist', null, null, null), array('staticGetter', null, null, null), array('staticSetter', null, null, null), diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php index f8c61dd48aa36..e7fddf473f37b 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php @@ -41,6 +41,9 @@ public function testGetProperties() 'B', 'Guid', 'g', + 'h', + 'i', + 'j', 'emptyVar', 'foo', 'foo2', @@ -77,6 +80,9 @@ public function testGetPropertiesWithCustomPrefixes() 'B', 'Guid', 'g', + 'h', + 'i', + 'j', 'emptyVar', 'foo', 'foo2', @@ -105,6 +111,9 @@ public function testGetPropertiesWithNoPrefixes() 'B', 'Guid', 'g', + 'h', + 'i', + 'j', 'emptyVar', 'foo', 'foo2', diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php index 5993d6e1d47e8..76c2e1042c604 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php @@ -68,6 +68,21 @@ class Dummy extends ParentDummy */ public $g; + /** + * @var ?string + */ + public $h; + + /** + * @var ?string|int + */ + public $i; + + /** + * @var ?\DateTime + */ + public $j; + /** * This should not be removed. * diff --git a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php index bc14cd8b69b1b..e526c62348797 100644 --- a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php +++ b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php @@ -14,6 +14,7 @@ use phpDocumentor\Reflection\Type as DocType; use phpDocumentor\Reflection\Types\Compound; use phpDocumentor\Reflection\Types\Null_; +use phpDocumentor\Reflection\Types\Nullable; use Symfony\Component\PropertyInfo\Type; /** @@ -27,13 +28,18 @@ final class PhpDocTypeHelper /** * Creates a {@see Type} from a PHPDoc type. * - * @return Type + * @return Type[] */ public function getTypes(DocType $varType) { $types = array(); $nullable = false; + if ($varType instanceof Nullable) { + $nullable = true; + $varType = $varType->getActualType(); + } + if (!$varType instanceof Compound) { if ($varType instanceof Null_) { $nullable = true; @@ -54,10 +60,10 @@ public function getTypes(DocType $varType) // If null is present, all types are nullable $nullKey = array_search(Type::BUILTIN_TYPE_NULL, $varTypes); - $nullable = false !== $nullKey; + $nullable = $nullable || false !== $nullKey; // Remove the null type from the type if other types are defined - if ($nullable && count($varTypes) > 1) { + if ($nullable && false !== $nullKey && count($varTypes) > 1) { unset($varTypes[$nullKey]); } diff --git a/src/Symfony/Component/PropertyInfo/composer.json b/src/Symfony/Component/PropertyInfo/composer.json index ce41fabd09365..bf02fe0f980c5 100644 --- a/src/Symfony/Component/PropertyInfo/composer.json +++ b/src/Symfony/Component/PropertyInfo/composer.json @@ -35,7 +35,7 @@ }, "conflict": { "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", - "phpdocumentor/type-resolver": "<0.2.1", + "phpdocumentor/type-resolver": "<0.3.0", "symfony/dependency-injection": "<3.3" }, "suggest": { From e12e217f2bab6416a1680459d78a6cf1c3bc3731 Mon Sep 17 00:00:00 2001 From: Julien Maulny Date: Thu, 28 Jun 2018 15:10:19 +0200 Subject: [PATCH 038/107] Prevent toolbar links color override by css --- .../Resources/views/Profiler/toolbar.css.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 65d44716fcf83..91764e30de144 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -150,11 +150,11 @@ margin-bottom: 0; } -.sf-toolbar-block .sf-toolbar-info-piece a { +div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece a { color: #99CDD8; text-decoration: underline; } -.sf-toolbar-block .sf-toolbar-info-piece a:hover { +div.sf-toolbar .sf-toolbar-block a:hover { text-decoration: none; } From 89470f19cc9e806ce7584b6091a74ed1a48b807d Mon Sep 17 00:00:00 2001 From: Anto Date: Mon, 2 Jul 2018 13:57:50 +0200 Subject: [PATCH 039/107] [Workflow] Update phpdoc to fit a used className --- src/Symfony/Component/Workflow/Event/Event.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Workflow/Event/Event.php b/src/Symfony/Component/Workflow/Event/Event.php index 943a4da5a681e..a9e20869682b3 100644 --- a/src/Symfony/Component/Workflow/Event/Event.php +++ b/src/Symfony/Component/Workflow/Event/Event.php @@ -30,10 +30,10 @@ class Event extends BaseEvent private $workflowName; /** - * @param object $subject - * @param Marking $marking - * @param Transition $transition - * @param Workflow $workflow + * @param object $subject + * @param Marking $marking + * @param Transition $transition + * @param WorkflowInterface $workflow */ public function __construct($subject, Marking $marking, Transition $transition, $workflow = null) { From cf1bc66464af7b187852f8b4a084bee6468e7046 Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Tue, 3 Jul 2018 08:45:41 +0200 Subject: [PATCH 040/107] [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid --- .../CompilerPass/RegisterEventListenersAndSubscribersPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php index b9f51144746d5..f7d513a14e09a 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -75,7 +75,7 @@ private function addTaggedSubscribers(ContainerBuilder $container) $connections = isset($tag['connection']) ? array($tag['connection']) : array_keys($this->connections); foreach ($connections as $con) { if (!isset($this->connections[$con])) { - throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $taggedSubscriber, implode(', ', array_keys($this->connections)))); + throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections)))); } $this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', array(new Reference($id))); From 8e37d771453cb1f77e42a10f5fbc80152c38b2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Jul 2018 23:12:41 +0200 Subject: [PATCH 041/107] [HttpFoundation] Fix tests: new message for status 425 --- src/Symfony/Component/HttpFoundation/Response.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 9b4bb4cc53807..3a1b5ca8f8858 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -64,7 +64,12 @@ class Response const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 const HTTP_LOCKED = 423; // RFC4918 const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 + + /** + * @deprecated + */ const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; // RFC2817 + const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 @@ -169,7 +174,7 @@ class Response 422 => 'Unprocessable Entity', // RFC4918 423 => 'Locked', // RFC4918 424 => 'Failed Dependency', // RFC4918 - 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 + 425 => 'Too Early', // RFC-ietf-httpbis-replay-04 426 => 'Upgrade Required', // RFC2817 428 => 'Precondition Required', // RFC6585 429 => 'Too Many Requests', // RFC6585 From 2ab7bcf797d3ffe58b05c60adb626a7146d05508 Mon Sep 17 00:00:00 2001 From: AzJezz Date: Sun, 1 Jul 2018 16:55:08 +0200 Subject: [PATCH 042/107] Add color support for Hyper terminal . --- src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | 3 ++- src/Symfony/Component/Console/Output/StreamOutput.php | 3 ++- src/Symfony/Component/Console/Style/SymfonyStyle.php | 2 +- src/Symfony/Component/VarDumper/Dumper/CliDumper.php | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 0290a69fcf688..57751d73299ab 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -231,7 +231,8 @@ private static function hasColorSupport() && sapi_windows_vt100_support(STDOUT)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM'); } if (function_exists('stream_isatty')) { diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 5fc5d01e14718..54eb0bea15b41 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -98,7 +98,8 @@ protected function hasColorSupport() && @sapi_windows_vt100_support($this->stream)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM'); } if (function_exists('stream_isatty')) { diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index a21f3c16e463b..b77ca78afffc6 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -271,7 +271,7 @@ public function createProgressBar($max = 0) { $progressBar = parent::createProgressBar($max); - if ('\\' !== DIRECTORY_SEPARATOR) { + if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 $progressBar->setProgressCharacter(''); $progressBar->setBarCharacter('▓'); // dark shade character \u2593 diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 9a8ddca86d81c..466188564cb86 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -484,7 +484,8 @@ private function hasColorSupport($stream) && @sapi_windows_vt100_support($stream)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM'); } if (function_exists('stream_isatty')) { @@ -513,7 +514,8 @@ private function isWindowsTrueColor() { $result = 183 <= getenv('ANSICON_VER') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM'); if (!$result && PHP_VERSION_ID >= 70200) { $version = sprintf( From 47d715e97b2d6d398e0f5244cb5fcaca375188b7 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Tue, 3 Jul 2018 12:43:53 +0100 Subject: [PATCH 043/107] Fix a bug when having more than one named handler per message subscriber --- .../Messenger/DependencyInjection/MessengerPass.php | 6 ++++-- .../Tests/DependencyInjection/MessengerPassTest.php | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php index 264f8bfdcdf5c..bd3c721b83752 100644 --- a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php +++ b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php @@ -128,11 +128,13 @@ private function registerHandlers(ContainerBuilder $container, array $busIds) if ('__invoke' !== $method) { $wrapperDefinition = (new Definition('callable'))->addArgument(array(new Reference($serviceId), $method))->setFactory('Closure::fromCallable'); - $definitions[$serviceId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::hash($messageClass.':'.$messagePriority.':'.$serviceId.':'.$method)] = $wrapperDefinition; + $definitions[$definitionId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::hash($messageClass.':'.$messagePriority.':'.$serviceId.':'.$method)] = $wrapperDefinition; + } else { + $definitionId = $serviceId; } foreach ($handlerBuses as $handlerBus) { - $handlersByBusAndMessage[$handlerBus][$messageClass][$messagePriority][] = $serviceId; + $handlersByBusAndMessage[$handlerBus][$messageClass][$messagePriority][] = $definitionId; } } } diff --git a/src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php b/src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php index 618604f2396c9..4b2a0de1b9981 100644 --- a/src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php +++ b/src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php @@ -288,7 +288,12 @@ public function testItShouldNotThrowIfGeneratorIsReturnedInsteadOfArray() $handlerMapping = $handlerLocatorDefinition->getArgument(0); $this->assertArrayHasKey('handler.'.DummyMessage::class, $handlerMapping); + $firstReference = $handlerMapping['handler.'.DummyMessage::class]->getValues()[0]; + $this->assertEquals(array(new Reference(HandlerWithGenerators::class), 'dummyMethod'), $container->getDefinition($firstReference)->getArgument(0)); + $this->assertArrayHasKey('handler.'.SecondMessage::class, $handlerMapping); + $secondReference = $handlerMapping['handler.'.SecondMessage::class]->getValues()[0]; + $this->assertEquals(array(new Reference(HandlerWithGenerators::class), 'secondMessage'), $container->getDefinition($secondReference)->getArgument(0)); } /** From c648b938b2213ab169740be5f80e09b8bcbbb020 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Tue, 3 Jul 2018 13:51:26 +0100 Subject: [PATCH 044/107] Fix serialization of abstract items with groups across multiple entities --- .../Serializer/Normalizer/ObjectNormalizer.php | 13 +++++++++---- .../Tests/Fixtures/DummyMessageNumberTwo.php | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php index 6c9098528b67e..77c98377ee70a 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php @@ -142,11 +142,16 @@ protected function getAllowedAttributes($classOrObject, array $context, $attribu return false; } - if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForMappedObject($classOrObject)) { - $allowedAttributes[] = $attributesAsString ? $discriminatorMapping->getTypeProperty() : new AttributeMetadata($discriminatorMapping->getTypeProperty()); + if (null !== $this->classDiscriminatorResolver) { + $class = \is_object($classOrObject) ? \get_class($classOrObject) : $classOrObject; + if (null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForMappedObject($classOrObject)) { + $allowedAttributes[] = $attributesAsString ? $discriminatorMapping->getTypeProperty() : new AttributeMetadata($discriminatorMapping->getTypeProperty()); + } - foreach ($discriminatorMapping->getTypesMapping() as $class) { - $allowedAttributes = array_merge($allowedAttributes, parent::getAllowedAttributes($class, $context, $attributesAsString)); + if (null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($class)) { + foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) { + $allowedAttributes = array_merge($allowedAttributes, parent::getAllowedAttributes($mappedClass, $context, $attributesAsString)); + } } } diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php index 060c10dd7935d..3b828e50bf44a 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php @@ -11,9 +11,15 @@ namespace Symfony\Component\Serializer\Tests\Fixtures; +use Symfony\Component\Serializer\Annotation\Groups; + /** * @author Samuel Roze */ class DummyMessageNumberTwo implements DummyMessageInterface { + /** + * @Groups({"two"}) + */ + public $three; } From 61f005af3652ba46faa143ed249d994509f53727 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 3 Jul 2018 21:42:53 +0200 Subject: [PATCH 045/107] [DI] Don't show internal service id on binding errors --- .../ResolveInstanceofConditionalsPass.php | 4 +++- .../ResolveInstanceofConditionalsPassTest.php | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php index 15110261a2252..e02f61a8f4ecc 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php @@ -117,9 +117,11 @@ private function processDefinition(ContainerBuilder $container, $id, Definition } } + $definition->setBindings($bindings); + // reset fields with "merge" behavior $abstract - ->setBindings($bindings) + ->setBindings(array()) ->setArguments(array()) ->setMethodCalls(array()) ->setDecoratedService(null) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php index 21a2810578e97..39078dbaf6576 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\Argument\BoundArgument; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass; use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass; @@ -250,4 +251,18 @@ public function testMergeReset() $this->assertEmpty($abstract->getTags()); $this->assertTrue($abstract->isAbstract()); } + + public function testBindings() + { + $container = new ContainerBuilder(); + $def = $container->register('foo', self::class)->setBindings(array('$toto' => 123)); + $def->setInstanceofConditionals(array(parent::class => new ChildDefinition(''))); + + (new ResolveInstanceofConditionalsPass())->process($container); + + $bindings = $container->getDefinition('foo')->getBindings(); + $this->assertSame(array('$toto'), array_keys($bindings)); + $this->assertInstanceOf(BoundArgument::class, $bindings['$toto']); + $this->assertSame(123, $bindings['$toto']->getValues()[0]); + } } From 196e708b68a1fb4d148432064ecfb71235fd91e6 Mon Sep 17 00:00:00 2001 From: Saif Eddin Gmati Date: Tue, 3 Jul 2018 17:28:18 +0200 Subject: [PATCH 046/107] Check for Hyper terminal on all operating systems. --- src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | 7 +++++-- src/Symfony/Component/Console/Output/StreamOutput.php | 7 +++++-- src/Symfony/Component/Console/Style/SymfonyStyle.php | 2 +- src/Symfony/Component/VarDumper/Dumper/CliDumper.php | 7 +++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 57751d73299ab..d1440bb1465a2 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -226,13 +226,16 @@ private static function hasColorSupport() return false; } + if ('Hyper' === getenv('TERM_PROGRAM')) { + return true; + } + if (DIRECTORY_SEPARATOR === '\\') { return (function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM'); + || 'xterm' === getenv('TERM'); } if (function_exists('stream_isatty')) { diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 54eb0bea15b41..6eb300ea322ed 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -93,13 +93,16 @@ protected function doWrite($message, $newline) */ protected function hasColorSupport() { + if ('Hyper' === getenv('TERM_PROGRAM')) { + return true; + } + if (DIRECTORY_SEPARATOR === '\\') { return (function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support($this->stream)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM'); + || 'xterm' === getenv('TERM'); } if (function_exists('stream_isatty')) { diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index b77ca78afffc6..14e641bbfcddc 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -271,7 +271,7 @@ public function createProgressBar($max = 0) { $progressBar = parent::createProgressBar($max); - if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { + if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 $progressBar->setProgressCharacter(''); $progressBar->setBarCharacter('▓'); // dark shade character \u2593 diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 466188564cb86..a7c77e596d8d3 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -479,13 +479,16 @@ private function hasColorSupport($stream) return false; } + if ('Hyper' === getenv('TERM_PROGRAM')) { + return true; + } + if (DIRECTORY_SEPARATOR === '\\') { return (function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support($stream)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM'); + || 'xterm' === getenv('TERM'); } if (function_exists('stream_isatty')) { From af96475e2a35462cf2d163c2b5cc4cf1bb55c095 Mon Sep 17 00:00:00 2001 From: Sir Kane Date: Tue, 3 Jul 2018 19:59:59 +0000 Subject: [PATCH 047/107] [HttpFoundation] add tests for FlashBagInterface::setAll() --- .../Tests/Session/Flash/FlashBagTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php index 3ceb124771d0d..3fe0122f4fd05 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php @@ -124,6 +124,19 @@ public function testKeys() $this->assertEquals(array('notice'), $this->bag->keys()); } + public function testSetAll() + { + $this->bag->add('one_flash', 'Foo'); + $this->bag->add('another_flash', 'Bar'); + $this->assertTrue($this->bag->has('one_flash')); + $this->assertTrue($this->bag->has('another_flash')); + $this->bag->setAll(array('unique_flash' => 'FooBar')); + $this->assertFalse($this->bag->has('one_flash')); + $this->assertFalse($this->bag->has('another_flash')); + $this->assertSame(array('unique_flash' => 'FooBar'), $this->bag->all()); + $this->assertSame(array(), $this->bag->all()); + } + public function testPeekAll() { $this->bag->set('notice', 'Foo'); From c77625988d3e72bfe6c4c14c15a57e04998843fd Mon Sep 17 00:00:00 2001 From: louhde Date: Wed, 4 Jul 2018 17:38:36 +0200 Subject: [PATCH 048/107] [Security] LdapUserProvider uidKey could be null --- .../Component/Security/Core/User/LdapUserProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Core/User/LdapUserProvider.php b/src/Symfony/Component/Security/Core/User/LdapUserProvider.php index b3fa3fa6b94f8..5f47fe8923b99 100644 --- a/src/Symfony/Component/Security/Core/User/LdapUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/LdapUserProvider.php @@ -35,8 +35,12 @@ class LdapUserProvider implements UserProviderInterface private $defaultSearch; private $passwordAttribute; - public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null) + public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), ?string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null) { + if (null === $uidKey) { + $uidKey = 'sAMAccountName'; + } + $this->ldap = $ldap; $this->baseDn = $baseDn; $this->searchDn = $searchDn; From 154ce9c170c69000ca4795100f5e1864d9588a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 4 Jul 2018 23:33:50 +0200 Subject: [PATCH 049/107] [DomCrawler] Fix ChoiceFormField::select() PHPDoc --- src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php b/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php index a3539bc1b421e..8562181a2915c 100644 --- a/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php +++ b/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php @@ -75,7 +75,7 @@ public function isDisabled() /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|array $value The value of the field */ public function select($value) { From b24acb0579a26e0da68b0125a7ef6fe0d009bc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 4 Jul 2018 18:09:16 +0200 Subject: [PATCH 050/107] [Workflow] Fixed BC break --- src/Symfony/Component/Workflow/Event/Event.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Workflow/Event/Event.php b/src/Symfony/Component/Workflow/Event/Event.php index a9e20869682b3..f77a20f778987 100644 --- a/src/Symfony/Component/Workflow/Event/Event.php +++ b/src/Symfony/Component/Workflow/Event/Event.php @@ -40,7 +40,10 @@ public function __construct($subject, Marking $marking, Transition $transition, $this->subject = $subject; $this->marking = $marking; $this->transition = $transition; - if (is_string($workflow)) { + if (null === $workflow) { + @trigger_error(sprintf('Passing only three parameters to "%s" is deprecated since Symfony 4.1. Pass a %s instance as fourth parameter instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); + $this->workflowName = 'unnamed'; + } elseif (is_string($workflow)) { @trigger_error(sprintf('Passing a string as 4th parameter of "%s" is deprecated since Symfony 4.1. Pass a %s instance instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); $this->workflowName = $workflow; } elseif ($workflow instanceof WorkflowInterface) { From b4552373c15c0f3393fe74016159d43df94e9624 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 6 Jul 2018 11:57:10 +0300 Subject: [PATCH 051/107] AppBundle->App. --- .../SecurityBundle/Command/UserPasswordEncoderCommand.php | 8 ++++---- .../DependencyInjection/MainConfiguration.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php index cea8bd2e1541d..d5d03c0f711ec 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php @@ -75,7 +75,7 @@ protected function configure() security: encoders: Symfony\Component\Security\Core\User\User: plaintext - AppBundle\Entity\User: bcrypt + App\Entity\User: bcrypt If you execute the command non-interactively, the first available configured @@ -87,16 +87,16 @@ protected function configure() Pass the full user class path as the second argument to encode passwords for your own entities: - php %command.full_name% --no-interaction [password] AppBundle\Entity\User + php %command.full_name% --no-interaction [password] App\Entity\User Executing the command interactively allows you to generate a random salt for encoding the password: - php %command.full_name% [password] AppBundle\Entity\User + php %command.full_name% [password] App\Entity\User In case your encoder doesn't require a salt, add the empty-salt option: - php %command.full_name% --empty-salt [password] AppBundle\Entity\User + php %command.full_name% --empty-salt [password] App\Entity\User EOF ) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index a514ab04a8327..0948b63442bfb 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -410,8 +410,8 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode) ->children() ->arrayNode('encoders') ->example(array( - 'AppBundle\Entity\User1' => 'bcrypt', - 'AppBundle\Entity\User2' => array( + 'App\Entity\User1' => 'bcrypt', + 'App\Entity\User2' => array( 'algorithm' => 'bcrypt', 'cost' => 13, ), From ddea90e97d47e6e69f0d9998b56191e5699f484d Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Fri, 6 Jul 2018 11:08:29 +0200 Subject: [PATCH 052/107] minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired) This PR was merged into the 4.2-dev branch. Discussion ---------- [Console] changed warning verbosity; fixes typo | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes* | Fixed tickets | n/a | License | MIT | Doc PR | n/a * Tests pass, but I do not have an installation of MacOS to run tests on. Tests should be unaffected (the test is simply [skipped on MacOS](https://github.com/symfony/console/blob/master/Tests/Command/CommandTest.php#L345)). When a Console Command fails to change the process title on MacOS, a warning is issued to output. This warning is relevant to developers of Console applications, but to end users is largely meaningless and potentially confusing. This PR changes the verbosity of the warning to "very verbose" so it does not interrupt normal usage. I've also fixed a typo in the message ("get" vs. "set"). Commits ------- 86c771a changed warning verbosity; fixes typo --- src/Symfony/Component/Console/Command/Command.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php index c8db0cff07f3a..b1f31ce794fc0 100644 --- a/src/Symfony/Component/Console/Command/Command.php +++ b/src/Symfony/Component/Console/Command/Command.php @@ -210,7 +210,10 @@ public function run(InputInterface $input, OutputInterface $output) if (function_exists('cli_set_process_title')) { if (!@cli_set_process_title($this->processTitle)) { if ('Darwin' === PHP_OS) { - $output->writeln('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.'); + $output->writeln( + 'Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', + OutputInterface::VERBOSITY_VERY_VERBOSE + ); } else { cli_set_process_title($this->processTitle); } From 39cb2a99bad09ed82e199429bab269ccb8769ee1 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 5 Jul 2018 19:06:52 +0200 Subject: [PATCH 053/107] improve deprecation messages --- src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php | 2 -- .../Component/Serializer/Normalizer/AbstractNormalizer.php | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php index 1cd134fbc78f2..ef259b338d9f2 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php @@ -38,8 +38,6 @@ public function __construct($handler) if ($handler instanceof FragmentHandler) { $this->handler = $handler; } elseif ($handler instanceof ContainerInterface) { - @trigger_error('The ability to pass a ContainerInterface instance as a first argument to '.__METHOD__.' method is deprecated since Symfony 2.7 and will be removed in 3.0. Pass a FragmentHandler instance instead.', E_USER_DEPRECATED); - $this->handler = $handler->get('fragment.handler'); } else { throw new \BadFunctionCallException(sprintf('%s takes a FragmentHandler or a ContainerInterface object as its first argument.', __METHOD__)); diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index 88f5f9273dae4..b1975122d19e7 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -158,7 +158,7 @@ public function setIgnoredAttributes(array $ignoredAttributes) */ public function setCamelizedAttributes(array $camelizedAttributes) { - @trigger_error(sprintf('%s is deprecated since Symfony 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED); if ($this->nameConverter && !$this->nameConverter instanceof CamelCaseToSnakeCaseNameConverter) { throw new LogicException(sprintf('%s cannot be called if a custom Name Converter is defined.', __METHOD__)); @@ -237,7 +237,7 @@ protected function handleCircularReference($object) */ protected function formatAttribute($attributeName) { - @trigger_error(sprintf('%s is deprecated since Symfony 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED); return $this->nameConverter ? $this->nameConverter->normalize($attributeName) : $attributeName; } From e4ae5a4ca9011be9f6e5464c2ed6ab53445ed769 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 6 Jul 2018 13:18:00 +0200 Subject: [PATCH 054/107] improve deprecation messages --- src/Symfony/Component/Console/Helper/TableStyle.php | 10 +++++----- .../Component/Debug/Exception/FlattenException.php | 2 +- .../Component/DependencyInjection/TypedReference.php | 6 +++--- .../Form/Extension/Core/Type/CountryType.php | 6 +++--- .../Form/Extension/Core/Type/CurrencyType.php | 6 +++--- .../Form/Extension/Core/Type/LanguageType.php | 6 +++--- .../Form/Extension/Core/Type/LocaleType.php | 6 +++--- .../Component/HttpFoundation/File/UploadedFile.php | 2 +- .../Core/Authentication/Token/AbstractToken.php | 4 ++-- .../Core/Authorization/Voter/ExpressionVoter.php | 2 +- .../Security/Core/Tests/User/UserCheckerTest.php | 12 ++++++------ .../Component/Security/Core/User/UserChecker.php | 4 ++-- .../Security/Http/Firewall/ContextListener.php | 2 +- .../Component/Translation/Dumper/FileDumper.php | 2 +- .../Translation/Writer/TranslationWriter.php | 2 +- src/Symfony/Component/Workflow/Event/Event.php | 2 +- src/Symfony/Component/Workflow/Registry.php | 2 +- .../Component/Workflow/Tests/RegistryTest.php | 2 +- 18 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Symfony/Component/Console/Helper/TableStyle.php b/src/Symfony/Component/Console/Helper/TableStyle.php index a0d0b5b770737..3339debe5dd02 100644 --- a/src/Symfony/Component/Console/Helper/TableStyle.php +++ b/src/Symfony/Component/Console/Helper/TableStyle.php @@ -110,7 +110,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null) */ public function setHorizontalBorderChar($horizontalBorderChar) { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar); } @@ -124,7 +124,7 @@ public function setHorizontalBorderChar($horizontalBorderChar) */ public function getHorizontalBorderChar() { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); return $this->horizontalOutsideBorderChar; } @@ -166,7 +166,7 @@ public function setVerticalBorderChars(string $outside, string $inside = null): */ public function setVerticalBorderChar($verticalBorderChar) { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar); } @@ -180,7 +180,7 @@ public function setVerticalBorderChar($verticalBorderChar) */ public function getVerticalBorderChar() { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); return $this->verticalOutsideBorderChar; } @@ -268,7 +268,7 @@ public function setDefaultCrossingChar(string $char): self */ public function setCrossingChar($crossingChar) { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), E_USER_DEPRECATED); return $this->setDefaultCrossingChar($crossingChar); } diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php index f70085160ba3a..2afffa21b6e82 100644 --- a/src/Symfony/Component/Debug/Exception/FlattenException.php +++ b/src/Symfony/Component/Debug/Exception/FlattenException.php @@ -186,7 +186,7 @@ public function getTrace() */ public function setTraceFromException(\Exception $exception) { - @trigger_error(sprintf('"%s" is deprecated since Symfony 4.1, use "setTraceFromThrowable()" instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use "setTraceFromThrowable()" instead.', __METHOD__), E_USER_DEPRECATED); $this->setTraceFromThrowable($exception); } diff --git a/src/Symfony/Component/DependencyInjection/TypedReference.php b/src/Symfony/Component/DependencyInjection/TypedReference.php index 9d488ddbb478c..2bd25ab46d299 100644 --- a/src/Symfony/Component/DependencyInjection/TypedReference.php +++ b/src/Symfony/Component/DependencyInjection/TypedReference.php @@ -29,7 +29,7 @@ class TypedReference extends Reference public function __construct(string $id, string $type, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { if (\is_string($invalidBehavior) || 3 < \func_num_args()) { - @trigger_error(sprintf('The $requiringClass argument of "%s" is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The $requiringClass argument of "%s()" is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); $this->requiringClass = $invalidBehavior; $invalidBehavior = 3 < \func_num_args() ? \func_get_arg(3) : ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; @@ -48,7 +48,7 @@ public function getType() */ public function getRequiringClass() { - @trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); return $this->requiringClass ?? ''; } @@ -58,7 +58,7 @@ public function getRequiringClass() */ public function canBeAutoregistered() { - @trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); return $this->requiringClass && (false !== $i = strpos($this->type, '\\')) && 0 === strncasecmp($this->type, $this->requiringClass, 1 + $i); } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php b/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php index e206936dd32e8..e7c41e0cec46f 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php @@ -77,7 +77,7 @@ public function getBlockPrefix() */ public function loadChoiceList($value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); if (null !== $this->choiceList) { return $this->choiceList; @@ -93,7 +93,7 @@ public function loadChoiceList($value = null) */ public function loadChoicesForValues(array $values, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $values = array_filter($values); @@ -116,7 +116,7 @@ public function loadChoicesForValues(array $values, $value = null) */ public function loadValuesForChoices(array $choices, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $choices = array_filter($choices); diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php b/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php index 79d874ca400b6..c6759ea3da912 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php @@ -77,7 +77,7 @@ public function getBlockPrefix() */ public function loadChoiceList($value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); if (null !== $this->choiceList) { return $this->choiceList; @@ -93,7 +93,7 @@ public function loadChoiceList($value = null) */ public function loadChoicesForValues(array $values, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $values = array_filter($values); @@ -116,7 +116,7 @@ public function loadChoicesForValues(array $values, $value = null) */ public function loadValuesForChoices(array $choices, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $choices = array_filter($choices); diff --git a/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php b/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php index 6d35c2392140f..c9bc9e6042c35 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php @@ -77,7 +77,7 @@ public function getBlockPrefix() */ public function loadChoiceList($value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); if (null !== $this->choiceList) { return $this->choiceList; @@ -93,7 +93,7 @@ public function loadChoiceList($value = null) */ public function loadChoicesForValues(array $values, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $values = array_filter($values); @@ -116,7 +116,7 @@ public function loadChoicesForValues(array $values, $value = null) */ public function loadValuesForChoices(array $choices, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $choices = array_filter($choices); diff --git a/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php b/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php index 4c0c467729ff1..c0de1c933bd17 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php @@ -77,7 +77,7 @@ public function getBlockPrefix() */ public function loadChoiceList($value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); if (null !== $this->choiceList) { return $this->choiceList; @@ -93,7 +93,7 @@ public function loadChoiceList($value = null) */ public function loadChoicesForValues(array $values, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $values = array_filter($values); @@ -116,7 +116,7 @@ public function loadChoicesForValues(array $values, $value = null) */ public function loadValuesForChoices(array $choices, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED); // Optimize $choices = array_filter($choices); diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index 252f46ad8e59b..594decb067281 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -158,7 +158,7 @@ public function guessClientExtension() */ public function getClientSize() { - @trigger_error(sprintf('"%s" is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED); return $this->getSize(); } diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index 5648dd730cdbe..a5e4bd696a2f9 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -261,7 +261,7 @@ private function hasUserChanged(UserInterface $user) } if ($this->user instanceof AdvancedUserInterface && $user instanceof AdvancedUserInterface) { - @trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('Checking for the AdvancedUserInterface in "%s()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED); if ($this->user->isAccountNonExpired() !== $user->isAccountNonExpired()) { return true; } @@ -278,7 +278,7 @@ private function hasUserChanged(UserInterface $user) return true; } } elseif ($this->user instanceof AdvancedUserInterface xor $user instanceof AdvancedUserInterface) { - @trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('Checking for the AdvancedUserInterface in "%s()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED); return true; } diff --git a/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php b/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php index cbee938667789..187430884625a 100644 --- a/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php +++ b/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php @@ -42,7 +42,7 @@ public function __construct(ExpressionLanguage $expressionLanguage, Authenticati */ public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1, register the provider directly on the injected ExpressionLanguage instance instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, register the provider directly on the injected ExpressionLanguage instance instead.', __METHOD__), E_USER_DEPRECATED); $this->expressionLanguage->registerProvider($provider); } diff --git a/src/Symfony/Component/Security/Core/Tests/User/UserCheckerTest.php b/src/Symfony/Component/Security/Core/Tests/User/UserCheckerTest.php index 541c94ce6525b..1d1d98ed123ad 100644 --- a/src/Symfony/Component/Security/Core/Tests/User/UserCheckerTest.php +++ b/src/Symfony/Component/Security/Core/Tests/User/UserCheckerTest.php @@ -32,7 +32,7 @@ public function testCheckPostAuthPass() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPostAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. */ public function testCheckPostAuthPassAdvancedUser() { @@ -55,7 +55,7 @@ public function testCheckPostAuthCredentialsExpired() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPostAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. * @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException */ public function testCheckPostAuthCredentialsExpiredAdvancedUser() @@ -70,7 +70,7 @@ public function testCheckPostAuthCredentialsExpiredAdvancedUser() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPreAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. */ public function testCheckPreAuthPassAdvancedUser() { @@ -95,7 +95,7 @@ public function testCheckPreAuthAccountLocked() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPreAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. * @expectedException \Symfony\Component\Security\Core\Exception\LockedException */ public function testCheckPreAuthAccountLockedAdvancedUser() @@ -119,7 +119,7 @@ public function testCheckPreAuthDisabled() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPreAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. * @expectedException \Symfony\Component\Security\Core\Exception\DisabledException */ public function testCheckPreAuthDisabledAdvancedUser() @@ -144,7 +144,7 @@ public function testCheckPreAuthAccountExpired() /** * @group legacy - * @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. + * @expectedDeprecation Calling "Symfony\Component\Security\Core\User\UserChecker::checkPreAuth()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality. * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException */ public function testCheckPreAuthAccountExpiredAdvancedUser() diff --git a/src/Symfony/Component/Security/Core/User/UserChecker.php b/src/Symfony/Component/Security/Core/User/UserChecker.php index a4aa09031bc7a..37d567842519b 100644 --- a/src/Symfony/Component/Security/Core/User/UserChecker.php +++ b/src/Symfony/Component/Security/Core/User/UserChecker.php @@ -33,7 +33,7 @@ public function checkPreAuth(UserInterface $user) } if ($user instanceof AdvancedUserInterface && !$user instanceof User) { - @trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Calling "%s()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED); } if (!$user->isAccountNonLocked()) { @@ -65,7 +65,7 @@ public function checkPostAuth(UserInterface $user) } if ($user instanceof AdvancedUserInterface && !$user instanceof User) { - @trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Calling "%s()" with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED); } if (!$user->isCredentialsNonExpired()) { diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 4b0d41f17fb95..2fb29bf58934f 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -70,7 +70,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP */ public function setLogoutOnUserChange($logoutOnUserChange) { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); } /** diff --git a/src/Symfony/Component/Translation/Dumper/FileDumper.php b/src/Symfony/Component/Translation/Dumper/FileDumper.php index 5a67b3a0d29dc..07c38b8291010 100644 --- a/src/Symfony/Component/Translation/Dumper/FileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/FileDumper.php @@ -51,7 +51,7 @@ public function setRelativePathTemplate($relativePathTemplate) */ public function setBackup($backup) { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); if (false !== $backup) { throw new \LogicException('The backup feature is no longer supported.'); diff --git a/src/Symfony/Component/Translation/Writer/TranslationWriter.php b/src/Symfony/Component/Translation/Writer/TranslationWriter.php index c03ded3c91993..ee35ff63eb61f 100644 --- a/src/Symfony/Component/Translation/Writer/TranslationWriter.php +++ b/src/Symfony/Component/Translation/Writer/TranslationWriter.php @@ -43,7 +43,7 @@ public function addDumper($format, DumperInterface $dumper) */ public function disableBackup() { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); foreach ($this->dumpers as $dumper) { if (method_exists($dumper, 'setBackup')) { diff --git a/src/Symfony/Component/Workflow/Event/Event.php b/src/Symfony/Component/Workflow/Event/Event.php index f77a20f778987..8e7cbe2f213b0 100644 --- a/src/Symfony/Component/Workflow/Event/Event.php +++ b/src/Symfony/Component/Workflow/Event/Event.php @@ -44,7 +44,7 @@ public function __construct($subject, Marking $marking, Transition $transition, @trigger_error(sprintf('Passing only three parameters to "%s" is deprecated since Symfony 4.1. Pass a %s instance as fourth parameter instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); $this->workflowName = 'unnamed'; } elseif (is_string($workflow)) { - @trigger_error(sprintf('Passing a string as 4th parameter of "%s" is deprecated since Symfony 4.1. Pass a %s instance instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a string as the 4th parameter of "%s()" is deprecated since Symfony 4.1. Pass a %s instance instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); $this->workflowName = $workflow; } elseif ($workflow instanceof WorkflowInterface) { $this->workflow = $workflow; diff --git a/src/Symfony/Component/Workflow/Registry.php b/src/Symfony/Component/Workflow/Registry.php index f3fd384e0d5c2..f2117f8715039 100644 --- a/src/Symfony/Component/Workflow/Registry.php +++ b/src/Symfony/Component/Workflow/Registry.php @@ -31,7 +31,7 @@ class Registry */ public function add(Workflow $workflow, $supportStrategy) { - @trigger_error(sprintf('%s is deprecated since Symfony 4.1. Use addWorkflow() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use addWorkflow() instead.', __METHOD__), E_USER_DEPRECATED); $this->workflows[] = array($workflow, $supportStrategy); } diff --git a/src/Symfony/Component/Workflow/Tests/RegistryTest.php b/src/Symfony/Component/Workflow/Tests/RegistryTest.php index e61d9b6b6372e..6d30d2f7e21d6 100644 --- a/src/Symfony/Component/Workflow/Tests/RegistryTest.php +++ b/src/Symfony/Component/Workflow/Tests/RegistryTest.php @@ -31,7 +31,7 @@ protected function tearDown() /** * @group legacy - * @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead. + * @expectedDeprecation The "Symfony\Component\Workflow\Registry::add()" method is deprecated since Symfony 4.1. Use addWorkflow() instead. */ public function testAddIsDeprecated() { From d28949b8469dc948ceb55dde8b9b6b1dee687327 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 7 Jul 2018 11:30:05 +0200 Subject: [PATCH 055/107] [HttpFoundation] don't encode cookie name for BC --- src/Symfony/Component/HttpFoundation/Response.php | 7 ++++++- .../Fixtures/response-functional/cookie_urlencode.expected | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index ba2ebbb11c88a..7c1edd5a5ed48 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -333,12 +333,17 @@ public function sendHeaders() } // headers - foreach ($this->headers->allPreserveCase() as $name => $values) { + foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { foreach ($values as $value) { header($name.': '.$value, false, $this->statusCode); } } + // cookies + foreach ($this->headers->getCookies() as $cookie) { + header('Set-Cookie: '.$cookie->getName().strstr($cookie, '='), false, $this->statusCode); + } + // status header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_urlencode.expected b/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_urlencode.expected index 4e9c4c075f5ed..14e44a398af66 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_urlencode.expected +++ b/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_urlencode.expected @@ -4,7 +4,7 @@ Array [0] => Content-Type: text/plain; charset=utf-8 [1] => Cache-Control: no-cache, private [2] => Date: Sat, 12 Nov 1955 20:04:00 GMT - [3] => Set-Cookie: %3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/ + [3] => Set-Cookie: ?*():@&+$/%#[]=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/ [4] => Set-Cookie: ?*():@&+$/%#[]=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/ ) shutdown From 3c39dfdaa66362fdbca71f9b5963150aef1455fb Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 7 Jul 2018 16:05:57 +0300 Subject: [PATCH 056/107] Replace .initialism with .text-uppercase. --- .../Twig/Resources/views/Form/bootstrap_4_layout.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 43c031b933366..177b3624bc13f 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -269,7 +269,7 @@ {%- for error in errors -%} - {{ 'Error'|trans({}, 'validators') }} {{ error.message }} + {{ 'Error'|trans({}, 'validators') }} {{ error.message }} {%- endfor -%} From 948c841acf30b7d471b5d985ba0cb7dadd645c56 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 6 Jul 2018 11:59:10 +0300 Subject: [PATCH 057/107] [FrameworkBundle] Fixed phpdoc in MicroKernelTrait::configureRoutes() --- src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php index ab6163e3ef4d7..5130071bcdec1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php @@ -28,7 +28,7 @@ trait MicroKernelTrait * Add or import routes into your application. * * $routes->import('config/routing.yml'); - * $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard'); + * $routes->add('/admin', 'App\Controller\AdminController::dashboard', 'admin_dashboard'); * * @param RouteCollectionBuilder $routes */ From b1a612087f92c1981976c478b9bfc68a9795410f Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Wed, 4 Jul 2018 16:15:49 +1200 Subject: [PATCH 058/107] [PropertyInfo] Fix dock block lookup fallback loop --- .../Extractor/PhpDocExtractor.php | 40 ++++++------ .../Tests/Extractor/PhpDocExtractorTest.php | 23 +++++++ .../Tests/Fixtures/DockBlockFallback.php | 64 +++++++++++++++++++ 3 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 src/Symfony/Component/PropertyInfo/Tests/Fixtures/DockBlockFallback.php diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index 5c3475ed0e525..c500d5fea8ebe 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -169,25 +169,21 @@ private function getDocBlock($class, $property) $ucFirstProperty = ucfirst($property); - try { - switch (true) { - case $docBlock = $this->getDocBlockFromProperty($class, $property): - $data = array($docBlock, self::PROPERTY, null); - break; + switch (true) { + case $docBlock = $this->getDocBlockFromProperty($class, $property): + $data = array($docBlock, self::PROPERTY, null); + break; - case list($docBlock) = $this->getDocBlockFromMethod($class, $ucFirstProperty, self::ACCESSOR): - $data = array($docBlock, self::ACCESSOR, null); - break; + case list($docBlock) = $this->getDocBlockFromMethod($class, $ucFirstProperty, self::ACCESSOR): + $data = array($docBlock, self::ACCESSOR, null); + break; - case list($docBlock, $prefix) = $this->getDocBlockFromMethod($class, $ucFirstProperty, self::MUTATOR): - $data = array($docBlock, self::MUTATOR, $prefix); - break; + case list($docBlock, $prefix) = $this->getDocBlockFromMethod($class, $ucFirstProperty, self::MUTATOR): + $data = array($docBlock, self::MUTATOR, $prefix); + break; - default: - $data = array(null, null, null); - } - } catch (\InvalidArgumentException $e) { - $data = array(null, null, null); + default: + $data = array(null, null, null); } return $this->docBlocks[$propertyHash] = $data; @@ -210,7 +206,11 @@ private function getDocBlockFromProperty($class, $property) return; } - return $this->docBlockFactory->create($reflectionProperty, $this->contextFactory->createFromReflector($reflectionProperty->getDeclaringClass())); + try { + return $this->docBlockFactory->create($reflectionProperty, $this->contextFactory->createFromReflector($reflectionProperty->getDeclaringClass())); + } catch (\InvalidArgumentException $e) { + return null; + } } /** @@ -251,6 +251,10 @@ private function getDocBlockFromMethod($class, $ucFirstProperty, $type) return; } - return array($this->docBlockFactory->create($reflectionMethod, $this->contextFactory->createFromReflector($reflectionMethod)), $prefix); + try { + return array($this->docBlockFactory->create($reflectionMethod, $this->contextFactory->createFromReflector($reflectionMethod)), $prefix); + } catch (\InvalidArgumentException $e) { + return null; + } } } diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php index 0b769c4531855..080df2893a877 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php @@ -184,6 +184,29 @@ public function testReturnNullOnEmptyDocBlock() { $this->assertNull($this->extractor->getShortDescription(EmptyDocBlock::class, 'foo')); } + + public function dockBlockFallbackTypesProvider() + { + return array( + 'pub' => array( + 'pub', array(new Type(Type::BUILTIN_TYPE_STRING)), + ), + 'protAcc' => array( + 'protAcc', array(new Type(Type::BUILTIN_TYPE_INT)), + ), + 'protMut' => array( + 'protMut', array(new Type(Type::BUILTIN_TYPE_BOOL)), + ), + ); + } + + /** + * @dataProvider dockBlockFallbackTypesProvider + */ + public function testDocBlockFallback($property, $types) + { + $this->assertEquals($types, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\DockBlockFallback', $property)); + } } class EmptyDocBlock diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DockBlockFallback.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DockBlockFallback.php new file mode 100644 index 0000000000000..3f9c303b59137 --- /dev/null +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DockBlockFallback.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\PropertyInfo\Tests\Fixtures; + +/** + * PhpDocExtractor should fallback from property -> accessor -> mutator when looking up dockblocks. + * + * @author Martin Rademacher + */ +class DockBlockFallback +{ + /** @var string $pub */ + public $pub = 'pub'; + + protected $protAcc; + protected $protMut; + + public function getPub() + { + return $this->pub; + } + + public function setPub($pub) + { + $this->pub = $pub; + } + + /** + * @return int + */ + public function getProtAcc() + { + return $this->protAcc; + } + + public function setProt($protAcc) + { + $this->protAcc = $protAcc; + } + + public function getProtMut() + { + return $this->protMut; + } + + /** + * @param bool $protMut + */ + public function setProtMut($protMut) + { + $this->protMut = $protMut; + } +} From ba7a4ca86345cf345f3eede6df4605f4f235753c Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Tue, 26 Jun 2018 07:18:26 -0400 Subject: [PATCH 059/107] [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output --- .../Bridge/Twig/Command/DebugCommand.php | 14 +++- .../Twig/Tests/Command/DebugCommandTest.php | 81 +++++++++++++++++++ 2 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index 1e45cf4d285af..66ed296c3f9a8 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -151,19 +151,27 @@ protected function execute(InputInterface $input, OutputInterface $output) } $rows = array(); + $firstNamespace = true; + $prevHasSeparator = false; foreach ($this->getLoaderPaths() as $namespace => $paths) { - if (count($paths) > 1) { + if (!$firstNamespace && !$prevHasSeparator && count($paths) > 1) { $rows[] = array('', ''); } + $firstNamespace = false; foreach ($paths as $path) { - $rows[] = array($namespace, '- '.$path); + $rows[] = array($namespace, $path.DIRECTORY_SEPARATOR); $namespace = ''; } if (count($paths) > 1) { $rows[] = array('', ''); + $prevHasSeparator = true; + } else { + $prevHasSeparator = false; } } - array_pop($rows); + if ($prevHasSeparator) { + array_pop($rows); + } $io->section('Loader Paths'); $io->table(array('Namespace', 'Paths'), $rows); diff --git a/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php b/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php new file mode 100644 index 0000000000000..77d522f5230aa --- /dev/null +++ b/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Twig\Tests\Command; + +use PHPUnit\Framework\TestCase; +use Symfony\Bridge\Twig\Command\DebugCommand; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Tester\CommandTester; +use Twig\Loader\FilesystemLoader; +use Twig\Environment; + +class DebugCommandTest extends TestCase +{ + public function testDebugCommand() + { + $tester = $this->createCommandTester(); + $ret = $tester->execute(array(), array('decorated' => false)); + + $this->assertEquals(0, $ret, 'Returns 0 in case of success'); + $this->assertContains('Functions', trim($tester->getDisplay())); + } + + public function testLineSeparatorInLoaderPaths() + { + // these paths aren't realistic, + // they're configured to force the line separator + $tester = $this->createCommandTester(array( + 'Acme' => array('extractor', 'extractor'), + '!Acme' => array('extractor', 'extractor'), + FilesystemLoader::MAIN_NAMESPACE => array('extractor', 'extractor'), + )); + $ret = $tester->execute(array(), array('decorated' => false)); + $ds = DIRECTORY_SEPARATOR; + $loaderPaths = <<assertEquals(0, $ret, 'Returns 0 in case of success'); + $this->assertContains($loaderPaths, trim($tester->getDisplay(true))); + } + + private function createCommandTester(array $paths = array()) + { + $filesystemLoader = new FilesystemLoader(array(), dirname(__DIR__).'/Fixtures'); + foreach ($paths as $namespace => $relDirs) { + foreach ($relDirs as $relDir) { + $filesystemLoader->addPath($relDir, $namespace); + } + } + $command = new DebugCommand(new Environment($filesystemLoader)); + + $application = new Application(); + $application->add($command); + $command = $application->find('debug:twig'); + + return new CommandTester($command); + } +} From 6d4812e995dc990a06727bd8fd3f1ba6a178dd39 Mon Sep 17 00:00:00 2001 From: Oleg Golovakhin Date: Wed, 30 May 2018 23:05:54 +0300 Subject: [PATCH 060/107] [OptionResolver] resolve arrays --- .../OptionsResolver/OptionsResolver.php | 106 ++++++++---- .../Tests/OptionsResolverTest.php | 153 +++++++++++++++++- 2 files changed, 223 insertions(+), 36 deletions(-) diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php index 95a492de94bb8..a58f45c0a6588 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php @@ -433,7 +433,7 @@ public function setAllowedValues($option, $allowedValues) )); } - $this->allowedValues[$option] = is_array($allowedValues) ? $allowedValues : array($allowedValues); + $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : array($allowedValues); // Make sure the option is processed unset($this->resolved[$option]); @@ -785,14 +785,13 @@ public function offsetGet($option) } if (!$valid) { - throw new InvalidOptionsException(sprintf( - 'The option "%s" with value %s is expected to be of type '. - '"%s", but is of type "%s".', - $option, - $this->formatValue($value), - implode('" or "', $this->allowedTypes[$option]), - implode('|', array_keys($invalidTypes)) - )); + $keys = array_keys($invalidTypes); + + if (1 === \count($keys) && '[]' === substr($keys[0], -2)) { + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), $keys[0])); + } + + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), implode('|', array_keys($invalidTypes)))); } } @@ -877,23 +876,8 @@ public function offsetGet($option) */ private function verifyTypes($type, $value, array &$invalidTypes) { - if ('[]' === substr($type, -2) && is_array($value)) { - $originalType = $type; - $type = substr($type, 0, -2); - $invalidValues = array_filter( // Filter out valid values, keeping invalid values in the resulting array - $value, - function ($value) use ($type) { - return !self::isValueValidType($type, $value); - } - ); - - if (!$invalidValues) { - return true; - } - - $invalidTypes[$this->formatTypeOf($value, $originalType)] = true; - - return false; + if (\is_array($value) && '[]' === substr($type, -2)) { + return $this->verifyArrayType($type, $value, $invalidTypes); } if (self::isValueValidType($type, $value)) { @@ -907,6 +891,46 @@ function ($value) use ($type) { return false; } + /** + * @return bool + */ + private function verifyArrayType($type, array $value, array &$invalidTypes, $level = 0) + { + $type = substr($type, 0, -2); + + $suffix = '[]'; + while (\strlen($suffix) <= $level * 2) { + $suffix .= '[]'; + } + + if ('[]' === substr($type, -2)) { + $success = true; + foreach ($value as $item) { + if (!\is_array($item)) { + $invalidTypes[$this->formatTypeOf($item, null).$suffix] = true; + + return false; + } + + if (!$this->verifyArrayType($type, $item, $invalidTypes, $level + 1)) { + $success = false; + } + } + + return $success; + } + + foreach ($value as $item) { + if (!self::isValueValidType($type, $item)) { + $invalidTypes[$this->formatTypeOf($item, $type).$suffix] = $value; + + return false; + } + } + + return true; + } + /** * Returns whether a resolved option with the given name exists. * @@ -990,13 +1014,13 @@ private function formatTypeOf($value, $type) while ('[]' === substr($type, -2)) { $type = substr($type, 0, -2); $value = array_shift($value); - if (!is_array($value)) { + if (!\is_array($value)) { break; } $suffix .= '[]'; } - if (is_array($value)) { + if (\is_array($value)) { $subTypes = array(); foreach ($value as $val) { $subTypes[$this->formatTypeOf($val, null)] = true; @@ -1006,7 +1030,7 @@ private function formatTypeOf($value, $type) } } - return (is_object($value) ? get_class($value) : gettype($value)).$suffix; + return (\is_object($value) ? get_class($value) : gettype($value)).$suffix; } /** @@ -1022,19 +1046,19 @@ private function formatTypeOf($value, $type) */ private function formatValue($value) { - if (is_object($value)) { + if (\is_object($value)) { return get_class($value); } - if (is_array($value)) { + if (\is_array($value)) { return 'array'; } - if (is_string($value)) { + if (\is_string($value)) { return '"'.$value.'"'; } - if (is_resource($value)) { + if (\is_resource($value)) { return 'resource'; } @@ -1078,4 +1102,20 @@ private static function isValueValidType($type, $value) { return (function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; } + + /** + * @return array + */ + private function getInvalidValues(array $arrayValues, $type) + { + $invalidValues = array(); + + foreach ($arrayValues as $key => $value) { + if (!self::isValueValidType($type, $value)) { + $invalidValues[$key] = $value; + } + } + + return $invalidValues; + } } diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php index 440af8b5787e6..034f42a8f6992 100644 --- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php +++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php @@ -511,7 +511,7 @@ public function testFailIfSetAllowedTypesFromLazyOption() /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but is of type "DateTime[]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "DateTime[]". */ public function testResolveFailsIfInvalidTypedArray() { @@ -535,7 +535,7 @@ public function testResolveFailsWithNonArray() /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but is of type "integer|stdClass|array|DateTime[]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass[]". */ public function testResolveFailsIfTypedArrayContainsInvalidTypes() { @@ -552,7 +552,7 @@ public function testResolveFailsIfTypedArrayContainsInvalidTypes() /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but is of type "double[][]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "double[][]". */ public function testResolveFailsWithCorrectLevelsButWrongScalar() { @@ -1650,4 +1650,151 @@ public function testCountFailsOutsideResolve() count($this->resolver); } + + public function testNestedArrays() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + + $this->assertEquals(array( + 'foo' => array( + array( + 1, 2, + ), + ), + ), $this->resolver->resolve( + array( + 'foo' => array( + array(1, 2), + ), + ) + )); + } + + public function testNested2Arrays() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][][][]'); + + $this->assertEquals(array( + 'foo' => array( + array( + array( + array( + 1, 2, + ), + ), + ), + ), + ), $this->resolver->resolve( + array( + 'foo' => array( + array( + array( + array(1, 2), + ), + ), + ), + ) + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer[][][][]". + */ + public function testNestedArraysException() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'float[][][][]'); + + $this->resolver->resolve( + array( + 'foo' => array( + array( + array( + array(1, 2), + ), + ), + ), + ) + ); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]". + */ + public function testNestedArrayException1() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + $this->resolver->resolve(array( + 'foo' => array( + array(1, true, 'str', array(2, 3)), + ), + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]". + */ + public function testNestedArrayException2() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + $this->resolver->resolve(array( + 'foo' => array( + array(true, 'str', array(2, 3)), + ), + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string[][]". + */ + public function testNestedArrayException3() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[][][]'); + $this->resolver->resolve(array( + 'foo' => array( + array('str', array(1, 2)), + ), + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer[][][]". + */ + public function testNestedArrayException4() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[][][]'); + $this->resolver->resolve(array( + 'foo' => array( + array( + array('str'), array(1, 2), ), + ), + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[]", but one of the elements is of type "array[]". + */ + public function testNestedArrayException5() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[]'); + $this->resolver->resolve(array( + 'foo' => array( + array( + array('str'), array(1, 2), ), + ), + )); + } } From bacb9ed333a9f5f23e0872d9ea819c7a05eacdea Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 7 Jul 2018 17:53:36 +0200 Subject: [PATCH 061/107] [Console] fix CS --- src/Symfony/Component/Console/Command/Command.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php index b1f31ce794fc0..ba93677715f4b 100644 --- a/src/Symfony/Component/Console/Command/Command.php +++ b/src/Symfony/Component/Console/Command/Command.php @@ -210,10 +210,7 @@ public function run(InputInterface $input, OutputInterface $output) if (function_exists('cli_set_process_title')) { if (!@cli_set_process_title($this->processTitle)) { if ('Darwin' === PHP_OS) { - $output->writeln( - 'Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', - OutputInterface::VERBOSITY_VERY_VERBOSE - ); + $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); } else { cli_set_process_title($this->processTitle); } From a3845c7d6e1f372b84887101fa631a89cc0d2637 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 6 Jul 2018 10:46:11 +0200 Subject: [PATCH 062/107] improve deprecation messages --- src/Symfony/Bridge/Twig/Command/DebugCommand.php | 6 +++--- src/Symfony/Bridge/Twig/Command/LintCommand.php | 6 +++--- .../Bridge/Twig/Tests/Command/LintCommandTest.php | 2 +- .../FrameworkBundle/Command/CacheWarmupCommand.php | 2 +- .../FrameworkBundle/Command/XliffLintCommand.php | 2 +- .../FrameworkBundle/Command/YamlLintCommand.php | 2 +- .../Tests/Translation/TranslatorTest.php | 12 ++++++------ .../FrameworkBundle/Translation/Translator.php | 2 +- .../Command/UserPasswordEncoderCommand.php | 2 +- .../SecurityBundle/Security/FirewallContext.php | 2 +- .../Functional/UserPasswordEncoderCommandTest.php | 2 +- .../Tests/Security/FirewallContextTest.php | 2 +- src/Symfony/Component/Console/Application.php | 8 ++++---- .../Form/Extension/Core/Type/TimezoneType.php | 6 +++--- .../HttpKernel/Controller/ControllerResolver.php | 4 ++-- .../Controller/TraceableControllerResolver.php | 2 +- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- .../Component/HttpKernel/Tests/KernelTest.php | 2 +- .../Security/Http/Logout/LogoutUrlGenerator.php | 2 +- src/Symfony/Component/Serializer/Serializer.php | 8 ++++---- .../DependencyInjection/TranslatorPass.php | 2 +- .../DependencyInjection/TranslationPassTest.php | 2 +- .../Tests/Writer/TranslationWriterTest.php | 2 +- src/Symfony/Component/Translation/Translator.php | 2 +- .../Translation/Writer/TranslationWriter.php | 2 +- src/Symfony/Component/VarDumper/Caster/Caster.php | 2 +- src/Symfony/Component/VarDumper/Cloner/Data.php | 2 +- .../Component/VarDumper/Test/VarDumperTestTrait.php | 4 ++-- 28 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index 1e45cf4d285af..6d0d3cc61c4e2 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -39,7 +39,7 @@ class DebugCommand extends Command public function __construct($twig = null, $projectDir = null) { if (!$twig instanceof Environment) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a command name as the first argument of "%s()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); parent::__construct($twig); @@ -54,7 +54,7 @@ public function __construct($twig = null, $projectDir = null) public function setTwigEnvironment(Environment $twig) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); $this->twig = $twig; } @@ -64,7 +64,7 @@ public function setTwigEnvironment(Environment $twig) */ protected function getTwigEnvironment() { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); return $this->twig; } diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 24630012188b1..a9d81c990423c 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -43,7 +43,7 @@ class LintCommand extends Command public function __construct($twig = null) { if (!$twig instanceof Environment) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a command name as the first argument of "%s()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); parent::__construct($twig); @@ -57,7 +57,7 @@ public function __construct($twig = null) public function setTwigEnvironment(Environment $twig) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); $this->twig = $twig; } @@ -67,7 +67,7 @@ public function setTwigEnvironment(Environment $twig) */ protected function getTwigEnvironment() { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); return $this->twig; } diff --git a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php index 9ef18640684f9..c761a1a3d6dc2 100644 --- a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php @@ -70,7 +70,7 @@ public function testLintFileCompileTimeException() /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bridge\Twig\Command\LintCommand::__construct" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bridge\Twig\Command\LintCommand::__construct()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead. * @expectedException \RuntimeException * @expectedExceptionMessage The Twig environment needs to be set. */ diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php index a5874df234674..593b93475564e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php @@ -36,7 +36,7 @@ class CacheWarmupCommand extends ContainerAwareCommand public function __construct($cacheWarmer = null) { if (!$cacheWarmer instanceof CacheWarmerAggregate) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a command name as the first argument of "%s()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); parent::__construct($cacheWarmer); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php index 534ab36c34a6f..bad4284e2d8c6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php @@ -29,7 +29,7 @@ class XliffLintCommand extends BaseLintCommand public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null) { if (func_num_args()) { - @trigger_error(sprintf('Passing a constructor argument in "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a constructor argument in "%s()" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); } if (null === $directoryIteratorProvider) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index 2ca60ca0673c8..2df4c165378a4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -28,7 +28,7 @@ class YamlLintCommand extends BaseLintCommand public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null) { if (func_num_args()) { - @trigger_error(sprintf('Passing a constructor argument in "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a constructor argument in "%s()" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); } if (null === $directoryIteratorProvider) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php index c2c2364d7097c..63ecc5171ca5d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php @@ -45,7 +45,7 @@ protected function deleteTmpDir() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. */ public function testTransWithoutCachingOmittingLocale() { @@ -66,7 +66,7 @@ public function testTransWithoutCachingOmittingLocale() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. */ public function testTransWithCachingOmittingLocale() { @@ -106,7 +106,7 @@ public function testTransWithCachingOmittingLocale() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. * @expectedException \InvalidArgumentException */ public function testTransWithCachingWithInvalidLocaleOmittingLocale() @@ -119,7 +119,7 @@ public function testTransWithCachingWithInvalidLocaleOmittingLocale() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. */ public function testLoadResourcesWithoutCachingOmittingLocale() { @@ -138,7 +138,7 @@ public function testLoadResourcesWithoutCachingOmittingLocale() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. */ public function testGetDefaultLocaleOmittingLocale() { @@ -167,7 +167,7 @@ public function testGetDefaultLocaleOmittingLocaleWithPsrContainer() /** * @group legacy - * @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. + * @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0. */ public function testWarmupOmittingLocale() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php index 631d14e91b600..119adccba1d2d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php @@ -75,7 +75,7 @@ public function __construct(ContainerInterface $container, $formatter, $defaultL $options = $loaderIds; $loaderIds = $defaultLocale; $defaultLocale = $container->getParameter('kernel.default_locale'); - @trigger_error(sprintf('Method %s() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.', __METHOD__), E_USER_DEPRECATED); } $this->container = $container; diff --git a/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php index cea8bd2e1541d..19e8d878a0c0b 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php @@ -42,7 +42,7 @@ class UserPasswordEncoderCommand extends ContainerAwareCommand public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = array()) { if (null === $encoderFactory) { - @trigger_error(sprintf('Passing null as the first argument of "%s" is deprecated since Symfony 3.3 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing null as the first argument of "%s()" is deprecated since Symfony 3.3 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); } $this->encoderFactory = $encoderFactory; diff --git a/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php b/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php index 7fafc1a35ba21..e68e5529dc13d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php +++ b/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php @@ -55,7 +55,7 @@ public function getConfig() */ public function getContext() { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return array($this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener()); } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php index 1c6f5c280f2ed..7a4a1f3907e9c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php @@ -231,7 +231,7 @@ public function testThrowsExceptionOnNoConfiguredEncoders() /** * @group legacy - * @expectedDeprecation Passing null as the first argument of "Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand::__construct" is deprecated since Symfony 3.3 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Passing null as the first argument of "Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand::__construct()" is deprecated since Symfony 3.3 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead. */ public function testLegacy() { diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php index 69c8ce308f53b..8466d9f06f702 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php @@ -41,7 +41,7 @@ public function testGetters() } /** - * @expectedDeprecation Method Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext() is deprecated since Symfony 3.3 and will be removed in 4.0. Use Symfony\Bundle\SecurityBundle\Security\FirewallContext::getListeners/getExceptionListener() instead. + * @expectedDeprecation The "Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use Symfony\Bundle\SecurityBundle\Security\FirewallContext::getListeners/getExceptionListener() instead. * @group legacy */ public function testGetContext() diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 107c1ed6caaa9..65dc90ccec2ef 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -807,7 +807,7 @@ protected function doRenderException(\Exception $e, OutputInterface $output) */ protected function getTerminalWidth() { - @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); return $this->terminal->getWidth(); } @@ -821,7 +821,7 @@ protected function getTerminalWidth() */ protected function getTerminalHeight() { - @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); return $this->terminal->getHeight(); } @@ -835,7 +835,7 @@ protected function getTerminalHeight() */ public function getTerminalDimensions() { - @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); return array($this->terminal->getWidth(), $this->terminal->getHeight()); } @@ -854,7 +854,7 @@ public function getTerminalDimensions() */ public function setTerminalDimensions($width, $height) { - @trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Set the COLUMNS and LINES env vars instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Set the COLUMNS and LINES env vars instead.', __METHOD__), E_USER_DEPRECATED); putenv('COLUMNS='.$width); putenv('LINES='.$height); diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php index a1c214c8bcd29..c562da0bf618f 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php @@ -95,7 +95,7 @@ public function getBlockPrefix() */ public function loadChoiceList($value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); if (null !== $this->choiceList) { return $this->choiceList; @@ -111,7 +111,7 @@ public function loadChoiceList($value = null) */ public function loadChoicesForValues(array $values, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); // Optimize $values = array_filter($values); @@ -134,7 +134,7 @@ public function loadChoicesForValues(array $values, $value = null) */ public function loadValuesForChoices(array $choices, $value = null) { - @trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); // Optimize $choices = array_filter($choices); diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php index b9d9f9fa254d9..0811fdf772a6b 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -101,7 +101,7 @@ public function getController(Request $request) */ public function getArguments(Request $request, $controller) { - @trigger_error(sprintf('%s is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED); if (is_array($controller)) { $r = new \ReflectionMethod($controller[0], $controller[1]); @@ -126,7 +126,7 @@ public function getArguments(Request $request, $controller) */ protected function doGetArguments(Request $request, $controller, array $parameters) { - @trigger_error(sprintf('%s is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED); $attributes = $request->attributes->all(); $arguments = array(); diff --git a/src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php index 750107714026d..bfb770a0d039e 100644 --- a/src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php @@ -60,7 +60,7 @@ public function getController(Request $request) */ public function getArguments(Request $request, $controller) { - @trigger_error(sprintf('The %s method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), E_USER_DEPRECATED); $ret = $this->argumentResolver->getArguments($request, $controller); diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 9668b9ecd124d..5041ecb4a9528 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -232,7 +232,7 @@ public function getBundle($name, $first = true/*, $noDeprecation = false */) } if (!$first && !$noDeprecation) { - @trigger_error(sprintf('Passing "false" as the second argument to %s() is deprecated as of 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing "false" as the second argument to "%s()" is deprecated as of 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); } if (!isset($this->bundleMap[$name])) { @@ -734,7 +734,7 @@ protected function getKernelParameters() protected function getEnvParameters() { if (0 === func_num_args() || func_get_arg(0)) { - @trigger_error(sprintf('The %s() method is deprecated as of 3.3 and will be removed in 4.0. Use the %%env()%% syntax to get the value of any environment variable from configuration files instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.3 and will be removed in 4.0. Use the %%env()%% syntax to get the value of any environment variable from configuration files instead.', __METHOD__), E_USER_DEPRECATED); } $parameters = array(); diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 7cde2ac5e2ef9..916cf8d24d06a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -809,7 +809,7 @@ public function testKernelRootDirNameStartingWithANumber() /** * @group legacy - * @expectedDeprecation The Symfony\Component\HttpKernel\Kernel::getEnvParameters() method is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax to get the value of any environment variable from configuration files instead. + * @expectedDeprecation The "Symfony\Component\HttpKernel\Kernel::getEnvParameters()" method is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax to get the value of any environment variable from configuration files instead. * @expectedDeprecation The support of special environment variables that start with SYMFONY__ (such as "SYMFONY__FOO__BAR") is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax instead to get the value of environment variables in configuration files. */ public function testSymfonyEnvironmentVariables() diff --git a/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php b/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php index 788f6470f9e50..3600ca6d73012 100644 --- a/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php +++ b/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php @@ -56,7 +56,7 @@ public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter if (__CLASS__ !== get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { - @trigger_error(sprintf('Method %s() will have a sixth `string $context = null` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a 6th `string $context = null` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); } } diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index 1eafaa96e52bb..60c603bb73df1 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -196,7 +196,7 @@ public function supportsNormalization($data, $format = null/*, array $context = if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { - @trigger_error(sprintf('Method %s() will have a third `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a third `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); } } @@ -217,7 +217,7 @@ public function supportsDenormalization($data, $type, $format = null/*, array $c if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { - @trigger_error(sprintf('Method %s() will have a fourth `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a fourth `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); } } @@ -291,7 +291,7 @@ public function supportsEncoding($format/*, array $context = array()*/) if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { - @trigger_error(sprintf('Method %s() will have a second `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a second `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); } } @@ -312,7 +312,7 @@ public function supportsDecoding($format/*, array $context = array()*/) if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { - @trigger_error(sprintf('Method %s() will have a second `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method will have a second `$context = array()` argument in version 4.0. Not defining it is deprecated since Symfony 3.3.', __METHOD__), E_USER_DEPRECATED); } } diff --git a/src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php b/src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php index db2a2a1ecc46b..e60a4242976f3 100644 --- a/src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php +++ b/src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php @@ -27,7 +27,7 @@ class TranslatorPass implements CompilerPassInterface public function __construct($translatorServiceId = 'translator.default', $readerServiceId = 'translation.loader', $loaderTag = 'translation.loader', $debugCommandServiceId = 'console.command.translation_debug', $updateCommandServiceId = 'console.command.translation_update') { if ('translation.loader' === $readerServiceId && 2 > func_num_args()) { - @trigger_error('The default value for $readerServiceId will change in 4.0 to "translation.reader".', E_USER_DEPRECATED); + @trigger_error(sprintf('The default value for $readerServiceId in "%s()" will change in 4.0 to "translation.reader".', __METHOD__), E_USER_DEPRECATED); } $this->translatorServiceId = $translatorServiceId; diff --git a/src/Symfony/Component/Translation/Tests/DependencyInjection/TranslationPassTest.php b/src/Symfony/Component/Translation/Tests/DependencyInjection/TranslationPassTest.php index c0274738d0f0d..4c03aaca57003 100644 --- a/src/Symfony/Component/Translation/Tests/DependencyInjection/TranslationPassTest.php +++ b/src/Symfony/Component/Translation/Tests/DependencyInjection/TranslationPassTest.php @@ -57,7 +57,7 @@ public function testValidCollector() /** * @group legacy - * @expectedDeprecation The default value for $readerServiceId will change in 4.0 to "translation.reader". + * @expectedDeprecation The default value for $readerServiceId in "Symfony\Component\Translation\DependencyInjection\TranslatorPass::__construct()" will change in 4.0 to "translation.reader". * * A test that verifies the deprecated "translation.loader" gets the LoaderInterfaces added. * diff --git a/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php b/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php index 8837553d56808..26a846ea90d94 100644 --- a/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php +++ b/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php @@ -20,7 +20,7 @@ class TranslationWriterTest extends TestCase { /** * @group legacy - * @expectedDeprecation Method Symfony\Component\Translation\Writer\TranslationWriter::writeTranslations() is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead. + * @expectedDeprecation The "Symfony\Component\Translation\Writer\TranslationWriter::writeTranslations()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead. */ public function testWriteTranslations() { diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 411eec7167ff9..6594ea2aec480 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -87,7 +87,7 @@ public function __construct($locale, $formatter = null, $cacheDir = null, $debug if ($formatter instanceof MessageSelector) { $formatter = new MessageFormatter($formatter); - @trigger_error(sprintf('Passing a "%s" instance into the "%s" as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', MessageSelector::class, __METHOD__, MessageFormatterInterface::class), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a "%s" instance into the "%s()" method as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', MessageSelector::class, __METHOD__, MessageFormatterInterface::class), E_USER_DEPRECATED); } elseif (null === $formatter) { $formatter = new MessageFormatter(); } diff --git a/src/Symfony/Component/Translation/Writer/TranslationWriter.php b/src/Symfony/Component/Translation/Writer/TranslationWriter.php index 5ff5cd855dfa4..66784c2a4d569 100644 --- a/src/Symfony/Component/Translation/Writer/TranslationWriter.php +++ b/src/Symfony/Component/Translation/Writer/TranslationWriter.php @@ -97,7 +97,7 @@ public function write(MessageCatalogue $catalogue, $format, $options = array()) */ public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array()) { - @trigger_error(sprintf('Method %s() is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.', __METHOD__), E_USER_DEPRECATED); $this->write($catalogue, $format, $options); } } diff --git a/src/Symfony/Component/VarDumper/Caster/Caster.php b/src/Symfony/Component/VarDumper/Caster/Caster.php index 2676fb78bf0b3..0caa4f1f923b0 100644 --- a/src/Symfony/Component/VarDumper/Caster/Caster.php +++ b/src/Symfony/Component/VarDumper/Caster/Caster.php @@ -49,7 +49,7 @@ class Caster public static function castObject($obj, $class, $hasDebugInfo = false) { if ($class instanceof \ReflectionClass) { - @trigger_error(sprintf('Passing a ReflectionClass to %s() is deprecated since Symfony 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a ReflectionClass to "%s()" is deprecated since Symfony 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED); $hasDebugInfo = $class->hasMethod('__debugInfo'); $class = $class->name; } diff --git a/src/Symfony/Component/VarDumper/Cloner/Data.php b/src/Symfony/Component/VarDumper/Cloner/Data.php index 75ded2912126f..0b6802169b272 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Data.php +++ b/src/Symfony/Component/VarDumper/Cloner/Data.php @@ -172,7 +172,7 @@ public function __toString() */ public function getRawData() { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); return $this->data; } diff --git a/src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php b/src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php index 0fffd55122218..4ca7b780cf3dc 100644 --- a/src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php +++ b/src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php @@ -22,7 +22,7 @@ trait VarDumperTestTrait public function assertDumpEquals($dump, $data, $filter = 0, $message = '') { if (is_string($filter)) { - @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); $message = $filter; $filter = 0; } @@ -33,7 +33,7 @@ public function assertDumpEquals($dump, $data, $filter = 0, $message = '') public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') { if (is_string($filter)) { - @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); $message = $filter; $filter = 0; } From 748cad48984e14e7213739b9a7a7091a93436dca Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 9 Jul 2018 10:01:26 +0200 Subject: [PATCH 063/107] add @xabbuh as a code owner of the Yaml component --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 415464c40b9a8..0bef18db33536 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,3 +25,5 @@ /src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php @lyrixx /src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php @lyrixx /src/Symfony/Component/Workflow/* @lyrixx +# Yaml +/src/Symfony/Component/Yaml/* @xabbuh From 57e95f3f9a4b6f664db310b449dff3352a132ca2 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 9 Jul 2018 11:01:07 +0200 Subject: [PATCH 064/107] Fix the detection of the Process new argument --- src/Symfony/Component/Process/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 830c623e0dc3b..dc386aa526937 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -272,7 +272,7 @@ public function start(callable $callback = null/*, array $env = array()*/) } else { if (__CLASS__ !== static::class) { $r = new \ReflectionMethod($this, __FUNCTION__); - if (__CLASS__ !== $r->getDeclaringClass()->getName() && (2 > $r->getNumberOfParameters() || 'env' !== $r->getParameters()[0]->name)) { + if (__CLASS__ !== $r->getDeclaringClass()->getName() && (2 > $r->getNumberOfParameters() || 'env' !== $r->getParameters()[1]->name)) { @trigger_error(sprintf('The %s::start() method expects a second "$env" argument since Symfony 3.3. It will be made mandatory in 4.0.', static::class), E_USER_DEPRECATED); } } From 925dda130ee989699fc584201b6f8c373bd100c4 Mon Sep 17 00:00:00 2001 From: Valentin Date: Mon, 9 Jul 2018 13:08:44 +0300 Subject: [PATCH 065/107] Removed .mb-0 in errors. --- .../Twig/Resources/views/Form/bootstrap_4_layout.html.twig | 2 +- src/Symfony/Bridge/Twig/composer.json | 4 ++-- .../Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php | 2 +- .../Component/Form/Tests/AbstractBootstrap4LayoutTest.php | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 177b3624bc13f..6d99a65df6672 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -268,7 +268,7 @@ {%- if errors|length > 0 -%} {%- for error in errors -%} - + {{ 'Error'|trans({}, 'validators') }} {{ error.message }} {%- endfor -%} diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index f3be0e624cd17..2b48bab11c382 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -23,7 +23,7 @@ "symfony/asset": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~2.8|~3.0|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/form": "^3.4.9|^4.0.9", + "symfony/form": "^3.4.13|~4.0.13|^4.1.2", "symfony/http-foundation": "^3.3.11|~4.0", "symfony/http-kernel": "~3.2|~4.0", "symfony/polyfill-intl-icu": "~1.0", @@ -41,7 +41,7 @@ "symfony/workflow": "~3.3|~4.0" }, "conflict": { - "symfony/form": "<3.4.9|<4.0.9,>=4.0", + "symfony/form": "<3.4.13|>=4.0,<4.0.13|>=4.1,<4.1.2", "symfony/console": "<3.4" }, "suggest": { diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php index 016792e0edaf6..e376cefc7e519 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php @@ -33,7 +33,7 @@ public function testRow() ./label[@for="name"] [ ./span[@class="alert alert-danger d-block"] - [./span[@class="mb-0 d-block"] + [./span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error![/trans]"]] ] diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php index f9c4613e591c7..50795792b71f5 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php @@ -42,7 +42,7 @@ public function testRow() ./label[@for="name"] [ ./span[@class="alert alert-danger d-block"] - [./span[@class="mb-0 d-block"] + [./span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error![/trans]"]] ] @@ -172,11 +172,11 @@ public function testErrors() '/span [@class="alert alert-danger d-block"] [ - ./span[@class="mb-0 d-block"] + ./span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error 1[/trans]"]] - /following-sibling::span[@class="mb-0 d-block"] + /following-sibling::span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error 2[/trans]"]] ] From cb3e7126987a31117bc3e15c3b78bd87a7d34c5c Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 7 Jul 2018 15:17:51 +0300 Subject: [PATCH 066/107] [Form] Removed .form-control-label class. --- .../Resources/views/Form/bootstrap_4_layout.html.twig | 2 +- src/Symfony/Bridge/Twig/composer.json | 4 ++-- .../Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php | 8 ++++---- .../Component/Form/Tests/AbstractBootstrap4LayoutTest.php | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 43c031b933366..73c4f3a1b5a2a 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -187,7 +187,7 @@ {%- set element = 'legend' -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%} {%- else -%} - {%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%} + {%- set label_attr = label_attr|merge({for: id}) -%} {%- endif -%} {% if required -%} {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index f3be0e624cd17..2b48bab11c382 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -23,7 +23,7 @@ "symfony/asset": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~2.8|~3.0|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/form": "^3.4.9|^4.0.9", + "symfony/form": "^3.4.13|~4.0.13|^4.1.2", "symfony/http-foundation": "^3.3.11|~4.0", "symfony/http-kernel": "~3.2|~4.0", "symfony/polyfill-intl-icu": "~1.0", @@ -41,7 +41,7 @@ "symfony/workflow": "~3.3|~4.0" }, "conflict": { - "symfony/form": "<3.4.9|<4.0.9,>=4.0", + "symfony/form": "<3.4.13|>=4.0,<4.0.13|>=4.1,<4.1.2", "symfony/console": "<3.4" }, "suggest": { diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php index 016792e0edaf6..8b5d298212c64 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php @@ -72,7 +72,7 @@ public function testLabelDoesNotRenderFieldAttributes() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="col-form-label col-sm-2 form-control-label required"] + [@class="col-form-label col-sm-2 required"] ' ); } @@ -89,7 +89,7 @@ public function testLabelWithCustomAttributesPassedDirectly() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class col-form-label col-sm-2 form-control-label required"] + [@class="my&class col-form-label col-sm-2 required"] ' ); } @@ -106,7 +106,7 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class col-form-label col-sm-2 form-control-label required"] + [@class="my&class col-form-label col-sm-2 required"] [.="[trans]Custom label[/trans]"] ' ); @@ -126,7 +126,7 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class col-form-label col-sm-2 form-control-label required"] + [@class="my&class col-form-label col-sm-2 required"] [.="[trans]Custom label[/trans]"] ' ); diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php index f9c4613e591c7..f63d9ef63b27a 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php @@ -81,7 +81,7 @@ public function testLabelDoesNotRenderFieldAttributes() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="form-control-label required"] + [@class="required"] ' ); } @@ -98,7 +98,7 @@ public function testLabelWithCustomAttributesPassedDirectly() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class form-control-label required"] + [@class="my&class required"] ' ); } @@ -115,7 +115,7 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class form-control-label required"] + [@class="my&class required"] [.="[trans]Custom label[/trans]"] ' ); @@ -135,7 +135,7 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly $this->assertMatchesXpath($html, '/label [@for="name"] - [@class="my&class form-control-label required"] + [@class="my&class required"] [.="[trans]Custom label[/trans]"] ' ); From 23481a112ee46dd7ec68a2b31be26d90faeaaaec Mon Sep 17 00:00:00 2001 From: fritzmg Date: Mon, 9 Jul 2018 11:10:55 +0200 Subject: [PATCH 067/107] [Lock] fix lock file permissions --- src/Symfony/Component/Lock/Store/FlockStore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Lock/Store/FlockStore.php b/src/Symfony/Component/Lock/Store/FlockStore.php index 5c5baee29a91d..ed43649b953a4 100644 --- a/src/Symfony/Component/Lock/Store/FlockStore.php +++ b/src/Symfony/Component/Lock/Store/FlockStore.php @@ -81,7 +81,7 @@ private function lock(Key $key, $blocking) set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); if (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) { if ($handle = fopen($fileName, 'x')) { - chmod($fileName, 0444); + chmod($fileName, 0644); } elseif (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) { usleep(100); // Give some time for chmod() to complete $handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r'); From 7a68fea2afeb1cbd038740998f4fd985b5e28ae2 Mon Sep 17 00:00:00 2001 From: fritzmg Date: Mon, 9 Jul 2018 11:21:24 +0200 Subject: [PATCH 068/107] [Filesystem] fix lock file permissions --- src/Symfony/Component/Filesystem/LockHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Filesystem/LockHandler.php b/src/Symfony/Component/Filesystem/LockHandler.php index 8290e5283ab00..2438b9c40e930 100644 --- a/src/Symfony/Component/Filesystem/LockHandler.php +++ b/src/Symfony/Component/Filesystem/LockHandler.php @@ -77,7 +77,7 @@ public function lock($blocking = false) if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) { if ($this->handle = fopen($this->file, 'x')) { - chmod($this->file, 0444); + chmod($this->file, 0644); } elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) { usleep(100); // Give some time for chmod() to complete $this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r'); From 7aa45579d50b51fe9fd2d840c5ed03f8b41f93d9 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Fri, 29 Jun 2018 16:44:31 +0200 Subject: [PATCH 069/107] [Console] fix typo in phpdoc --- src/Symfony/Component/Console/Output/OutputInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Output/OutputInterface.php b/src/Symfony/Component/Console/Output/OutputInterface.php index dc6d08ad36a9c..3bf2157c1ad15 100644 --- a/src/Symfony/Component/Console/Output/OutputInterface.php +++ b/src/Symfony/Component/Console/Output/OutputInterface.php @@ -33,7 +33,7 @@ interface OutputInterface /** * Writes a message to the output. * - * @param string|array $messages The message as an array of lines or a single string + * @param string|array $messages The message as an array of strings or a single string * @param bool $newline Whether to add a newline * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ @@ -42,7 +42,7 @@ public function write($messages, $newline = false, $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @param string|array $messages The message as an array of lines of a single string + * @param string|array $messages The message as an array of strings or a single string * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ public function writeln($messages, $options = 0); From 881c46aaddd538d14ab1f2506321ef22df001ec7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 9 Jul 2018 15:24:25 +0200 Subject: [PATCH 070/107] [Filesystem] fix lock file mode --- src/Symfony/Component/Filesystem/LockHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Filesystem/LockHandler.php b/src/Symfony/Component/Filesystem/LockHandler.php index 2438b9c40e930..6d85c51b8cb4c 100644 --- a/src/Symfony/Component/Filesystem/LockHandler.php +++ b/src/Symfony/Component/Filesystem/LockHandler.php @@ -77,7 +77,7 @@ public function lock($blocking = false) if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) { if ($this->handle = fopen($this->file, 'x')) { - chmod($this->file, 0644); + chmod($this->file, 0666); } elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) { usleep(100); // Give some time for chmod() to complete $this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r'); From d3260dfdcd2cb365788ea3bc41e91739a8acb81d Mon Sep 17 00:00:00 2001 From: Albert Casdemont Date: Tue, 10 Jul 2018 13:02:47 +0200 Subject: [PATCH 071/107] [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset --- .../Debug/TraceableEventDispatcher.php | 1 + .../Tests/Debug/TraceableEventDispatcherTest.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php index 3b6e7cc393144..8d851623fb67a 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php @@ -217,6 +217,7 @@ public function getOrphanedEvents(): array public function reset() { $this->called = array(); + $this->orphanedEvents = array(); } /** diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 2521f741ea1fc..ab3b33e3779a4 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -271,6 +271,17 @@ public function testListenerCanRemoveItselfWhenExecuted() $this->assertCount(1, $eventDispatcher->getListeners('foo'), 'expected listener1 to be removed'); } + + public function testClearOrphanedEvents() + { + $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $tdispatcher->dispatch('foo'); + $events = $tdispatcher->getOrphanedEvents(); + $this->assertCount(1, $events); + $tdispatcher->reset(); + $events = $tdispatcher->getOrphanedEvents(); + $this->assertCount(0, $events); + } } class EventSubscriber implements EventSubscriberInterface From a265caf041aa56d2f3212dd587518ac66bd08a5b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 10 Jul 2018 15:15:49 +0200 Subject: [PATCH 072/107] [DependencyInjection] add missing test for #27710 --- .../ValidateEnvPlaceholdersPassTest.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php index b5841f343a4e8..cbec6bf778a49 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php @@ -234,6 +234,18 @@ public function testConfigurationWithoutRootNode(): void $this->addToAssertionCount(1); } + public function testEmptyConfigFromMoreThanOneSource() + { + $container = new ContainerBuilder(); + $container->registerExtension(new EnvExtension(new ConfigurationWithArrayNodeRequiringOneElement())); + $container->loadFromExtension('env_extension', array()); + $container->loadFromExtension('env_extension', array()); + + $this->doProcess($container); + + $this->addToAssertionCount(1); + } + public function testDiscardedEnvInConfig(): void { $container = new ContainerBuilder(); @@ -313,6 +325,24 @@ public function getConfigTreeBuilder() } } +class ConfigurationWithArrayNodeRequiringOneElement implements ConfigurationInterface +{ + public function getConfigTreeBuilder() + { + $treeBuilder = new TreeBuilder(); + $treeBuilder->root('env_extension') + ->children() + ->arrayNode('nodes') + ->isRequired() + ->requiresAtLeastOneElement() + ->scalarPrototype()->end() + ->end() + ->end(); + + return $treeBuilder; + } +} + class EnvExtension extends Extension { private $configuration; @@ -335,6 +365,10 @@ public function getConfiguration(array $config, ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container) { + if (!array_filter($configs)) { + return; + } + try { $this->config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs); } catch (TreeWithoutRootNodeException $e) { From d78dcc06154efe292a8511eb2b67f4866b9edf68 Mon Sep 17 00:00:00 2001 From: Sebastian Schwarz Date: Tue, 10 Jul 2018 15:15:57 +0200 Subject: [PATCH 073/107] [Console] correctly return parameter's default value on "--" Fixes #27916 --- .../Component/Console/Input/ArgvInput.php | 2 +- .../Component/Console/Input/ArrayInput.php | 2 +- .../Console/Tests/Input/ArgvInputTest.php | 25 ++++++++++--------- .../Console/Tests/Input/ArrayInputTest.php | 4 +-- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Symfony/Component/Console/Input/ArgvInput.php b/src/Symfony/Component/Console/Input/ArgvInput.php index fd81981070f47..087974ab7336f 100644 --- a/src/Symfony/Component/Console/Input/ArgvInput.php +++ b/src/Symfony/Component/Console/Input/ArgvInput.php @@ -306,7 +306,7 @@ public function getParameterOption($values, $default = false, $onlyParams = fals while (0 < count($tokens)) { $token = array_shift($tokens); if ($onlyParams && '--' === $token) { - return false; + return $default; } foreach ($values as $value) { diff --git a/src/Symfony/Component/Console/Input/ArrayInput.php b/src/Symfony/Component/Console/Input/ArrayInput.php index 4d9797ba1af0c..595a8a0e8cbc1 100644 --- a/src/Symfony/Component/Console/Input/ArrayInput.php +++ b/src/Symfony/Component/Console/Input/ArrayInput.php @@ -81,7 +81,7 @@ public function getParameterOption($values, $default = false, $onlyParams = fals foreach ($this->parameters as $k => $v) { if ($onlyParams && ('--' === $k || (is_int($k) && '--' === $v))) { - return false; + return $default; } if (is_int($k)) { diff --git a/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php b/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php index 61d1723e0842e..4cd7ab478f3a4 100644 --- a/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php @@ -395,25 +395,26 @@ public function testToString() /** * @dataProvider provideGetParameterOptionValues */ - public function testGetParameterOptionEqualSign($argv, $key, $onlyParams, $expected) + public function testGetParameterOptionEqualSign($argv, $key, $default, $onlyParams, $expected) { $input = new ArgvInput($argv); - $this->assertEquals($expected, $input->getParameterOption($key, false, $onlyParams), '->getParameterOption() returns the expected value'); + $this->assertEquals($expected, $input->getParameterOption($key, $default, $onlyParams), '->getParameterOption() returns the expected value'); } public function provideGetParameterOptionValues() { return array( - array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', false, 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), '--env', false, 'dev'), - array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), false, 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), false, 'dev'), - array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), false, '1'), - array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), false, '1'), - array(array('app/console', 'foo:bar', '--env', 'val'), '--env', false, 'val'), - array(array('app/console', 'foo:bar', '--env', 'val', '--dummy'), '--env', false, 'val'), - array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', false, 'dev'), - array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', true, false), + array(array('app/console', 'foo:bar'), '-e', 'default', false, 'default'), + array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'default', false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'default', false, 'dev'), + array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'default', false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'default', false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), 'default', false, '1'), + array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), 'default', false, '1'), + array(array('app/console', 'foo:bar', '--env', 'val'), '--env', 'default', false, 'val'), + array(array('app/console', 'foo:bar', '--env', 'val', '--dummy'), '--env', 'default', false, 'val'), + array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', 'default', false, 'dev'), + array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', 'default', true, 'default'), ); } diff --git a/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php b/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php index 6b443e0b2abae..34b67ac7f5235 100644 --- a/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php @@ -47,14 +47,14 @@ public function testGetParameterOption() { $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar')); $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); - $this->assertFalse($input->getParameterOption('--bar'), '->getParameterOption() returns the default if an option is not present in the passed parameters'); + $this->assertEquals('default', $input->getParameterOption('--bar', 'default'), '->getParameterOption() returns the default value if an option is not present in the passed parameters'); $input = new ArrayInput(array('Fabien', '--foo' => 'bar')); $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); $input = new ArrayInput(array('--foo', '--', '--bar' => 'woop')); $this->assertEquals('woop', $input->getParameterOption('--bar'), '->getParameterOption() returns the correct value if an option is present in the passed parameters'); - $this->assertFalse($input->getParameterOption('--bar', false, true), '->getParameterOption() returns false if an option is present in the passed parameters after an end of options signal'); + $this->assertEquals('default', $input->getParameterOption('--bar', 'default', true), '->getParameterOption() returns the default value if an option is present in the passed parameters after an end of options signal'); } public function testParseArguments() From 5f5077f4fceb69347bfca62e2a7723e45b6a55d0 Mon Sep 17 00:00:00 2001 From: Vincent Chalnot Date: Wed, 11 Jul 2018 11:08:35 +0200 Subject: [PATCH 074/107] [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables. --- .../Form/Extension/DataCollector/FormDataExtractor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php index 490a4ad711b96..d907aa270736d 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php @@ -15,6 +15,7 @@ use Symfony\Component\Form\FormView; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\VarDumper\Caster\CutStub; /** * Default implementation of {@link FormDataExtractorInterface}. @@ -155,6 +156,10 @@ public function extractViewVariables(FormView $view) ); foreach ($view->vars as $varName => $value) { + // Removing redundant variable from view variables + if ('form' === $varName) { + $value = new CutStub($value); + } $data['view_vars'][$varName] = $value; } From 559cdb01bd871f2866b0e0f5bbd04dd9dbbc2dd9 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 11 Jul 2018 10:13:25 +0200 Subject: [PATCH 075/107] fix typo in ContainerBuilder docblock --- .../Component/DependencyInjection/ContainerBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 2aa30026dcbcd..1960bf9d893bb 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -493,10 +493,10 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV * the parameters passed to the container constructor to have precedence * over the loaded ones. * - * $container = new ContainerBuilder(array('foo' => 'bar')); + * $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); * $loader = new LoaderXXX($container); * $loader->load('resource_name'); - * $container->register('foo', new stdClass()); + * $container->register('foo', 'stdClass'); * * In the above example, even if the loaded resource defines a foo * parameter, the value will still be 'bar' as defined in the ContainerBuilder From a72f4ecb3ac2cca30531607d3ce591e7157d7eea Mon Sep 17 00:00:00 2001 From: Jan Hort Date: Wed, 11 Jul 2018 16:52:26 +0200 Subject: [PATCH 076/107] [HttpFoundation] Fixed phpdoc for get method of HeaderBag --- src/Symfony/Component/HttpFoundation/HeaderBag.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/HeaderBag.php b/src/Symfony/Component/HttpFoundation/HeaderBag.php index d1065e797740a..890dabd130333 100644 --- a/src/Symfony/Component/HttpFoundation/HeaderBag.php +++ b/src/Symfony/Component/HttpFoundation/HeaderBag.php @@ -101,11 +101,11 @@ public function add(array $headers) /** * Returns a header value by name. * - * @param string $key The header name - * @param string|string[] $default The default value - * @param bool $first Whether to return the first value or all header values + * @param string $key The header name + * @param string|string[]|null $default The default value + * @param bool $first Whether to return the first value or all header values * - * @return string|string[] The first header value or default value if $first is true, an array of values otherwise + * @return string|string[]|null The first header value or default value if $first is true, an array of values otherwise */ public function get($key, $default = null, $first = true) { From ec4b04b2d563aab2dd38dad3a259fc5c9250488a Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Tue, 3 Jul 2018 14:27:03 +0100 Subject: [PATCH 077/107] Supports nested "abstract" object while serializing and de-serializing --- .../Normalizer/AbstractObjectNormalizer.php | 32 ++++++++++++++++++- .../Tests/Fixtures/DummyMessageNumberTwo.php | 15 +++++++++ .../Serializer/Tests/SerializerTest.php | 20 +++++++++++- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index 7f8d341846f7d..08e5841060dbd 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -294,7 +294,7 @@ abstract protected function setAttributeValue($object, $attribute, $value, $form */ private function validateAndDenormalize(string $currentClass, string $attribute, $data, ?string $format, array $context) { - if (null === $this->propertyTypeExtractor || null === $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) { + if (null === $types = $this->getTypes($currentClass, $attribute)) { return $data; } @@ -357,6 +357,36 @@ private function validateAndDenormalize(string $currentClass, string $attribute, throw new NotNormalizableValueException(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $attribute, $currentClass, implode('", "', array_keys($expectedTypes)), gettype($data))); } + /** + * @return Type[]|null + */ + private function getTypes(string $currentClass, string $attribute) + { + if (null === $this->propertyTypeExtractor) { + return null; + } + + if (null !== $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) { + return $types; + } + + if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($currentClass)) { + if ($discriminatorMapping->getTypeProperty() === $attribute) { + return array( + new Type(Type::BUILTIN_TYPE_STRING), + ); + } + + foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) { + if (null !== $types = $this->propertyTypeExtractor->getTypes($mappedClass, $attribute)) { + return $types; + } + } + } + + return null; + } + /** * Sets an attribute and apply the name converter if necessary. * diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php index 3b828e50bf44a..5a24e7c9ff08e 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DummyMessageNumberTwo.php @@ -22,4 +22,19 @@ class DummyMessageNumberTwo implements DummyMessageInterface * @Groups({"two"}) */ public $three; + + /** + * @var DummyMessageNumberOne + */ + private $nested; + + public function setNested(DummyMessageNumberOne $nested) + { + $this->nested = $nested; + } + + public function getNested(): DummyMessageNumberOne + { + return $this->nested; + } } diff --git a/src/Symfony/Component/Serializer/Tests/SerializerTest.php b/src/Symfony/Component/Serializer/Tests/SerializerTest.php index 25fbbf38ce584..743461a727a01 100644 --- a/src/Symfony/Component/Serializer/Tests/SerializerTest.php +++ b/src/Symfony/Component/Serializer/Tests/SerializerTest.php @@ -13,6 +13,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use PHPUnit\Framework\TestCase; +use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorMapping; use Symfony\Component\Serializer\Mapping\ClassMetadata; @@ -35,6 +36,7 @@ use Symfony\Component\Serializer\Tests\Fixtures\AbstractDummySecondChild; use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface; use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberOne; +use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberTwo; use Symfony\Component\Serializer\Tests\Fixtures\TraversableDummy; use Symfony\Component\Serializer\Tests\Fixtures\NormalizableTraversableDummy; use Symfony\Component\Serializer\Tests\Normalizer\TestNormalizer; @@ -430,6 +432,22 @@ public function testDeserializeAndSerializeInterfacedObjectsWithTheClassMetadata $this->assertEquals('{"two":2,"type":"one"}', $serialized); } + public function testDeserializeAndSerializeNestedInterfacedObjectsWithTheClassMetadataDiscriminator() + { + $nested = new DummyMessageNumberOne(); + $nested->one = 'foo'; + + $example = new DummyMessageNumberTwo(); + $example->setNested($nested); + + $serializer = $this->serializerWithClassDiscriminator(); + + $serialized = $serializer->serialize($example, 'json'); + $deserialized = $serializer->deserialize($serialized, DummyMessageInterface::class, 'json'); + + $this->assertEquals($example, $deserialized); + } + /** * @expectedException \Symfony\Component\Serializer\Exception\RuntimeException * @expectedExceptionMessage The type "second" has no mapped class for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface" @@ -452,7 +470,7 @@ private function serializerWithClassDiscriminator() { $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); - return new Serializer(array(new ObjectNormalizer($classMetadataFactory, null, null, null, new ClassDiscriminatorFromClassMetadata($classMetadataFactory))), array('json' => new JsonEncoder())); + return new Serializer(array(new ObjectNormalizer($classMetadataFactory, null, null, new ReflectionExtractor(), new ClassDiscriminatorFromClassMetadata($classMetadataFactory))), array('json' => new JsonEncoder())); } } From 51a49c7f78557a847d512cac6224fc10f6706327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 13 Jul 2018 08:54:27 +0200 Subject: [PATCH 078/107] [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called --- .../HttpFoundation/StreamedResponse.php | 12 ++++++++++++ .../HttpFoundation/Tests/ResponseTest.php | 7 ++++++- .../Tests/StreamedResponseTest.php | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/StreamedResponse.php b/src/Symfony/Component/HttpFoundation/StreamedResponse.php index 01e8cf8c36df2..41ba4dc4e78c3 100644 --- a/src/Symfony/Component/HttpFoundation/StreamedResponse.php +++ b/src/Symfony/Component/HttpFoundation/StreamedResponse.php @@ -134,4 +134,16 @@ public function getContent() { return false; } + + /** + * {@inheritdoc} + * + * @return $this + */ + public function setNotModified() + { + $this->setCallback(function () {}); + + return parent::setNotModified(); + } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 46fcc5f3eb774..ffd8eb354f15a 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -126,7 +126,7 @@ public function testMustRevalidateWithProxyRevalidateCacheControlHeader() public function testSetNotModified() { - $response = new Response(); + $response = new Response('foo'); $modified = $response->setNotModified(); $this->assertObjectHasAttribute('headers', $modified); $this->assertObjectHasAttribute('content', $modified); @@ -135,6 +135,11 @@ public function testSetNotModified() $this->assertObjectHasAttribute('statusText', $modified); $this->assertObjectHasAttribute('charset', $modified); $this->assertEquals(304, $modified->getStatusCode()); + + ob_start(); + $modified->sendContent(); + $string = ob_get_clean(); + $this->assertEmpty($string); } public function testIsSuccessful() diff --git a/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php index 2ccb6841ad84b..66effe595df71 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php @@ -132,4 +132,22 @@ public function testReturnThis() $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders()); } + + public function testSetNotModified() + { + $response = new StreamedResponse(function () { echo 'foo'; }); + $modified = $response->setNotModified(); + $this->assertObjectHasAttribute('headers', $modified); + $this->assertObjectHasAttribute('content', $modified); + $this->assertObjectHasAttribute('version', $modified); + $this->assertObjectHasAttribute('statusCode', $modified); + $this->assertObjectHasAttribute('statusText', $modified); + $this->assertObjectHasAttribute('charset', $modified); + $this->assertEquals(304, $modified->getStatusCode()); + + ob_start(); + $modified->sendContent(); + $string = ob_get_clean(); + $this->assertEmpty($string); + } } From 5f59ad4600bf93c2f5e2a2524ef5f2e0a081a93e Mon Sep 17 00:00:00 2001 From: Webnet team Date: Wed, 11 Jul 2018 15:26:07 +0200 Subject: [PATCH 079/107] suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag --- .../Attribute/NamespacedAttributeBag.php | 8 ++++++- .../Attribute/NamespacedAttributeBagTest.php | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php index abbf37ee7c33c..f9df69e90782f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php @@ -124,7 +124,13 @@ protected function &resolveAttributePath($name, $writeContext = false) foreach ($parts as $part) { if (null !== $array && !array_key_exists($part, $array)) { - $array[$part] = $writeContext ? array() : null; + if (!$writeContext) { + $null = null; + + return $null; + } + + $array[$part] = array(); } $array = &$array[$part]; diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php index f074ce1b26261..ec4cd5ad1a146 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php @@ -82,6 +82,17 @@ public function testHas($key, $value, $exists) $this->assertEquals($exists, $this->bag->has($key)); } + /** + * @dataProvider attributesProvider + */ + public function testHasNoSideEffect($key, $value, $expected) + { + $expected = json_encode($this->bag->all()); + $this->bag->has($key); + + $this->assertEquals($expected, json_encode($this->bag->all())); + } + /** * @dataProvider attributesProvider */ @@ -96,6 +107,17 @@ public function testGetDefaults() $this->assertEquals('default', $this->bag->get('user2.login', 'default')); } + /** + * @dataProvider attributesProvider + */ + public function testGetNoSideEffect($key, $value, $expected) + { + $expected = json_encode($this->bag->all()); + $this->bag->get($key); + + $this->assertEquals($expected, json_encode($this->bag->all())); + } + /** * @dataProvider attributesProvider */ From aaf7e889f7c7707a57a104348476cee43b51e401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 13 Jul 2018 14:52:14 +0200 Subject: [PATCH 080/107] Fix tests --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 926f66198f5f7..e0a1c53c4f158 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "doctrine/cache": "~1.6", "doctrine/data-fixtures": "1.0.*", "doctrine/dbal": "~2.4", - "doctrine/orm": "~2.4,>=2.4.5", + "doctrine/orm": "~2.4,>=2.4.5,<=2.7.0", "doctrine/doctrine-bundle": "~1.4", "monolog/monolog": "~1.11", "ocramius/proxy-manager": "~0.4|~1.0|~2.0", From ecef6f1b9b170acd0b47f3c1d31b95685f576ee2 Mon Sep 17 00:00:00 2001 From: jmsche Date: Fri, 13 Jul 2018 16:00:59 +0200 Subject: [PATCH 081/107] [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 91764e30de144..00ab74ad9f667 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -263,6 +263,7 @@ div.sf-toolbar .sf-toolbar-block a:hover { border-width: 0; position: relative; top: 8px; + vertical-align: baseline; } .sf-toolbar-block .sf-toolbar-icon img + span, From 7306018a30182e60ad039742ec580df5eed14c9f Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Fri, 13 Jul 2018 15:34:18 +0200 Subject: [PATCH 082/107] [Security] Update user phpdoc on tokens --- .../Core/Authentication/Token/AbstractToken.php | 9 +-------- .../Core/Authentication/Token/TokenInterface.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index 8a9f2477b2ea8..fc02e5feb926c 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -77,14 +77,7 @@ public function getUser() } /** - * Sets the user in the token. - * - * The user can be a UserInterface instance, or an object implementing - * a __toString method or the username as a regular string. - * - * @param string|object $user The user - * - * @throws \InvalidArgumentException + * {@inheritdoc} */ public function setUser($user) { diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php b/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php index 4e1dd7b2fc46b..583700c178a71 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php @@ -47,17 +47,22 @@ public function getCredentials(); /** * Returns a user representation. * - * @return mixed Can be a UserInterface instance, an object implementing a __toString method, - * or the username as a regular string + * @return string|object Can be a UserInterface instance, an object implementing a __toString method, + * or the username as a regular string * * @see AbstractToken::setUser() */ public function getUser(); /** - * Sets a user. + * Sets the user in the token. * - * @param mixed $user + * The user can be a UserInterface instance, or an object implementing + * a __toString method or the username as a regular string. + * + * @param string|object $user The user + * + * @throws \InvalidArgumentException */ public function setUser($user); From 9854a269813a0ab2a7dc13a3cb7a5bb3e487c956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Sat, 14 Jul 2018 16:36:53 +0200 Subject: [PATCH 083/107] [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument --- src/Symfony/Component/Form/FormConfigBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 4ec16782c6074..14150179d8ea9 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -138,7 +138,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface private $data; /** - * @var string + * @var string|null */ private $dataClass; @@ -181,7 +181,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface * Creates an empty form configuration. * * @param string|int $name The form name - * @param string $dataClass The class of the form's data + * @param string|null $dataClass The class of the form's data * @param EventDispatcherInterface $dispatcher The event dispatcher * @param array $options The form options * From 32ad5d9f9cdbc8f175953981ba7df08caf2c07b1 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 10 Jul 2018 21:33:14 +0200 Subject: [PATCH 084/107] [Form] Improve rendering of `file` field in bootstrap 4 --- .../views/Form/bootstrap_4_layout.html.twig | 21 +++++++++---------- .../Tests/AbstractBootstrap4LayoutTest.php | 17 ++++++++++++--- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 952ef3aec1ec9..e821ac9c5adbd 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -114,6 +114,16 @@ {%- endblock percent_widget %} +{% block file_widget -%} +
+ <{{ element|default('div') }} class="custom-file"> + {%- set type = type|default('file') -%} + {{- block('form_widget_simple') -}} + + +
+{% endblock %} + {% block form_widget_simple -%} {% if type is not defined or type != 'hidden' %} {%- set attr = attr|merge({class: (attr.class|default('') ~ (type|default('') == 'file' ? ' custom-file-input' : ' form-control'))|trim}) -%} @@ -186,8 +196,6 @@ {%- if compound is defined and compound -%} {%- set element = 'legend' -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%} - {% elseif type is defined and type == 'file' %} - {%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' custom-file-label')|trim}) -%} {%- else -%} {%- set label_attr = label_attr|merge({for: id}) -%} {%- endif -%} @@ -269,15 +277,6 @@ {%- endblock form_row %} -{% block file_row -%} -
- <{{ element|default('div') }} class="custom-file"> - {{- form_widget(form) -}} - {{- form_label(form) -}} - -
-{% endblock %} - {# Errors #} {% block form_errors -%} diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php index 28b3111c4af07..a3fc43a49f280 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php @@ -940,9 +940,20 @@ public function testFile() { $form = $this->factory->createNamed('name', FileType::class); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class form-control-file')), -'/input - [@type="file"] + $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'nope', 'attr' => array('class' => 'my&class form-control-file')), +'/div + [@class="form-group"] + [ + ./div + [@class="custom-file"] + [ + ./input + [@type="file"] + [@name="name"] + /following-sibling::label + [@for="name"] + ] + ] ' ); } From 3cd2eef6e680c60d4d1d1e8ecd759f5806513698 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Sun, 15 Jul 2018 17:41:19 +0200 Subject: [PATCH 085/107] Add placeholder support in bootstrap 4 file fields --- .../views/Form/bootstrap_4_layout.html.twig | 6 ++++- .../Tests/AbstractBootstrap4LayoutTest.php | 24 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index e821ac9c5adbd..8f790fdd19450 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -119,7 +119,11 @@ <{{ element|default('div') }} class="custom-file"> {%- set type = type|default('file') -%} {{- block('form_widget_simple') -}} - + {% endblock %} diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php index a3fc43a49f280..283757080bd55 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php @@ -940,7 +940,7 @@ public function testFile() { $form = $this->factory->createNamed('name', FileType::class); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'nope', 'attr' => array('class' => 'my&class form-control-file')), + $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file')), '/div [@class="form-group"] [ @@ -958,6 +958,28 @@ public function testFile() ); } + public function testFileWithPlaceholder() + { + $form = $this->factory->createNamed('name', FileType::class); + + $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file', 'placeholder' => 'Custom Placeholder')), +'/div + [@class="form-group"] + [ + ./div + [@class="custom-file"] + [ + ./input + [@type="file"] + [@name="name"] + /following-sibling::label + [@for="name" and text() = "[trans]Custom Placeholder[/trans]"] + ] + ] +' + ); + } + public function testMoney() { $form = $this->factory->createNamed('name', MoneyType::class, 1234.56, array( From b5863bc7e8620205b7d8f6c4ba92682187db4747 Mon Sep 17 00:00:00 2001 From: Ivan Nikolaev Date: Mon, 16 Jul 2018 15:56:07 +0300 Subject: [PATCH 086/107] [FrameworkBundle] fixed brackets position in method calls --- .../DependencyInjection/FrameworkExtensionTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 3a81958b1158c..11b0c959593ec 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -191,8 +191,8 @@ public function testWorkflows() { $container = $this->createContainerFromFile('workflows'); - $this->assertTrue($container->hasDefinition('workflow.article', 'Workflow is registered as a service')); - $this->assertTrue($container->hasDefinition('workflow.article.definition', 'Workflow definition is registered as a service')); + $this->assertTrue($container->hasDefinition('workflow.article'), 'Workflow is registered as a service'); + $this->assertTrue($container->hasDefinition('workflow.article.definition'), 'Workflow definition is registered as a service'); $workflowDefinition = $container->getDefinition('workflow.article.definition'); @@ -210,8 +210,8 @@ public function testWorkflows() ); $this->assertSame(array('workflow.definition' => array(array('name' => 'article', 'type' => 'workflow', 'marking_store' => 'multiple_state'))), $workflowDefinition->getTags()); - $this->assertTrue($container->hasDefinition('state_machine.pull_request', 'State machine is registered as a service')); - $this->assertTrue($container->hasDefinition('state_machine.pull_request.definition', 'State machine definition is registered as a service')); + $this->assertTrue($container->hasDefinition('state_machine.pull_request'), 'State machine is registered as a service'); + $this->assertTrue($container->hasDefinition('state_machine.pull_request.definition'), 'State machine definition is registered as a service'); $this->assertCount(4, $workflowDefinition->getArgument(1)); $this->assertSame('draft', $workflowDefinition->getArgument(2)); @@ -293,8 +293,8 @@ public function testWorkflowMultipleTransitionsWithSameName() { $container = $this->createContainerFromFile('workflow_with_multiple_transitions_with_same_name'); - $this->assertTrue($container->hasDefinition('workflow.article', 'Workflow is registered as a service')); - $this->assertTrue($container->hasDefinition('workflow.article.definition', 'Workflow definition is registered as a service')); + $this->assertTrue($container->hasDefinition('workflow.article'), 'Workflow is registered as a service'); + $this->assertTrue($container->hasDefinition('workflow.article.definition'), 'Workflow definition is registered as a service'); $workflowDefinition = $container->getDefinition('workflow.article.definition'); From 2afd49ff17cc645843a0c3d09534689b439c2284 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 16 Jul 2018 16:05:32 +0200 Subject: [PATCH 087/107] fixed typo --- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 955f3cad443fb..8f0bd34f5b6af 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -241,7 +241,7 @@ public function testWorkflows() $this->assertInstanceOf(Reference::class, $markingStoreRef); $this->assertEquals('workflow_service', (string) $markingStoreRef); - $this->assertTrue($container->hasDefinition('workflow.registry', 'Workflow registry is registered as a service')); + $this->assertTrue($container->hasDefinition('workflow.registry'), 'Workflow registry is registered as a service'); $registryDefinition = $container->getDefinition('workflow.registry'); $this->assertGreaterThan(0, count($registryDefinition->getMethodCalls())); } From ad2e166d4ebd4398d822e6caf42141cc60446545 Mon Sep 17 00:00:00 2001 From: Yannick Vanhaeren Date: Tue, 17 Jul 2018 09:53:55 +0200 Subject: [PATCH 088/107] Fix SVGs not scaling in IE9, IE10, and IE11 --- .../WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 00ab74ad9f667..b5e21a6ebf05d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -60,6 +60,7 @@ .sf-toolbarreset svg, .sf-toolbarreset img { height: 20px; + width: 20px; display: inline-block; } From 1d93b5e26ad9bb9e22c9a7c453ea98bc5400dbbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 17 Jul 2018 14:18:04 +0200 Subject: [PATCH 089/107] [MonologBridge] Improve FirePHPHandler --- src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php b/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php index 056496ae1325a..966a7baf83079 100644 --- a/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php @@ -38,9 +38,10 @@ public function onKernelResponse(FilterResponseEvent $event) return; } - if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent')) - && !$event->getRequest()->headers->has('X-FirePHP-Version')) { - $this->sendHeaders = false; + $request = $event->getRequest(); + if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $request->headers->get('User-Agent')) + && !$request->headers->has('X-FirePHP-Version')) { + self::$sendHeaders = false; $this->headers = array(); return; @@ -58,7 +59,7 @@ public function onKernelResponse(FilterResponseEvent $event) */ protected function sendHeader($header, $content) { - if (!$this->sendHeaders) { + if (!self::$sendHeaders) { return; } From 8e49598788cab3bb20ff1b1284406eee4c28bc98 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 18 Jul 2018 13:02:07 +0200 Subject: [PATCH 090/107] Fix PHPDoc return type GetResponseEvent::getResponse() may return null too --- src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php b/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php index f7745ea3dc160..c25a0f1cf1a1a 100644 --- a/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php @@ -29,7 +29,7 @@ class GetResponseEvent extends KernelEvent /** * Returns the response object. * - * @return Response + * @return Response|null */ public function getResponse() { From 1a427b181dec0ffe920b604d5b42f23d83495c12 Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 16 Feb 2018 06:32:23 +0100 Subject: [PATCH 091/107] Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler --- .../FrameworkBundle/Translation/TranslationLoader.php | 7 +++++-- .../Session/Storage/Handler/WriteCheckSessionHandler.php | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php index 2431e79ff238e..2466d1f2952da 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php @@ -14,13 +14,16 @@ use Symfony\Component\Translation\Reader\TranslationReader; use Symfony\Component\Translation\MessageCatalogue; -@trigger_error(sprintf('The class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use "%s" instead. ', TranslationLoader::class, TranslationReader::class), E_USER_DEPRECATED); - /** * @deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Component\Translation\Reader\TranslationReader instead */ class TranslationLoader extends TranslationReader { + public function __construct() + { + @trigger_error(sprintf('The class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use "%s" instead. ', self::class, TranslationReader::class), E_USER_DEPRECATED); + } + /** * Loads translation messages from a directory to the catalogue. * diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php index 1541ec4e0aa49..127e47f2107a3 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; -@trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Implement `SessionUpdateTimestampHandlerInterface` or extend `AbstractSessionHandler` instead.', WriteCheckSessionHandler::class), E_USER_DEPRECATED); - /** * Wraps another SessionHandlerInterface to only write the session when it has been modified. * @@ -31,6 +29,8 @@ class WriteCheckSessionHandler implements \SessionHandlerInterface public function __construct(\SessionHandlerInterface $wrappedSessionHandler) { + @trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Implement `SessionUpdateTimestampHandlerInterface` or extend `AbstractSessionHandler` instead.', self::class), E_USER_DEPRECATED); + $this->wrappedSessionHandler = $wrappedSessionHandler; } From 7cf840c83c1a61014f7f72e63c1819c1dfe91b26 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Thu, 19 Jul 2018 10:51:22 +0200 Subject: [PATCH 092/107] add missing translation for uuid validator --- .../Validator/Resources/translations/validators.it.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index 38e437d6cf978..b3ea45f70bfc2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Questo valore non è un codice BIC valido. + + This is not a valid UUID. + Questo non è un UUID valido. + From 2a950b668f92f7c0eceb213b8efbcc983b48577d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Egyed?= Date: Thu, 19 Jul 2018 12:05:15 +0200 Subject: [PATCH 093/107] [Validator] Add missing UUID validator message translation (en) --- .../Validator/Resources/translations/validators.en.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 2a5c97d8cf2d0..30ac67c34622e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). This is not a valid Business Identifier Code (BIC). + + This is not a valid UUID. + This is not a valid UUID. + From 0b2134415c7506fd8a99abb30bc9e34851ba0b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Egyed?= Date: Thu, 19 Jul 2018 12:07:41 +0200 Subject: [PATCH 094/107] [Validator] Add missing UUID validator message translation (hu) --- .../Validator/Resources/translations/validators.hu.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index a113a7241bc68..afa3de65ecb07 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT). + + This is not a valid UUID. + Érvénytelen egyedi azonosító (UUID). + From 4ff0f951be67af1be5d2830244e707859ce9becd Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 19 Jul 2018 13:59:44 +0200 Subject: [PATCH 095/107] Serbo-Croatian has Serbian plural rule --- src/Symfony/Component/Translation/PluralizationRules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Translation/PluralizationRules.php b/src/Symfony/Component/Translation/PluralizationRules.php index 2b7b118336938..80de7aabdf06c 100644 --- a/src/Symfony/Component/Translation/PluralizationRules.php +++ b/src/Symfony/Component/Translation/PluralizationRules.php @@ -144,6 +144,7 @@ public static function get($number, $locale) case 'bs': case 'hr': case 'ru': + case 'sh': case 'sr': case 'uk': return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); From ee780f3c664f8e2846aba087c5e9653a92c64252 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 19 Jul 2018 14:11:20 +0200 Subject: [PATCH 096/107] Add several missing translations of the UUID validation message. --- .../Validator/Resources/translations/validators.ca.xlf | 4 ++++ .../Validator/Resources/translations/validators.de.xlf | 4 ++++ .../Validator/Resources/translations/validators.es.xlf | 4 ++++ .../Validator/Resources/translations/validators.eu.xlf | 4 ++++ .../Validator/Resources/translations/validators.fr.xlf | 4 ++++ .../Validator/Resources/translations/validators.nl.xlf | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index 85b6970fc31cf..ecdc80bdf735f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -302,6 +302,10 @@ An empty file is not allowed. No està permès un fixter buit. + + This is not a valid UUID. + Aquest valor no és un UUID vàlid. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 192b992f8f3ba..8be512549cedd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Dieser Wert ist kein gültiger BIC. + + This is not a valid UUID. + Dies ist keine gültige UUID. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index 1fa59dda6ad46..f8950a6f47b4e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). No es un Código de Identificación Bancaria (BIC) válido. + + This is not a valid UUID. + Este valor no es un UUID válido. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index b2edefd30398b..eef1c5acc1946 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar. + + This is not a valid UUID. + Balio hau ez da onartutako UUID bat. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 30a883bbf239d..a6d5a63db9a7a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Ce n'est pas un code universel d'identification des banques (BIC) valide. + + This is not a valid UUID. + Ceci n'est pas un UUID valide. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index e81141f0eed81..f49c8c6f022da 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -310,6 +310,10 @@ This is not a valid Business Identifier Code (BIC). Dit is geen geldige bedrijfsidentificatiecode (BIC/SWIFT). + + This is not a valid UUID. + Deze waarde is geen geldige UUID waarde. + From 53347c42fde857e49cfbe5ad4dcc4fc94eae6c32 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Thu, 19 Jul 2018 11:59:26 -0400 Subject: [PATCH 097/107] Fixed templateExists on parse error of the template name --- .../Fragment/HIncludeFragmentRenderer.php | 2 +- .../Tests/Fragment/HIncludeFragmentRendererTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index 3252f061e5fc7..4ee89d6e8c05f 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -135,7 +135,7 @@ private function templateExists($template) if ($this->templating instanceof EngineInterface) { try { return $this->templating->exists($template); - } catch (\InvalidArgumentException $e) { + } catch (\Exception $e) { return false; } } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php index 1be052e5e62fd..7171c71bc3af4 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php @@ -86,4 +86,17 @@ public function testRenderWithDefaultText() $strategy = new HIncludeFragmentRenderer($engine); $this->assertEquals('default', $strategy->render('/foo', Request::create('/'), array('default' => 'default'))->getContent()); } + + public function testRenderWithEngineAndDefaultText() + { + $engine = $this->getMockBuilder('Symfony\\Component\\Templating\\EngineInterface')->getMock(); + $engine->expects($this->once()) + ->method('exists') + ->with('loading...') + ->will($this->throwException(new \RuntimeException())); + + // only default + $strategy = new HIncludeFragmentRenderer($engine); + $this->assertEquals('loading...', $strategy->render('/foo', Request::create('/'), array('default' => 'loading...'))->getContent()); + } } From 22b2257609b67d0b078a7613598df7d742a69585 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Fri, 20 Jul 2018 11:39:40 +0100 Subject: [PATCH 098/107] Add missing typehint on chain sender --- src/Symfony/Component/Messenger/Transport/ChainSender.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Transport/ChainSender.php b/src/Symfony/Component/Messenger/Transport/ChainSender.php index 97e3ce44bbaf1..2d2d55f03df76 100644 --- a/src/Symfony/Component/Messenger/Transport/ChainSender.php +++ b/src/Symfony/Component/Messenger/Transport/ChainSender.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Messenger\Transport; +use Symfony\Component\Messenger\Envelope; + /** * @author Tobias Schultze */ @@ -29,7 +31,7 @@ public function __construct(iterable $senders) /** * {@inheritdoc} */ - public function send($message): void + public function send(Envelope $message): void { foreach ($this->senders as $sender) { $sender->send($message); From 5d76ed7a3afc748aa38d219b9a3ca100d3c458fc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 10:13:01 +0200 Subject: [PATCH 099/107] fixed UUID error message id in translation files --- .../Validator/Resources/translations/validators.ca.xlf | 2 +- .../Validator/Resources/translations/validators.de.xlf | 2 +- .../Validator/Resources/translations/validators.en.xlf | 2 +- .../Validator/Resources/translations/validators.es.xlf | 2 +- .../Validator/Resources/translations/validators.eu.xlf | 2 +- .../Validator/Resources/translations/validators.fr.xlf | 2 +- .../Validator/Resources/translations/validators.hu.xlf | 2 +- .../Validator/Resources/translations/validators.it.xlf | 2 +- .../Validator/Resources/translations/validators.nl.xlf | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index ecdc80bdf735f..078a25d052d10 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -302,7 +302,7 @@ An empty file is not allowed. No està permès un fixter buit. - + This is not a valid UUID. Aquest valor no és un UUID vàlid. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 8be512549cedd..503a22930bcfb 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). Dieser Wert ist kein gültiger BIC. - + This is not a valid UUID. Dies ist keine gültige UUID. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 30ac67c34622e..693177d431d14 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). This is not a valid Business Identifier Code (BIC). - + This is not a valid UUID. This is not a valid UUID. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index f8950a6f47b4e..d356d190e2bb1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). No es un Código de Identificación Bancaria (BIC) válido. - + This is not a valid UUID. Este valor no es un UUID válido. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index eef1c5acc1946..4ec25166910d6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar. - + This is not a valid UUID. Balio hau ez da onartutako UUID bat. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index a6d5a63db9a7a..7032ac9a7391a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). Ce n'est pas un code universel d'identification des banques (BIC) valide. - + This is not a valid UUID. Ceci n'est pas un UUID valide. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index afa3de65ecb07..f495d09106978 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT). - + This is not a valid UUID. Érvénytelen egyedi azonosító (UUID). diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index b3ea45f70bfc2..ee24b9ca4ac8d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -314,7 +314,7 @@ This is not a valid Business Identifier Code (BIC). Questo valore non è un codice BIC valido. - + This is not a valid UUID. Questo non è un UUID valido. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index f49c8c6f022da..954558ad223e1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -310,7 +310,7 @@ This is not a valid Business Identifier Code (BIC). Dit is geen geldige bedrijfsidentificatiecode (BIC/SWIFT). - + This is not a valid UUID. Deze waarde is geen geldige UUID waarde. From 48644a8fc80fa0cf2c39200ba9aa8beb38390a14 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 10:22:17 +0200 Subject: [PATCH 100/107] backported translations --- .../Validator/Resources/translations/validators.bg.xlf | 4 ++++ .../Validator/Resources/translations/validators.cs.xlf | 4 ++++ .../Validator/Resources/translations/validators.da.xlf | 4 ++++ .../Validator/Resources/translations/validators.de.xlf | 4 ++++ .../Validator/Resources/translations/validators.en.xlf | 4 ++++ .../Validator/Resources/translations/validators.es.xlf | 4 ++++ .../Validator/Resources/translations/validators.eu.xlf | 4 ++++ .../Validator/Resources/translations/validators.fi.xlf | 4 ++++ .../Validator/Resources/translations/validators.fr.xlf | 4 ++++ .../Validator/Resources/translations/validators.gl.xlf | 4 ++++ .../Validator/Resources/translations/validators.hr.xlf | 4 ++++ .../Validator/Resources/translations/validators.hu.xlf | 4 ++++ .../Validator/Resources/translations/validators.it.xlf | 4 ++++ .../Validator/Resources/translations/validators.lt.xlf | 4 ++++ .../Validator/Resources/translations/validators.nl.xlf | 4 ++++ .../Validator/Resources/translations/validators.pl.xlf | 4 ++++ .../Validator/Resources/translations/validators.pt.xlf | 4 ++++ .../Validator/Resources/translations/validators.ro.xlf | 4 ++++ .../Validator/Resources/translations/validators.ru.xlf | 4 ++++ .../Validator/Resources/translations/validators.sl.xlf | 4 ++++ .../Validator/Resources/translations/validators.sv.xlf | 4 ++++ .../Validator/Resources/translations/validators.tr.xlf | 4 ++++ .../Validator/Resources/translations/validators.uk.xlf | 4 ++++ .../Validator/Resources/translations/validators.zh_CN.xlf | 4 ++++ 24 files changed, 96 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf index a33eb8239153b..dc6f95ff130fa 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Невалиден бизнес идентификационен код (BIC). + + Error + Грешка + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf index 24061e5b1a014..4b966698f7769 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Tato hodnota není platný identifikační kód podniku (BIC). + + Error + Chyba + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf index 1630b50b45af3..3a545c80b6409 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf @@ -242,6 +242,10 @@ This value is not a valid ISSN. Værdien er ikke en gyldig ISSN. + + Error + Fejl + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 503a22930bcfb..3e44e1e284b8c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Dieser Wert ist kein gültiger BIC. + + Error + Fehler + This is not a valid UUID. Dies ist keine gültige UUID. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 693177d431d14..3d173846a54f1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). This is not a valid Business Identifier Code (BIC). + + Error + Error + This is not a valid UUID. This is not a valid UUID. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index d356d190e2bb1..25d5b8a5d33a7 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). No es un Código de Identificación Bancaria (BIC) válido. + + Error + Error + This is not a valid UUID. Este valor no es un UUID válido. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index 4ec25166910d6..d311dedb5e62e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar. + + Error + Errore + This is not a valid UUID. Balio hau ez da onartutako UUID bat. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf index 3f5a07e0921ae..e4390981dfda1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf @@ -222,6 +222,10 @@ Unsupported card type or invalid card number. Tätä korttityyppiä ei tueta tai korttinumero on virheellinen. + + Error + Virhe + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 7032ac9a7391a..382acb975ce66 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Ce n'est pas un code universel d'identification des banques (BIC) valide. + + Error + Erreur + This is not a valid UUID. Ceci n'est pas un UUID valide. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf index 1d0cc13c865c1..ecb7155cac892 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf @@ -310,6 +310,10 @@ This value does not match the expected {{ charset }} charset. A codificación de caracteres para este valor debería ser {{ charset }}. + + This is not a valid Business Identifier Code (BIC). + Non é un Código de Identificación Bancaria (BIC) válido. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index 8c62d899fdaec..126ef90332e30 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Ovo nije validan poslovni identifikacijski broj (BIC). + + Error + Greška + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index f495d09106978..1011d5481829b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT). + + Error + Hiba + This is not a valid UUID. Érvénytelen egyedi azonosító (UUID). diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index ee24b9ca4ac8d..f19544701d637 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Questo valore non è un codice BIC valido. + + Error + Errore + This is not a valid UUID. Questo non è un UUID valido. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf index 6bdb8142a33e2..60641b5e68dbd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf @@ -302,6 +302,10 @@ An empty file is not allowed. Failas negali būti tuščias. + + Error + Klaida + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index 954558ad223e1..413a97eb17c6f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -310,6 +310,10 @@ This is not a valid Business Identifier Code (BIC). Dit is geen geldige bedrijfsidentificatiecode (BIC/SWIFT). + + Error + Fout + This is not a valid UUID. Deze waarde is geen geldige UUID waarde. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index d364eba937e8d..f33274e6e6ce9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Ta wartość nie jest poprawnym kodem BIC (Business Identifier Code). + + Error + Błąd + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index d563c921cb90b..0561c048f512c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -302,6 +302,10 @@ An empty file is not allowed. Ficheiro vazio não é permitido. + + Error + Erro + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf index 27346a9f17718..63af47042b199 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Această valoare nu trebuie să fie identică cu {{ compared_value_type }} {{ compared_value }}. + + Error + Eroare + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf index 3ce5e6e9d4330..11bfead5e505c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf @@ -310,6 +310,10 @@ This value does not match the expected {{ charset }} charset. Значение не совпадает с ожидаемой {{ charset }} кодировкой. + + Error + Ошибка + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index 834db4015e8e4..6f5fd98ca192e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). To ni veljavna identifikacijska koda podjetja (BIC). + + Error + Napaka + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index 879c0a5c559d0..fa043ea23a309 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -314,6 +314,10 @@ This is not a valid Business Identifier Code (BIC). Detta är inte en giltig BIC-kod. + + Error + Fel + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf index a7906eaae25af..5e19e3e5a3c66 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf @@ -222,6 +222,10 @@ Unsupported card type or invalid card number. Desteklenmeyen kart tipi veya geçersiz kart numarası. + + Error + Hata + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index 3b1f28631b411..1a734710a63ba 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Значення не повинно бути ідентичним {{ compared_value_type }} {{ compared_value }}. + + Error + Помилка + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf index 6c95ef1a20dda..d4ed03ded1916 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf @@ -310,6 +310,10 @@ This value does not match the expected {{ charset }} charset. 该值不符合 {{ charset }} 编码。 + + Error + 错误 + From 6f97c893403a5c48cbd86e920a45e1b510ab5d9c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 11:02:31 +0200 Subject: [PATCH 101/107] updated CHANGELOG for 2.8.43 --- CHANGELOG-2.8.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index 7d381b890873c..4db4bfd7cb1e7 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,20 @@ in 2.8 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/v2.8.0...v2.8.1 +* 2.8.43 (2018-07-23) + + * bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto) + * bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls) + * bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche) + * bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm) + * bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr) + * bug #27904 [Filesystem] fix lock file permissions (fritzmg) + * bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn) + * bug #27831 Check for Hyper terminal on all operating systems. (azjezz) + * bug #27794 Add color support for Hyper terminal . (azjezz) + * bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas) + * bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas) + * 2.8.42 (2018-06-25) * bug #27669 [Filesystem] fix file lock on SunOS (fritzmg) From d74b11f8772b3b057b9f8994e47e3f3f07ad36ff Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 11:02:44 +0200 Subject: [PATCH 102/107] update CONTRIBUTORS for 2.8.43 --- CONTRIBUTORS.md | 64 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 21142e2bdea33..b6eef0b63198c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,8 +16,8 @@ Symfony is the result of the work of many people who made the code better - Robin Chalas (chalas_r) - Johannes S (johannes) - Jakub Zalas (jakubzalas) - - Kris Wallsmith (kriswallsmith) - Maxime Steinhausser (ogizanagi) + - Kris Wallsmith (kriswallsmith) - Ryan Weaver (weaverryan) - Javier Eguiluz (javier.eguiluz) - Grégoire Pineau (lyrixx) @@ -25,8 +25,8 @@ Symfony is the result of the work of many people who made the code better - Abdellatif Ait boudad (aitboudad) - Romain Neutron (romain) - Pascal Borreli (pborreli) - - Wouter De Jong (wouterj) - Roland Franssen (ro0) + - Wouter De Jong (wouterj) - Joseph Bielawski (stloyd) - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) @@ -39,8 +39,8 @@ Symfony is the result of the work of many people who made the code better - Jules Pietri (heah) - Eriksen Costa (eriksencosta) - Guilhem Niot (energetick) - - Sarah Khalil (saro0h) - Yonel Ceruto (yonelceruto) + - Sarah Khalil (saro0h) - Jonathan Wage (jwage) - Hamza Amrouche (simperfit) - Diego Saint Esteben (dosten) @@ -54,16 +54,16 @@ Symfony is the result of the work of many people who made the code better - Bulat Shakirzyanov (avalanche123) - Peter Rehm (rpet) - Matthias Pigulla (mpdude) + - Dany Maillard (maidmaid) - Saša Stamenković (umpirsky) - Kevin Bond (kbond) - Tobias Nyholm (tobias) - Pierre du Plessis (pierredup) - Henrik Bjørnskov (henrikbjorn) - - Dany Maillard (maidmaid) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) - - Konstantin Kudryashov (everzet) - Alexander M. Turek (derrabus) + - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Jérémy DERUSSÉ (jderusse) - Florin Patan (florinpatan) @@ -77,13 +77,13 @@ Symfony is the result of the work of many people who made the code better - Charles Sarrazin (csarrazi) - Konstantin Myakshin (koc) - Christian Raue + - David Maicher (dmaicher) - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - Issei Murasawa (issei_m) - Douglas Greenshields (shieldo) - - David Maicher (dmaicher) - Vladimir Reznichenko (kalessil) - Lee McDermott - Brandon Turner @@ -105,11 +105,12 @@ Symfony is the result of the work of many people who made the code better - Tim Nagel (merk) - Grégoire Paris (greg0ire) - Brice BERNARD (brikou) + - Valentin Udaltsov (vudaltsov) + - gadelat (gadelat) - Baptiste Clavié (talus) - marc.weistroff - lenar - Alexander Schwenn (xelaris) - - gadelat (gadelat) - Włodzimierz Gajda (gajdaw) - Peter Kokot (maastermedia) - Jacob Dreesen (jdreesen) @@ -123,7 +124,6 @@ Symfony is the result of the work of many people who made the code better - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - Eric GELOEN (gelo) - - Valentin Udaltsov (vudaltsov) - Lars Strojny (lstrojny) - Daniel Wehner (dawehner) - Tugdual Saunier (tucksaun) @@ -142,6 +142,7 @@ Symfony is the result of the work of many people who made the code better - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) + - Chris Wilkinson (thewilkybarkid) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - Pablo Godel (pgodel) @@ -154,7 +155,6 @@ Symfony is the result of the work of many people who made the code better - Teoh Han Hui (teohhanhui) - Mikael Pajunen - Joel Wurtz (brouznouf) - - Chris Wilkinson (thewilkybarkid) - Oleg Voronkovich - Vyacheslav Pavlov - Richard van Laak (rvanlaak) @@ -170,6 +170,7 @@ Symfony is the result of the work of many people who made the code better - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba + - Jannik Zschiesche (apfelbox) - GDIBass - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - James Halsall (jaitsu) @@ -204,7 +205,6 @@ Symfony is the result of the work of many people who made the code better - Matthieu Bontemps (mbontemps) - apetitpa - Pierre Minnieur (pminnieur) - - Jannik Zschiesche (apfelbox) - fivestar - Dominique Bongiraud - Jeremy Livingston (jeremylivingston) @@ -232,6 +232,7 @@ Symfony is the result of the work of many people who made the code better - Nikolay Labinskiy (e-moe) - Michaël Perrin (michael.perrin) - Marcel Beerta (mazen) + - Albert Casademont (acasademont) - Loïc Faugeron - Hidde Wieringa (hiddewie) - Marco Pivetta (ocramius) @@ -265,6 +266,7 @@ Symfony is the result of the work of many people who made the code better - Jordan Samouh (jordansamouh) - Baptiste Lafontaine (magnetik) - Jakub Kucharovic (jkucharovic) + - Edi Modrić (emodric) - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto @@ -276,7 +278,6 @@ Symfony is the result of the work of many people who made the code better - Tyson Andre - Chekote - Thomas Adam - - Albert Casademont (acasademont) - Viktor Bocharskyi (bocharsky_bw) - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) @@ -305,7 +306,6 @@ Symfony is the result of the work of many people who made the code better - Christian Schmidt - Maxime Veber (nek-) - MatTheCat - - Edi Modrić (emodric) - Chad Sikorra (chadsikorra) - Chris Smith (cs278) - Florian Klein (docteurklein) @@ -349,6 +349,7 @@ Symfony is the result of the work of many people who made the code better - Artur Melo (restless) - Matthew Lewinski (lewinski) - Magnus Nordlander (magnusnordlander) + - Thomas Royer (cydonia7) - alquerci - Francesco Levorato - Vitaliy Zakharov (zakharovvi) @@ -376,6 +377,7 @@ Symfony is the result of the work of many people who made the code better - ShinDarth - Stéphane PY (steph_py) - Philipp Kräutli (pkraeutli) + - Grzegorz (Greg) Zdanowski (kiler129) - Kirill chEbba Chebunin (chebba) - Greg Thornton (xdissent) - Gary PEGEOT (gary-p) @@ -429,13 +431,13 @@ Symfony is the result of the work of many people who made the code better - Christopher Davis (chrisguitarguy) - Jan Schumann - Niklas Fiekas + - Colin O'Dell (colinodell) - Markus Bachmann (baachi) - lancergr - Zan Baldwin - Mihai Stancu - Olivier Dolbeau (odolbeau) - Jan Rosier (rosier) - - Thomas Royer (cydonia7) - Arturs Vonda - Josip Kruslin - Asmir Mustafic (goetas) @@ -484,7 +486,6 @@ Symfony is the result of the work of many people who made the code better - Miroslav Sustek - Sullivan SENECHAL (soullivaneuh) - Pablo Díez (pablodip) - - Grzegorz (Greg) Zdanowski (kiler129) - Martin Hujer (martinhujer) - Kevin McBride - Sergio Santoro @@ -553,6 +554,7 @@ Symfony is the result of the work of many people who made the code better - Ned Schwartz - Ziumin - Jeremy Benoist + - fritzmg - Lenar Lõhmus - Sander Toonen (xatoo) - Benjamin Laugueux (yzalis) @@ -576,7 +578,6 @@ Symfony is the result of the work of many people who made the code better - Sebastian Blum - aubx - Marvin Butkereit - - Colin O'Dell (colinodell) - Ricky Su (ricky) - Gildas Quéméner (gquemener) - Charles-Henri Bruyand @@ -596,6 +597,7 @@ Symfony is the result of the work of many people who made the code better - Stefan Gehrig (sgehrig) - Hany el-Kerdany - Wang Jingyu + - Webnet team (webnet) - Åsmund Garfors - Gunnstein Lye (glye) - Maxime Douailin @@ -614,6 +616,7 @@ Symfony is the result of the work of many people who made the code better - David Fuhr - Kamil Kokot (pamil) - Max Grigorian (maxakawizard) + - DerManoMann - mcfedr (mcfedr) - Rostyslav Kinash - Maciej Malarz (malarzm) @@ -692,12 +695,15 @@ Symfony is the result of the work of many people who made the code better - Indra Gunawan (guind) - Peter Ward - Davide Borsatto (davide.borsatto) + - Rhodri Pugh (rodnaph) - Julien DIDIER (juliendidier) - Dominik Ritter (dritter) - Sebastian Grodzicki (sgrodzicki) - Jeroen van den Enden (stoefke) - Pascal Helfenstein + - Anthony GRASSIOT (antograssiot) - Baldur Rensch (brensch) + - Pierre Rineau - Vladyslav Petrovych - Alex Xandra Albert Sim - Craig Duncan (duncan3dc) @@ -729,6 +735,7 @@ Symfony is the result of the work of many people who made the code better - Joschi Kuphal - John Bohn (jbohn) - Marc Morera (mmoreram) + - Saif Eddin Gmati (azjezz) - Smaine Milianni (ismail1432) - Michael Moravec - Andrew Hilobok (hilobok) @@ -747,6 +754,7 @@ Symfony is the result of the work of many people who made the code better - Xavier Lacot (xavier) - possum - Denis Zunke (donalberto) + - Ahmadou Waly Ndiaye (waly) - Philipp Cordes - Ahmed TAILOULOUTE (ahmedtai) - Olivier Maisonneuve (olineuve) @@ -791,6 +799,7 @@ Symfony is the result of the work of many people who made the code better - Neil Ferreira - Nathanael Noblet (gnat) - Indra Gunawan (indragunawan) + - Julie Hourcade (juliehde) - Dmitry Parnas (parnas) - Paul LE CORRE - Emanuele Iannone @@ -902,10 +911,12 @@ Symfony is the result of the work of many people who made the code better - Michael Tibben - Billie Thompson - Sander Marechal + - Oleg Golovakhin (doc_tr) - Icode4Food (icode4food) - Radosław Benkel - jean pasqualini (darkilliant) - Ross Motley (rossmotley) + - Julien Fredon - ttomor - Mei Gwilym (meigwilym) - Michael H. Arieli (excelwebzone) @@ -913,7 +924,6 @@ Symfony is the result of the work of many people who made the code better - Fred Cox - Luciano Mammino (loige) - fabios - - Webnet team (webnet) - Sander Coolen (scoolen) - Nicolas Le Goff (nlegoff) - Ben Oman @@ -932,6 +942,7 @@ Symfony is the result of the work of many people who made the code better - dantleech - Bastien DURAND (deamon) - Xavier Leune + - Rudy Onfroy - Tero Alén (tero) - DerManoMann - Guillaume Royer @@ -970,6 +981,7 @@ Symfony is the result of the work of many people who made the code better - Behnoush norouzali (behnoush) - Max Beutel - Antanas Arvasevicius + - Pierre Dudoret - Thomas - Maximilian Berghoff (electricmaxxx) - nacho @@ -978,6 +990,7 @@ Symfony is the result of the work of many people who made the code better - Sergey Novikov (s12v) - Marcos Quesada (marcos_quesada) - Matthew Vickery (mattvick) + - Viktor Novikov (panzer_commander) - Paul Mitchum (paul-m) - Angel Koilov (po_taka) - Dan Finnie @@ -1012,7 +1025,6 @@ Symfony is the result of the work of many people who made the code better - Thanos Polymeneas (thanos) - Benoit Garret - Jakub Sacha - - DerManoMann - Olaf Klischat - orlovv - Jonathan Hedstrom @@ -1058,11 +1070,9 @@ Symfony is the result of the work of many people who made the code better - rchoquet - gitlost - Taras Girnyk - - Anthony GRASSIOT (antograssiot) - Eduardo García Sanz (coma) - James Gilliland - fduch (fduch) - - Rhodri Pugh (rodnaph) - David de Boer (ddeboer) - Ryan Rogers - Klaus Purer @@ -1076,6 +1086,7 @@ Symfony is the result of the work of many people who made the code better - Roger Webb - Dmitriy Simushev - Pawel Smolinski + - Oxan van Leeuwen - pkowalczyk - Max Voloshin (maxvoloshin) - Nicolas Fabre (nfabre) @@ -1126,6 +1137,7 @@ Symfony is the result of the work of many people who made the code better - ConneXNL - Aharon Perkel - matze + - Rubén Calvo (rubencm) - Abdul.Mohsen B. A. A - Benoît Burnichon - pthompson @@ -1149,6 +1161,7 @@ Symfony is the result of the work of many people who made the code better - Erika Heidi Reinaldo (erikaheidi) - Pierre Tachoire (krichprollsch) - Marc J. Schmidt (marcjs) + - Sebastian Schwarz - Marco Jantke - Saem Ghani - Clément LEFEBVRE @@ -1179,6 +1192,7 @@ Symfony is the result of the work of many people who made the code better - Mathieu TUDISCO (mathieutu) - markusu49 - Steve Frécinaux + - Constantine Shtompel - Jules Lamur - Renato Mendes Figueiredo - ShiraNai7 @@ -1220,7 +1234,6 @@ Symfony is the result of the work of many people who made the code better - Tadcka - Beth Binkovitz - Gonzalo Míguez - - Pierre Rineau - Romain Geissler - Adrien Moiruad - Tomaz Ahlin @@ -1292,6 +1305,7 @@ Symfony is the result of the work of many people who made the code better - karl.rixon - Konrad Mohrfeldt - Lance Chen + - Ciaran McNulty (ciaranmcnulty) - Andrew (drew) - kor3k kor3k (kor3k) - Stelian Mocanita (stelian) @@ -1303,6 +1317,7 @@ Symfony is the result of the work of many people who made the code better - Mephistofeles - Hoffmann András - Olivier + - Cyril PASCAL - pscheit - Wybren Koelmans - Zdeněk Drahoš @@ -1329,6 +1344,7 @@ Symfony is the result of the work of many people who made the code better - Artiom - Jakub Simon - Bouke Haarsma + - Evert Harmeling - Martin Eckhardt - natechicago - Jonathan Poston @@ -1355,6 +1371,7 @@ Symfony is the result of the work of many people who made the code better - Harold Iedema - Arnau González (arnaugm) - Simon Bouland (bouland) + - Ivan Nikolaev (destillat) - Matthew Foster (mfoster) - Paul Seiffert (seiffert) - Vasily Khayrulin (sirian) @@ -1502,7 +1519,6 @@ Symfony is the result of the work of many people who made the code better - Fritz Michael Gschwantner - Alexey Prilipko - Dmitriy Fedorenko - - fritzmg - vlakoff - bertillon - Bertalan Attila @@ -1528,10 +1544,12 @@ Symfony is the result of the work of many people who made the code better - Joel Marcey - David Christmann - root + - Vincent Chalnot - James Hudson - Tom Maguire - Richard Quadling - David Zuelke + - Adrian - Oleg Andreyev - Pierre Rineau - Maxim Lovchikov @@ -1554,6 +1572,7 @@ Symfony is the result of the work of many people who made the code better - Hein Zaw Htet™ - Ruben Kruiswijk - Cosmin-Romeo TANASE + - Julien Maulny - Michael J - Joseph Maarek - Alexander Menk @@ -1599,6 +1618,7 @@ Symfony is the result of the work of many people who made the code better - Kuba Werłos - Tomas Liubinas - Alex + - Jan Hort - Klaas Naaijkens - Daniel González Cerviño - Rafał @@ -1964,10 +1984,12 @@ Symfony is the result of the work of many people who made the code better - Mohamed Karnichi (amiral) - Andrew Carter (andrewcarteruk) - Adam Elsodaney (archfizz) + - Gregório Bonfante Borba (bonfante) - Daniel Kolvik (dkvk) - Marc Lemay (flug) - Henne Van Och (hennevo) - Jeroen De Dauw (jeroendedauw) + - Jonathan Scheiber (jmsche) - Daniel Alejandro Castro Arellano (lexcast) - Maxime COLIN (maximecolin) - Muharrem Demirci (mdemirci) From 78ef2a07400e5c4974e2a66a23fd14b452508ddf Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 11:02:45 +0200 Subject: [PATCH 103/107] updated VERSION for 2.8.43 --- 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 10ff79297b6b3..d97d56d20109c 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.43-DEV'; + const VERSION = '2.8.43'; const VERSION_ID = 20843; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 43; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From 8869b296b88eee54a86f84f4b9e031d717720120 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 23 Jul 2018 14:38:31 +0200 Subject: [PATCH 104/107] [TwigBridge][Form] fix tests by moving AbstractBootstrap* cases to the bridge --- .../Extension}/AbstractBootstrap3HorizontalLayoutTest.php | 2 +- .../Twig/Tests/Extension}/AbstractBootstrap3LayoutTest.php | 3 ++- .../Extension}/AbstractBootstrap4HorizontalLayoutTest.php | 2 +- .../Twig/Tests/Extension}/AbstractBootstrap4LayoutTest.php | 2 +- .../Extension/FormExtensionBootstrap3HorizontalLayoutTest.php | 1 - .../Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php | 1 - .../Extension/FormExtensionBootstrap4HorizontalLayoutTest.php | 1 - .../Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php | 1 - 8 files changed, 5 insertions(+), 8 deletions(-) rename src/Symfony/{Component/Form/Tests => Bridge/Twig/Tests/Extension}/AbstractBootstrap3HorizontalLayoutTest.php (99%) rename src/Symfony/{Component/Form/Tests => Bridge/Twig/Tests/Extension}/AbstractBootstrap3LayoutTest.php (99%) rename src/Symfony/{Component/Form/Tests => Bridge/Twig/Tests/Extension}/AbstractBootstrap4HorizontalLayoutTest.php (99%) rename src/Symfony/{Component/Form/Tests => Bridge/Twig/Tests/Extension}/AbstractBootstrap4LayoutTest.php (99%) diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap3HorizontalLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php similarity index 99% rename from src/Symfony/Component/Form/Tests/AbstractBootstrap3HorizontalLayoutTest.php rename to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php index 04b5b5836c650..97311b38a93f9 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap3HorizontalLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Form\Tests; +namespace Symfony\Bridge\Twig\Tests\Extension; abstract class AbstractBootstrap3HorizontalLayoutTest extends AbstractBootstrap3LayoutTest { diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php similarity index 99% rename from src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php rename to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php index 33de7b638fd68..5800e6fef19a8 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php @@ -9,9 +9,10 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Form\Tests; +namespace Symfony\Bridge\Twig\Tests\Extension; use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Tests\AbstractLayoutTest; abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest { diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php similarity index 99% rename from src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php rename to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php index b78c193c4f40d..9d216e38194f2 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Form\Tests; +namespace Symfony\Bridge\Twig\Tests\Extension; use Symfony\Component\Form\FormError; diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php similarity index 99% rename from src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php rename to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php index 15d7962379912..1d8c597920ce5 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Form\Tests; +namespace Symfony\Bridge\Twig\Tests\Extension; use Symfony\Component\Form\Extension\Core\Type\ButtonType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php index e5ee8903efe4a..309b2df80b16c 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php @@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; use Symfony\Component\Form\FormRenderer; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Tests\AbstractBootstrap3HorizontalLayoutTest; use Twig\Environment; class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3HorizontalLayoutTest diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php index d45ac367b1808..99002c6f1bbb8 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php @@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; use Symfony\Component\Form\FormRenderer; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Tests\AbstractBootstrap3LayoutTest; use Twig\Environment; class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php index 551d145acf4e5..1a563d76a26cc 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php @@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; use Symfony\Component\Form\FormRenderer; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Tests\AbstractBootstrap4HorizontalLayoutTest; use Twig\Environment; /** diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php index fdc4f3ebda5c0..d93bd3925feb2 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php @@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader; use Symfony\Component\Form\FormRenderer; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Tests\AbstractBootstrap4LayoutTest; use Twig\Environment; /** From 5fa1f12f3c57ead1858f6d3185187dcccdd53882 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 23 Jul 2018 14:58:27 +0200 Subject: [PATCH 105/107] [Form] fix truncating form views in data collector --- .../Form/Extension/DataCollector/FormDataCollector.php | 2 ++ .../Form/Extension/DataCollector/FormDataExtractor.php | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php index 448f7cb815dca..cd09530b1d03b 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php @@ -19,6 +19,7 @@ use Symfony\Component\Validator\ConstraintViolationInterface; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Component\VarDumper\Caster\StubCaster; use Symfony\Component\VarDumper\Cloner\Stub; /** @@ -262,6 +263,7 @@ protected function getCasters() Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())), ); }, + FormView::class => array(StubCaster::class, 'cutInternals'), ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) { return array( Caster::PREFIX_VIRTUAL.'root' => $v->getRoot(), diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php index d907aa270736d..490a4ad711b96 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php @@ -15,7 +15,6 @@ use Symfony\Component\Form\FormView; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; use Symfony\Component\Validator\ConstraintViolationInterface; -use Symfony\Component\VarDumper\Caster\CutStub; /** * Default implementation of {@link FormDataExtractorInterface}. @@ -156,10 +155,6 @@ public function extractViewVariables(FormView $view) ); foreach ($view->vars as $varName => $value) { - // Removing redundant variable from view variables - if ('form' === $varName) { - $value = new CutStub($value); - } $data['view_vars'][$varName] = $value; } From 52c642b1f45c12e61903999793203149f9ab536a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 19:16:16 +0200 Subject: [PATCH 106/107] updated CHANGELOG for 4.1.2 --- CHANGELOG-4.1.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CHANGELOG-4.1.md b/CHANGELOG-4.1.md index b09b994c5cd63..e7126dcf6d28c 100644 --- a/CHANGELOG-4.1.md +++ b/CHANGELOG-4.1.md @@ -7,6 +7,53 @@ in 4.1 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.1.0...v4.1.1 +* 4.1.2 (2018-07-23) + + * bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto) + * bug #28013 [Messenger] Add missing typehint on chain sender (sroze) + * bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls) + * bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito) + * bug #27827 [Serializer] Supports nested abstract items (sroze) + * bug #27958 [Form] Remaining changes for bootstrap 4 file fields (apfelbox) + * bug #27919 [Form] Improve rendering of `file` field in bootstrap 4 (apfelbox) + * bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche) + * bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm) + * bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr) + * bug #27913 [EventDispatcher] Clear orphaned events on reset (acasademont) + * bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot) + * bug #27918 [Console] correctly return parameter's default value on "--" (seschwar) + * bug #27826 [Serializer] Fix serialization of items with groups across entities and discrimination map (sroze) + * bug #27904 [Filesystem] fix lock file permissions (fritzmg) + * bug #27903 [Lock] fix lock file permissions (fritzmg) + * bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov) + * bug #27902 Fix the detection of the Process new argument (stof) + * bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas) + * bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas) + * bug #27435 [OptionResolver] resolve arrays (Doctrs) + * bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto) + * bug #27837 [PropertyInfo] Fix dock block lookup fallback loop (DerManoMann) + * bug #27848 [Workflow] Fixed BC break (lyrixx) + * bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn) + * bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde) + * bug #27820 [Messenger] Fix a bug when having more than one named handler per message subscriber (sroze) + * bug #27834 [DI] Don't show internal service id on binding errors (nicolas-grekas) + * bug #27831 Check for Hyper terminal on all operating systems. (azjezz) + * bug #27794 Add color support for Hyper terminal . (azjezz) + * bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas) + * bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan) + * bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid) + * bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel) + * bug #27773 [Serializer] Class discriminator and serialization groups (sroze) + * bug #27710 [DependencyInjection] fix handling of empty DI extension configs (xabbuh) + * bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas) + * bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher) + * bug #27727 [Routing] Disallow object usage inside Route (paxal) + * bug #27736 [Routing] fix too much greediness in host-matching regex (nicolas-grekas) + * bug #27747 [HttpFoundation] fix registration of session proxies (nicolas-grekas) + * bug #27754 [HttpFoundation] missing namespace for RedisProxy (Bonfante) + * bug #27722 Redesign the Debug error page in prod (javiereguiluz) + * bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas) + * 4.1.1 (2018-06-25) * bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid) From 971445977fb4fbee52b18a9afcfec6ad7a78ce83 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 19:16:22 +0200 Subject: [PATCH 107/107] updated VERSION for 4.1.2 --- 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 05f068673e351..f536bd0b30399 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -63,12 +63,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.1.2-DEV'; + const VERSION = '4.1.2'; const VERSION_ID = 40102; const MAJOR_VERSION = 4; const MINOR_VERSION = 1; const RELEASE_VERSION = 2; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2019'; const END_OF_LIFE = '07/2019';