From 2420b67660ffafe0a6ea03dfb71f0ec6ec47a5be Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Sun, 6 Dec 2020 14:00:57 +0100 Subject: [PATCH 01/64] [FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler --- src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php index 0dc2860229bdf..524b8ded2d48e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php @@ -119,6 +119,7 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new RegisterControllerArgumentLocatorsPass()); $container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING); $container->addCompilerPass(new RoutingResolverPass()); + $container->addCompilerPass(new DataCollectorTranslatorPass()); $container->addCompilerPass(new ProfilerPass()); // must be registered before removing private services as some might be listeners/subscribers // but as late as possible to get resolved parameters @@ -139,7 +140,6 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new FragmentRendererPass()); $this->addCompilerPassIfExists($container, SerializerPass::class); $this->addCompilerPassIfExists($container, PropertyInfoPass::class); - $container->addCompilerPass(new DataCollectorTranslatorPass()); $container->addCompilerPass(new ControllerArgumentValueResolverPass()); $container->addCompilerPass(new CachePoolPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 32); $container->addCompilerPass(new CachePoolClearerPass(), PassConfig::TYPE_AFTER_REMOVING); From 9070047c4c4b0eb9adb3d656326da01871d78c1f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 14 Jul 2021 15:13:19 +0200 Subject: [PATCH 02/64] [PropertyInfo] Support for intersection types Signed-off-by: Alexander M. Turek --- psalm.xml | 9 +++++++++ .../PropertyInfo/Extractor/ReflectionExtractor.php | 4 ++-- .../Tests/Extractor/ReflectionExtractorTest.php | 13 +++++++++++-- .../PropertyInfo/Tests/Fixtures/Php81Dummy.php | 4 ++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/psalm.xml b/psalm.xml index 3f12f1331c272..eefa7b1dabbc2 100644 --- a/psalm.xml +++ b/psalm.xml @@ -17,4 +17,13 @@ + + + + + + + + + diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index 0af4b9bf1bb36..be22f95855b9e 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -333,8 +333,8 @@ private function extractFromReflectionType(\ReflectionType $reflectionType, \Ref $types = []; $nullable = $reflectionType->allowsNull(); - foreach ($reflectionType instanceof \ReflectionUnionType ? $reflectionType->getTypes() : [$reflectionType] as $type) { - $phpTypeOrClass = $reflectionType instanceof \ReflectionNamedType ? $reflectionType->getName() : (string) $type; + foreach (($reflectionType instanceof \ReflectionUnionType || $reflectionType instanceof \ReflectionIntersectionType) ? $reflectionType->getTypes() : [$reflectionType] as $type) { + $phpTypeOrClass = $type->getName(); if ('null' === $phpTypeOrClass || 'mixed' === $phpTypeOrClass || 'never' === $phpTypeOrClass) { continue; } diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php index 95e1ca5cda118..2f2449cd1112d 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php @@ -256,11 +256,20 @@ public function php80TypesProvider() } /** + * @dataProvider php81TypesProvider * @requires PHP 8.1 */ - public function testExtractPhp81Type() + public function testExtractPhp81Type($property, array $type = null) { - $this->assertNull($this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php81Dummy', 'nothing', [])); + $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php81Dummy', $property, [])); + } + + public function php81TypesProvider() + { + return [ + ['nothing', null], + ['collection', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Traversable'), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Countable')]], + ]; } /** diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php index b4e896a434524..1300c3e695f1f 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php @@ -8,4 +8,8 @@ public function getNothing(): never { throw new \Exception('Oops'); } + + public function getCollection(): \Traversable&\Countable + { + } } From 1a13f06989808373627fdace709a69e1eac87cbc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Aug 2021 14:27:11 +0200 Subject: [PATCH 03/64] Update CHANGELOG for 4.4.30 --- CHANGELOG-4.4.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG-4.4.md b/CHANGELOG-4.4.md index 40d08340ad617..2067112f91c93 100644 --- a/CHANGELOG-4.4.md +++ b/CHANGELOG-4.4.md @@ -7,6 +7,24 @@ in 4.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.4.0...v4.4.1 +* 4.4.30 (2021-08-30) + + * bug #42753 Cast ini_get to an integer to match expected type (natewiebe13) + * bug #42345 [Messenger] Remove indices in messenger table on MySQL to prevent deadlocks while removing messages when running multiple consumers (jeroennoten) + * bug #40744 allow null for framework.translator.default_path (SimonHeimberg) + * bug #39856 [DomCrawler] improve failure messages of the CrawlerSelectorTextContains constraint (xabbuh) + * bug #40545 [HttpFoundation] Fix isNotModified determination logic (ol0lll) + * bug #42368 [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values (herndlm) + * bug #41684 Fix Url Validator false positives (sidz) + * bug #42576 [Translation] Reverse fallback locales (ro0NL) + * bug #42628 [PropertyInfo] Support for the `never` return type (derrabus) + * bug #42585 [ExpressionLanguage] [Lexer] Remove PHP 8.0 polyfill (nigelmann) + * bug #42621 [Security] Don't produce TypeErrors for non-string CSRF tokens (derrabus) + * bug #42365 [Cache] Do not add namespace argument to `NullAdapter` in `CachePoolPass` (olsavmic) + * bug #42331 [HttpKernel] always close open stopwatch section after handling `kernel.request` events (xabbuh) + * bug #42260 Fix return types for PHP 8.1 (derrabus) + * bug #42341 [Validator] Update MIR card scheme (ossinkine) + * 4.4.29 (2021-07-29) * bug #42307 [Mailer] Fixed decode exception when sendgrid response is 202 (rubanooo) From 0c6f25fc3ae70762c3efe3921a56d883790958ec Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Aug 2021 14:27:17 +0200 Subject: [PATCH 04/64] Update CONTRIBUTORS for 4.4.30 --- CONTRIBUTORS.md | 93 +++++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5c9b27862671f..f804602f54457 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,10 +12,10 @@ The Symfony Connect username in parenthesis allows to get more information - Tobias Schultze (tobion) - Robin Chalas (chalas_r) - Christophe Coevoet (stof) + - Wouter De Jong (wouterj) - Jérémy DERUSSÉ (jderusse) - Maxime Steinhausser (ogizanagi) - Kévin Dunglas (dunglas) - - Wouter De Jong (wouterj) - Grégoire Pineau (lyrixx) - Jordi Boggiano (seldaek) - Victor Berchet (victor) @@ -48,11 +48,11 @@ The Symfony Connect username in parenthesis allows to get more information - Eriksen Costa (eriksencosta) - Ener-Getick (energetick) - Sarah Khalil (saro0h) - - Pierre du Plessis (pierredup) - Kevin Bond (kbond) + - Pierre du Plessis (pierredup) + - Valentin Udaltsov (vudaltsov) - Iltar van der Berg (kjarli) - Jonathan Wage (jwage) - - Valentin Udaltsov (vudaltsov) - Matthias Pigulla (mpdude) - Vasilij Duško (staff) - Diego Saint Esteben (dosten) @@ -91,6 +91,7 @@ The Symfony Connect username in parenthesis allows to get more information - Issei Murasawa (issei_m) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) + - Antoine M (amakdessi) - Vasilij Dusko - Douglas Greenshields (shieldo) - Graham Campbell (graham) @@ -99,7 +100,6 @@ The Symfony Connect username in parenthesis allows to get more information - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - - Antoine M (amakdessi) - Fran Moreno (franmomu) - Dariusz Ruminski - Jérôme Vasseur (jvasseur) @@ -112,26 +112,27 @@ The Symfony Connect username in parenthesis allows to get more information - Bart van den Burg (burgov) - Jordan Alliot (jalliot) - John Wards (johnwards) + - Alexander Schranz (alexander-schranz) - Baptiste Clavié (talus) - Antoine Hérault (herzult) - Paráda József (paradajozsef) - - Alexander Schranz (alexander-schranz) - Arnaud Le Blanc (arnaud-lb) - Przemysław Bogusz (przemyslaw-bogusz) + - Vincent Langlet (deviling) - Maxime STEINHAUSSER + - Tomas Norkūnas (norkunas) - Michal Piotrowski (eventhorizon) - Tomáš Votruba (tomas_votruba) - Massimiliano Arione (garak) - Mathias Arlaud (mtarld) - Tim Nagel (merk) - - Vincent Langlet (deviling) - Chris Wilkinson (thewilkybarkid) - - Tomas Norkūnas (norkunas) - Peter Kokot (maastermedia) - Lars Strojny (lstrojny) - Brice BERNARD (brikou) - Ahmed TAILOULOUTE (ahmedtai) - Gregor Harlan (gharlan) + - HypeMC (hypemc) - marc.weistroff - lenar - Alexander Schwenn (xelaris) @@ -144,29 +145,29 @@ The Symfony Connect username in parenthesis allows to get more information - Jacob Dreesen (jdreesen) - Malte Schlüter (maltemaltesich) - Joel Wurtz (brouznouf) + - Théo FIDRY (theofidry) - Florian Voutzinos (florianv) - Teoh Han Hui (teohhanhui) - Colin Frei - Javier Spagnoletti (phansys) - Joshua Thijssen - - HypeMC (hypemc) - Daniel Wehner (dawehner) - Tugdual Saunier (tucksaun) - excelwebzone - Gordon Franke (gimler) - Saif Eddin Gmati (azjezz) + - Alexandre Daubois (alexandre-daubois) - Jesse Rushlow (geeshoe) - Fabien Pennequin (fabienpennequin) - - Théo FIDRY (theofidry) - Olivier Dolbeau (odolbeau) - - Alexandre Daubois (alexandre-daubois) + - Smaine Milianni (ismail1432) + - Richard van Laak (rvanlaak) - Eric GELOEN (gelo) - Matthieu Napoli (mnapoli) - Jannik Zschiesche (apfelbox) - Mathieu Santostefano (welcomattic) - Robert Schönthal (digitalkaoz) - Florian Lonqueu-Brochard (florianlb) - - Richard van Laak (rvanlaak) - Tigran Azatyan (tigranazatyan) - YaFou - Gary PEGEOT (gary-p) @@ -183,10 +184,10 @@ The Symfony Connect username in parenthesis allows to get more information - Hidenori Goto (hidenorigoto) - Jan Rosier (rosier) - Alessandro Chitolina (alekitto) + - Ruud Kamphuis (ruudk) - Albert Casademont (acasademont) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - - Smaine Milianni (ismail1432) - SpacePossum - Pablo Godel (pgodel) - Andreas Braun @@ -194,7 +195,6 @@ The Symfony Connect username in parenthesis allows to get more information - François-Xavier de Guillebon (de-gui_f) - Oleg Voronkovich - hacfi (hifi) - - Ruud Kamphuis (ruudk) - Rafael Dohms (rdohms) - George Mponos (gmponos) - jwdeitch @@ -215,6 +215,7 @@ The Symfony Connect username in parenthesis allows to get more information - Timo Bakx (timobakx) - Marco Pivetta (ocramius) - Vincent Touzet (vincenttouzet) + - Nate Wiebe (natewiebe13) - Rouven Weßling (realityking) - Jérôme Parmentier (lctrs) - Ben Davies (bendavies) @@ -248,6 +249,7 @@ The Symfony Connect username in parenthesis allows to get more information - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - Mathieu Lechat (mat_the_cat) + - Jeroen Noten (jeroennoten) - Marek Štípek (maryo) - Daniel Espendiller - Possum @@ -263,7 +265,6 @@ The Symfony Connect username in parenthesis allows to get more information - Hidde Wieringa (hiddewie) - Antonio Pauletich (x-coder264) - Andre Rømcke (andrerom) - - Nate Wiebe (natewiebe13) - Philippe Segatori - Thibaut Cheymol (tcheymol) - Sebastien Morel (plopix) @@ -287,10 +288,10 @@ The Symfony Connect username in parenthesis allows to get more information - François Pluchino (francoispluchino) - Rokas Mikalkėnas (rokasm) - bronze1man - - Jeroen Noten (jeroennoten) - sun (sun) - Larry Garfield (crell) - Edi Modrić (emodric) + - Gocha Ossinkine (ossinkine) - Roman Martinuk (a2a4) - Leo Feyer (leofeyer) - Nikolay Labinskiy (e-moe) @@ -314,8 +315,10 @@ The Symfony Connect username in parenthesis allows to get more information - Dustin Whittle (dustinwhittle) - jeff - John Kary (johnkary) + - zairig imad (zairigimad) - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) + - Maciej Malarz (malarzm) - Michele Orselli (orso) - Sven Paulus (subsven) - Daniel STANCU @@ -330,7 +333,6 @@ The Symfony Connect username in parenthesis allows to get more information - Bohan Yang (brentybh) - Pascal Montoya - Julien Brochet (mewt) - - Gocha Ossinkine (ossinkine) - Tristan Darricau (nicofuma) - Victor Bocharsky (bocharsky_bw) - Bozhidar Hristov (warxcell) @@ -360,12 +362,10 @@ The Symfony Connect username in parenthesis allows to get more information - Manuel Reinhard (sprain) - Harm van Tilborg (hvt) - Danny Berger (dpb587) - - zairig imad (zairigimad) - Antonio J. García Lagar (ajgarlag) - Adam Prager (padam87) - Judicaël RUFFIEUX (axanagor) - Benoît Burnichon (bburnichon) - - Maciej Malarz (malarzm) - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) - Mickaël Andrieu (mickaelandrieu) @@ -400,6 +400,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bob den Otter (bopp) - Thomas Schulz (king2500) - Frank de Jonge (frenkynet) + - Artem Henvald (artemgenvald) - Lescot Edouard (idetox) - Nikita Konstantinov - Wodor Wodorski @@ -422,10 +423,12 @@ The Symfony Connect username in parenthesis allows to get more information - Roumen Damianoff (roumen) - Kim Hemsø Rasmussen (kimhemsoe) - Oleg Andreyev + - Martin Herndl (herndlm) - Pavel Kirpitsov (pavel-kirpichyov) - Pascal Luna (skalpa) - Wouter Van Hecke - Iker Ibarguren (ikerib) + - Bob van de Vijver (bobvandevijver) - Peter Kruithof (pkruithof) - Michael Holm (hollo) - Sylvain Fabre (sylfabre) @@ -437,6 +440,7 @@ The Symfony Connect username in parenthesis allows to get more information - Gonzalo Vilaseca (gonzalovilaseca) - Ben Hakim - Haralan Dobrev (hkdobrev) + - Marco Petersen (ocrampete16) - MatTheCat - Vilius Grigaliūnas - David Badura (davidbadura) @@ -493,7 +497,6 @@ The Symfony Connect username in parenthesis allows to get more information - Oleksandr Barabolia (oleksandrbarabolia) - Christopher Davis (chrisguitarguy) - ivan - - Artem Henvald (artemgenvald) - Greg Anderson - Tri Pham (phamuyentri) - BoShurik @@ -519,15 +522,14 @@ The Symfony Connect username in parenthesis allows to get more information - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Dmytro Borysovskyi (dmytr0) - - Bob van de Vijver (bobvandevijver) - Tomasz Kowalczyk (thunderer) - Artur Eshenbrener + - Soner Sayakci - Thomas Perez (scullwm) - Felix Labrecque - Yaroslav Kiliba - Terje Bråten - Renan Gonçalves (renan_saddam) - - Marco Petersen (ocrampete16) - Tarmo Leppänen (tarlepp) - Martin Auswöger - Robbert Klarenbeek (robbertkl) @@ -536,6 +538,7 @@ The Symfony Connect username in parenthesis allows to get more information - JhonnyL - hossein zolfi (ocean) - Clément Gautier (clementgautier) + - Koen Reiniers (koenre) - Dāvis Zālītis (k0d3r1s) - Sanpi - Eduardo Gulias (egulias) @@ -617,6 +620,7 @@ The Symfony Connect username in parenthesis allows to get more information - Valentin Jonovs (valentins-jonovs) - Bastien DURAND (deamon) - Jeanmonod David (jeanmonod) + - Christin Gruber (christingruber) - Andrey Sevastianov - Webnet team (webnet) - Urinbayev Shakhobiddin (shokhaa) @@ -666,6 +670,7 @@ The Symfony Connect username in parenthesis allows to get more information - Andrew M-Y (andr) - Krasimir Bosilkov (kbosilkov) - Marcin Michalski (marcinmichalski) + - Yoann RENARD (yrenard) - Vitaliy Tverdokhlib (vitaliytv) - Ariel Ferrandini (aferrandini) - Niklas Keller @@ -676,7 +681,6 @@ The Symfony Connect username in parenthesis allows to get more information - Tim Goudriaan (codedmonkey) - Jonas Flodén (flojon) - AnneKir - - Soner Sayakci - Tobias Weichart - Miro Michalicka - Marcin Sikoń (marphi) @@ -692,7 +696,6 @@ The Symfony Connect username in parenthesis allows to get more information - Christian Wahler - Giso Stallenberg (gisostallenberg) - Gintautas Miselis - - Koen Reiniers (koenre) - Rob Bast - Roberto Espinoza (respinoza) - Pierre Rineau @@ -725,10 +728,13 @@ The Symfony Connect username in parenthesis allows to get more information - Jan van Thoor (janvt) - Gladhon - Joshua Nye + - Martin Kirilov (wucdbm) - Nathan Dench (ndenc2) + - Thibault Richard (t-richard) - Sebastian Bergmann - Miroslav Sustek - Pablo Díez (pablodip) + - SiD (plbsid) - Michel Roca (mroca) - Piotr Kugla (piku235) - Kevin McBride @@ -777,8 +783,10 @@ The Symfony Connect username in parenthesis allows to get more information - Norbert Orzechowicz (norzechowicz) - Denis Charrier (brucewouaigne) - Matthijs van den Bos (matthijs) + - Simon Podlipsky (simpod) - DemigodCode - Jaik Dean (jaikdean) + - Pavel Popov (metaer) - Lenard Palko - arai - Nils Adermann (naderman) @@ -824,6 +832,7 @@ The Symfony Connect username in parenthesis allows to get more information - Jeremy Benoist - Lenar Lõhmus - Daniël Brekelmans (dbrekelmans) + - Simon Heimberg (simon_heimberg) - Benjamin Laugueux (yzalis) - Zach Badgett (zachbadgett) - Aurélien Fredouelle @@ -860,7 +869,6 @@ The Symfony Connect username in parenthesis allows to get more information - Jules Matsounga (hyoa) - Quentin Dequippe (qdequippe) - khoptynskyi - - Christin Gruber (christingruber) - Jean-Christophe Cuvelier [Artack] - julien57 - Julien Montel (julienmgel) @@ -914,6 +922,7 @@ The Symfony Connect username in parenthesis allows to get more information - Nahuel Cuesta (ncuesta) - Chris Boden (cboden) - Christophe Villeger (seragan) + - Hendrik Luup - Julien Fredon - Jacek Wilczyński (jacekwilczynski) - Xavier Leune (xleune) @@ -954,7 +963,6 @@ The Symfony Connect username in parenthesis allows to get more information - Mardari Dorel (dorumd) - Daisuke Ohata - Vincent Simonin - - Yoann RENARD (yrenard) - Alex Bogomazov (alebo) - maxime.steinhausser - Claus Due (namelesscoder) @@ -987,7 +995,6 @@ The Symfony Connect username in parenthesis allows to get more information - rtek - Benjamin Dos Santos - Jérémy Jarrié (gagnar) - - Martin Herndl (herndlm) - Tomas Javaisis - Ivan Grigoriev - Johann Saunier (prophet777) @@ -1058,7 +1065,6 @@ The Symfony Connect username in parenthesis allows to get more information - mohammadreza honarkhah - develop - flip111 - - Thibault Richard (t-richard) - VJ - RJ Garcia - Adam Wójs (awojs) @@ -1081,7 +1087,6 @@ The Symfony Connect username in parenthesis allows to get more information - Andrea Sprega (asprega) - Alexander Volochnev (exelenz) - Viktor Bajraktar (njutn95) - - SiD (plbsid) - Mbechezi Nawo - Michael Piecko - Toni Peric (tperic) @@ -1144,7 +1149,6 @@ The Symfony Connect username in parenthesis allows to get more information - michaelwilliams - Romain - Matěj Humpál - - Martin Kirilov - Pierre Grimaud (pgrimaud) - Alexandre Parent - 1emming @@ -1182,6 +1186,7 @@ The Symfony Connect username in parenthesis allows to get more information - Krzysiek Łabuś - Juraj Surman - Camille Dejoye + - Fabien S (bafs) - 1ma (jautenim) - Douglas Hammond (wizhippo) - Xavier Lacot (xavier) @@ -1204,7 +1209,6 @@ The Symfony Connect username in parenthesis allows to get more information - roromix - Dmitry Pigin (dotty) - Vincent Composieux (eko) - - Simon Podlipsky (simpod) - Jayson Xu (superjavason) - Hubert Lenoir (hubert_lenoir) - fago @@ -1248,6 +1252,7 @@ The Symfony Connect username in parenthesis allows to get more information - Aleksandar Jakovljevic (ajakov) - Laurent Bassin (lbassin) - Hamza Makraz (makraz) + - Tomasz Ignatiuk - andrey1s - Abhoryo - Fabian Vogler (fabian) @@ -1269,11 +1274,13 @@ The Symfony Connect username in parenthesis allows to get more information - Tony Malzhacker - Pchol - Mathieu MARCHOIS + - W0rma - Cyril Quintin (cyqui) - Cyrille Bourgois (cyrilleb) - Gerard van Helden (drm) - Johnny Peck (johnnypeck) - Marcos Rezende (rezehnde) + - Roman Anasal - Ivan Menshykov - David Romaní - Patrick Allaert @@ -1344,7 +1351,6 @@ The Symfony Connect username in parenthesis allows to get more information - Harry Walter (haswalt) - Johnson Page (jwpage) - Ruben Gonzalez (rubenruateltek) - - Simon Heimberg (simon_heimberg) - Michael Roterman (wtfzdotnet) - Arno Geurts - Adán Lobato (adanlobato) @@ -1412,6 +1418,7 @@ The Symfony Connect username in parenthesis allows to get more information - Antoine Bluchet (soyuka) - Patrick Kaufmann - Anton Dyshkant + - Paul Oms - Reece Fowell (reecefowell) - stefan.r - Guillaume Gammelin @@ -1558,6 +1565,7 @@ The Symfony Connect username in parenthesis allows to get more information - Maximilian Berghoff (electricmaxxx) - nacho - Piotr Antosik (antek88) + - Volker Killesreiter (ol0lll) - Vedran Mihočinec (v-m-i) - Sergey Novikov (s12v) - creiner @@ -1677,6 +1685,7 @@ The Symfony Connect username in parenthesis allows to get more information - rchoquet - gitlost - Taras Girnyk + - Dmitry Derepko - Jan Vernarsky - Amine Yakoubi - Eduardo García Sanz (coma) @@ -1686,7 +1695,9 @@ The Symfony Connect username in parenthesis allows to get more information - James Gilliland - fduch (fduch) - Juan Miguel Besada Vidal (soutlink) + - dlorek - Stuart Fyfe + - Carl Casbolt (carlcasbolt) - David de Boer (ddeboer) - Eno Mullaraj (emullaraj) - Nathan PAGE (nathix) @@ -1695,6 +1706,7 @@ The Symfony Connect username in parenthesis allows to get more information - arnaud (arnooo999) - Gilles Doge (gido) - Oscar Esteve (oesteve) + - Peter Potrowl - abulford - Philipp Kretzschmar - antograssiot @@ -1762,10 +1774,12 @@ The Symfony Connect username in parenthesis allows to get more information - Christian Rishøj - Patrick Berenschot - SuRiKmAn + - rtek - Jelte Steijaert (jelte) - David Négrier (moufmouf) - Quique Porta (quiqueporta) - Artem Oliynyk (artemoliynyk) + - Ben Roberts (benr77) - Andrea Quintino (dirk39) - Tomasz Szymczyk (karion) - Alex Vasilchenko @@ -1896,7 +1910,6 @@ The Symfony Connect username in parenthesis allows to get more information - Luis Galeas - Bogdan Scordaliu - Martin Pärtel - - Fabien S (bafs) - Daniel Rotter (danrot) - Frédéric Bouchery (fbouchery) - kylekatarnls (kylekatarnls) @@ -1921,6 +1934,7 @@ The Symfony Connect username in parenthesis allows to get more information - Guillaume BRETOU (guiguiboy) - Nikita Popov (nikic) - Carsten Nielsen (phreaknerd) + - Michael Olšavský - Jay Severson - Benny Born - Emirald Mateli @@ -2049,6 +2063,7 @@ The Symfony Connect username in parenthesis allows to get more information - Antonio Peric-Mazar (antonioperic) - César Suárez (csuarez) - Bjorn Twachtmann (dotbjorn) + - Wahyu Kristianto (kristories) - Tobias Genberg (lorceroth) - Nicolas Badey (nico-b) - Shane Preece (shane) @@ -2112,6 +2127,7 @@ The Symfony Connect username in parenthesis allows to get more information - Joni Halme - Matt Farmer - catch + - aetxebeste - siganushka - Alexandre Segura - Josef Cech @@ -2192,6 +2208,7 @@ The Symfony Connect username in parenthesis allows to get more information - David Stone - jjanvier - Julius Beckmann + - Ruben Jansen - shreypuranik - loru88 - Thibaut Salanon @@ -2261,6 +2278,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alessio Baglio (ioalessio) - Johannes Müller (johmue) - Jordi Llonch (jordillonch) + - Jordi Sala Morales (jsala) - Mouad ZIANI (mouadziani) - Nicholas Ruunu (nicholasruunu) - Jeroen van den Nieuwenhuisen (nieuwenhuisen) @@ -2275,8 +2293,8 @@ The Symfony Connect username in parenthesis allows to get more information - alex - Nicole Cordes - Nicolas PHILIPPE - - Roman Anasal - Roman Orlov + - Simon Ackermann - VolCh - Alexey Popkov - Gijs Kunze @@ -2437,6 +2455,7 @@ The Symfony Connect username in parenthesis allows to get more information - Filipe Guerra - Jean Ragouin - Gerben Wijnja + - Emre YILMAZ - Rowan Manning - Per Modin - David Windell @@ -2521,6 +2540,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bart Reunes (metalarend) - Muriel (metalmumu) - Michael Pohlers (mick_the_big) + - Misha Klomp (mishaklomp) - mlpo (mlpo) - Marek Šimeček (mssimi) - Dmitriy Tkachenko (neka) @@ -2598,6 +2618,7 @@ The Symfony Connect username in parenthesis allows to get more information - temperatur - misterx - Cas + - Vincent Godé - Dusan Kasan - Michael Steininger - Nardberjean @@ -2628,6 +2649,7 @@ The Symfony Connect username in parenthesis allows to get more information - Michel Bardelmeijer - Tomas Kmieliauskas - Ikko Ashimine + - Brad Jones - Billie Thompson - lol768 - jamogon @@ -2681,6 +2703,7 @@ The Symfony Connect username in parenthesis allows to get more information - James Michael DuPont - Kasperki - Tammy D + - Rodolfo Ruiz - Enrico - Ryan Rud - Ondrej Slinták @@ -2701,6 +2724,7 @@ The Symfony Connect username in parenthesis allows to get more information - Markus Staab - Pierre-Louis LAUNAY - djama + - Benjamin Rosenberger - Vladyslav Startsev - Michael Gwynne - Eduardo Conceição @@ -2717,6 +2741,7 @@ The Symfony Connect username in parenthesis allows to get more information - nsbx - Shude - Richard Hodgson + - Sven Fabricius - Ondřej Führer - Sema - Thorsten Hallwas @@ -2760,6 +2785,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sam Anthony - Christian Stocker - Oussama Elgoumri + - Steve Marvell - Dawid Nowak - Lesnykh Ilia - sabruss @@ -2823,6 +2849,7 @@ The Symfony Connect username in parenthesis allows to get more information - Gerry Vandermaesen (gerryvdm) - Ghazy Ben Ahmed (ghazy) - Arash Tabriziyan (ghost098) + - Greg Szczotka (greg606) - ibasaw (ibasaw) - Vladislav Krupenkin (ideea) - Ilija Tovilo (ilijatovilo) From f8c1100c276ebb40faaf9f683b7c05c05df51a12 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Aug 2021 14:27:20 +0200 Subject: [PATCH 05/64] Update VERSION for 4.4.30 --- 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 7956190d279d6..6c816aaf63d63 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.30-DEV'; + public const VERSION = '4.4.30'; public const VERSION_ID = 40430; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 30; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From 11fc285362527cb8838ad92a81a648c69d0aeb89 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Aug 2021 14:32:54 +0200 Subject: [PATCH 06/64] Bump Symfony version to 4.4.31 --- 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 6c816aaf63d63..8ce7e145921f4 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.30'; - public const VERSION_ID = 40430; + public const VERSION = '4.4.31-DEV'; + public const VERSION_ID = 40431; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 30; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 31; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From e2cc89030dc7970f3f2fcfb27262548b3380a53d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Aug 2021 14:41:40 +0200 Subject: [PATCH 07/64] Bump Symfony version to 5.3.8 --- 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 21e7e8543254b..631d2a89ffcdd 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -75,12 +75,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '5.3.7'; - public const VERSION_ID = 50307; + public const VERSION = '5.3.8-DEV'; + public const VERSION_ID = 50308; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 3; - public const RELEASE_VERSION = 7; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 8; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2022'; public const END_OF_LIFE = '01/2022'; From 2db2c009438cfd22f729dcd67248eda52408d606 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 29 Aug 2021 21:59:18 +0200 Subject: [PATCH 08/64] [VarExporter] Suppress deprecations for legacy fixtures Signed-off-by: Alexander M. Turek --- .../Tests/Fixtures/FooSerializable.php | 37 +++++++++++ .../Tests/Fixtures/MySerializable.php | 25 +++++++ .../Tests/Fixtures/foo-serializable.php | 2 +- .../Tests/Fixtures/serializable.php | 2 +- .../VarExporter/Tests/VarExporterTest.php | 65 +++++++------------ 5 files changed, 87 insertions(+), 44 deletions(-) create mode 100644 src/Symfony/Component/VarExporter/Tests/Fixtures/FooSerializable.php create mode 100644 src/Symfony/Component/VarExporter/Tests/Fixtures/MySerializable.php diff --git a/src/Symfony/Component/VarExporter/Tests/Fixtures/FooSerializable.php b/src/Symfony/Component/VarExporter/Tests/Fixtures/FooSerializable.php new file mode 100644 index 0000000000000..63d9fd230c790 --- /dev/null +++ b/src/Symfony/Component/VarExporter/Tests/Fixtures/FooSerializable.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarExporter\Tests\Fixtures; + +class FooSerializable implements \Serializable +{ + private $foo; + + public function __construct(string $foo) + { + $this->foo = $foo; + } + + public function getFoo(): string + { + return $this->foo; + } + + public function serialize(): string + { + return serialize([$this->getFoo()]); + } + + public function unserialize($str) + { + [$this->foo] = unserialize($str); + } +} diff --git a/src/Symfony/Component/VarExporter/Tests/Fixtures/MySerializable.php b/src/Symfony/Component/VarExporter/Tests/Fixtures/MySerializable.php new file mode 100644 index 0000000000000..8d649a22a944d --- /dev/null +++ b/src/Symfony/Component/VarExporter/Tests/Fixtures/MySerializable.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarExporter\Tests\Fixtures; + +class MySerializable implements \Serializable +{ + public function serialize(): string + { + return '123'; + } + + public function unserialize($data): void + { + // no-op + } +} diff --git a/src/Symfony/Component/VarExporter/Tests/Fixtures/foo-serializable.php b/src/Symfony/Component/VarExporter/Tests/Fixtures/foo-serializable.php index fd4e2671010b3..c6285fd1fbebe 100644 --- a/src/Symfony/Component/VarExporter/Tests/Fixtures/foo-serializable.php +++ b/src/Symfony/Component/VarExporter/Tests/Fixtures/foo-serializable.php @@ -2,7 +2,7 @@ return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( $o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ - 'C:51:"Symfony\\Component\\VarExporter\\Tests\\FooSerializable":20:{a:1:{i:0;s:3:"bar";}}', + 'C:60:"Symfony\\Component\\VarExporter\\Tests\\Fixtures\\FooSerializable":20:{a:1:{i:0;s:3:"bar";}}', ]), null, [], diff --git a/src/Symfony/Component/VarExporter/Tests/Fixtures/serializable.php b/src/Symfony/Component/VarExporter/Tests/Fixtures/serializable.php index fcf32278b0685..9e7b52803d924 100644 --- a/src/Symfony/Component/VarExporter/Tests/Fixtures/serializable.php +++ b/src/Symfony/Component/VarExporter/Tests/Fixtures/serializable.php @@ -2,7 +2,7 @@ return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( $o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ - 'C:50:"Symfony\\Component\\VarExporter\\Tests\\MySerializable":3:{123}', + 'C:59:"Symfony\\Component\\VarExporter\\Tests\\Fixtures\\MySerializable":3:{123}', ]), null, [], diff --git a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php index cd10c7af37a8a..c10a87761ce8c 100644 --- a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php +++ b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php @@ -16,7 +16,9 @@ use Symfony\Component\VarExporter\Exception\ClassNotFoundException; use Symfony\Component\VarExporter\Exception\NotInstantiableTypeException; use Symfony\Component\VarExporter\Internal\Registry; +use Symfony\Component\VarExporter\Tests\Fixtures\FooSerializable; use Symfony\Component\VarExporter\Tests\Fixtures\FooUnitEnum; +use Symfony\Component\VarExporter\Tests\Fixtures\MySerializable; use Symfony\Component\VarExporter\VarExporter; class VarExporterTest extends TestCase @@ -137,9 +139,28 @@ public function provideExport() yield ['array-iterator', new \ArrayIterator([123], 1)]; yield ['array-object-custom', new MyArrayObject([234])]; - $value = new MySerializable(); + $errorHandler = set_error_handler(static function (int $errno, string $errstr) use (&$errorHandler) { + if (\E_DEPRECATED === $errno && str_contains($errstr, 'implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead')) { + // We're testing if the component handles deprecated Serializable implementations well. + // This kind of implementation triggers a deprecation warning since PHP 8.1 that we explicitly want to + // ignore here. We probably need to reevaluate this piece of code for PHP 9. + return true; + } + + return $errorHandler ? $errorHandler(...\func_get_args()) : false; + }); - yield ['serializable', [$value, $value]]; + try { + $mySerializable = new MySerializable(); + $fooSerializable = new FooSerializable('bar'); + } finally { + restore_error_handler(); + } + + yield ['serializable', [$mySerializable, $mySerializable]]; + yield ['foo-serializable', $fooSerializable]; + + unset($mySerializable, $fooSerializable, $errorHandler); $value = new MyWakeup(); $value->sub = new MyWakeup(); @@ -211,8 +232,6 @@ public function provideExport() yield ['abstract-parent', new ConcreteClass()]; - yield ['foo-serializable', new FooSerializable('bar')]; - yield ['private-constructor', PrivateConstructor::create('bar')]; yield ['php74-serializable', new Php74Serializable()]; @@ -223,19 +242,6 @@ public function provideExport() } } -class MySerializable implements \Serializable -{ - public function serialize(): string - { - return '123'; - } - - public function unserialize($data) - { - // no-op - } -} - class MyWakeup { public $sub; @@ -384,31 +390,6 @@ public function __construct() } } -class FooSerializable implements \Serializable -{ - private $foo; - - public function __construct(string $foo) - { - $this->foo = $foo; - } - - public function getFoo(): string - { - return $this->foo; - } - - public function serialize(): string - { - return serialize([$this->getFoo()]); - } - - public function unserialize($str) - { - [$this->foo] = unserialize($str); - } -} - class Php74Serializable implements \Serializable { public function __serialize(): array From e5e99718c68763902eb1c585271bdf7e9a6be05d Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 31 Aug 2021 19:03:23 +0200 Subject: [PATCH 09/64] Fix circular reference in autowired decorators --- .../Compiler/AutowirePass.php | 6 ++-- .../Tests/Compiler/AutowirePassTest.php | 28 +++++++++++++++---- .../Fixtures/includes/autowiring_classes.php | 4 +++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php index b77568be593e6..ddfc5fd382143 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php @@ -153,8 +153,10 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot, $this->decoratedClass = null; $this->getPreviousValue = null; - if ($isRoot && ($definition = $this->container->getDefinition($this->currentId)) && null !== ($this->decoratedId = $definition->innerServiceId) && $this->container->has($this->decoratedId)) { - $this->decoratedClass = $this->container->findDefinition($this->decoratedId)->getClass(); + if ($isRoot && ($definition = $this->container->getDefinition($this->currentId)) && ($decoratedDefinition = $definition->getDecoratedService()) && null !== ($innerId = $decoratedDefinition[0]) && $this->container->has($innerId)) { + // If the class references to itself and is decorated, provide the inner service id and class to not get a circular reference + $this->decoratedClass = $this->container->findDefinition($innerId)->getClass(); + $this->decoratedId = $decoratedDefinition[1] ?? $this->currentId.'.inner'; } foreach ($this->methodCalls as $i => $call) { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php index b61dc64fe8234..33e9adecfb4ea 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php @@ -985,8 +985,8 @@ public function testAutowireDecorator() ->setAutowired(true) ; - (new DecoratorServicePass())->process($container); (new AutowirePass())->process($container); + (new DecoratorServicePass())->process($container); $definition = $container->getDefinition(Decorator::class); $this->assertSame(Decorator::class.'.inner', (string) $definition->getArgument(1)); @@ -1008,8 +1008,8 @@ public function testAutowireDecoratorChain() ->setAutowired(true) ; - (new DecoratorServicePass())->process($container); (new AutowirePass())->process($container); + (new DecoratorServicePass())->process($container); $definition = $container->getDefinition(DecoratedDecorator::class); $this->assertSame(DecoratedDecorator::class.'.inner', (string) $definition->getArgument(0)); @@ -1026,8 +1026,8 @@ public function testAutowireDecoratorRenamedId() ->setAutowired(true) ; - (new DecoratorServicePass())->process($container); (new AutowirePass())->process($container); + (new DecoratorServicePass())->process($container); $definition = $container->getDefinition(Decorator::class); $this->assertSame('renamed', (string) $definition->getArgument(1)); @@ -1044,12 +1044,11 @@ public function testDoNotAutowireDecoratorWhenSeveralArgumentOfTheType() ->setAutowired(true) ; - (new DecoratorServicePass())->process($container); try { (new AutowirePass())->process($container); $this->fail('AutowirePass should have thrown an exception'); } catch (AutowiringFailedException $e) { - $this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator.inner".', (string) $e->getMessage()); + $this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\Decorated", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator".', (string) $e->getMessage()); } } @@ -1106,4 +1105,23 @@ public function testArgumentWithTarget() $this->assertSame(BarInterface::class.' $imageStorage', (string) $container->getDefinition('with_target')->getArgument(0)); } + + public function testDecorationWithServiceAndAliasedInterface() + { + $container = new ContainerBuilder(); + + $container->register(DecoratorImpl::class, DecoratorImpl::class) + ->setAutowired(true) + ->setPublic(true); + $container->setAlias(DecoratorInterface::class, DecoratorImpl::class)->setPublic(true); + $container->register(DecoratedDecorator::class, DecoratedDecorator::class) + ->setAutowired(true) + ->setPublic(true) + ->setDecoratedService(DecoratorImpl::class); + + $container->compile(); + + static::assertInstanceOf(DecoratedDecorator::class, $container->get(DecoratorInterface::class)); + static::assertInstanceOf(DecoratedDecorator::class, $container->get(DecoratorImpl::class)); + } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php index 3714936b4df2b..5bf9465a7a2dd 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php @@ -382,6 +382,10 @@ interface DecoratorInterface { } +class DecoratorImpl implements DecoratorInterface +{ +} + class Decorated implements DecoratorInterface { public function __construct($quz = null, \NonExistent $nonExistent = null, DecoratorInterface $decorated = null, array $foo = []) From 3ce1f76fbc191207f3a23c72a2df211550ac3845 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 1 Sep 2021 00:12:25 +0200 Subject: [PATCH 10/64] Fix tests failing with DBAL 3 --- composer.json | 3 +- .../RememberMe/DoctrineTokenProvider.php | 17 +++--- .../DoctrineDataCollectorTest.php | 36 +++++++------ .../DoctrinePingConnectionMiddlewareTest.php | 9 ++-- src/Symfony/Bridge/Doctrine/composer.json | 4 +- .../Component/Cache/Traits/PdoTrait.php | 54 +++++++++++-------- src/Symfony/Component/Cache/composer.json | 4 +- .../Transport/Doctrine/ConnectionTest.php | 12 ++++- .../Doctrine/DoctrineIntegrationTest.php | 10 +++- .../Transport/Doctrine/Connection.php | 12 ++++- 10 files changed, 103 insertions(+), 58 deletions(-) diff --git a/composer.json b/composer.json index da8e66b784de0..1e73439a2dd1e 100644 --- a/composer.json +++ b/composer.json @@ -123,7 +123,7 @@ "doctrine/cache": "^1.6|^2.0", "doctrine/collections": "~1.0", "doctrine/data-fixtures": "^1.1", - "doctrine/dbal": "^2.6|^3.0", + "doctrine/dbal": "^2.7|^3.0", "doctrine/orm": "^2.6.3", "guzzlehttp/promises": "^1.4", "masterminds/html5": "^2.6", @@ -143,6 +143,7 @@ "twig/markdown-extra": "^2.12|^3" }, "conflict": { + "doctrine/dbal": "<2.7", "egulias/email-validator": "~3.0.0", "masterminds/html5": "<2.6", "monolog/monolog": ">=2", diff --git a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php index 4b63652ae8058..8f8256f6cb99b 100644 --- a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php @@ -13,6 +13,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\Result as DriverResult; +use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -63,7 +64,7 @@ public function loadTokenBySeries($series) $sql = 'SELECT class, username, value, lastUsed AS last_used' .' FROM rememberme_token WHERE series=:series'; $paramValues = ['series' => $series]; - $paramTypes = ['series' => \PDO::PARAM_STR]; + $paramTypes = ['series' => ParameterType::STRING]; $stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes); $row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC); @@ -81,7 +82,7 @@ public function deleteTokenBySeries($series) { $sql = 'DELETE FROM rememberme_token WHERE series=:series'; $paramValues = ['series' => $series]; - $paramTypes = ['series' => \PDO::PARAM_STR]; + $paramTypes = ['series' => ParameterType::STRING]; if (method_exists($this->conn, 'executeStatement')) { $this->conn->executeStatement($sql, $paramValues, $paramTypes); } else { @@ -102,9 +103,9 @@ public function updateToken($series, $tokenValue, \DateTime $lastUsed) 'series' => $series, ]; $paramTypes = [ - 'value' => \PDO::PARAM_STR, + 'value' => ParameterType::STRING, 'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE, - 'series' => \PDO::PARAM_STR, + 'series' => ParameterType::STRING, ]; if (method_exists($this->conn, 'executeStatement')) { $updated = $this->conn->executeStatement($sql, $paramValues, $paramTypes); @@ -132,10 +133,10 @@ public function createNewToken(PersistentTokenInterface $token) 'lastUsed' => $token->getLastUsed(), ]; $paramTypes = [ - 'class' => \PDO::PARAM_STR, - 'username' => \PDO::PARAM_STR, - 'series' => \PDO::PARAM_STR, - 'value' => \PDO::PARAM_STR, + 'class' => ParameterType::STRING, + 'username' => ParameterType::STRING, + 'series' => ParameterType::STRING, + 'value' => ParameterType::STRING, 'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE, ]; if (method_exists($this->conn, 'executeStatement')) { diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index 9c31d6d7e76b4..35fc48ff1536f 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -11,9 +11,9 @@ namespace Symfony\Bridge\Doctrine\Tests\DataCollector; +use Doctrine\DBAL\Connection; use Doctrine\DBAL\Logging\DebugStack; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\DBAL\Version; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\Persistence\ManagerRegistry; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector; @@ -22,6 +22,9 @@ use Symfony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Dumper\CliDumper; +// Doctrine DBAL 2 compatibility +class_exists(\Doctrine\DBAL\Platforms\MySqlPlatform::class); + class DoctrineDataCollectorTest extends TestCase { public function testCollectConnections() @@ -93,6 +96,8 @@ public function testCollectQueries($param, $types, $expected, $explainable, bool $dumper->setColors(false); $collectedParam->dump($dumper); $this->assertStringMatchesFormat($expected, print_r(stream_get_contents($out, -1, 0), true)); + } elseif (\is_string($expected)) { + $this->assertStringMatchesFormat($expected, $collectedParam); } else { $this->assertEquals($expected, $collectedParam); } @@ -150,7 +155,7 @@ public function testReset() /** * @dataProvider paramProvider */ - public function testSerialization($param, $types, $expected, $explainable, bool $runnable = true) + public function testSerialization($param, array $types, $expected, $explainable, bool $runnable = true) { $queries = [ ['sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => [$param], 'types' => $types, 'executionMS' => 1], @@ -167,6 +172,8 @@ public function testSerialization($param, $types, $expected, $explainable, bool $dumper->setColors(false); $collectedParam->dump($dumper); $this->assertStringMatchesFormat($expected, print_r(stream_get_contents($out, -1, 0), true)); + } elseif (\is_string($expected)) { + $this->assertStringMatchesFormat($expected, $collectedParam); } else { $this->assertEquals($expected, $collectedParam); } @@ -175,9 +182,9 @@ public function testSerialization($param, $types, $expected, $explainable, bool $this->assertSame($runnable, $collectedQueries['default'][0]['runnable']); } - public function paramProvider() + public function paramProvider(): array { - $tests = [ + return [ ['some value', [], 'some value', true], [1, [], 1, true], [true, [], true, true], @@ -207,30 +214,25 @@ public function paramProvider() , false, ], - ]; - - if (version_compare(Version::VERSION, '2.6', '>=')) { - $tests[] = ['this is not a date', ['date'], "⚠ Could not convert PHP value 'this is not a date' of type 'string' to type 'date'. Expected one of the following types: null, DateTime", false, false]; - $tests[] = [ + ['this is not a date', ['date'], "⚠ Could not convert PHP value 'this is not a date'%S to type %Sdate%S. Expected one of the following types: null, DateTime", false, false], + [ new \stdClass(), ['date'], <<getMockBuilder(\Doctrine\DBAL\Connection::class) + $connection = $this->getMockBuilder(Connection::class) ->disableOriginalConstructor() ->getMock(); $connection->expects($this->any()) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php index f99a48527c442..be63ef923dfbc 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php @@ -103,9 +103,12 @@ public function testInvalidEntityManagerThrowsException() public function testMiddlewareNoPingInNonWorkerContext() { - $this->connection->expects($this->never()) - ->method('ping') - ->willReturn(false); + // This method has been removed in DBAL 3.0 + if (method_exists(Connection::class, 'ping')) { + $this->connection->expects($this->never()) + ->method('ping') + ->willReturn(false); + } $this->connection->expects($this->never()) ->method('close') diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index 0da77033b3334..79961033bc0a6 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -43,10 +43,12 @@ "doctrine/annotations": "^1.10.4", "doctrine/collections": "~1.0", "doctrine/data-fixtures": "^1.1", - "doctrine/dbal": "^2.6|^3.0", + "doctrine/dbal": "^2.7|^3.0", "doctrine/orm": "^2.6.3" }, "conflict": { + "doctrine/dbal": "<2.7", + "doctrine/orm": "<2.6.3", "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "symfony/dependency-injection": "<3.4", "symfony/form": "<4.4", diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index a2129c459b6f7..f069248a75e50 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -17,6 +17,7 @@ use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception\TableNotFoundException; +use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Schema\Schema; use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\Marshaller\DefaultMarshaller; @@ -166,17 +167,20 @@ public function prune() $deleteSql .= " AND $this->idCol LIKE :namespace"; } + $connection = $this->getConnection(); + $useDbalConstants = $connection instanceof Connection; + try { - $delete = $this->getConnection()->prepare($deleteSql); + $delete = $connection->prepare($deleteSql); } catch (TableNotFoundException $e) { return true; } catch (\PDOException $e) { return true; } - $delete->bindValue(':time', time(), \PDO::PARAM_INT); + $delete->bindValue(':time', time(), $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); if ('' !== $this->namespace) { - $delete->bindValue(':namespace', sprintf('%s%%', $this->namespace), \PDO::PARAM_STR); + $delete->bindValue(':namespace', sprintf('%s%%', $this->namespace), $useDbalConstants ? ParameterType::STRING : \PDO::PARAM_STR); } try { return $delete->execute(); @@ -192,13 +196,16 @@ public function prune() */ protected function doFetch(array $ids) { + $connection = $this->getConnection(); + $useDbalConstants = $connection instanceof Connection; + $now = time(); $expired = []; $sql = str_pad('', (\count($ids) << 1) - 1, '?,'); $sql = "SELECT $this->idCol, CASE WHEN $this->lifetimeCol IS NULL OR $this->lifetimeCol + $this->timeCol > ? THEN $this->dataCol ELSE NULL END FROM $this->table WHERE $this->idCol IN ($sql)"; - $stmt = $this->getConnection()->prepare($sql); - $stmt->bindValue($i = 1, $now, \PDO::PARAM_INT); + $stmt = $connection->prepare($sql); + $stmt->bindValue($i = 1, $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); foreach ($ids as $id) { $stmt->bindValue(++$i, $id); } @@ -222,8 +229,8 @@ protected function doFetch(array $ids) if ($expired) { $sql = str_pad('', (\count($expired) << 1) - 1, '?,'); $sql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol <= ? AND $this->idCol IN ($sql)"; - $stmt = $this->getConnection()->prepare($sql); - $stmt->bindValue($i = 1, $now, \PDO::PARAM_INT); + $stmt = $connection->prepare($sql); + $stmt->bindValue($i = 1, $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); foreach ($expired as $id) { $stmt->bindValue(++$i, $id); } @@ -236,11 +243,14 @@ protected function doFetch(array $ids) */ protected function doHave($id) { + $connection = $this->getConnection(); + $useDbalConstants = $connection instanceof Connection; + $sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND ($this->lifetimeCol IS NULL OR $this->lifetimeCol + $this->timeCol > :time)"; - $stmt = $this->getConnection()->prepare($sql); + $stmt = $connection->prepare($sql); $stmt->bindValue(':id', $id); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->bindValue(':time', time(), $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); $result = $stmt->execute(); return (bool) (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn()); @@ -303,6 +313,8 @@ protected function doSave(array $values, int $lifetime) } $conn = $this->getConnection(); + $useDbalConstants = $conn instanceof Connection; + $driver = $this->driver; $insertSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time)"; @@ -354,25 +366,25 @@ protected function doSave(array $values, int $lifetime) if ('sqlsrv' === $driver || 'oci' === $driver) { $stmt->bindParam(1, $id); $stmt->bindParam(2, $id); - $stmt->bindParam(3, $data, \PDO::PARAM_LOB); - $stmt->bindValue(4, $lifetime, \PDO::PARAM_INT); - $stmt->bindValue(5, $now, \PDO::PARAM_INT); - $stmt->bindParam(6, $data, \PDO::PARAM_LOB); - $stmt->bindValue(7, $lifetime, \PDO::PARAM_INT); - $stmt->bindValue(8, $now, \PDO::PARAM_INT); + $stmt->bindParam(3, $data, $useDbalConstants ? ParameterType::LARGE_OBJECT : \PDO::PARAM_LOB); + $stmt->bindValue(4, $lifetime, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); + $stmt->bindValue(5, $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); + $stmt->bindParam(6, $data, $useDbalConstants ? ParameterType::LARGE_OBJECT : \PDO::PARAM_LOB); + $stmt->bindValue(7, $lifetime, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); + $stmt->bindValue(8, $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); } else { $stmt->bindParam(':id', $id); - $stmt->bindParam(':data', $data, \PDO::PARAM_LOB); - $stmt->bindValue(':lifetime', $lifetime, \PDO::PARAM_INT); - $stmt->bindValue(':time', $now, \PDO::PARAM_INT); + $stmt->bindParam(':data', $data, $useDbalConstants ? ParameterType::LARGE_OBJECT : \PDO::PARAM_LOB); + $stmt->bindValue(':lifetime', $lifetime, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); + $stmt->bindValue(':time', $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); } if (null === $driver) { $insertStmt = $conn->prepare($insertSql); $insertStmt->bindParam(':id', $id); - $insertStmt->bindParam(':data', $data, \PDO::PARAM_LOB); - $insertStmt->bindValue(':lifetime', $lifetime, \PDO::PARAM_INT); - $insertStmt->bindValue(':time', $now, \PDO::PARAM_INT); + $insertStmt->bindParam(':data', $data, $useDbalConstants ? ParameterType::LARGE_OBJECT : \PDO::PARAM_LOB); + $insertStmt->bindValue(':lifetime', $lifetime, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); + $insertStmt->bindValue(':time', $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT); } foreach ($values as $id => $data) { diff --git a/src/Symfony/Component/Cache/composer.json b/src/Symfony/Component/Cache/composer.json index d71f2169e03c2..72bd68fbe31dd 100644 --- a/src/Symfony/Component/Cache/composer.json +++ b/src/Symfony/Component/Cache/composer.json @@ -33,7 +33,7 @@ "require-dev": { "cache/integration-tests": "dev-master", "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.6|^3.0", + "doctrine/dbal": "^2.7|^3.0", "predis/predis": "^1.1", "psr/simple-cache": "^1.0", "symfony/config": "^4.2|^5.0", @@ -43,7 +43,7 @@ "symfony/var-dumper": "^4.4|^5.0" }, "conflict": { - "doctrine/dbal": "<2.6", + "doctrine/dbal": "<2.7", "symfony/dependency-injection": "<3.4", "symfony/http-kernel": "<4.4|>=5.0", "symfony/var-dumper": "<4.4" diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php index d8b1447257ba1..5bc7dddcd2934 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php @@ -140,7 +140,11 @@ private function getDBALConnectionMock() $schemaConfig->method('getMaxIdentifierLength')->willReturn(63); $schemaConfig->method('getDefaultTableOptions')->willReturn([]); $schemaManager->method('createSchemaConfig')->willReturn($schemaConfig); - $driverConnection->method('getSchemaManager')->willReturn($schemaManager); + if (method_exists(DBALConnection::class, 'createSchemaManager')) { + $driverConnection->method('createSchemaManager')->willReturn($schemaManager); + } else { + $driverConnection->method('getSchemaManager')->willReturn($schemaManager); + } return $driverConnection; } @@ -428,7 +432,11 @@ public function testSetupIndices(string $platformClass, array $expectedIndices) $expectedTable->addIndex($indexColumns); } $schemaManager->method('createSchema')->willReturn($schema); - $driverConnection->method('getSchemaManager')->willReturn($schemaManager); + if (method_exists(DBALConnection::class, 'createSchemaManager')) { + $driverConnection->method('createSchemaManager')->willReturn($schemaManager); + } else { + $driverConnection->method('getSchemaManager')->willReturn($schemaManager); + } $platformMock = $this->createMock($platformClass); $platformMock diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/DoctrineIntegrationTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/DoctrineIntegrationTest.php index d0b531387033e..2bc70871baf5c 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/DoctrineIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/DoctrineIntegrationTest.php @@ -14,6 +14,7 @@ use Doctrine\DBAL\Driver\Result as DriverResult; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Result; +use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage; use Symfony\Component\Messenger\Transport\Doctrine\Connection; @@ -175,7 +176,7 @@ public function testItRetrieveTheMessageThatIsOlderThanRedeliverTimeout() public function testTheTransportIsSetupOnGet() { - $this->assertFalse($this->driverConnection->getSchemaManager()->tablesExist('messenger_messages')); + $this->assertFalse($this->createSchemaManager()->tablesExist('messenger_messages')); $this->assertNull($this->connection->get()); $this->connection->send('the body', ['my' => 'header']); @@ -187,4 +188,11 @@ private function formatDateTime(\DateTime $dateTime) { return $dateTime->format($this->driverConnection->getDatabasePlatform()->getDateTimeFormatString()); } + + private function createSchemaManager(): AbstractSchemaManager + { + return method_exists($this->driverConnection, 'createSchemaManager') + ? $this->driverConnection->createSchemaManager() + : $this->driverConnection->getSchemaManager(); + } } diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index e936ca09e871f..063724b976219 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -20,6 +20,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Result; +use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer; @@ -377,7 +378,7 @@ private function executeStatement(string $sql, array $parameters = [], array $ty private function getSchema(): Schema { - $schema = new Schema([], [], $this->driverConnection->getSchemaManager()->createSchemaConfig()); + $schema = new Schema([], [], $this->createSchemaManager()->createSchemaConfig()); $table = $schema->createTable($this->configuration['table_name']); $table->addColumn('id', self::$useDeprecatedConstants ? Type::BIGINT : Types::BIGINT) ->setAutoincrement(true) @@ -421,7 +422,7 @@ private function updateSchema(): void } $comparator = new Comparator(); - $schemaDiff = $comparator->compare($this->driverConnection->getSchemaManager()->createSchema(), $this->getSchema()); + $schemaDiff = $comparator->compare($this->createSchemaManager()->createSchema(), $this->getSchema()); foreach ($schemaDiff->toSaveSql($this->driverConnection->getDatabasePlatform()) as $sql) { if (method_exists($this->driverConnection, 'executeStatement')) { @@ -431,4 +432,11 @@ private function updateSchema(): void } } } + + private function createSchemaManager(): AbstractSchemaManager + { + return method_exists($this->driverConnection, 'createSchemaManager') + ? $this->driverConnection->createSchemaManager() + : $this->driverConnection->getSchemaManager(); + } } From 6faae75102751b9550ed767b7afe5a544e35d5ee Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 1 Sep 2021 15:54:51 +0200 Subject: [PATCH 11/64] fix tests Signed-off-by: Alexander M. Turek --- .../Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php index 1f7f6afe4cc0f..6c0c0b9bc721d 100644 --- a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php +++ b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php @@ -166,7 +166,7 @@ public function getTypes(string $class, string $property, array $context = []) case Type::BUILTIN_TYPE_ARRAY: switch ($typeOfField) { case Types::ARRAY: - case Types::JSON_ARRAY: + case 'json_array': return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)]; case Types::SIMPLE_ARRAY: @@ -280,7 +280,7 @@ private function getPhpType(string $doctrineType): ?string case Types::ARRAY: case Types::SIMPLE_ARRAY: - case Types::JSON_ARRAY: + case 'json_array': return Type::BUILTIN_TYPE_ARRAY; } From f1b3840309708ba0713b33ef2e9fafcba24a9a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20de=20Marqu=C3=A9=20Fromentin?= Date: Wed, 1 Sep 2021 16:36:38 +0200 Subject: [PATCH 12/64] [HttpKernel] Fix timeline in profiler Simple fix to #42804 --- .../Component/HttpKernel/DataCollector/TimeDataCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php index 7c0cdaa90d7d1..b83c44a48dea5 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php @@ -47,7 +47,7 @@ public function collect(Request $request, Response $response/*, \Throwable $exce } $this->data = [ - 'token' => $response->headers->get('X-Debug-Token'), + 'token' => $request->attributes->get('_stopwatch_token'), 'start_time' => $startTime * 1000, 'events' => [], 'stopwatch_installed' => class_exists(Stopwatch::class, false), From 8ce5533214577d1691d9d74e59c32e52d3d1d84f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 Sep 2021 16:48:59 +0200 Subject: [PATCH 13/64] [Mime] Update mime types --- src/Symfony/Component/Mime/MimeTypes.php | 224 ++++++++++++++---- .../Mime/Resources/bin/update_mime_types.php | 2 +- 2 files changed, 179 insertions(+), 47 deletions(-) diff --git a/src/Symfony/Component/Mime/MimeTypes.php b/src/Symfony/Component/Mime/MimeTypes.php index e2b5bf4354910..8a570f6d26a9b 100644 --- a/src/Symfony/Component/Mime/MimeTypes.php +++ b/src/Symfony/Component/Mime/MimeTypes.php @@ -146,7 +146,7 @@ public function guessMimeType(string $path): ?string /** * A map of MIME types and their default extensions. * - * Updated from upstream on 2019-01-16 + * Updated from upstream on 2021-09-01 * * @see Resources/bin/update_mime_types.php */ @@ -158,6 +158,7 @@ public function guessMimeType(string $path): ?string 'application/atom+xml' => ['atom'], 'application/atomcat+xml' => ['atomcat'], 'application/atomsvc+xml' => ['atomsvc'], + 'application/bzip2' => ['bz2', 'bz'], 'application/ccxml+xml' => ['ccxml'], 'application/cdmi-capability' => ['cdmia'], 'application/cdmi-container' => ['cdmic'], @@ -240,14 +241,15 @@ public function guessMimeType(string $path): ?string 'application/ogg' => ['ogx'], 'application/omdoc+xml' => ['omdoc'], 'application/onenote' => ['onetoc', 'onetoc2', 'onetmp', 'onepkg'], + 'application/ovf' => ['ova'], 'application/owl+xml' => ['owx'], - 'application/oxps' => ['oxps', 'xps'], + 'application/oxps' => ['oxps'], 'application/patch-ops-error+xml' => ['xer'], 'application/pcap' => ['pcap', 'cap', 'dmp'], 'application/pdf' => ['pdf'], 'application/pgp' => ['pgp', 'gpg', 'asc'], 'application/pgp-encrypted' => ['pgp', 'gpg', 'asc'], - 'application/pgp-keys' => ['skr', 'pkr', 'asc', 'pgp', 'gpg'], + 'application/pgp-keys' => ['skr', 'pkr', 'asc', 'pgp', 'gpg', 'key'], 'application/pgp-signature' => ['asc', 'sig', 'pgp', 'gpg'], 'application/photoshop' => ['psd'], 'application/pics-rules' => ['prf'], @@ -283,6 +285,7 @@ public function guessMimeType(string $path): ?string 'application/rss+xml' => ['rss'], 'application/rtf' => ['rtf'], 'application/sbml+xml' => ['sbml'], + 'application/schema+json' => ['json'], 'application/scvp-cv-request' => ['scq'], 'application/scvp-cv-response' => ['scs'], 'application/scvp-vp-request' => ['spq'], @@ -304,8 +307,10 @@ public function guessMimeType(string $path): ?string 'application/ssml+xml' => ['ssml'], 'application/stuffit' => ['sit'], 'application/tei+xml' => ['tei', 'teicorpus'], + 'application/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/thraud+xml' => ['tfi'], 'application/timestamped-data' => ['tsd'], + 'application/toml' => ['toml'], 'application/trig' => ['trig'], 'application/vnd.3gpp.pic-bw-large' => ['plb'], 'application/vnd.3gpp.pic-bw-small' => ['psb'], @@ -327,6 +332,7 @@ public function guessMimeType(string $path): ?string 'application/vnd.airzip.filesecure.azf' => ['azf'], 'application/vnd.airzip.filesecure.azs' => ['azs'], 'application/vnd.amazon.ebook' => ['azw'], + 'application/vnd.amazon.mobi8-ebook' => ['azw3', 'kfx'], 'application/vnd.americandynamics.acc' => ['acc'], 'application/vnd.amiga.ami' => ['ami'], 'application/vnd.android.package-archive' => ['apk'], @@ -337,6 +343,8 @@ public function guessMimeType(string $path): ?string 'application/vnd.apple.installer+xml' => ['mpkg'], 'application/vnd.apple.keynote' => ['key'], 'application/vnd.apple.mpegurl' => ['m3u8', 'm3u'], + 'application/vnd.apple.numbers' => ['numbers'], + 'application/vnd.apple.pages' => ['pages'], 'application/vnd.aristanetworks.swi' => ['swi'], 'application/vnd.astraea-software.iota' => ['iota'], 'application/vnd.audiograph' => ['aep'], @@ -549,7 +557,7 @@ public function guessMimeType(string $path): ?string 'application/vnd.ms-word.template.macroenabled.12' => ['dotm'], 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb', 'xlr'], 'application/vnd.ms-wpl' => ['wpl'], - 'application/vnd.ms-xpsdocument' => ['xps', 'oxps'], + 'application/vnd.ms-xpsdocument' => ['xps'], 'application/vnd.msaccess' => ['mdb'], 'application/vnd.mseq' => ['mseq'], 'application/vnd.musician' => ['mus'], @@ -719,7 +727,7 @@ public function guessMimeType(string $path): ?string 'application/wspolicy+xml' => ['wspolicy'], 'application/wwf' => ['wwf'], 'application/x-123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/x-7z-compressed' => ['7z'], + 'application/x-7z-compressed' => ['7z', '7z.001'], 'application/x-abiword' => ['abw', 'abw.CRASHED', 'abw.gz', 'zabw'], 'application/x-ace' => ['ace'], 'application/x-ace-compressed' => ['ace'], @@ -729,6 +737,8 @@ public function guessMimeType(string $path): ?string 'application/x-annodex' => ['anx'], 'application/x-aportisdoc' => ['pdb', 'pdc'], 'application/x-apple-diskimage' => ['dmg'], + 'application/x-apple-systemprofiler+xml' => ['spx'], + 'application/x-appleworks-document' => ['cwk'], 'application/x-applix-spreadsheet' => ['as'], 'application/x-applix-word' => ['aw'], 'application/x-archive' => ['a', 'ar'], @@ -745,6 +755,7 @@ public function guessMimeType(string $path): ?string 'application/x-bittorrent' => ['torrent'], 'application/x-blender' => ['blender', 'blend', 'BLEND'], 'application/x-blorb' => ['blb', 'blorb'], + 'application/x-bps-patch' => ['bps'], 'application/x-bsdiff' => ['bsdiff'], 'application/x-bzdvi' => ['dvi.bz2'], 'application/x-bzip' => ['bz', 'bz2'], @@ -767,6 +778,7 @@ public function guessMimeType(string $path): ?string 'application/x-chm' => ['chm'], 'application/x-cisco-vpn-settings' => ['pcf'], 'application/x-compress' => ['Z'], + 'application/x-compressed-iso' => ['cso'], 'application/x-compressed-tar' => ['tar.gz', 'tgz'], 'application/x-conference' => ['nsc'], 'application/x-coreldraw' => ['cdr'], @@ -786,9 +798,11 @@ public function guessMimeType(string $path): ?string 'application/x-dia-diagram' => ['dia'], 'application/x-dia-shape' => ['shape'], 'application/x-director' => ['dir', 'dcr', 'dxr', 'cst', 'cct', 'cxt', 'w3d', 'fgd', 'swa'], + 'application/x-discjuggler-cd-image' => ['cdi'], 'application/x-docbook+xml' => ['dbk', 'docbook'], 'application/x-doom' => ['wad'], 'application/x-doom-wad' => ['wad'], + 'application/x-dreamcast-rom' => ['iso'], 'application/x-dtbncx+xml' => ['ncx'], 'application/x-dtbook+xml' => ['dtb'], 'application/x-dtbresource+xml' => ['res'], @@ -826,9 +840,10 @@ public function guessMimeType(string $path): ?string 'application/x-gamegear-rom' => ['gg'], 'application/x-gba-rom' => ['gba', 'agb'], 'application/x-gca-compressed' => ['gca'], + 'application/x-gd-rom-cue' => ['gdi'], 'application/x-gedcom' => ['ged', 'gedcom'], 'application/x-genesis-32x-rom' => ['32x', 'mdx'], - 'application/x-genesis-rom' => ['gen', 'smd'], + 'application/x-genesis-rom' => ['gen', 'smd', 'sgd'], 'application/x-gettext' => ['po'], 'application/x-gettext-translation' => ['gmo', 'mo'], 'application/x-glade' => ['glade'], @@ -856,11 +871,14 @@ public function guessMimeType(string $path): ?string 'application/x-hwt' => ['hwt'], 'application/x-ica' => ['ica'], 'application/x-install-instructions' => ['install'], + 'application/x-ips-patch' => ['ips'], 'application/x-ipynb+json' => ['ipynb'], 'application/x-iso9660-appimage' => ['appimage'], 'application/x-iso9660-image' => ['iso', 'iso9660'], 'application/x-it87' => ['it87'], 'application/x-iwork-keynote-sffkey' => ['key'], + 'application/x-iwork-numbers-sffnumbers' => ['numbers'], + 'application/x-iwork-pages-sffpages' => ['pages'], 'application/x-jar' => ['jar'], 'application/x-java' => ['class'], 'application/x-java-archive' => ['jar'], @@ -885,7 +903,7 @@ public function guessMimeType(string $path): ?string 'application/x-kontour' => ['kon'], 'application/x-kpovmodeler' => ['kpm'], 'application/x-kpresenter' => ['kpr', 'kpt'], - 'application/x-krita' => ['kra'], + 'application/x-krita' => ['kra', 'krz'], 'application/x-kspread' => ['ksp'], 'application/x-kugar' => ['kud'], 'application/x-kword' => ['kwd', 'kwt'], @@ -908,12 +926,14 @@ public function guessMimeType(string $path): ?string 'application/x-lzpdf' => ['pdf.lz'], 'application/x-m4' => ['m4'], 'application/x-magicpoint' => ['mgp'], + 'application/x-mame-chd' => ['chd'], 'application/x-markaby' => ['mab'], 'application/x-mathematica' => ['nb'], 'application/x-mdb' => ['mdb'], 'application/x-mie' => ['mie'], 'application/x-mif' => ['mif'], 'application/x-mimearchive' => ['mhtml', 'mht'], + 'application/x-mobi8-ebook' => ['azw3', 'kfx'], 'application/x-mobipocket-ebook' => ['prc', 'mobi'], 'application/x-ms-application' => ['application'], 'application/x-ms-asx' => ['asx', 'wax', 'wvx', 'wmx'], @@ -948,9 +968,11 @@ public function guessMimeType(string $path): ?string 'application/x-nes-rom' => ['nes', 'nez', 'unf', 'unif'], 'application/x-netcdf' => ['nc', 'cdf'], 'application/x-netshow-channel' => ['nsc'], + 'application/x-nintendo-3ds-executable' => ['3dsx'], + 'application/x-nintendo-3ds-rom' => ['3ds', 'cci'], 'application/x-nintendo-ds-rom' => ['nds'], 'application/x-nzb' => ['nzb'], - 'application/x-object' => ['o'], + 'application/x-object' => ['o', 'mod'], 'application/x-ogg' => ['ogx'], 'application/x-oleo' => ['oleo'], 'application/x-pagemaker' => ['p65', 'pm', 'pm6', 'pmd'], @@ -970,7 +992,11 @@ public function guessMimeType(string $path): ?string 'application/x-planperfect' => ['pln'], 'application/x-pocket-word' => ['psw'], 'application/x-pw' => ['pw'], + 'application/x-pyspread-bz-spreadsheet' => ['pys'], + 'application/x-pyspread-spreadsheet' => ['pysu'], 'application/x-python-bytecode' => ['pyc', 'pyo'], + 'application/x-qed-disk' => ['qed'], + 'application/x-qemu-disk' => ['qcow2', 'qcow'], 'application/x-qpress' => ['qp'], 'application/x-qtiplot' => ['qti', 'qti.gz'], 'application/x-quattropro' => ['wb1', 'wb2', 'wb3'], @@ -990,9 +1016,10 @@ public function guessMimeType(string $path): ?string 'application/x-ruby' => ['rb'], 'application/x-sami' => ['smi', 'sami'], 'application/x-sap-file' => ['sap'], - 'application/x-saturn-rom' => ['bin', 'iso'], + 'application/x-saturn-rom' => ['iso'], 'application/x-sdp' => ['sdp'], - 'application/x-sega-cd-rom' => ['bin', 'iso'], + 'application/x-sega-cd-rom' => ['iso'], + 'application/x-sega-pico-rom' => ['iso'], 'application/x-sg1000-rom' => ['sg'], 'application/x-sh' => ['sh'], 'application/x-shar' => ['shar'], @@ -1024,6 +1051,7 @@ public function guessMimeType(string $path): ?string 'application/x-t602' => ['602'], 'application/x-tads' => ['gam'], 'application/x-tar' => ['tar', 'gtar', 'gem'], + 'application/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/x-tarz' => ['tar.Z', 'taz'], 'application/x-tcl' => ['tcl'], 'application/x-tex' => ['tex', 'ltx', 'sty', 'cls', 'dtx', 'ins', 'latex'], @@ -1031,6 +1059,7 @@ public function guessMimeType(string $path): ?string 'application/x-tex-pk' => ['pk'], 'application/x-tex-tfm' => ['tfm'], 'application/x-texinfo' => ['texinfo', 'texi'], + 'application/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/x-tgif' => ['obj'], 'application/x-theme' => ['theme'], 'application/x-thomson-cartridge-memo7' => ['m7'], @@ -1039,11 +1068,20 @@ public function guessMimeType(string $path): ?string 'application/x-trash' => ['bak', 'old', 'sik'], 'application/x-trig' => ['trig'], 'application/x-troff' => ['tr', 'roff', 't'], - 'application/x-troff-man' => ['man'], + 'application/x-troff-man' => ['man', '[1-9]'], 'application/x-tzo' => ['tar.lzo', 'tzo'], 'application/x-ufraw' => ['ufraw'], 'application/x-ustar' => ['ustar'], + 'application/x-vdi-disk' => ['vdi'], + 'application/x-vhd-disk' => ['vhd', 'vpc'], + 'application/x-vhdx-disk' => ['vhdx'], 'application/x-virtual-boy-rom' => ['vb'], + 'application/x-virtualbox-ova' => ['ova'], + 'application/x-virtualbox-vdi' => ['vdi'], + 'application/x-virtualbox-vhd' => ['vhd', 'vpc'], + 'application/x-virtualbox-vhdx' => ['vhdx'], + 'application/x-virtualbox-vmdk' => ['vmdk'], + 'application/x-vmdk-disk' => ['vmdk'], 'application/x-vnd.kde.kexi' => ['kexi'], 'application/x-wais-source' => ['src'], 'application/x-wbfs' => ['iso'], @@ -1075,17 +1113,18 @@ public function guessMimeType(string $path): ?string 'application/x-zip-compressed-fb2' => ['fb2.zip'], 'application/x-zmachine' => ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'], 'application/x-zoo' => ['zoo'], + 'application/x-zstd-compressed-tar' => ['tar.zst', 'tzst'], 'application/xaml+xml' => ['xaml'], 'application/xcap-diff+xml' => ['xdf'], 'application/xenc+xml' => ['xenc'], - 'application/xhtml+xml' => ['xhtml', 'xht'], + 'application/xhtml+xml' => ['xhtml', 'xht', 'html', 'htm'], 'application/xliff+xml' => ['xlf', 'xliff'], 'application/xml' => ['xml', 'xsl', 'xbl', 'xsd', 'rng'], 'application/xml-dtd' => ['dtd'], 'application/xml-external-parsed-entity' => ['ent'], 'application/xop+xml' => ['xop'], 'application/xproc+xml' => ['xpl'], - 'application/xps' => ['oxps', 'xps'], + 'application/xps' => ['xps'], 'application/xslt+xml' => ['xslt', 'xsl'], 'application/xspf+xml' => ['xspf'], 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], @@ -1093,6 +1132,7 @@ public function guessMimeType(string $path): ?string 'application/yin+xml' => ['yin'], 'application/zip' => ['zip'], 'application/zlib' => ['zz'], + 'application/zstd' => ['zst'], 'audio/3gpp' => ['3gp', '3gpp', '3ga'], 'audio/3gpp-encrypted' => ['3gp', '3gpp', '3ga'], 'audio/3gpp2' => ['3g2', '3gp2', '3gpp2'], @@ -1124,7 +1164,7 @@ public function guessMimeType(string $path): ?string 'audio/tta' => ['tta'], 'audio/usac' => ['loas', 'xhe'], 'audio/vnd.audible' => ['aa', 'aax'], - 'audio/vnd.audible.aax' => ['aa', 'aax'], + 'audio/vnd.audible.aax' => ['aax'], 'audio/vnd.dece.audio' => ['uva', 'uvva'], 'audio/vnd.digital-winds' => ['eol'], 'audio/vnd.dra' => ['dra'], @@ -1195,7 +1235,7 @@ public function guessMimeType(string $path): ?string 'audio/x-scpls' => ['pls'], 'audio/x-shorten' => ['shn'], 'audio/x-speex' => ['spx'], - 'audio/x-speex+ogg' => ['oga', 'ogg'], + 'audio/x-speex+ogg' => ['oga', 'ogg', 'spx'], 'audio/x-stm' => ['stm'], 'audio/x-tta' => ['tta'], 'audio/x-voc' => ['voc'], @@ -1219,8 +1259,11 @@ public function guessMimeType(string $path): ?string 'font/collection' => ['ttc'], 'font/otf' => ['otf'], 'font/ttf' => ['ttf'], - 'font/woff' => ['woff', 'woff2'], + 'font/woff' => ['woff'], 'font/woff2' => ['woff2'], + 'image/astc' => ['astc'], + 'image/avif' => ['avif', 'avifs'], + 'image/avif-sequence' => ['avif', 'avifs'], 'image/bmp' => ['bmp', 'dib'], 'image/cdr' => ['cdr'], 'image/cgm' => ['cgm'], @@ -1242,11 +1285,13 @@ public function guessMimeType(string $path): ?string 'image/jpeg2000-image' => ['jp2', 'jpg2'], 'image/jpm' => ['jpm', 'jpgm'], 'image/jpx' => ['jpf', 'jpx'], + 'image/jxl' => ['jxl'], 'image/ktx' => ['ktx'], + 'image/ktx2' => ['ktx2'], 'image/openraster' => ['ora'], 'image/pdf' => ['pdf'], 'image/photoshop' => ['psd'], - 'image/pjpeg' => ['jpeg', 'jpg', 'jpe'], + 'image/pjpeg' => ['jpg', 'jpeg', 'jpe'], 'image/png' => ['png'], 'image/prs.btif' => ['btif'], 'image/psd' => ['psd'], @@ -1255,6 +1300,8 @@ public function guessMimeType(string $path): ?string 'image/svg' => ['svg'], 'image/svg+xml' => ['svg', 'svgz'], 'image/svg+xml-compressed' => ['svgz'], + 'image/targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], + 'image/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/tiff' => ['tiff', 'tif'], 'image/vnd.adobe.photoshop' => ['psd'], 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], @@ -1284,6 +1331,7 @@ public function guessMimeType(string $path): ?string 'image/x-bmp' => ['bmp', 'dib'], 'image/x-bzeps' => ['eps.bz2', 'epsi.bz2', 'epsf.bz2'], 'image/x-canon-cr2' => ['cr2'], + 'image/x-canon-cr3' => ['cr3'], 'image/x-canon-crw' => ['crw'], 'image/x-cdr' => ['cdr'], 'image/x-cmu-raster' => ['ras'], @@ -1321,6 +1369,7 @@ public function guessMimeType(string $path): ?string 'image/x-ms-bmp' => ['bmp', 'dib'], 'image/x-msod' => ['msod'], 'image/x-nikon-nef' => ['nef'], + 'image/x-nikon-nrw' => ['nrw'], 'image/x-olympus-orf' => ['orf'], 'image/x-panasonic-raw' => ['raw'], 'image/x-panasonic-raw2' => ['rw2'], @@ -1345,6 +1394,7 @@ public function guessMimeType(string $path): ?string 'image/x-sony-sr2' => ['sr2'], 'image/x-sony-srf' => ['srf'], 'image/x-sun-raster' => ['sun'], + 'image/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/x-win-bitmap' => ['cur'], 'image/x-win-metafile' => ['wmf'], @@ -1357,6 +1407,8 @@ public function guessMimeType(string $path): ?string 'image/x-xwindowdump' => ['xwd'], 'image/x.djvu' => ['djvu', 'djv'], 'message/rfc822' => ['eml', 'mime'], + 'model/gltf+json' => ['gltf'], + 'model/gltf-binary' => ['glb'], 'model/iges' => ['igs', 'iges'], 'model/mesh' => ['msh', 'mesh', 'silo'], 'model/stl' => ['stl'], @@ -1374,6 +1426,7 @@ public function guessMimeType(string $path): ?string 'model/x3d+xml' => ['x3d', 'x3dz'], 'text/cache-manifest' => ['appcache', 'manifest'], 'text/calendar' => ['ics', 'ifb', 'vcs'], + 'text/crystal' => ['cr'], 'text/css' => ['css'], 'text/csv' => ['csv'], 'text/csv-schema' => ['csvs'], @@ -1387,6 +1440,7 @@ public function guessMimeType(string $path): ?string 'text/markdown' => ['md', 'mkd', 'markdown'], 'text/mathml' => ['mml'], 'text/n3' => ['n3'], + 'text/org' => ['org'], 'text/plain' => ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'asc'], 'text/prs.lines.tag' => ['dsc'], 'text/rdf' => ['rdf', 'rdfs', 'owl'], @@ -1397,9 +1451,12 @@ public function guessMimeType(string $path): ?string 'text/sgml' => ['sgml', 'sgm'], 'text/spreadsheet' => ['sylk', 'slk'], 'text/tab-separated-values' => ['tsv'], + 'text/tcl' => ['tcl', 'tk'], 'text/troff' => ['t', 'tr', 'roff', 'man', 'me', 'ms'], 'text/turtle' => ['ttl'], 'text/uri-list' => ['uri', 'uris', 'urls'], + 'text/vbs' => ['vbs'], + 'text/vbscript' => ['vbs'], 'text/vcard' => ['vcard', 'vcf', 'vct', 'gcrd'], 'text/vnd.curl' => ['curl'], 'text/vnd.curl.dcurl' => ['dcurl'], @@ -1413,6 +1470,7 @@ public function guessMimeType(string $path): ?string 'text/vnd.in3d.spot' => ['spot'], 'text/vnd.qt.linguist' => ['ts'], 'text/vnd.rn-realtext' => ['rt'], + 'text/vnd.senx.warpscript' => ['mc2'], 'text/vnd.sun.j2me.app-descriptor' => ['jad'], 'text/vnd.trolltech.linguist' => ['ts'], 'text/vnd.wap.wml' => ['wml'], @@ -1428,9 +1486,12 @@ public function guessMimeType(string $path): ?string 'text/x-cmake' => ['cmake'], 'text/x-cobol' => ['cbl', 'cob'], 'text/x-comma-separated-values' => ['csv'], + 'text/x-common-lisp' => ['asd', 'fasl', 'lisp', 'ros'], + 'text/x-crystal' => ['cr'], 'text/x-csharp' => ['cs'], 'text/x-csrc' => ['c'], 'text/x-csv' => ['csv'], + 'text/x-dart' => ['dart'], 'text/x-dbus-service' => ['service'], 'text/x-dcl' => ['dcl'], 'text/x-diff' => ['diff', 'patch'], @@ -1438,6 +1499,7 @@ public function guessMimeType(string $path): ?string 'text/x-dsrc' => ['d', 'di'], 'text/x-dtd' => ['dtd'], 'text/x-eiffel' => ['e', 'eif'], + 'text/x-elixir' => ['ex', 'exs'], 'text/x-emacs-lisp' => ['el'], 'text/x-erlang' => ['erl'], 'text/x-fortran' => ['f', 'for', 'f77', 'f90', 'f95'], @@ -1447,12 +1509,16 @@ public function guessMimeType(string $path): ?string 'text/x-gherkin' => ['feature'], 'text/x-go' => ['go'], 'text/x-google-video-pointer' => ['gvp'], + 'text/x-gradle' => ['gradle'], + 'text/x-groovy' => ['groovy', 'gvy', 'gy', 'gsh'], 'text/x-haskell' => ['hs'], 'text/x-idl' => ['idl'], 'text/x-imelody' => ['imy', 'ime'], 'text/x-iptables' => ['iptables'], 'text/x-java' => ['java'], 'text/x-java-source' => ['java'], + 'text/x-kaitai-struct' => ['ksy'], + 'text/x-kotlin' => ['kt'], 'text/x-ldif' => ['ldif'], 'text/x-lilypond' => ['ly'], 'text/x-literate-haskell' => ['lhs'], @@ -1485,12 +1551,14 @@ public function guessMimeType(string $path): ?string 'text/x-po' => ['po'], 'text/x-pot' => ['pot'], 'text/x-python' => ['py', 'pyx', 'wsgi'], - 'text/x-python3' => ['py', 'py3', 'py3x'], + 'text/x-python3' => ['py', 'py3', 'py3x', 'pyi'], 'text/x-qml' => ['qml', 'qmltypes', 'qmlproject'], 'text/x-reject' => ['rej'], 'text/x-rpm-spec' => ['spec'], + 'text/x-rst' => ['rst'], + 'text/x-sagemath' => ['sage'], 'text/x-sass' => ['sass'], - 'text/x-scala' => ['scala'], + 'text/x-scala' => ['scala', 'sc'], 'text/x-scheme' => ['scm', 'ss'], 'text/x-scss' => ['scss'], 'text/x-setext' => ['etx'], @@ -1560,6 +1628,8 @@ public function guessMimeType(string $path): ?string 'video/vnd.fvt' => ['fvt'], 'video/vnd.mpegurl' => ['mxu', 'm4u', 'm1u'], 'video/vnd.ms-playready.media.pyv' => ['pyv'], + 'video/vnd.radgamettools.bink' => ['bik', 'bk2'], + 'video/vnd.radgamettools.smacker' => ['smk'], 'video/vnd.rn-realvideo' => ['rv', 'rvx'], 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], 'video/vnd.vivo' => ['viv', 'vivo'], @@ -1614,7 +1684,8 @@ public function guessMimeType(string $path): ?string private const REVERSE_MAP = [ '32x' => ['application/x-genesis-32x-rom'], '3dml' => ['text/vnd.in3d.3dml'], - '3ds' => ['image/x-3ds'], + '3ds' => ['application/x-nintendo-3ds-rom', 'image/x-3ds'], + '3dsx' => ['application/x-nintendo-3ds-executable'], '3g2' => ['audio/3gpp2', 'video/3gpp2'], '3ga' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], '3gp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], @@ -1622,15 +1693,17 @@ public function guessMimeType(string $path): ?string '3gpp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], '3gpp2' => ['audio/3gpp2', 'video/3gpp2'], '7z' => ['application/x-7z-compressed'], + '7z.001' => ['application/x-7z-compressed'], 'BLEND' => ['application/x-blender'], 'C' => ['text/x-c++src'], 'PAR2' => ['application/x-par2'], 'PL' => ['application/x-perl', 'text/x-perl'], 'Z' => ['application/x-compress'], + '[1-9]' => ['application/x-troff-man'], 'a' => ['application/x-archive'], 'a26' => ['application/x-atari-2600-rom'], 'a78' => ['application/x-atari-7800-rom'], - 'aa' => ['audio/vnd.audible', 'audio/vnd.audible.aax', 'audio/x-pn-audibleaudio'], + 'aa' => ['audio/vnd.audible', 'audio/x-pn-audibleaudio'], 'aab' => ['application/x-authorware-bin'], 'aac' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], 'aam' => ['application/x-authorware-map'], @@ -1684,11 +1757,13 @@ public function guessMimeType(string $path): ?string 'arw' => ['image/x-sony-arw'], 'as' => ['application/x-applix-spreadsheet'], 'asc' => ['application/pgp', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature', 'text/plain'], + 'asd' => ['text/x-common-lisp'], 'asf' => ['application/vnd.ms-asf', 'video/x-ms-asf', 'video/x-ms-asf-plugin', 'video/x-ms-wm'], 'asm' => ['text/x-asm'], 'aso' => ['application/vnd.accpac.simply.aso'], 'asp' => ['application/x-asp'], 'ass' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts', 'text/x-ssa'], + 'astc' => ['image/astc'], 'asx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-asf', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], 'atc' => ['application/vnd.acucorp'], 'atom' => ['application/atom+xml'], @@ -1699,6 +1774,8 @@ public function guessMimeType(string $path): ?string 'automount' => ['text/x-systemd-unit'], 'avf' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], 'avi' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], + 'avif' => ['image/avif', 'image/avif-sequence'], + 'avifs' => ['image/avif', 'image/avif-sequence'], 'aw' => ['application/applixware', 'application/x-applix-word'], 'awb' => ['audio/amr-wb', 'audio/amr-wb-encrypted'], 'awk' => ['application/x-awk'], @@ -1707,6 +1784,7 @@ public function guessMimeType(string $path): ?string 'azf' => ['application/vnd.airzip.filesecure.azf'], 'azs' => ['application/vnd.airzip.filesecure.azs'], 'azw' => ['application/vnd.amazon.ebook'], + 'azw3' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], 'bak' => ['application/x-trash'], 'bat' => ['application/x-msdownload'], 'bcpio' => ['application/x-bcpio'], @@ -1716,7 +1794,9 @@ public function guessMimeType(string $path): ?string 'bed' => ['application/vnd.realvnc.bed'], 'bh2' => ['application/vnd.fujitsu.oasysprs'], 'bib' => ['text/x-bibtex'], - 'bin' => ['application/octet-stream', 'application/x-saturn-rom', 'application/x-sega-cd-rom'], + 'bik' => ['video/vnd.radgamettools.bink'], + 'bin' => ['application/octet-stream'], + 'bk2' => ['video/vnd.radgamettools.bink'], 'blb' => ['application/x-blorb'], 'blend' => ['application/x-blender'], 'blender' => ['application/x-blender'], @@ -1727,10 +1807,11 @@ public function guessMimeType(string $path): ?string 'box' => ['application/vnd.previewsystems.box'], 'boz' => ['application/x-bzip2'], 'bpk' => ['application/octet-stream'], + 'bps' => ['application/x-bps-patch'], 'bsdiff' => ['application/x-bsdiff'], 'btif' => ['image/prs.btif'], - 'bz' => ['application/x-bzip', 'application/x-bzip2'], - 'bz2' => ['application/x-bz2', 'application/x-bzip', 'application/x-bzip2'], + 'bz' => ['application/bzip2', 'application/x-bzip', 'application/x-bzip2'], + 'bz2' => ['application/x-bz2', 'application/bzip2', 'application/x-bzip', 'application/x-bzip2'], 'c' => ['text/x-c', 'text/x-csrc'], 'c++' => ['text/x-c++src'], 'c11amc' => ['application/vnd.cluetrust.cartomobile-config'], @@ -1752,11 +1833,13 @@ public function guessMimeType(string $path): ?string 'cbt' => ['application/x-cbr', 'application/x-cbt'], 'cbz' => ['application/vnd.comicbook+zip', 'application/x-cbr', 'application/x-cbz'], 'cc' => ['text/x-c', 'text/x-c++src'], + 'cci' => ['application/x-nintendo-3ds-rom'], 'ccmx' => ['application/x-ccmx'], 'cct' => ['application/x-director'], 'ccxml' => ['application/ccxml+xml'], 'cdbcmsg' => ['application/vnd.contact.cmsg'], 'cdf' => ['application/x-netcdf'], + 'cdi' => ['application/x-discjuggler-cd-image'], 'cdkey' => ['application/vnd.mediastation.cdkey'], 'cdmia' => ['application/cdmi-capability'], 'cdmic' => ['application/cdmi-container'], @@ -1773,6 +1856,7 @@ public function guessMimeType(string $path): ?string 'cgb' => ['application/x-gameboy-color-rom'], 'cgm' => ['image/cgm'], 'chat' => ['application/x-chat'], + 'chd' => ['application/x-mame-chd'], 'chm' => ['application/vnd.ms-htmlhelp', 'application/x-chm'], 'chrt' => ['application/vnd.kde.kchart', 'application/x-kchart'], 'cif' => ['chemical/x-cif'], @@ -1805,7 +1889,9 @@ public function guessMimeType(string $path): ?string 'cpio.gz' => ['application/x-cpio-compressed'], 'cpp' => ['text/x-c', 'text/x-c++src'], 'cpt' => ['application/mac-compactpro'], + 'cr' => ['text/crystal', 'text/x-crystal'], 'cr2' => ['image/x-canon-cr2'], + 'cr3' => ['image/x-canon-cr3'], 'crd' => ['application/x-mscardfile'], 'crdownload' => ['application/x-partial-download'], 'crl' => ['application/pkix-crl'], @@ -1815,15 +1901,17 @@ public function guessMimeType(string $path): ?string 'cs' => ['text/x-csharp'], 'csh' => ['application/x-csh'], 'csml' => ['chemical/x-csml'], + 'cso' => ['application/x-compressed-iso'], 'csp' => ['application/vnd.commonspace'], 'css' => ['text/css'], 'cst' => ['application/x-director'], - 'csv' => ['text/csv', 'text/x-comma-separated-values', 'text/x-csv', 'application/csv'], + 'csv' => ['text/csv', 'application/csv', 'text/x-comma-separated-values', 'text/x-csv'], 'csvs' => ['text/csv-schema'], 'cu' => ['application/cu-seeme'], 'cue' => ['application/x-cue'], 'cur' => ['image/x-win-bitmap'], 'curl' => ['text/vnd.curl'], + 'cwk' => ['application/x-appleworks-document'], 'cww' => ['application/prs.cww'], 'cxt' => ['application/x-director'], 'cxx' => ['text/x-c', 'text/x-c++src'], @@ -1831,7 +1919,7 @@ public function guessMimeType(string $path): ?string 'dae' => ['model/vnd.collada+xml'], 'daf' => ['application/vnd.mobius.daf'], 'dar' => ['application/x-dar'], - 'dart' => ['application/vnd.dart'], + 'dart' => ['application/vnd.dart', 'text/x-dart'], 'dataless' => ['application/vnd.fdsn.seed'], 'davmount' => ['application/davmount+xml'], 'dbf' => ['application/dbase', 'application/dbf', 'application/x-dbase', 'application/x-dbf'], @@ -1940,9 +2028,11 @@ public function guessMimeType(string $path): ?string 'etx' => ['text/x-setext'], 'eva' => ['application/x-eva'], 'evy' => ['application/x-envoy'], + 'ex' => ['text/x-elixir'], 'exe' => ['application/x-ms-dos-executable', 'application/x-msdownload'], 'exi' => ['application/exi'], 'exr' => ['image/x-exr'], + 'exs' => ['text/x-elixir'], 'ext' => ['application/vnd.novadigm.ext'], 'ez' => ['application/andrew-inset'], 'ez2' => ['application/vnd.ezpix-album'], @@ -1954,6 +2044,7 @@ public function guessMimeType(string $path): ?string 'f77' => ['text/x-fortran'], 'f90' => ['text/x-fortran'], 'f95' => ['text/x-fortran'], + 'fasl' => ['text/x-common-lisp'], 'fb2' => ['application/x-fictionbook', 'application/x-fictionbook+xml'], 'fb2.zip' => ['application/x-zip-compressed-fb2'], 'fbs' => ['image/vnd.fastbidsheet'], @@ -2016,6 +2107,7 @@ public function guessMimeType(string $path): ?string 'gca' => ['application/x-gca-compressed'], 'gcode' => ['text/x.gcode'], 'gcrd' => ['text/directory', 'text/vcard', 'text/x-vcard'], + 'gdi' => ['application/x-gd-rom-cue'], 'gdl' => ['model/vnd.gdl'], 'ged' => ['application/x-gedcom', 'text/gedcom'], 'gedcom' => ['application/x-gedcom', 'text/gedcom'], @@ -2034,6 +2126,8 @@ public function guessMimeType(string $path): ?string 'gih' => ['image/x-gimp-gih'], 'gim' => ['application/vnd.groove-identity-message'], 'glade' => ['application/x-glade'], + 'glb' => ['model/gltf-binary'], + 'gltf' => ['model/gltf+json'], 'gml' => ['application/gml+xml'], 'gmo' => ['application/x-gettext-translation'], 'gmx' => ['application/vnd.gmx'], @@ -2051,21 +2145,26 @@ public function guessMimeType(string $path): ?string 'gqf' => ['application/vnd.grafeq'], 'gqs' => ['application/vnd.grafeq'], 'gra' => ['application/x-graphite'], + 'gradle' => ['text/x-gradle'], 'gram' => ['application/srgs'], 'gramps' => ['application/x-gramps-xml'], 'gre' => ['application/vnd.geometry-explorer'], + 'groovy' => ['text/x-groovy'], 'grv' => ['application/vnd.groove-injector'], 'grxml' => ['application/srgs+xml'], 'gs' => ['text/x-genie'], 'gsf' => ['application/x-font-ghostscript', 'application/x-font-type1'], + 'gsh' => ['text/x-groovy'], 'gsm' => ['audio/x-gsm'], 'gtar' => ['application/x-gtar', 'application/x-tar'], 'gtm' => ['application/vnd.groove-tool-message'], 'gtw' => ['model/vnd.gtw'], 'gv' => ['text/vnd.graphviz'], 'gvp' => ['text/google-video-pointer', 'text/x-google-video-pointer'], + 'gvy' => ['text/x-groovy'], 'gxf' => ['application/gxf'], 'gxt' => ['application/vnd.geonext'], + 'gy' => ['text/x-groovy'], 'gz' => ['application/x-gzip', 'application/gzip'], 'h' => ['text/x-c', 'text/x-chdr'], 'h++' => ['text/x-c++hdr'], @@ -2092,8 +2191,8 @@ public function guessMimeType(string $path): ?string 'hqx' => ['application/stuffit', 'application/mac-binhex40'], 'hs' => ['text/x-haskell'], 'htke' => ['application/vnd.kenameaapp'], - 'htm' => ['text/html'], - 'html' => ['text/html'], + 'htm' => ['text/html', 'application/xhtml+xml'], + 'html' => ['text/html', 'application/xhtml+xml'], 'hvd' => ['application/vnd.yamaha.hv-dic'], 'hvp' => ['application/vnd.yamaha.hv-voice'], 'hvs' => ['application/vnd.yamaha.hv-script'], @@ -2102,7 +2201,7 @@ public function guessMimeType(string $path): ?string 'hxx' => ['text/x-c++hdr'], 'i2g' => ['application/vnd.intergeo'], 'ica' => ['application/x-ica'], - 'icb' => ['image/x-icb', 'image/x-tga'], + 'icb' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], 'icc' => ['application/vnd.iccprofile'], 'ice' => ['x-conference/x-cooltalk'], 'icm' => ['application/vnd.iccprofile'], @@ -2135,11 +2234,12 @@ public function guessMimeType(string $path): ?string 'iota' => ['application/vnd.astraea-software.iota'], 'ipfix' => ['application/ipfix'], 'ipk' => ['application/vnd.shana.informed.package'], + 'ips' => ['application/x-ips-patch'], 'iptables' => ['text/x-iptables'], 'ipynb' => ['application/x-ipynb+json'], 'irm' => ['application/vnd.ibm.rights-management'], 'irp' => ['application/vnd.irepository.package+xml'], - 'iso' => ['application/x-cd-image', 'application/x-gamecube-iso-image', 'application/x-gamecube-rom', 'application/x-iso9660-image', 'application/x-saturn-rom', 'application/x-sega-cd-rom', 'application/x-wbfs', 'application/x-wia', 'application/x-wii-iso-image', 'application/x-wii-rom'], + 'iso' => ['application/x-cd-image', 'application/x-dreamcast-rom', 'application/x-gamecube-iso-image', 'application/x-gamecube-rom', 'application/x-iso9660-image', 'application/x-saturn-rom', 'application/x-sega-cd-rom', 'application/x-sega-pico-rom', 'application/x-wbfs', 'application/x-wia', 'application/x-wii-iso-image', 'application/x-wii-rom'], 'iso9660' => ['application/x-cd-image', 'application/x-iso9660-image'], 'it' => ['audio/x-it'], 'it87' => ['application/x-it87'], @@ -2174,10 +2274,11 @@ public function guessMimeType(string $path): ?string 'jrd' => ['application/jrd+json'], 'js' => ['text/javascript', 'application/javascript', 'application/x-javascript'], 'jsm' => ['application/javascript', 'application/x-javascript', 'text/javascript'], - 'json' => ['application/json'], + 'json' => ['application/json', 'application/schema+json'], 'json-patch' => ['application/json-patch+json'], 'jsonld' => ['application/ld+json'], 'jsonml' => ['application/jsonml+json'], + 'jxl' => ['image/jxl'], 'k25' => ['image/x-kodak-k25'], 'k7' => ['application/x-thomson-cassette'], 'kar' => ['audio/midi', 'audio/x-midi'], @@ -2187,8 +2288,9 @@ public function guessMimeType(string $path): ?string 'kexi' => ['application/x-kexiproject-sqlite', 'application/x-kexiproject-sqlite2', 'application/x-kexiproject-sqlite3', 'application/x-vnd.kde.kexi'], 'kexic' => ['application/x-kexi-connectiondata'], 'kexis' => ['application/x-kexiproject-shortcut'], - 'key' => ['application/vnd.apple.keynote', 'application/x-iwork-keynote-sffkey'], + 'key' => ['application/pgp-keys', 'application/vnd.apple.keynote', 'application/x-iwork-keynote-sffkey'], 'kfo' => ['application/vnd.kde.kformula', 'application/x-kformula'], + 'kfx' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], 'kia' => ['application/vnd.kidspiration'], 'kil' => ['application/x-killustrator'], 'kino' => ['application/smil', 'application/smil+xml'], @@ -2202,10 +2304,14 @@ public function guessMimeType(string $path): ?string 'kpt' => ['application/vnd.kde.kpresenter', 'application/x-kpresenter'], 'kpxx' => ['application/vnd.ds-keypoint'], 'kra' => ['application/x-krita'], + 'krz' => ['application/x-krita'], 'ks' => ['application/x-java-keystore'], 'ksp' => ['application/vnd.kde.kspread', 'application/x-kspread'], + 'ksy' => ['text/x-kaitai-struct'], + 'kt' => ['text/x-kotlin'], 'ktr' => ['application/vnd.kahootz'], 'ktx' => ['image/ktx'], + 'ktx2' => ['image/ktx2'], 'ktz' => ['application/vnd.kahootz'], 'kud' => ['application/x-kugar'], 'kwd' => ['application/vnd.kde.kword', 'application/x-kword'], @@ -2222,6 +2328,7 @@ public function guessMimeType(string $path): ?string 'lhs' => ['text/x-literate-haskell'], 'lhz' => ['application/x-lhz'], 'link66' => ['application/vnd.route66.link66+xml'], + 'lisp' => ['text/x-common-lisp'], 'list' => ['text/plain'], 'list3820' => ['application/vnd.ibm.modcap'], 'listafp' => ['application/vnd.ibm.modcap'], @@ -2285,6 +2392,7 @@ public function guessMimeType(string $path): ?string 'mbk' => ['application/vnd.mobius.mbk'], 'mbox' => ['application/mbox'], 'mc1' => ['application/vnd.medcalcdata'], + 'mc2' => ['text/vnd.senx.warpscript'], 'mcd' => ['application/vnd.mcd'], 'mcurl' => ['text/vnd.curl.mcurl'], 'md' => ['text/markdown', 'text/x-markdown'], @@ -2334,7 +2442,7 @@ public function guessMimeType(string $path): ?string 'mo3' => ['audio/x-mo3'], 'mobi' => ['application/x-mobipocket-ebook'], 'moc' => ['text/x-moc'], - 'mod' => ['audio/x-mod'], + 'mod' => ['application/x-object', 'audio/x-mod'], 'mods' => ['application/mods+xml'], 'mof' => ['text/x-mof'], 'moov' => ['video/quicktime'], @@ -2416,10 +2524,12 @@ public function guessMimeType(string $path): ?string 'nnw' => ['application/vnd.noblenet-web'], 'not' => ['text/x-mup'], 'npx' => ['image/vnd.net-fpx'], + 'nrw' => ['image/x-nikon-nrw'], 'nsc' => ['application/x-conference', 'application/x-netshow-channel'], 'nsf' => ['application/vnd.lotus-notes'], 'nsv' => ['video/x-nsv'], 'ntf' => ['application/vnd.nitf'], + 'numbers' => ['application/vnd.apple.numbers', 'application/x-iwork-numbers-sffnumbers'], 'nzb' => ['application/x-nzb'], 'o' => ['application/x-object'], 'oa2' => ['application/vnd.fujitsu.oasys2'], @@ -2458,7 +2568,7 @@ public function guessMimeType(string $path): ?string 'opus' => ['audio/ogg', 'audio/x-ogg', 'audio/x-opus+ogg'], 'ora' => ['image/openraster'], 'orf' => ['image/x-olympus-orf'], - 'org' => ['application/vnd.lotus-organizer'], + 'org' => ['application/vnd.lotus-organizer', 'text/org'], 'osf' => ['application/vnd.yamaha.openscoreformat'], 'osfpvg' => ['application/vnd.yamaha.openscoreformat.osfpvg+xml'], 'otc' => ['application/vnd.oasis.opendocument.chart-template'], @@ -2469,9 +2579,10 @@ public function guessMimeType(string $path): ?string 'otp' => ['application/vnd.oasis.opendocument.presentation-template'], 'ots' => ['application/vnd.oasis.opendocument.spreadsheet-template'], 'ott' => ['application/vnd.oasis.opendocument.text-template'], + 'ova' => ['application/ovf', 'application/x-virtualbox-ova'], 'owl' => ['application/rdf+xml', 'text/rdf'], 'owx' => ['application/owl+xml'], - 'oxps' => ['application/oxps', 'application/vnd.ms-xpsdocument', 'application/xps'], + 'oxps' => ['application/oxps'], 'oxt' => ['application/vnd.openofficeorg.extension'], 'p' => ['text/x-pascal'], 'p10' => ['application/pkcs10'], @@ -2485,6 +2596,7 @@ public function guessMimeType(string $path): ?string 'p8' => ['application/pkcs8'], 'p8e' => ['application/pkcs8-encrypted'], 'pack' => ['application/x-java-pack200'], + 'pages' => ['application/vnd.apple.pages', 'application/x-iwork-pages-sffpages'], 'pak' => ['application/x-pak'], 'par2' => ['application/x-par2'], 'part' => ['application/x-partial-download'], @@ -2594,12 +2706,18 @@ public function guessMimeType(string $path): ?string 'py3x' => ['text/x-python3'], 'pya' => ['audio/vnd.ms-playready.media.pya'], 'pyc' => ['application/x-python-bytecode'], + 'pyi' => ['text/x-python3'], 'pyo' => ['application/x-python-bytecode'], + 'pys' => ['application/x-pyspread-bz-spreadsheet'], + 'pysu' => ['application/x-pyspread-spreadsheet'], 'pyv' => ['video/vnd.ms-playready.media.pyv'], 'pyx' => ['text/x-python'], 'qam' => ['application/vnd.epson.quickanime'], 'qbo' => ['application/vnd.intu.qbo'], + 'qcow' => ['application/x-qemu-disk'], + 'qcow2' => ['application/x-qemu-disk'], 'qd' => ['application/x-fd-file', 'application/x-raw-floppy-disk-image'], + 'qed' => ['application/x-qed-disk'], 'qfx' => ['application/vnd.intu.qfx'], 'qif' => ['application/x-qw', 'image/x-quicktime'], 'qml' => ['text/x-qml'], @@ -2658,6 +2776,7 @@ public function guessMimeType(string $path): ?string 'rng' => ['application/xml', 'text/xml'], 'roa' => ['application/rpki-roa'], 'roff' => ['application/x-troff', 'text/troff', 'text/x-troff'], + 'ros' => ['text/x-common-lisp'], 'rp' => ['image/vnd.rn-realpix'], 'rp9' => ['application/vnd.cloanto.rp9'], 'rpm' => ['application/x-redhat-package-manager', 'application/x-rpm'], @@ -2667,6 +2786,7 @@ public function guessMimeType(string $path): ?string 'rs' => ['application/rls-services+xml', 'text/rust'], 'rsd' => ['application/rsd+xml'], 'rss' => ['application/rss+xml', 'text/rss'], + 'rst' => ['text/x-rst'], 'rt' => ['text/vnd.rn-realtext'], 'rtf' => ['application/rtf', 'text/rtf'], 'rtx' => ['text/richtext'], @@ -2676,13 +2796,14 @@ public function guessMimeType(string $path): ?string 's' => ['text/x-asm'], 's3m' => ['audio/s3m', 'audio/x-s3m'], 'saf' => ['application/vnd.yamaha.smaf-audio'], + 'sage' => ['text/x-sagemath'], 'sam' => ['application/x-amipro'], 'sami' => ['application/x-sami'], 'sap' => ['application/x-sap-file', 'application/x-thomson-sap-image'], 'sass' => ['text/x-sass'], 'sav' => ['application/x-spss-sav', 'application/x-spss-savefile'], 'sbml' => ['application/sbml+xml'], - 'sc' => ['application/vnd.ibm.secure-container'], + 'sc' => ['application/vnd.ibm.secure-container', 'text/x-scala'], 'scala' => ['text/x-scala'], 'scd' => ['application/x-msschedule'], 'scm' => ['application/vnd.lotus-screencam', 'text/x-scheme'], @@ -2714,6 +2835,7 @@ public function guessMimeType(string $path): ?string 'sfv' => ['text/x-sfv'], 'sg' => ['application/x-sg1000-rom'], 'sgb' => ['application/x-gameboy-rom'], + 'sgd' => ['application/x-genesis-rom'], 'sgf' => ['application/x-go-sgf'], 'sgi' => ['image/sgi', 'image/x-sgi'], 'sgl' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], @@ -2754,6 +2876,7 @@ public function guessMimeType(string $path): ?string 'smf' => ['application/vnd.stardivision.math'], 'smi' => ['application/smil', 'application/smil+xml', 'application/x-sami'], 'smil' => ['application/smil', 'application/smil+xml'], + 'smk' => ['video/vnd.radgamettools.smacker'], 'sml' => ['application/smil', 'application/smil+xml'], 'sms' => ['application/x-sms-rom'], 'smv' => ['video/x-smv'], @@ -2772,7 +2895,7 @@ public function guessMimeType(string $path): ?string 'spot' => ['text/vnd.in3d.spot'], 'spp' => ['application/scvp-vp-response'], 'spq' => ['application/scvp-vp-request'], - 'spx' => ['audio/ogg', 'audio/x-speex'], + 'spx' => ['application/x-apple-systemprofiler+xml', 'audio/ogg', 'audio/x-speex', 'audio/x-speex+ogg'], 'sql' => ['application/sql', 'application/x-sql', 'text/x-sql'], 'sqlite2' => ['application/x-sqlite2'], 'sqlite3' => ['application/vnd.sqlite3', 'application/x-sqlite3'], @@ -2841,13 +2964,14 @@ public function guessMimeType(string $path): ?string 'tar.lzma' => ['application/x-lzma-compressed-tar'], 'tar.lzo' => ['application/x-tzo'], 'tar.xz' => ['application/x-xz-compressed-tar'], + 'tar.zst' => ['application/x-zstd-compressed-tar'], 'target' => ['text/x-systemd-unit'], 'taz' => ['application/x-tarz'], 'tb2' => ['application/x-bzip-compressed-tar'], 'tbz' => ['application/x-bzip-compressed-tar'], 'tbz2' => ['application/x-bzip-compressed-tar'], 'tcap' => ['application/vnd.3gpp2.tcap'], - 'tcl' => ['application/x-tcl', 'text/x-tcl'], + 'tcl' => ['application/x-tcl', 'text/tcl', 'text/x-tcl'], 'teacher' => ['application/vnd.smart.teacher'], 'tei' => ['application/tei+xml'], 'teicorpus' => ['application/tei+xml'], @@ -2857,7 +2981,7 @@ public function guessMimeType(string $path): ?string 'text' => ['text/plain'], 'tfi' => ['application/thraud+xml'], 'tfm' => ['application/x-tex-tfm'], - 'tga' => ['image/x-icb', 'image/x-tga'], + 'tga' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], 'tgz' => ['application/x-compressed-tar'], 'theme' => ['application/x-theme'], 'themepack' => ['application/x-windows-themepack'], @@ -2865,15 +2989,16 @@ public function guessMimeType(string $path): ?string 'tif' => ['image/tiff'], 'tiff' => ['image/tiff'], 'timer' => ['text/x-systemd-unit'], - 'tk' => ['text/x-tcl'], + 'tk' => ['text/tcl', 'text/x-tcl'], 'tlrz' => ['application/x-lrzip-compressed-tar'], 'tlz' => ['application/x-lzma-compressed-tar'], 'tmo' => ['application/vnd.tmobile-livetv'], 'tnef' => ['application/ms-tnef', 'application/vnd.ms-tnef'], 'tnf' => ['application/ms-tnef', 'application/vnd.ms-tnef'], 'toc' => ['application/x-cdrdao-toc'], + 'toml' => ['application/toml'], 'torrent' => ['application/x-bittorrent'], - 'tpic' => ['image/x-icb', 'image/x-tga'], + 'tpic' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], 'tpl' => ['application/vnd.groove-tool-template'], 'tpt' => ['application/vnd.trid.tpt'], 'tr' => ['application/x-troff', 'text/troff', 'text/x-troff'], @@ -2896,6 +3021,7 @@ public function guessMimeType(string $path): ?string 'txt' => ['text/plain'], 'txz' => ['application/x-xz-compressed-tar'], 'tzo' => ['application/x-tzo'], + 'tzst' => ['application/x-zstd-compressed-tar'], 'u32' => ['application/x-authorware-bin'], 'udeb' => ['application/vnd.debian.binary-package', 'application/x-deb', 'application/x-debian-package'], 'ufd' => ['application/vnd.ufdl'], @@ -2952,6 +3078,7 @@ public function guessMimeType(string $path): ?string 'vala' => ['text/x-vala'], 'vapi' => ['text/x-vala'], 'vb' => ['application/x-virtual-boy-rom'], + 'vbs' => ['text/vbs', 'text/vbscript'], 'vcard' => ['text/directory', 'text/vcard', 'text/x-vcard'], 'vcd' => ['application/x-cdlink'], 'vcf' => ['text/x-vcard', 'text/directory', 'text/vcard'], @@ -2959,17 +3086,21 @@ public function guessMimeType(string $path): ?string 'vcs' => ['application/ics', 'text/calendar', 'text/x-vcalendar'], 'vct' => ['text/directory', 'text/vcard', 'text/x-vcard'], 'vcx' => ['application/vnd.vcx'], - 'vda' => ['image/x-icb', 'image/x-tga'], - 'vhd' => ['text/x-vhdl'], + 'vda' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], + 'vdi' => ['application/x-vdi-disk', 'application/x-virtualbox-vdi'], + 'vhd' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd', 'text/x-vhdl'], 'vhdl' => ['text/x-vhdl'], + 'vhdx' => ['application/x-vhdx-disk', 'application/x-virtualbox-vhdx'], 'vis' => ['application/vnd.visionary'], 'viv' => ['video/vivo', 'video/vnd.vivo'], 'vivo' => ['video/vivo', 'video/vnd.vivo'], 'vlc' => ['application/m3u', 'audio/m3u', 'audio/mpegurl', 'audio/x-m3u', 'audio/x-mp3-playlist', 'audio/x-mpegurl'], + 'vmdk' => ['application/x-virtualbox-vmdk', 'application/x-vmdk-disk'], 'vob' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2', 'video/x-ms-vob'], 'voc' => ['audio/x-voc'], 'vor' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], 'vox' => ['application/x-authorware-bin'], + 'vpc' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd'], 'vrm' => ['model/vrml'], 'vrml' => ['model/vrml'], 'vsd' => ['application/vnd.visio'], @@ -2979,7 +3110,7 @@ public function guessMimeType(string $path): ?string 'vss' => ['application/vnd.visio'], 'vssm' => ['application/vnd.ms-visio.stencil.macroenabled.main+xml'], 'vssx' => ['application/vnd.ms-visio.stencil.main+xml'], - 'vst' => ['application/vnd.visio', 'image/x-icb', 'image/x-tga'], + 'vst' => ['application/tga', 'application/vnd.visio', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], 'vstm' => ['application/vnd.ms-visio.template.macroenabled.main+xml'], 'vstx' => ['application/vnd.ms-visio.template.main+xml'], 'vsw' => ['application/vnd.visio'], @@ -3022,7 +3153,7 @@ public function guessMimeType(string $path): ?string 'wmx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], 'wmz' => ['application/x-ms-wmz', 'application/x-msmetafile'], 'woff' => ['application/font-woff', 'application/x-font-woff', 'font/woff'], - 'woff2' => ['font/woff', 'font/woff2'], + 'woff2' => ['font/woff2'], 'wp' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], 'wp4' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], 'wp5' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], @@ -3109,7 +3240,7 @@ public function guessMimeType(string $path): ?string 'xpl' => ['application/xproc+xml'], 'xpm' => ['image/x-xpixmap', 'image/x-xpm'], 'xpr' => ['application/vnd.is-xpr'], - 'xps' => ['application/oxps', 'application/vnd.ms-xpsdocument', 'application/xps'], + 'xps' => ['application/vnd.ms-xpsdocument', 'application/xps'], 'xpw' => ['application/vnd.intercon.formnet'], 'xpx' => ['application/vnd.intercon.formnet'], 'xsd' => ['application/xml', 'text/xml'], @@ -3146,6 +3277,7 @@ public function guessMimeType(string $path): ?string 'zmm' => ['application/vnd.handheld-entertainment+xml'], 'zoo' => ['application/x-zoo'], 'zsav' => ['application/x-spss-sav', 'application/x-spss-savefile'], + 'zst' => ['application/zstd'], 'zz' => ['application/zlib'], '123' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], '602' => ['application/x-t602'], diff --git a/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php b/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php index 74a9449c75e8d..11af70d129346 100644 --- a/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php +++ b/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php @@ -21,7 +21,7 @@ $new[$mimeType] = $extensions; } -$xml = simplexml_load_string(file_get_contents('https://raw.github.com/minad/mimemagic/master/script/freedesktop.org.xml')); +$xml = simplexml_load_string(file_get_contents('https://gitlab.freedesktop.org/xdg/shared-mime-info/-/raw/master/data/freedesktop.org.xml.in?inline=false')); foreach ($xml as $node) { $exts = []; foreach ($node->glob as $glob) { From 9523fcde74e5087d66762b972b2fda6ef2bf3944 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 1 Sep 2021 20:31:55 +0200 Subject: [PATCH 14/64] Run PHP 8.1 CI with all extensions Signed-off-by: Alexander M. Turek --- .github/workflows/unit-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 430d67c4c8cda..12e4508dcea8b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -39,7 +39,6 @@ jobs: - name: Configure for PHP 8.1 if: "${{ matrix.php == '8.1' }}" run: | - echo "extensions=mbstring" >> $GITHUB_ENV composer config platform.php 8.0.99 - name: Setup PHP From 93f27d993a487d1e7c887b009d59ddf457e3a71d Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 1 Sep 2021 20:29:59 +0200 Subject: [PATCH 15/64] Fix implicit float to int cast --- src/Symfony/Component/Cache/Adapter/AbstractAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php index 71338c3c12e0a..edbdc3ea92a11 100644 --- a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php @@ -121,7 +121,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version, return $opcache; } - $apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version); + $apcu = new ApcuAdapter($namespace, intdiv($defaultLifetime, 5), $version); if (null !== $logger) { $apcu->setLogger($logger); } From a4306d27249635861ddc87c194a5f7bdacbdbfaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20TAMARELLE?= Date: Thu, 2 Sep 2021 22:39:23 +0200 Subject: [PATCH 16/64] Clean about command description after Environment section was removed Change introduced in 5.1 #34768 ec945f10d8da0dc1a3f7e413c3ee92f11c84ed52 --- src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php index 3e359a04cbc42..05e7c3c6767b4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php @@ -44,9 +44,6 @@ protected function configure() The PHP section displays important configuration that could affect your application. The values might be different between web and CLI. - -The Environment section displays the current environment variables managed by Symfony Dotenv. It will not -be shown if no variables were found. The values might be different between web and CLI. EOT ) ; From cefe78da75b8d1107119efe6761fe11dcb66836f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 3 Sep 2021 09:35:20 +0200 Subject: [PATCH 17/64] Revert "bug #42831 [Mime] Update mime types (fabpot)" This reverts commit cac85b34529fafa8f651ac7b9218b0be975a704a, reversing changes made to ced441587bbe139127b8330c2a9d8963618dcaa8. --- src/Symfony/Component/Mime/MimeTypes.php | 224 ++++-------------- .../Mime/Resources/bin/update_mime_types.php | 2 +- 2 files changed, 47 insertions(+), 179 deletions(-) diff --git a/src/Symfony/Component/Mime/MimeTypes.php b/src/Symfony/Component/Mime/MimeTypes.php index 8a570f6d26a9b..e2b5bf4354910 100644 --- a/src/Symfony/Component/Mime/MimeTypes.php +++ b/src/Symfony/Component/Mime/MimeTypes.php @@ -146,7 +146,7 @@ public function guessMimeType(string $path): ?string /** * A map of MIME types and their default extensions. * - * Updated from upstream on 2021-09-01 + * Updated from upstream on 2019-01-16 * * @see Resources/bin/update_mime_types.php */ @@ -158,7 +158,6 @@ public function guessMimeType(string $path): ?string 'application/atom+xml' => ['atom'], 'application/atomcat+xml' => ['atomcat'], 'application/atomsvc+xml' => ['atomsvc'], - 'application/bzip2' => ['bz2', 'bz'], 'application/ccxml+xml' => ['ccxml'], 'application/cdmi-capability' => ['cdmia'], 'application/cdmi-container' => ['cdmic'], @@ -241,15 +240,14 @@ public function guessMimeType(string $path): ?string 'application/ogg' => ['ogx'], 'application/omdoc+xml' => ['omdoc'], 'application/onenote' => ['onetoc', 'onetoc2', 'onetmp', 'onepkg'], - 'application/ovf' => ['ova'], 'application/owl+xml' => ['owx'], - 'application/oxps' => ['oxps'], + 'application/oxps' => ['oxps', 'xps'], 'application/patch-ops-error+xml' => ['xer'], 'application/pcap' => ['pcap', 'cap', 'dmp'], 'application/pdf' => ['pdf'], 'application/pgp' => ['pgp', 'gpg', 'asc'], 'application/pgp-encrypted' => ['pgp', 'gpg', 'asc'], - 'application/pgp-keys' => ['skr', 'pkr', 'asc', 'pgp', 'gpg', 'key'], + 'application/pgp-keys' => ['skr', 'pkr', 'asc', 'pgp', 'gpg'], 'application/pgp-signature' => ['asc', 'sig', 'pgp', 'gpg'], 'application/photoshop' => ['psd'], 'application/pics-rules' => ['prf'], @@ -285,7 +283,6 @@ public function guessMimeType(string $path): ?string 'application/rss+xml' => ['rss'], 'application/rtf' => ['rtf'], 'application/sbml+xml' => ['sbml'], - 'application/schema+json' => ['json'], 'application/scvp-cv-request' => ['scq'], 'application/scvp-cv-response' => ['scs'], 'application/scvp-vp-request' => ['spq'], @@ -307,10 +304,8 @@ public function guessMimeType(string $path): ?string 'application/ssml+xml' => ['ssml'], 'application/stuffit' => ['sit'], 'application/tei+xml' => ['tei', 'teicorpus'], - 'application/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/thraud+xml' => ['tfi'], 'application/timestamped-data' => ['tsd'], - 'application/toml' => ['toml'], 'application/trig' => ['trig'], 'application/vnd.3gpp.pic-bw-large' => ['plb'], 'application/vnd.3gpp.pic-bw-small' => ['psb'], @@ -332,7 +327,6 @@ public function guessMimeType(string $path): ?string 'application/vnd.airzip.filesecure.azf' => ['azf'], 'application/vnd.airzip.filesecure.azs' => ['azs'], 'application/vnd.amazon.ebook' => ['azw'], - 'application/vnd.amazon.mobi8-ebook' => ['azw3', 'kfx'], 'application/vnd.americandynamics.acc' => ['acc'], 'application/vnd.amiga.ami' => ['ami'], 'application/vnd.android.package-archive' => ['apk'], @@ -343,8 +337,6 @@ public function guessMimeType(string $path): ?string 'application/vnd.apple.installer+xml' => ['mpkg'], 'application/vnd.apple.keynote' => ['key'], 'application/vnd.apple.mpegurl' => ['m3u8', 'm3u'], - 'application/vnd.apple.numbers' => ['numbers'], - 'application/vnd.apple.pages' => ['pages'], 'application/vnd.aristanetworks.swi' => ['swi'], 'application/vnd.astraea-software.iota' => ['iota'], 'application/vnd.audiograph' => ['aep'], @@ -557,7 +549,7 @@ public function guessMimeType(string $path): ?string 'application/vnd.ms-word.template.macroenabled.12' => ['dotm'], 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb', 'xlr'], 'application/vnd.ms-wpl' => ['wpl'], - 'application/vnd.ms-xpsdocument' => ['xps'], + 'application/vnd.ms-xpsdocument' => ['xps', 'oxps'], 'application/vnd.msaccess' => ['mdb'], 'application/vnd.mseq' => ['mseq'], 'application/vnd.musician' => ['mus'], @@ -727,7 +719,7 @@ public function guessMimeType(string $path): ?string 'application/wspolicy+xml' => ['wspolicy'], 'application/wwf' => ['wwf'], 'application/x-123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/x-7z-compressed' => ['7z', '7z.001'], + 'application/x-7z-compressed' => ['7z'], 'application/x-abiword' => ['abw', 'abw.CRASHED', 'abw.gz', 'zabw'], 'application/x-ace' => ['ace'], 'application/x-ace-compressed' => ['ace'], @@ -737,8 +729,6 @@ public function guessMimeType(string $path): ?string 'application/x-annodex' => ['anx'], 'application/x-aportisdoc' => ['pdb', 'pdc'], 'application/x-apple-diskimage' => ['dmg'], - 'application/x-apple-systemprofiler+xml' => ['spx'], - 'application/x-appleworks-document' => ['cwk'], 'application/x-applix-spreadsheet' => ['as'], 'application/x-applix-word' => ['aw'], 'application/x-archive' => ['a', 'ar'], @@ -755,7 +745,6 @@ public function guessMimeType(string $path): ?string 'application/x-bittorrent' => ['torrent'], 'application/x-blender' => ['blender', 'blend', 'BLEND'], 'application/x-blorb' => ['blb', 'blorb'], - 'application/x-bps-patch' => ['bps'], 'application/x-bsdiff' => ['bsdiff'], 'application/x-bzdvi' => ['dvi.bz2'], 'application/x-bzip' => ['bz', 'bz2'], @@ -778,7 +767,6 @@ public function guessMimeType(string $path): ?string 'application/x-chm' => ['chm'], 'application/x-cisco-vpn-settings' => ['pcf'], 'application/x-compress' => ['Z'], - 'application/x-compressed-iso' => ['cso'], 'application/x-compressed-tar' => ['tar.gz', 'tgz'], 'application/x-conference' => ['nsc'], 'application/x-coreldraw' => ['cdr'], @@ -798,11 +786,9 @@ public function guessMimeType(string $path): ?string 'application/x-dia-diagram' => ['dia'], 'application/x-dia-shape' => ['shape'], 'application/x-director' => ['dir', 'dcr', 'dxr', 'cst', 'cct', 'cxt', 'w3d', 'fgd', 'swa'], - 'application/x-discjuggler-cd-image' => ['cdi'], 'application/x-docbook+xml' => ['dbk', 'docbook'], 'application/x-doom' => ['wad'], 'application/x-doom-wad' => ['wad'], - 'application/x-dreamcast-rom' => ['iso'], 'application/x-dtbncx+xml' => ['ncx'], 'application/x-dtbook+xml' => ['dtb'], 'application/x-dtbresource+xml' => ['res'], @@ -840,10 +826,9 @@ public function guessMimeType(string $path): ?string 'application/x-gamegear-rom' => ['gg'], 'application/x-gba-rom' => ['gba', 'agb'], 'application/x-gca-compressed' => ['gca'], - 'application/x-gd-rom-cue' => ['gdi'], 'application/x-gedcom' => ['ged', 'gedcom'], 'application/x-genesis-32x-rom' => ['32x', 'mdx'], - 'application/x-genesis-rom' => ['gen', 'smd', 'sgd'], + 'application/x-genesis-rom' => ['gen', 'smd'], 'application/x-gettext' => ['po'], 'application/x-gettext-translation' => ['gmo', 'mo'], 'application/x-glade' => ['glade'], @@ -871,14 +856,11 @@ public function guessMimeType(string $path): ?string 'application/x-hwt' => ['hwt'], 'application/x-ica' => ['ica'], 'application/x-install-instructions' => ['install'], - 'application/x-ips-patch' => ['ips'], 'application/x-ipynb+json' => ['ipynb'], 'application/x-iso9660-appimage' => ['appimage'], 'application/x-iso9660-image' => ['iso', 'iso9660'], 'application/x-it87' => ['it87'], 'application/x-iwork-keynote-sffkey' => ['key'], - 'application/x-iwork-numbers-sffnumbers' => ['numbers'], - 'application/x-iwork-pages-sffpages' => ['pages'], 'application/x-jar' => ['jar'], 'application/x-java' => ['class'], 'application/x-java-archive' => ['jar'], @@ -903,7 +885,7 @@ public function guessMimeType(string $path): ?string 'application/x-kontour' => ['kon'], 'application/x-kpovmodeler' => ['kpm'], 'application/x-kpresenter' => ['kpr', 'kpt'], - 'application/x-krita' => ['kra', 'krz'], + 'application/x-krita' => ['kra'], 'application/x-kspread' => ['ksp'], 'application/x-kugar' => ['kud'], 'application/x-kword' => ['kwd', 'kwt'], @@ -926,14 +908,12 @@ public function guessMimeType(string $path): ?string 'application/x-lzpdf' => ['pdf.lz'], 'application/x-m4' => ['m4'], 'application/x-magicpoint' => ['mgp'], - 'application/x-mame-chd' => ['chd'], 'application/x-markaby' => ['mab'], 'application/x-mathematica' => ['nb'], 'application/x-mdb' => ['mdb'], 'application/x-mie' => ['mie'], 'application/x-mif' => ['mif'], 'application/x-mimearchive' => ['mhtml', 'mht'], - 'application/x-mobi8-ebook' => ['azw3', 'kfx'], 'application/x-mobipocket-ebook' => ['prc', 'mobi'], 'application/x-ms-application' => ['application'], 'application/x-ms-asx' => ['asx', 'wax', 'wvx', 'wmx'], @@ -968,11 +948,9 @@ public function guessMimeType(string $path): ?string 'application/x-nes-rom' => ['nes', 'nez', 'unf', 'unif'], 'application/x-netcdf' => ['nc', 'cdf'], 'application/x-netshow-channel' => ['nsc'], - 'application/x-nintendo-3ds-executable' => ['3dsx'], - 'application/x-nintendo-3ds-rom' => ['3ds', 'cci'], 'application/x-nintendo-ds-rom' => ['nds'], 'application/x-nzb' => ['nzb'], - 'application/x-object' => ['o', 'mod'], + 'application/x-object' => ['o'], 'application/x-ogg' => ['ogx'], 'application/x-oleo' => ['oleo'], 'application/x-pagemaker' => ['p65', 'pm', 'pm6', 'pmd'], @@ -992,11 +970,7 @@ public function guessMimeType(string $path): ?string 'application/x-planperfect' => ['pln'], 'application/x-pocket-word' => ['psw'], 'application/x-pw' => ['pw'], - 'application/x-pyspread-bz-spreadsheet' => ['pys'], - 'application/x-pyspread-spreadsheet' => ['pysu'], 'application/x-python-bytecode' => ['pyc', 'pyo'], - 'application/x-qed-disk' => ['qed'], - 'application/x-qemu-disk' => ['qcow2', 'qcow'], 'application/x-qpress' => ['qp'], 'application/x-qtiplot' => ['qti', 'qti.gz'], 'application/x-quattropro' => ['wb1', 'wb2', 'wb3'], @@ -1016,10 +990,9 @@ public function guessMimeType(string $path): ?string 'application/x-ruby' => ['rb'], 'application/x-sami' => ['smi', 'sami'], 'application/x-sap-file' => ['sap'], - 'application/x-saturn-rom' => ['iso'], + 'application/x-saturn-rom' => ['bin', 'iso'], 'application/x-sdp' => ['sdp'], - 'application/x-sega-cd-rom' => ['iso'], - 'application/x-sega-pico-rom' => ['iso'], + 'application/x-sega-cd-rom' => ['bin', 'iso'], 'application/x-sg1000-rom' => ['sg'], 'application/x-sh' => ['sh'], 'application/x-shar' => ['shar'], @@ -1051,7 +1024,6 @@ public function guessMimeType(string $path): ?string 'application/x-t602' => ['602'], 'application/x-tads' => ['gam'], 'application/x-tar' => ['tar', 'gtar', 'gem'], - 'application/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/x-tarz' => ['tar.Z', 'taz'], 'application/x-tcl' => ['tcl'], 'application/x-tex' => ['tex', 'ltx', 'sty', 'cls', 'dtx', 'ins', 'latex'], @@ -1059,7 +1031,6 @@ public function guessMimeType(string $path): ?string 'application/x-tex-pk' => ['pk'], 'application/x-tex-tfm' => ['tfm'], 'application/x-texinfo' => ['texinfo', 'texi'], - 'application/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'application/x-tgif' => ['obj'], 'application/x-theme' => ['theme'], 'application/x-thomson-cartridge-memo7' => ['m7'], @@ -1068,20 +1039,11 @@ public function guessMimeType(string $path): ?string 'application/x-trash' => ['bak', 'old', 'sik'], 'application/x-trig' => ['trig'], 'application/x-troff' => ['tr', 'roff', 't'], - 'application/x-troff-man' => ['man', '[1-9]'], + 'application/x-troff-man' => ['man'], 'application/x-tzo' => ['tar.lzo', 'tzo'], 'application/x-ufraw' => ['ufraw'], 'application/x-ustar' => ['ustar'], - 'application/x-vdi-disk' => ['vdi'], - 'application/x-vhd-disk' => ['vhd', 'vpc'], - 'application/x-vhdx-disk' => ['vhdx'], 'application/x-virtual-boy-rom' => ['vb'], - 'application/x-virtualbox-ova' => ['ova'], - 'application/x-virtualbox-vdi' => ['vdi'], - 'application/x-virtualbox-vhd' => ['vhd', 'vpc'], - 'application/x-virtualbox-vhdx' => ['vhdx'], - 'application/x-virtualbox-vmdk' => ['vmdk'], - 'application/x-vmdk-disk' => ['vmdk'], 'application/x-vnd.kde.kexi' => ['kexi'], 'application/x-wais-source' => ['src'], 'application/x-wbfs' => ['iso'], @@ -1113,18 +1075,17 @@ public function guessMimeType(string $path): ?string 'application/x-zip-compressed-fb2' => ['fb2.zip'], 'application/x-zmachine' => ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'], 'application/x-zoo' => ['zoo'], - 'application/x-zstd-compressed-tar' => ['tar.zst', 'tzst'], 'application/xaml+xml' => ['xaml'], 'application/xcap-diff+xml' => ['xdf'], 'application/xenc+xml' => ['xenc'], - 'application/xhtml+xml' => ['xhtml', 'xht', 'html', 'htm'], + 'application/xhtml+xml' => ['xhtml', 'xht'], 'application/xliff+xml' => ['xlf', 'xliff'], 'application/xml' => ['xml', 'xsl', 'xbl', 'xsd', 'rng'], 'application/xml-dtd' => ['dtd'], 'application/xml-external-parsed-entity' => ['ent'], 'application/xop+xml' => ['xop'], 'application/xproc+xml' => ['xpl'], - 'application/xps' => ['xps'], + 'application/xps' => ['oxps', 'xps'], 'application/xslt+xml' => ['xslt', 'xsl'], 'application/xspf+xml' => ['xspf'], 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], @@ -1132,7 +1093,6 @@ public function guessMimeType(string $path): ?string 'application/yin+xml' => ['yin'], 'application/zip' => ['zip'], 'application/zlib' => ['zz'], - 'application/zstd' => ['zst'], 'audio/3gpp' => ['3gp', '3gpp', '3ga'], 'audio/3gpp-encrypted' => ['3gp', '3gpp', '3ga'], 'audio/3gpp2' => ['3g2', '3gp2', '3gpp2'], @@ -1164,7 +1124,7 @@ public function guessMimeType(string $path): ?string 'audio/tta' => ['tta'], 'audio/usac' => ['loas', 'xhe'], 'audio/vnd.audible' => ['aa', 'aax'], - 'audio/vnd.audible.aax' => ['aax'], + 'audio/vnd.audible.aax' => ['aa', 'aax'], 'audio/vnd.dece.audio' => ['uva', 'uvva'], 'audio/vnd.digital-winds' => ['eol'], 'audio/vnd.dra' => ['dra'], @@ -1235,7 +1195,7 @@ public function guessMimeType(string $path): ?string 'audio/x-scpls' => ['pls'], 'audio/x-shorten' => ['shn'], 'audio/x-speex' => ['spx'], - 'audio/x-speex+ogg' => ['oga', 'ogg', 'spx'], + 'audio/x-speex+ogg' => ['oga', 'ogg'], 'audio/x-stm' => ['stm'], 'audio/x-tta' => ['tta'], 'audio/x-voc' => ['voc'], @@ -1259,11 +1219,8 @@ public function guessMimeType(string $path): ?string 'font/collection' => ['ttc'], 'font/otf' => ['otf'], 'font/ttf' => ['ttf'], - 'font/woff' => ['woff'], + 'font/woff' => ['woff', 'woff2'], 'font/woff2' => ['woff2'], - 'image/astc' => ['astc'], - 'image/avif' => ['avif', 'avifs'], - 'image/avif-sequence' => ['avif', 'avifs'], 'image/bmp' => ['bmp', 'dib'], 'image/cdr' => ['cdr'], 'image/cgm' => ['cgm'], @@ -1285,13 +1242,11 @@ public function guessMimeType(string $path): ?string 'image/jpeg2000-image' => ['jp2', 'jpg2'], 'image/jpm' => ['jpm', 'jpgm'], 'image/jpx' => ['jpf', 'jpx'], - 'image/jxl' => ['jxl'], 'image/ktx' => ['ktx'], - 'image/ktx2' => ['ktx2'], 'image/openraster' => ['ora'], 'image/pdf' => ['pdf'], 'image/photoshop' => ['psd'], - 'image/pjpeg' => ['jpg', 'jpeg', 'jpe'], + 'image/pjpeg' => ['jpeg', 'jpg', 'jpe'], 'image/png' => ['png'], 'image/prs.btif' => ['btif'], 'image/psd' => ['psd'], @@ -1300,8 +1255,6 @@ public function guessMimeType(string $path): ?string 'image/svg' => ['svg'], 'image/svg+xml' => ['svg', 'svgz'], 'image/svg+xml-compressed' => ['svgz'], - 'image/targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/tiff' => ['tiff', 'tif'], 'image/vnd.adobe.photoshop' => ['psd'], 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], @@ -1331,7 +1284,6 @@ public function guessMimeType(string $path): ?string 'image/x-bmp' => ['bmp', 'dib'], 'image/x-bzeps' => ['eps.bz2', 'epsi.bz2', 'epsf.bz2'], 'image/x-canon-cr2' => ['cr2'], - 'image/x-canon-cr3' => ['cr3'], 'image/x-canon-crw' => ['crw'], 'image/x-cdr' => ['cdr'], 'image/x-cmu-raster' => ['ras'], @@ -1369,7 +1321,6 @@ public function guessMimeType(string $path): ?string 'image/x-ms-bmp' => ['bmp', 'dib'], 'image/x-msod' => ['msod'], 'image/x-nikon-nef' => ['nef'], - 'image/x-nikon-nrw' => ['nrw'], 'image/x-olympus-orf' => ['orf'], 'image/x-panasonic-raw' => ['raw'], 'image/x-panasonic-raw2' => ['rw2'], @@ -1394,7 +1345,6 @@ public function guessMimeType(string $path): ?string 'image/x-sony-sr2' => ['sr2'], 'image/x-sony-srf' => ['srf'], 'image/x-sun-raster' => ['sun'], - 'image/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], 'image/x-win-bitmap' => ['cur'], 'image/x-win-metafile' => ['wmf'], @@ -1407,8 +1357,6 @@ public function guessMimeType(string $path): ?string 'image/x-xwindowdump' => ['xwd'], 'image/x.djvu' => ['djvu', 'djv'], 'message/rfc822' => ['eml', 'mime'], - 'model/gltf+json' => ['gltf'], - 'model/gltf-binary' => ['glb'], 'model/iges' => ['igs', 'iges'], 'model/mesh' => ['msh', 'mesh', 'silo'], 'model/stl' => ['stl'], @@ -1426,7 +1374,6 @@ public function guessMimeType(string $path): ?string 'model/x3d+xml' => ['x3d', 'x3dz'], 'text/cache-manifest' => ['appcache', 'manifest'], 'text/calendar' => ['ics', 'ifb', 'vcs'], - 'text/crystal' => ['cr'], 'text/css' => ['css'], 'text/csv' => ['csv'], 'text/csv-schema' => ['csvs'], @@ -1440,7 +1387,6 @@ public function guessMimeType(string $path): ?string 'text/markdown' => ['md', 'mkd', 'markdown'], 'text/mathml' => ['mml'], 'text/n3' => ['n3'], - 'text/org' => ['org'], 'text/plain' => ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'asc'], 'text/prs.lines.tag' => ['dsc'], 'text/rdf' => ['rdf', 'rdfs', 'owl'], @@ -1451,12 +1397,9 @@ public function guessMimeType(string $path): ?string 'text/sgml' => ['sgml', 'sgm'], 'text/spreadsheet' => ['sylk', 'slk'], 'text/tab-separated-values' => ['tsv'], - 'text/tcl' => ['tcl', 'tk'], 'text/troff' => ['t', 'tr', 'roff', 'man', 'me', 'ms'], 'text/turtle' => ['ttl'], 'text/uri-list' => ['uri', 'uris', 'urls'], - 'text/vbs' => ['vbs'], - 'text/vbscript' => ['vbs'], 'text/vcard' => ['vcard', 'vcf', 'vct', 'gcrd'], 'text/vnd.curl' => ['curl'], 'text/vnd.curl.dcurl' => ['dcurl'], @@ -1470,7 +1413,6 @@ public function guessMimeType(string $path): ?string 'text/vnd.in3d.spot' => ['spot'], 'text/vnd.qt.linguist' => ['ts'], 'text/vnd.rn-realtext' => ['rt'], - 'text/vnd.senx.warpscript' => ['mc2'], 'text/vnd.sun.j2me.app-descriptor' => ['jad'], 'text/vnd.trolltech.linguist' => ['ts'], 'text/vnd.wap.wml' => ['wml'], @@ -1486,12 +1428,9 @@ public function guessMimeType(string $path): ?string 'text/x-cmake' => ['cmake'], 'text/x-cobol' => ['cbl', 'cob'], 'text/x-comma-separated-values' => ['csv'], - 'text/x-common-lisp' => ['asd', 'fasl', 'lisp', 'ros'], - 'text/x-crystal' => ['cr'], 'text/x-csharp' => ['cs'], 'text/x-csrc' => ['c'], 'text/x-csv' => ['csv'], - 'text/x-dart' => ['dart'], 'text/x-dbus-service' => ['service'], 'text/x-dcl' => ['dcl'], 'text/x-diff' => ['diff', 'patch'], @@ -1499,7 +1438,6 @@ public function guessMimeType(string $path): ?string 'text/x-dsrc' => ['d', 'di'], 'text/x-dtd' => ['dtd'], 'text/x-eiffel' => ['e', 'eif'], - 'text/x-elixir' => ['ex', 'exs'], 'text/x-emacs-lisp' => ['el'], 'text/x-erlang' => ['erl'], 'text/x-fortran' => ['f', 'for', 'f77', 'f90', 'f95'], @@ -1509,16 +1447,12 @@ public function guessMimeType(string $path): ?string 'text/x-gherkin' => ['feature'], 'text/x-go' => ['go'], 'text/x-google-video-pointer' => ['gvp'], - 'text/x-gradle' => ['gradle'], - 'text/x-groovy' => ['groovy', 'gvy', 'gy', 'gsh'], 'text/x-haskell' => ['hs'], 'text/x-idl' => ['idl'], 'text/x-imelody' => ['imy', 'ime'], 'text/x-iptables' => ['iptables'], 'text/x-java' => ['java'], 'text/x-java-source' => ['java'], - 'text/x-kaitai-struct' => ['ksy'], - 'text/x-kotlin' => ['kt'], 'text/x-ldif' => ['ldif'], 'text/x-lilypond' => ['ly'], 'text/x-literate-haskell' => ['lhs'], @@ -1551,14 +1485,12 @@ public function guessMimeType(string $path): ?string 'text/x-po' => ['po'], 'text/x-pot' => ['pot'], 'text/x-python' => ['py', 'pyx', 'wsgi'], - 'text/x-python3' => ['py', 'py3', 'py3x', 'pyi'], + 'text/x-python3' => ['py', 'py3', 'py3x'], 'text/x-qml' => ['qml', 'qmltypes', 'qmlproject'], 'text/x-reject' => ['rej'], 'text/x-rpm-spec' => ['spec'], - 'text/x-rst' => ['rst'], - 'text/x-sagemath' => ['sage'], 'text/x-sass' => ['sass'], - 'text/x-scala' => ['scala', 'sc'], + 'text/x-scala' => ['scala'], 'text/x-scheme' => ['scm', 'ss'], 'text/x-scss' => ['scss'], 'text/x-setext' => ['etx'], @@ -1628,8 +1560,6 @@ public function guessMimeType(string $path): ?string 'video/vnd.fvt' => ['fvt'], 'video/vnd.mpegurl' => ['mxu', 'm4u', 'm1u'], 'video/vnd.ms-playready.media.pyv' => ['pyv'], - 'video/vnd.radgamettools.bink' => ['bik', 'bk2'], - 'video/vnd.radgamettools.smacker' => ['smk'], 'video/vnd.rn-realvideo' => ['rv', 'rvx'], 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], 'video/vnd.vivo' => ['viv', 'vivo'], @@ -1684,8 +1614,7 @@ public function guessMimeType(string $path): ?string private const REVERSE_MAP = [ '32x' => ['application/x-genesis-32x-rom'], '3dml' => ['text/vnd.in3d.3dml'], - '3ds' => ['application/x-nintendo-3ds-rom', 'image/x-3ds'], - '3dsx' => ['application/x-nintendo-3ds-executable'], + '3ds' => ['image/x-3ds'], '3g2' => ['audio/3gpp2', 'video/3gpp2'], '3ga' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], '3gp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], @@ -1693,17 +1622,15 @@ public function guessMimeType(string $path): ?string '3gpp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], '3gpp2' => ['audio/3gpp2', 'video/3gpp2'], '7z' => ['application/x-7z-compressed'], - '7z.001' => ['application/x-7z-compressed'], 'BLEND' => ['application/x-blender'], 'C' => ['text/x-c++src'], 'PAR2' => ['application/x-par2'], 'PL' => ['application/x-perl', 'text/x-perl'], 'Z' => ['application/x-compress'], - '[1-9]' => ['application/x-troff-man'], 'a' => ['application/x-archive'], 'a26' => ['application/x-atari-2600-rom'], 'a78' => ['application/x-atari-7800-rom'], - 'aa' => ['audio/vnd.audible', 'audio/x-pn-audibleaudio'], + 'aa' => ['audio/vnd.audible', 'audio/vnd.audible.aax', 'audio/x-pn-audibleaudio'], 'aab' => ['application/x-authorware-bin'], 'aac' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], 'aam' => ['application/x-authorware-map'], @@ -1757,13 +1684,11 @@ public function guessMimeType(string $path): ?string 'arw' => ['image/x-sony-arw'], 'as' => ['application/x-applix-spreadsheet'], 'asc' => ['application/pgp', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature', 'text/plain'], - 'asd' => ['text/x-common-lisp'], 'asf' => ['application/vnd.ms-asf', 'video/x-ms-asf', 'video/x-ms-asf-plugin', 'video/x-ms-wm'], 'asm' => ['text/x-asm'], 'aso' => ['application/vnd.accpac.simply.aso'], 'asp' => ['application/x-asp'], 'ass' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts', 'text/x-ssa'], - 'astc' => ['image/astc'], 'asx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-asf', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], 'atc' => ['application/vnd.acucorp'], 'atom' => ['application/atom+xml'], @@ -1774,8 +1699,6 @@ public function guessMimeType(string $path): ?string 'automount' => ['text/x-systemd-unit'], 'avf' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], 'avi' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], - 'avif' => ['image/avif', 'image/avif-sequence'], - 'avifs' => ['image/avif', 'image/avif-sequence'], 'aw' => ['application/applixware', 'application/x-applix-word'], 'awb' => ['audio/amr-wb', 'audio/amr-wb-encrypted'], 'awk' => ['application/x-awk'], @@ -1784,7 +1707,6 @@ public function guessMimeType(string $path): ?string 'azf' => ['application/vnd.airzip.filesecure.azf'], 'azs' => ['application/vnd.airzip.filesecure.azs'], 'azw' => ['application/vnd.amazon.ebook'], - 'azw3' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], 'bak' => ['application/x-trash'], 'bat' => ['application/x-msdownload'], 'bcpio' => ['application/x-bcpio'], @@ -1794,9 +1716,7 @@ public function guessMimeType(string $path): ?string 'bed' => ['application/vnd.realvnc.bed'], 'bh2' => ['application/vnd.fujitsu.oasysprs'], 'bib' => ['text/x-bibtex'], - 'bik' => ['video/vnd.radgamettools.bink'], - 'bin' => ['application/octet-stream'], - 'bk2' => ['video/vnd.radgamettools.bink'], + 'bin' => ['application/octet-stream', 'application/x-saturn-rom', 'application/x-sega-cd-rom'], 'blb' => ['application/x-blorb'], 'blend' => ['application/x-blender'], 'blender' => ['application/x-blender'], @@ -1807,11 +1727,10 @@ public function guessMimeType(string $path): ?string 'box' => ['application/vnd.previewsystems.box'], 'boz' => ['application/x-bzip2'], 'bpk' => ['application/octet-stream'], - 'bps' => ['application/x-bps-patch'], 'bsdiff' => ['application/x-bsdiff'], 'btif' => ['image/prs.btif'], - 'bz' => ['application/bzip2', 'application/x-bzip', 'application/x-bzip2'], - 'bz2' => ['application/x-bz2', 'application/bzip2', 'application/x-bzip', 'application/x-bzip2'], + 'bz' => ['application/x-bzip', 'application/x-bzip2'], + 'bz2' => ['application/x-bz2', 'application/x-bzip', 'application/x-bzip2'], 'c' => ['text/x-c', 'text/x-csrc'], 'c++' => ['text/x-c++src'], 'c11amc' => ['application/vnd.cluetrust.cartomobile-config'], @@ -1833,13 +1752,11 @@ public function guessMimeType(string $path): ?string 'cbt' => ['application/x-cbr', 'application/x-cbt'], 'cbz' => ['application/vnd.comicbook+zip', 'application/x-cbr', 'application/x-cbz'], 'cc' => ['text/x-c', 'text/x-c++src'], - 'cci' => ['application/x-nintendo-3ds-rom'], 'ccmx' => ['application/x-ccmx'], 'cct' => ['application/x-director'], 'ccxml' => ['application/ccxml+xml'], 'cdbcmsg' => ['application/vnd.contact.cmsg'], 'cdf' => ['application/x-netcdf'], - 'cdi' => ['application/x-discjuggler-cd-image'], 'cdkey' => ['application/vnd.mediastation.cdkey'], 'cdmia' => ['application/cdmi-capability'], 'cdmic' => ['application/cdmi-container'], @@ -1856,7 +1773,6 @@ public function guessMimeType(string $path): ?string 'cgb' => ['application/x-gameboy-color-rom'], 'cgm' => ['image/cgm'], 'chat' => ['application/x-chat'], - 'chd' => ['application/x-mame-chd'], 'chm' => ['application/vnd.ms-htmlhelp', 'application/x-chm'], 'chrt' => ['application/vnd.kde.kchart', 'application/x-kchart'], 'cif' => ['chemical/x-cif'], @@ -1889,9 +1805,7 @@ public function guessMimeType(string $path): ?string 'cpio.gz' => ['application/x-cpio-compressed'], 'cpp' => ['text/x-c', 'text/x-c++src'], 'cpt' => ['application/mac-compactpro'], - 'cr' => ['text/crystal', 'text/x-crystal'], 'cr2' => ['image/x-canon-cr2'], - 'cr3' => ['image/x-canon-cr3'], 'crd' => ['application/x-mscardfile'], 'crdownload' => ['application/x-partial-download'], 'crl' => ['application/pkix-crl'], @@ -1901,17 +1815,15 @@ public function guessMimeType(string $path): ?string 'cs' => ['text/x-csharp'], 'csh' => ['application/x-csh'], 'csml' => ['chemical/x-csml'], - 'cso' => ['application/x-compressed-iso'], 'csp' => ['application/vnd.commonspace'], 'css' => ['text/css'], 'cst' => ['application/x-director'], - 'csv' => ['text/csv', 'application/csv', 'text/x-comma-separated-values', 'text/x-csv'], + 'csv' => ['text/csv', 'text/x-comma-separated-values', 'text/x-csv', 'application/csv'], 'csvs' => ['text/csv-schema'], 'cu' => ['application/cu-seeme'], 'cue' => ['application/x-cue'], 'cur' => ['image/x-win-bitmap'], 'curl' => ['text/vnd.curl'], - 'cwk' => ['application/x-appleworks-document'], 'cww' => ['application/prs.cww'], 'cxt' => ['application/x-director'], 'cxx' => ['text/x-c', 'text/x-c++src'], @@ -1919,7 +1831,7 @@ public function guessMimeType(string $path): ?string 'dae' => ['model/vnd.collada+xml'], 'daf' => ['application/vnd.mobius.daf'], 'dar' => ['application/x-dar'], - 'dart' => ['application/vnd.dart', 'text/x-dart'], + 'dart' => ['application/vnd.dart'], 'dataless' => ['application/vnd.fdsn.seed'], 'davmount' => ['application/davmount+xml'], 'dbf' => ['application/dbase', 'application/dbf', 'application/x-dbase', 'application/x-dbf'], @@ -2028,11 +1940,9 @@ public function guessMimeType(string $path): ?string 'etx' => ['text/x-setext'], 'eva' => ['application/x-eva'], 'evy' => ['application/x-envoy'], - 'ex' => ['text/x-elixir'], 'exe' => ['application/x-ms-dos-executable', 'application/x-msdownload'], 'exi' => ['application/exi'], 'exr' => ['image/x-exr'], - 'exs' => ['text/x-elixir'], 'ext' => ['application/vnd.novadigm.ext'], 'ez' => ['application/andrew-inset'], 'ez2' => ['application/vnd.ezpix-album'], @@ -2044,7 +1954,6 @@ public function guessMimeType(string $path): ?string 'f77' => ['text/x-fortran'], 'f90' => ['text/x-fortran'], 'f95' => ['text/x-fortran'], - 'fasl' => ['text/x-common-lisp'], 'fb2' => ['application/x-fictionbook', 'application/x-fictionbook+xml'], 'fb2.zip' => ['application/x-zip-compressed-fb2'], 'fbs' => ['image/vnd.fastbidsheet'], @@ -2107,7 +2016,6 @@ public function guessMimeType(string $path): ?string 'gca' => ['application/x-gca-compressed'], 'gcode' => ['text/x.gcode'], 'gcrd' => ['text/directory', 'text/vcard', 'text/x-vcard'], - 'gdi' => ['application/x-gd-rom-cue'], 'gdl' => ['model/vnd.gdl'], 'ged' => ['application/x-gedcom', 'text/gedcom'], 'gedcom' => ['application/x-gedcom', 'text/gedcom'], @@ -2126,8 +2034,6 @@ public function guessMimeType(string $path): ?string 'gih' => ['image/x-gimp-gih'], 'gim' => ['application/vnd.groove-identity-message'], 'glade' => ['application/x-glade'], - 'glb' => ['model/gltf-binary'], - 'gltf' => ['model/gltf+json'], 'gml' => ['application/gml+xml'], 'gmo' => ['application/x-gettext-translation'], 'gmx' => ['application/vnd.gmx'], @@ -2145,26 +2051,21 @@ public function guessMimeType(string $path): ?string 'gqf' => ['application/vnd.grafeq'], 'gqs' => ['application/vnd.grafeq'], 'gra' => ['application/x-graphite'], - 'gradle' => ['text/x-gradle'], 'gram' => ['application/srgs'], 'gramps' => ['application/x-gramps-xml'], 'gre' => ['application/vnd.geometry-explorer'], - 'groovy' => ['text/x-groovy'], 'grv' => ['application/vnd.groove-injector'], 'grxml' => ['application/srgs+xml'], 'gs' => ['text/x-genie'], 'gsf' => ['application/x-font-ghostscript', 'application/x-font-type1'], - 'gsh' => ['text/x-groovy'], 'gsm' => ['audio/x-gsm'], 'gtar' => ['application/x-gtar', 'application/x-tar'], 'gtm' => ['application/vnd.groove-tool-message'], 'gtw' => ['model/vnd.gtw'], 'gv' => ['text/vnd.graphviz'], 'gvp' => ['text/google-video-pointer', 'text/x-google-video-pointer'], - 'gvy' => ['text/x-groovy'], 'gxf' => ['application/gxf'], 'gxt' => ['application/vnd.geonext'], - 'gy' => ['text/x-groovy'], 'gz' => ['application/x-gzip', 'application/gzip'], 'h' => ['text/x-c', 'text/x-chdr'], 'h++' => ['text/x-c++hdr'], @@ -2191,8 +2092,8 @@ public function guessMimeType(string $path): ?string 'hqx' => ['application/stuffit', 'application/mac-binhex40'], 'hs' => ['text/x-haskell'], 'htke' => ['application/vnd.kenameaapp'], - 'htm' => ['text/html', 'application/xhtml+xml'], - 'html' => ['text/html', 'application/xhtml+xml'], + 'htm' => ['text/html'], + 'html' => ['text/html'], 'hvd' => ['application/vnd.yamaha.hv-dic'], 'hvp' => ['application/vnd.yamaha.hv-voice'], 'hvs' => ['application/vnd.yamaha.hv-script'], @@ -2201,7 +2102,7 @@ public function guessMimeType(string $path): ?string 'hxx' => ['text/x-c++hdr'], 'i2g' => ['application/vnd.intergeo'], 'ica' => ['application/x-ica'], - 'icb' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], + 'icb' => ['image/x-icb', 'image/x-tga'], 'icc' => ['application/vnd.iccprofile'], 'ice' => ['x-conference/x-cooltalk'], 'icm' => ['application/vnd.iccprofile'], @@ -2234,12 +2135,11 @@ public function guessMimeType(string $path): ?string 'iota' => ['application/vnd.astraea-software.iota'], 'ipfix' => ['application/ipfix'], 'ipk' => ['application/vnd.shana.informed.package'], - 'ips' => ['application/x-ips-patch'], 'iptables' => ['text/x-iptables'], 'ipynb' => ['application/x-ipynb+json'], 'irm' => ['application/vnd.ibm.rights-management'], 'irp' => ['application/vnd.irepository.package+xml'], - 'iso' => ['application/x-cd-image', 'application/x-dreamcast-rom', 'application/x-gamecube-iso-image', 'application/x-gamecube-rom', 'application/x-iso9660-image', 'application/x-saturn-rom', 'application/x-sega-cd-rom', 'application/x-sega-pico-rom', 'application/x-wbfs', 'application/x-wia', 'application/x-wii-iso-image', 'application/x-wii-rom'], + 'iso' => ['application/x-cd-image', 'application/x-gamecube-iso-image', 'application/x-gamecube-rom', 'application/x-iso9660-image', 'application/x-saturn-rom', 'application/x-sega-cd-rom', 'application/x-wbfs', 'application/x-wia', 'application/x-wii-iso-image', 'application/x-wii-rom'], 'iso9660' => ['application/x-cd-image', 'application/x-iso9660-image'], 'it' => ['audio/x-it'], 'it87' => ['application/x-it87'], @@ -2274,11 +2174,10 @@ public function guessMimeType(string $path): ?string 'jrd' => ['application/jrd+json'], 'js' => ['text/javascript', 'application/javascript', 'application/x-javascript'], 'jsm' => ['application/javascript', 'application/x-javascript', 'text/javascript'], - 'json' => ['application/json', 'application/schema+json'], + 'json' => ['application/json'], 'json-patch' => ['application/json-patch+json'], 'jsonld' => ['application/ld+json'], 'jsonml' => ['application/jsonml+json'], - 'jxl' => ['image/jxl'], 'k25' => ['image/x-kodak-k25'], 'k7' => ['application/x-thomson-cassette'], 'kar' => ['audio/midi', 'audio/x-midi'], @@ -2288,9 +2187,8 @@ public function guessMimeType(string $path): ?string 'kexi' => ['application/x-kexiproject-sqlite', 'application/x-kexiproject-sqlite2', 'application/x-kexiproject-sqlite3', 'application/x-vnd.kde.kexi'], 'kexic' => ['application/x-kexi-connectiondata'], 'kexis' => ['application/x-kexiproject-shortcut'], - 'key' => ['application/pgp-keys', 'application/vnd.apple.keynote', 'application/x-iwork-keynote-sffkey'], + 'key' => ['application/vnd.apple.keynote', 'application/x-iwork-keynote-sffkey'], 'kfo' => ['application/vnd.kde.kformula', 'application/x-kformula'], - 'kfx' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], 'kia' => ['application/vnd.kidspiration'], 'kil' => ['application/x-killustrator'], 'kino' => ['application/smil', 'application/smil+xml'], @@ -2304,14 +2202,10 @@ public function guessMimeType(string $path): ?string 'kpt' => ['application/vnd.kde.kpresenter', 'application/x-kpresenter'], 'kpxx' => ['application/vnd.ds-keypoint'], 'kra' => ['application/x-krita'], - 'krz' => ['application/x-krita'], 'ks' => ['application/x-java-keystore'], 'ksp' => ['application/vnd.kde.kspread', 'application/x-kspread'], - 'ksy' => ['text/x-kaitai-struct'], - 'kt' => ['text/x-kotlin'], 'ktr' => ['application/vnd.kahootz'], 'ktx' => ['image/ktx'], - 'ktx2' => ['image/ktx2'], 'ktz' => ['application/vnd.kahootz'], 'kud' => ['application/x-kugar'], 'kwd' => ['application/vnd.kde.kword', 'application/x-kword'], @@ -2328,7 +2222,6 @@ public function guessMimeType(string $path): ?string 'lhs' => ['text/x-literate-haskell'], 'lhz' => ['application/x-lhz'], 'link66' => ['application/vnd.route66.link66+xml'], - 'lisp' => ['text/x-common-lisp'], 'list' => ['text/plain'], 'list3820' => ['application/vnd.ibm.modcap'], 'listafp' => ['application/vnd.ibm.modcap'], @@ -2392,7 +2285,6 @@ public function guessMimeType(string $path): ?string 'mbk' => ['application/vnd.mobius.mbk'], 'mbox' => ['application/mbox'], 'mc1' => ['application/vnd.medcalcdata'], - 'mc2' => ['text/vnd.senx.warpscript'], 'mcd' => ['application/vnd.mcd'], 'mcurl' => ['text/vnd.curl.mcurl'], 'md' => ['text/markdown', 'text/x-markdown'], @@ -2442,7 +2334,7 @@ public function guessMimeType(string $path): ?string 'mo3' => ['audio/x-mo3'], 'mobi' => ['application/x-mobipocket-ebook'], 'moc' => ['text/x-moc'], - 'mod' => ['application/x-object', 'audio/x-mod'], + 'mod' => ['audio/x-mod'], 'mods' => ['application/mods+xml'], 'mof' => ['text/x-mof'], 'moov' => ['video/quicktime'], @@ -2524,12 +2416,10 @@ public function guessMimeType(string $path): ?string 'nnw' => ['application/vnd.noblenet-web'], 'not' => ['text/x-mup'], 'npx' => ['image/vnd.net-fpx'], - 'nrw' => ['image/x-nikon-nrw'], 'nsc' => ['application/x-conference', 'application/x-netshow-channel'], 'nsf' => ['application/vnd.lotus-notes'], 'nsv' => ['video/x-nsv'], 'ntf' => ['application/vnd.nitf'], - 'numbers' => ['application/vnd.apple.numbers', 'application/x-iwork-numbers-sffnumbers'], 'nzb' => ['application/x-nzb'], 'o' => ['application/x-object'], 'oa2' => ['application/vnd.fujitsu.oasys2'], @@ -2568,7 +2458,7 @@ public function guessMimeType(string $path): ?string 'opus' => ['audio/ogg', 'audio/x-ogg', 'audio/x-opus+ogg'], 'ora' => ['image/openraster'], 'orf' => ['image/x-olympus-orf'], - 'org' => ['application/vnd.lotus-organizer', 'text/org'], + 'org' => ['application/vnd.lotus-organizer'], 'osf' => ['application/vnd.yamaha.openscoreformat'], 'osfpvg' => ['application/vnd.yamaha.openscoreformat.osfpvg+xml'], 'otc' => ['application/vnd.oasis.opendocument.chart-template'], @@ -2579,10 +2469,9 @@ public function guessMimeType(string $path): ?string 'otp' => ['application/vnd.oasis.opendocument.presentation-template'], 'ots' => ['application/vnd.oasis.opendocument.spreadsheet-template'], 'ott' => ['application/vnd.oasis.opendocument.text-template'], - 'ova' => ['application/ovf', 'application/x-virtualbox-ova'], 'owl' => ['application/rdf+xml', 'text/rdf'], 'owx' => ['application/owl+xml'], - 'oxps' => ['application/oxps'], + 'oxps' => ['application/oxps', 'application/vnd.ms-xpsdocument', 'application/xps'], 'oxt' => ['application/vnd.openofficeorg.extension'], 'p' => ['text/x-pascal'], 'p10' => ['application/pkcs10'], @@ -2596,7 +2485,6 @@ public function guessMimeType(string $path): ?string 'p8' => ['application/pkcs8'], 'p8e' => ['application/pkcs8-encrypted'], 'pack' => ['application/x-java-pack200'], - 'pages' => ['application/vnd.apple.pages', 'application/x-iwork-pages-sffpages'], 'pak' => ['application/x-pak'], 'par2' => ['application/x-par2'], 'part' => ['application/x-partial-download'], @@ -2706,18 +2594,12 @@ public function guessMimeType(string $path): ?string 'py3x' => ['text/x-python3'], 'pya' => ['audio/vnd.ms-playready.media.pya'], 'pyc' => ['application/x-python-bytecode'], - 'pyi' => ['text/x-python3'], 'pyo' => ['application/x-python-bytecode'], - 'pys' => ['application/x-pyspread-bz-spreadsheet'], - 'pysu' => ['application/x-pyspread-spreadsheet'], 'pyv' => ['video/vnd.ms-playready.media.pyv'], 'pyx' => ['text/x-python'], 'qam' => ['application/vnd.epson.quickanime'], 'qbo' => ['application/vnd.intu.qbo'], - 'qcow' => ['application/x-qemu-disk'], - 'qcow2' => ['application/x-qemu-disk'], 'qd' => ['application/x-fd-file', 'application/x-raw-floppy-disk-image'], - 'qed' => ['application/x-qed-disk'], 'qfx' => ['application/vnd.intu.qfx'], 'qif' => ['application/x-qw', 'image/x-quicktime'], 'qml' => ['text/x-qml'], @@ -2776,7 +2658,6 @@ public function guessMimeType(string $path): ?string 'rng' => ['application/xml', 'text/xml'], 'roa' => ['application/rpki-roa'], 'roff' => ['application/x-troff', 'text/troff', 'text/x-troff'], - 'ros' => ['text/x-common-lisp'], 'rp' => ['image/vnd.rn-realpix'], 'rp9' => ['application/vnd.cloanto.rp9'], 'rpm' => ['application/x-redhat-package-manager', 'application/x-rpm'], @@ -2786,7 +2667,6 @@ public function guessMimeType(string $path): ?string 'rs' => ['application/rls-services+xml', 'text/rust'], 'rsd' => ['application/rsd+xml'], 'rss' => ['application/rss+xml', 'text/rss'], - 'rst' => ['text/x-rst'], 'rt' => ['text/vnd.rn-realtext'], 'rtf' => ['application/rtf', 'text/rtf'], 'rtx' => ['text/richtext'], @@ -2796,14 +2676,13 @@ public function guessMimeType(string $path): ?string 's' => ['text/x-asm'], 's3m' => ['audio/s3m', 'audio/x-s3m'], 'saf' => ['application/vnd.yamaha.smaf-audio'], - 'sage' => ['text/x-sagemath'], 'sam' => ['application/x-amipro'], 'sami' => ['application/x-sami'], 'sap' => ['application/x-sap-file', 'application/x-thomson-sap-image'], 'sass' => ['text/x-sass'], 'sav' => ['application/x-spss-sav', 'application/x-spss-savefile'], 'sbml' => ['application/sbml+xml'], - 'sc' => ['application/vnd.ibm.secure-container', 'text/x-scala'], + 'sc' => ['application/vnd.ibm.secure-container'], 'scala' => ['text/x-scala'], 'scd' => ['application/x-msschedule'], 'scm' => ['application/vnd.lotus-screencam', 'text/x-scheme'], @@ -2835,7 +2714,6 @@ public function guessMimeType(string $path): ?string 'sfv' => ['text/x-sfv'], 'sg' => ['application/x-sg1000-rom'], 'sgb' => ['application/x-gameboy-rom'], - 'sgd' => ['application/x-genesis-rom'], 'sgf' => ['application/x-go-sgf'], 'sgi' => ['image/sgi', 'image/x-sgi'], 'sgl' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], @@ -2876,7 +2754,6 @@ public function guessMimeType(string $path): ?string 'smf' => ['application/vnd.stardivision.math'], 'smi' => ['application/smil', 'application/smil+xml', 'application/x-sami'], 'smil' => ['application/smil', 'application/smil+xml'], - 'smk' => ['video/vnd.radgamettools.smacker'], 'sml' => ['application/smil', 'application/smil+xml'], 'sms' => ['application/x-sms-rom'], 'smv' => ['video/x-smv'], @@ -2895,7 +2772,7 @@ public function guessMimeType(string $path): ?string 'spot' => ['text/vnd.in3d.spot'], 'spp' => ['application/scvp-vp-response'], 'spq' => ['application/scvp-vp-request'], - 'spx' => ['application/x-apple-systemprofiler+xml', 'audio/ogg', 'audio/x-speex', 'audio/x-speex+ogg'], + 'spx' => ['audio/ogg', 'audio/x-speex'], 'sql' => ['application/sql', 'application/x-sql', 'text/x-sql'], 'sqlite2' => ['application/x-sqlite2'], 'sqlite3' => ['application/vnd.sqlite3', 'application/x-sqlite3'], @@ -2964,14 +2841,13 @@ public function guessMimeType(string $path): ?string 'tar.lzma' => ['application/x-lzma-compressed-tar'], 'tar.lzo' => ['application/x-tzo'], 'tar.xz' => ['application/x-xz-compressed-tar'], - 'tar.zst' => ['application/x-zstd-compressed-tar'], 'target' => ['text/x-systemd-unit'], 'taz' => ['application/x-tarz'], 'tb2' => ['application/x-bzip-compressed-tar'], 'tbz' => ['application/x-bzip-compressed-tar'], 'tbz2' => ['application/x-bzip-compressed-tar'], 'tcap' => ['application/vnd.3gpp2.tcap'], - 'tcl' => ['application/x-tcl', 'text/tcl', 'text/x-tcl'], + 'tcl' => ['application/x-tcl', 'text/x-tcl'], 'teacher' => ['application/vnd.smart.teacher'], 'tei' => ['application/tei+xml'], 'teicorpus' => ['application/tei+xml'], @@ -2981,7 +2857,7 @@ public function guessMimeType(string $path): ?string 'text' => ['text/plain'], 'tfi' => ['application/thraud+xml'], 'tfm' => ['application/x-tex-tfm'], - 'tga' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], + 'tga' => ['image/x-icb', 'image/x-tga'], 'tgz' => ['application/x-compressed-tar'], 'theme' => ['application/x-theme'], 'themepack' => ['application/x-windows-themepack'], @@ -2989,16 +2865,15 @@ public function guessMimeType(string $path): ?string 'tif' => ['image/tiff'], 'tiff' => ['image/tiff'], 'timer' => ['text/x-systemd-unit'], - 'tk' => ['text/tcl', 'text/x-tcl'], + 'tk' => ['text/x-tcl'], 'tlrz' => ['application/x-lrzip-compressed-tar'], 'tlz' => ['application/x-lzma-compressed-tar'], 'tmo' => ['application/vnd.tmobile-livetv'], 'tnef' => ['application/ms-tnef', 'application/vnd.ms-tnef'], 'tnf' => ['application/ms-tnef', 'application/vnd.ms-tnef'], 'toc' => ['application/x-cdrdao-toc'], - 'toml' => ['application/toml'], 'torrent' => ['application/x-bittorrent'], - 'tpic' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], + 'tpic' => ['image/x-icb', 'image/x-tga'], 'tpl' => ['application/vnd.groove-tool-template'], 'tpt' => ['application/vnd.trid.tpt'], 'tr' => ['application/x-troff', 'text/troff', 'text/x-troff'], @@ -3021,7 +2896,6 @@ public function guessMimeType(string $path): ?string 'txt' => ['text/plain'], 'txz' => ['application/x-xz-compressed-tar'], 'tzo' => ['application/x-tzo'], - 'tzst' => ['application/x-zstd-compressed-tar'], 'u32' => ['application/x-authorware-bin'], 'udeb' => ['application/vnd.debian.binary-package', 'application/x-deb', 'application/x-debian-package'], 'ufd' => ['application/vnd.ufdl'], @@ -3078,7 +2952,6 @@ public function guessMimeType(string $path): ?string 'vala' => ['text/x-vala'], 'vapi' => ['text/x-vala'], 'vb' => ['application/x-virtual-boy-rom'], - 'vbs' => ['text/vbs', 'text/vbscript'], 'vcard' => ['text/directory', 'text/vcard', 'text/x-vcard'], 'vcd' => ['application/x-cdlink'], 'vcf' => ['text/x-vcard', 'text/directory', 'text/vcard'], @@ -3086,21 +2959,17 @@ public function guessMimeType(string $path): ?string 'vcs' => ['application/ics', 'text/calendar', 'text/x-vcalendar'], 'vct' => ['text/directory', 'text/vcard', 'text/x-vcard'], 'vcx' => ['application/vnd.vcx'], - 'vda' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'vdi' => ['application/x-vdi-disk', 'application/x-virtualbox-vdi'], - 'vhd' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd', 'text/x-vhdl'], + 'vda' => ['image/x-icb', 'image/x-tga'], + 'vhd' => ['text/x-vhdl'], 'vhdl' => ['text/x-vhdl'], - 'vhdx' => ['application/x-vhdx-disk', 'application/x-virtualbox-vhdx'], 'vis' => ['application/vnd.visionary'], 'viv' => ['video/vivo', 'video/vnd.vivo'], 'vivo' => ['video/vivo', 'video/vnd.vivo'], 'vlc' => ['application/m3u', 'audio/m3u', 'audio/mpegurl', 'audio/x-m3u', 'audio/x-mp3-playlist', 'audio/x-mpegurl'], - 'vmdk' => ['application/x-virtualbox-vmdk', 'application/x-vmdk-disk'], 'vob' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2', 'video/x-ms-vob'], 'voc' => ['audio/x-voc'], 'vor' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], 'vox' => ['application/x-authorware-bin'], - 'vpc' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd'], 'vrm' => ['model/vrml'], 'vrml' => ['model/vrml'], 'vsd' => ['application/vnd.visio'], @@ -3110,7 +2979,7 @@ public function guessMimeType(string $path): ?string 'vss' => ['application/vnd.visio'], 'vssm' => ['application/vnd.ms-visio.stencil.macroenabled.main+xml'], 'vssx' => ['application/vnd.ms-visio.stencil.main+xml'], - 'vst' => ['application/tga', 'application/vnd.visio', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], + 'vst' => ['application/vnd.visio', 'image/x-icb', 'image/x-tga'], 'vstm' => ['application/vnd.ms-visio.template.macroenabled.main+xml'], 'vstx' => ['application/vnd.ms-visio.template.main+xml'], 'vsw' => ['application/vnd.visio'], @@ -3153,7 +3022,7 @@ public function guessMimeType(string $path): ?string 'wmx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], 'wmz' => ['application/x-ms-wmz', 'application/x-msmetafile'], 'woff' => ['application/font-woff', 'application/x-font-woff', 'font/woff'], - 'woff2' => ['font/woff2'], + 'woff2' => ['font/woff', 'font/woff2'], 'wp' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], 'wp4' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], 'wp5' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], @@ -3240,7 +3109,7 @@ public function guessMimeType(string $path): ?string 'xpl' => ['application/xproc+xml'], 'xpm' => ['image/x-xpixmap', 'image/x-xpm'], 'xpr' => ['application/vnd.is-xpr'], - 'xps' => ['application/vnd.ms-xpsdocument', 'application/xps'], + 'xps' => ['application/oxps', 'application/vnd.ms-xpsdocument', 'application/xps'], 'xpw' => ['application/vnd.intercon.formnet'], 'xpx' => ['application/vnd.intercon.formnet'], 'xsd' => ['application/xml', 'text/xml'], @@ -3277,7 +3146,6 @@ public function guessMimeType(string $path): ?string 'zmm' => ['application/vnd.handheld-entertainment+xml'], 'zoo' => ['application/x-zoo'], 'zsav' => ['application/x-spss-sav', 'application/x-spss-savefile'], - 'zst' => ['application/zstd'], 'zz' => ['application/zlib'], '123' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], '602' => ['application/x-t602'], diff --git a/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php b/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php index 11af70d129346..74a9449c75e8d 100644 --- a/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php +++ b/src/Symfony/Component/Mime/Resources/bin/update_mime_types.php @@ -21,7 +21,7 @@ $new[$mimeType] = $extensions; } -$xml = simplexml_load_string(file_get_contents('https://gitlab.freedesktop.org/xdg/shared-mime-info/-/raw/master/data/freedesktop.org.xml.in?inline=false')); +$xml = simplexml_load_string(file_get_contents('https://raw.github.com/minad/mimemagic/master/script/freedesktop.org.xml')); foreach ($xml as $node) { $exts = []; foreach ($node->glob as $glob) { From b3184d8902c0cfae771a254b268747fd636a74cf Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Fri, 3 Sep 2021 14:15:32 +0200 Subject: [PATCH 18/64] [PasswordHasher] Fix documentation link --- src/Symfony/Component/PasswordHasher/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/PasswordHasher/README.md b/src/Symfony/Component/PasswordHasher/README.md index 0bddd95d61e80..0878746fca38c 100644 --- a/src/Symfony/Component/PasswordHasher/README.md +++ b/src/Symfony/Component/PasswordHasher/README.md @@ -33,7 +33,7 @@ $passwordHasher->verify($hash, 'plain'); // returns true (valid) Resources --------- - * [Documentation](https://symfony.com/doc/current/password-hasher.html) + * [Documentation](https://symfony.com/doc/current/security.html#c-hashing-passwords) * [Contributing](https://symfony.com/doc/current/contributing/index.html) * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) From 19282b56a21c0aedb19b2e500c8a55cba8a110c5 Mon Sep 17 00:00:00 2001 From: Vlad Dumitrache Date: Sun, 5 Sep 2021 16:51:30 +0300 Subject: [PATCH 19/64] [Translation] Add missing Romanian translations --- .../Validator/Resources/translations/validators.ro.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf index 2f7660ea08e17..64a5c80fb6d24 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf @@ -386,6 +386,10 @@ This value is not a valid International Securities Identification Number (ISIN). Această valoare nu este un număr internațional de identificare (ISIN) valabil. + + This value should be a valid expression. + Această valoare ar trebui să fie o expresie validă. + From c95deeaca113e812bdbf444aead166ed3621a664 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 3 Sep 2021 18:53:21 +0200 Subject: [PATCH 20/64] [HttpClient] Fix handling timeouts when responses are destructed --- .../HttpClient/Internal/ClientState.php | 1 + .../HttpClient/Response/ResponseTrait.php | 21 +++++++++--- .../HttpClient/Tests/HttpClientTestCase.php | 9 ++++++ .../HttpClient/Tests/MockHttpClientTest.php | 4 +++ .../HttpClient/Tests/NativeHttpClientTest.php | 5 +++ .../HttpClient/Test/HttpClientTestCase.php | 32 +++++++++++++++++++ 6 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Internal/ClientState.php b/src/Symfony/Component/HttpClient/Internal/ClientState.php index c316e7b078920..52fe3c8c054c7 100644 --- a/src/Symfony/Component/HttpClient/Internal/ClientState.php +++ b/src/Symfony/Component/HttpClient/Internal/ClientState.php @@ -22,4 +22,5 @@ class ClientState { public $handlesActivity = []; public $openHandles = []; + public $lastTimeout; } diff --git a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php index 69caabf4b85d0..0f041d4d02d21 100644 --- a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php +++ b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php @@ -233,15 +233,15 @@ abstract protected static function perform(ClientState $multi, array &$responses */ abstract protected static function select(ClientState $multi, float $timeout): int; - private static function initialize(self $response): void + private static function initialize(self $response, float $timeout = null): void { if (null !== $response->info['error']) { throw new TransportException($response->info['error']); } try { - if (($response->initializer)($response)) { - foreach (self::stream([$response]) as $chunk) { + if (($response->initializer)($response, $timeout)) { + foreach (self::stream([$response], $timeout) as $chunk) { if ($chunk->isFirst()) { break; } @@ -304,7 +304,7 @@ private function doDestruct() $this->shouldBuffer = true; if ($this->initializer && null === $this->info['error']) { - self::initialize($this); + self::initialize($this, -0.0); $this->checkStatusCode(); } } @@ -325,6 +325,12 @@ public static function stream(iterable $responses, float $timeout = null): \Gene $lastActivity = microtime(true); $elapsedTimeout = 0; + if ($fromLastTimeout = 0.0 === $timeout && '-0' === (string) $timeout) { + $timeout = null; + } elseif ($fromLastTimeout = 0 > $timeout) { + $timeout = -$timeout; + } + while (true) { $hasActivity = false; $timeoutMax = 0; @@ -340,13 +346,18 @@ public static function stream(iterable $responses, float $timeout = null): \Gene $timeoutMin = min($timeoutMin, $response->timeout, 1); $chunk = false; + if ($fromLastTimeout && null !== $multi->lastTimeout) { + $elapsedTimeout = microtime(true) - $multi->lastTimeout; + } + if (isset($multi->handlesActivity[$j])) { - // no-op + $multi->lastTimeout = null; } elseif (!isset($multi->openHandles[$j])) { unset($responses[$j]); continue; } elseif ($elapsedTimeout >= $timeoutMax) { $multi->handlesActivity[$j] = [new ErrorChunk($response->offset, sprintf('Idle timeout reached for "%s".', $response->getInfo('url')))]; + $multi->lastTimeout ?? $multi->lastTimeout = $lastActivity; } else { continue; } diff --git a/src/Symfony/Component/HttpClient/Tests/HttpClientTestCase.php b/src/Symfony/Component/HttpClient/Tests/HttpClientTestCase.php index a3782df49e5ed..85466d33b5438 100644 --- a/src/Symfony/Component/HttpClient/Tests/HttpClientTestCase.php +++ b/src/Symfony/Component/HttpClient/Tests/HttpClientTestCase.php @@ -19,6 +19,15 @@ abstract class HttpClientTestCase extends BaseHttpClientTestCase { + public function testTimeoutOnDestruct() + { + if (!method_exists(parent::class, 'testTimeoutOnDestruct')) { + $this->markTestSkipped('BaseHttpClientTestCase doesn\'t have testTimeoutOnDestruct().'); + } + + parent::testTimeoutOnDestruct(); + } + public function testAcceptHeader() { $client = $this->getHttpClient(__FUNCTION__); diff --git a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php index 27cc87f0ccfbd..75bf16d3e6c86 100644 --- a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php @@ -115,6 +115,10 @@ protected function getHttpClient(string $testCase): HttpClientInterface $this->markTestSkipped('Real transport required'); break; + case 'testTimeoutOnDestruct': + $this->markTestSkipped('Real transport required'); + break; + case 'testDestruct': $this->markTestSkipped("MockHttpClient doesn't timeout on destruct"); break; diff --git a/src/Symfony/Component/HttpClient/Tests/NativeHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/NativeHttpClientTest.php index bcfab64bdcace..2f76cc91c609f 100644 --- a/src/Symfony/Component/HttpClient/Tests/NativeHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/NativeHttpClientTest.php @@ -25,4 +25,9 @@ public function testInformationalResponseStream() { $this->markTestSkipped('NativeHttpClient doesn\'t support informational status codes.'); } + + public function testTimeoutOnDestruct() + { + $this->markTestSkipped('NativeHttpClient doesn\'t support opening concurrent requests.'); + } } diff --git a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php index f3e75c9337c2c..1062c7c024b4d 100644 --- a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php +++ b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php @@ -810,6 +810,38 @@ public function testTimeoutWithActiveConcurrentStream() } } + public function testTimeoutOnDestruct() + { + $p1 = TestHttpServer::start(8067); + $p2 = TestHttpServer::start(8077); + + $client = $this->getHttpClient(__FUNCTION__); + $start = microtime(true); + $responses = []; + + $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + + try { + while ($response = array_shift($responses)) { + try { + unset($response); + $this->fail(TransportExceptionInterface::class.' expected'); + } catch (TransportExceptionInterface $e) { + } + } + + $duration = microtime(true) - $start; + + $this->assertLessThan(1.0, $duration); + } finally { + $p1->stop(); + $p2->stop(); + } + } + public function testDestruct() { $client = $this->getHttpClient(__FUNCTION__); From 1ab97ea5f34f5aff281360605c35ddea7c6ce64f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Sep 2021 19:40:00 +0200 Subject: [PATCH 21/64] [HttpKernel] Fix broken mock Signed-off-by: Alexander M. Turek --- .../HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php b/src/Symfony/Component/HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php index 0c6f1543acfdd..26b323f81051a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php @@ -32,9 +32,11 @@ public function testClearPool() $pool = $this->createMock(CacheItemPoolInterface::class); $pool ->expects($this->once()) - ->method('clear'); + ->method('clear') + ->willReturn(true) + ; - (new Psr6CacheClearer(['pool' => $pool]))->clearPool('pool'); + $this->assertTrue((new Psr6CacheClearer(['pool' => $pool]))->clearPool('pool')); } public function testClearPoolThrowsExceptionOnUnreferencedPool() From b8ddb65286433a9fb6ea0ab2e0f90b032a614561 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 7 Sep 2021 08:53:54 +0200 Subject: [PATCH 22/64] [Cache] Make sure PdoAdapter::prune() always returns a bool Signed-off-by: Alexander M. Turek --- .../Component/Cache/Tests/Adapter/AdapterTestCase.php | 10 +++++----- src/Symfony/Component/Cache/Traits/PdoTrait.php | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php index 27354cf911f3c..3ff73aeab965f 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php @@ -217,7 +217,7 @@ public function testPrune() $doSet('qux', 'qux-val', new \DateInterval('PT20S')); sleep(30); - $cache->prune(); + $this->assertTrue($cache->prune()); $this->assertTrue($this->isPruned($cache, 'foo')); $this->assertTrue($this->isPruned($cache, 'bar')); $this->assertTrue($this->isPruned($cache, 'baz')); @@ -228,27 +228,27 @@ public function testPrune() $doSet('baz', 'baz-val', new \DateInterval('PT40S')); $doSet('qux', 'qux-val', new \DateInterval('PT80S')); - $cache->prune(); + $this->assertTrue($cache->prune()); $this->assertFalse($this->isPruned($cache, 'foo')); $this->assertFalse($this->isPruned($cache, 'bar')); $this->assertFalse($this->isPruned($cache, 'baz')); $this->assertFalse($this->isPruned($cache, 'qux')); sleep(30); - $cache->prune(); + $this->assertTrue($cache->prune()); $this->assertFalse($this->isPruned($cache, 'foo')); $this->assertTrue($this->isPruned($cache, 'bar')); $this->assertFalse($this->isPruned($cache, 'baz')); $this->assertFalse($this->isPruned($cache, 'qux')); sleep(30); - $cache->prune(); + $this->assertTrue($cache->prune()); $this->assertFalse($this->isPruned($cache, 'foo')); $this->assertTrue($this->isPruned($cache, 'baz')); $this->assertFalse($this->isPruned($cache, 'qux')); sleep(30); - $cache->prune(); + $this->assertTrue($cache->prune()); $this->assertFalse($this->isPruned($cache, 'foo')); $this->assertTrue($this->isPruned($cache, 'qux')); } diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index f069248a75e50..2f733a78e1307 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -19,6 +19,7 @@ use Doctrine\DBAL\Exception\TableNotFoundException; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Statement; use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\Marshaller\DefaultMarshaller; use Symfony\Component\Cache\Marshaller\MarshallerInterface; @@ -183,6 +184,13 @@ public function prune() $delete->bindValue(':namespace', sprintf('%s%%', $this->namespace), $useDbalConstants ? ParameterType::STRING : \PDO::PARAM_STR); } try { + // Doctrine DBAL ^2.13 || >= 3.1 + if ($delete instanceof Statement && method_exists($delete, 'executeStatement')) { + $delete->executeStatement(); + + return true; + } + return $delete->execute(); } catch (TableNotFoundException $e) { return true; From 6214f3a8db843d9fef046bef7a468e7a19ec6e7e Mon Sep 17 00:00:00 2001 From: Andriy Date: Sat, 28 Aug 2021 17:40:09 -0700 Subject: [PATCH 23/64] Match 5.1 mailer configuration --- .../Bundle/FrameworkBundle/Resources/config/mailer.php | 4 ++++ .../Bundle/FrameworkBundle/Resources/config/mailer_debug.php | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.php index 350a6b27d7dc6..b15b29270afd4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.php @@ -73,5 +73,9 @@ ->tag('kernel.event_subscriber') ->tag('kernel.reset', ['method' => 'reset']) ->deprecate('symfony/framework-bundle', '5.2', 'The "%service_id%" service is deprecated, use "mailer.message_logger_listener" instead.') + + ->set('mailer.message_logger_listener', MessageLoggerListener::class) + ->tag('kernel.event_subscriber') + ->tag('kernel.reset', ['method' => 'reset']) ; }; diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.php index 5bc56faad5a05..3fb6ce0a42d49 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.php @@ -24,9 +24,5 @@ 'template' => '@WebProfiler/Collector/mailer.html.twig', 'id' => 'mailer', ]) - - ->set('mailer.message_logger_listener', MessageLoggerListener::class) - ->tag('kernel.event_subscriber') - ->tag('kernel.reset', ['method' => 'reset']) ; }; From a7d6f8f28c0bcc81b561249cefac79542800648a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 7 Sep 2021 12:45:28 +0200 Subject: [PATCH 24/64] [HttpClient] fix test --- .../HttpClient/Tests/AsyncDecoratorTraitTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Tests/AsyncDecoratorTraitTest.php b/src/Symfony/Component/HttpClient/Tests/AsyncDecoratorTraitTest.php index 4eeb6e7f87c04..0dfca6d4a2f97 100644 --- a/src/Symfony/Component/HttpClient/Tests/AsyncDecoratorTraitTest.php +++ b/src/Symfony/Component/HttpClient/Tests/AsyncDecoratorTraitTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpClient\Tests; use Symfony\Component\HttpClient\AsyncDecoratorTrait; -use Symfony\Component\HttpClient\CurlHttpClient; use Symfony\Component\HttpClient\DecoratorTrait; use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\HttpClient\Response\AsyncContext; @@ -32,7 +31,7 @@ protected function getHttpClient(string $testCase, \Closure $chunkFilter = null, } if ('testTimeoutOnDestruct' === $testCase) { - return new CurlHttpClient(); + return HttpClient::create(); } $chunkFilter = $chunkFilter ?? static function (ChunkInterface $chunk, AsyncContext $context) { yield $chunk; }; @@ -58,10 +57,10 @@ public function request(string $method, string $url, array $options = []): Respo public function testTimeoutOnDestruct() { if (HttpClient::create() instanceof NativeHttpClient) { - parent::testTimeoutOnDestruct(); - } else { - HttpClientTestCase::testTimeoutOnDestruct(); + $this->markTestSkipped('NativeHttpClient doesn\'t support opening concurrent requests.'); } + + HttpClientTestCase::testTimeoutOnDestruct(); } public function testRetry404() From 2ea14ffc32bc46319bff29ab6ccaeea5ba5aa9f0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 7 Sep 2021 17:19:13 +0200 Subject: [PATCH 25/64] fix psalm script --- .github/workflows/psalm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 9c126e2ef2422..c5c9bfecf4d09 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -52,5 +52,4 @@ jobs: - name: Psalm run: | - ./vendor/bin/psalm.phar --no-progress - ./vendor/bin/psalm.phar --output-format=github --no-progress + ./vendor/bin/psalm.phar --no-progress || ./vendor/bin/psalm.phar --output-format=github --no-progress From edfad64a38e86e3c2772c57fe2921f6fde0bbb83 Mon Sep 17 00:00:00 2001 From: Ruslan Zavacky Date: Wed, 8 Sep 2021 14:24:05 +0300 Subject: [PATCH 26/64] [Messenger] Support rediss in transport bridge --- .../Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php | 1 + .../Messenger/Bridge/Redis/Transport/RedisTransportFactory.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php index 728fe67c78bc3..754e5ae07d6c7 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php @@ -27,6 +27,7 @@ public function testSupportsOnlyRedisTransports() $factory = new RedisTransportFactory(); $this->assertTrue($factory->supports('redis://localhost', [])); + $this->assertTrue($factory->supports('rediss://localhost', [])); $this->assertFalse($factory->supports('sqs://localhost', [])); $this->assertFalse($factory->supports('invalid-dsn', [])); } diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransportFactory.php b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransportFactory.php index 55deeb09e7fa8..88cead8a934f4 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransportFactory.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransportFactory.php @@ -30,7 +30,7 @@ public function createTransport(string $dsn, array $options, SerializerInterface public function supports(string $dsn, array $options): bool { - return 0 === strpos($dsn, 'redis://'); + return 0 === strpos($dsn, 'redis://') || 0 === strpos($dsn, 'rediss://'); } } From 48f830a277de4f994bf8d48f462702bec6747b4d Mon Sep 17 00:00:00 2001 From: BoShurik Date: Thu, 9 Sep 2021 17:49:32 +0300 Subject: [PATCH 27/64] Relax service locator tests. Allow any order --- .../RegisterControllerArgumentLocatorsPassTest.php | 3 ++- .../RemoveEmptyControllerArgumentLocatorsPassTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index c00e1849fc500..5a0964f6c21ca 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -236,7 +236,8 @@ public function testNoExceptionOnNonExistentTypeHintOptionalArg() $pass->process($container); $locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0); - $this->assertSame(['foo::barAction', 'foo::fooAction'], array_keys($locator)); + + $this->assertEqualsCanonicalizing(['foo::barAction', 'foo::fooAction'], array_keys($locator)); } public function testArgumentWithNoTypeHintIsOk() diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php index b5e55bdea9e97..b9dd84d592fa6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php @@ -57,7 +57,7 @@ public function testProcess() 'Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass: Removing method "setTestCase" of service "c2" from controller candidates: the method is called at instantiation, thus cannot be an action.', ]; - $this->assertSame($expectedLog, $container->getCompiler()->getLog()); + $this->assertEqualsCanonicalizing($expectedLog, $container->getCompiler()->getLog()); } public function testInvoke() From 10effd71930d3a4d1ff381127ea4acf16e9dab73 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 10 Sep 2021 11:25:11 +0200 Subject: [PATCH 28/64] [Mime] Allow array as input for RawMessage Signed-off-by: Alexander M. Turek --- src/Symfony/Component/Mime/RawMessage.php | 5 +++- .../Component/Mime/Tests/RawMessageTest.php | 23 +++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/Mime/RawMessage.php b/src/Symfony/Component/Mime/RawMessage.php index 66788d8ad526d..d2a311daebecf 100644 --- a/src/Symfony/Component/Mime/RawMessage.php +++ b/src/Symfony/Component/Mime/RawMessage.php @@ -33,8 +33,11 @@ public function toString(): string if (\is_string($this->message)) { return $this->message; } + if ($this->message instanceof \Traversable) { + $this->message = iterator_to_array($this->message, false); + } - return $this->message = implode('', iterator_to_array($this->message, false)); + return $this->message = implode('', $this->message); } public function toIterable(): iterable diff --git a/src/Symfony/Component/Mime/Tests/RawMessageTest.php b/src/Symfony/Component/Mime/Tests/RawMessageTest.php index 26e7605baba2d..41503451bb1da 100644 --- a/src/Symfony/Component/Mime/Tests/RawMessageTest.php +++ b/src/Symfony/Component/Mime/Tests/RawMessageTest.php @@ -16,16 +16,12 @@ class RawMessageTest extends TestCase { - public function testToString() + /** + * @dataProvider provideMessages + */ + public function testToString($messageParameter) { - $message = new RawMessage('string'); - $this->assertEquals('string', $message->toString()); - $this->assertEquals('string', implode('', iterator_to_array($message->toIterable()))); - // calling methods more than once work - $this->assertEquals('string', $message->toString()); - $this->assertEquals('string', implode('', iterator_to_array($message->toIterable()))); - - $message = new RawMessage(new \ArrayObject(['some', ' ', 'string'])); + $message = new RawMessage($messageParameter); $this->assertEquals('some string', $message->toString()); $this->assertEquals('some string', implode('', iterator_to_array($message->toIterable()))); // calling methods more than once work @@ -33,6 +29,15 @@ public function testToString() $this->assertEquals('some string', implode('', iterator_to_array($message->toIterable()))); } + public function provideMessages(): array + { + return [ + 'string' => ['some string'], + 'traversable' => [new \ArrayObject(['some', ' ', 'string'])], + 'array' => [['some', ' ', 'string']], + ]; + } + public function testSerialization() { $message = new RawMessage('string'); From 5cb8312785b795513a0e3027f67c86531c855e02 Mon Sep 17 00:00:00 2001 From: Fabian Haase Date: Sat, 21 Aug 2021 16:06:03 +0200 Subject: [PATCH 29/64] [PropertyAccess] Fix Regression in PropertyAccessor::isWritable() --- .../PropertyAccess/PropertyAccessor.php | 10 ++-------- .../Tests/PropertyAccessorArrayAccessTest.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index 5ece2c17e87bb..583bd886911fe 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -313,10 +313,8 @@ public function isWritable($objectOrArray, $propertyPath) if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) { return false; } - } else { - if (!$this->isPropertyWritable($zval[self::VALUE], $propertyPath->getElement($i))) { - return false; - } + } elseif (!\is_object($zval[self::VALUE]) || !$this->isPropertyWritable($zval[self::VALUE], $propertyPath->getElement($i))) { + return false; } if (\is_object($zval[self::VALUE])) { @@ -663,10 +661,6 @@ private function getWriteInfo(string $class, string $property, $value): Property */ private function isPropertyWritable(object $object, string $property): bool { - if (!\is_object($object)) { - return false; - } - $mutatorForArray = $this->getWriteInfo(\get_class($object), $property, []); if (PropertyWriteInfo::TYPE_NONE !== $mutatorForArray->getType() || ($object instanceof \stdClass && property_exists($object, $property))) { diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayAccessTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayAccessTest.php index 71e71a7838600..98d6eb57d5936 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayAccessTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayAccessTest.php @@ -38,6 +38,14 @@ public function getValidPropertyPaths() ]; } + public function getInvalidPropertyPaths() + { + return [ + [$this->getContainer(['firstName' => 'Bernhard']), 'firstName', 'Bernhard'], + [$this->getContainer(['person' => $this->getContainer(['firstName' => 'Bernhard'])]), 'person.firstName', 'Bernhard'], + ]; + } + /** * @dataProvider getValidPropertyPaths */ @@ -83,4 +91,12 @@ public function testIsWritable($collection, $path) { $this->assertTrue($this->propertyAccessor->isWritable($collection, $path)); } + + /** + * @dataProvider getInvalidPropertyPaths + */ + public function testIsNotWritable($collection, $path) + { + $this->assertFalse($this->propertyAccessor->isWritable($collection, $path)); + } } From 058429542af0ac6cd0d6e4b7f50b776c7e038386 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 10 Sep 2021 14:46:58 +0200 Subject: [PATCH 30/64] fix merge --- .../RegisterControllerArgumentLocatorsPassTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index f0aa4a4453607..7dbc439d70b62 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -397,7 +397,7 @@ public function testAlias() $pass->process($container); $locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0); - $this->assertSame([RegisterTestController::class.'::fooAction', 'foo::fooAction'], array_keys($locator)); + $this->assertEqualsCanonicalizing([RegisterTestController::class.'::fooAction', 'foo::fooAction'], array_keys($locator)); } /** From 18ab810a8d6d4c17497303df17e931261d542fce Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 10 Sep 2021 14:21:00 +0200 Subject: [PATCH 31/64] [FrameworkBundle] fix session-related BC layer triggering deprecation --- src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php index 8ded6a2ee4320..7d4475a7e21ca 100644 --- a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php +++ b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php @@ -128,11 +128,14 @@ public function loginUser(object $user, string $firewallContext = 'main'): self $container = $this->getContainer(); $container->get('security.untracked_token_storage')->setToken($token); - if (!$container->has('session') && !$container->has('session_factory')) { + if ($container->has('session.factory')) { + $session = $container->get('session.factory')->createSession(); + } elseif ($container->has('session')) { + $session = $container->get('session'); + } else { return $this; } - $session = $container->get($container->has('session') ? 'session' : 'session_factory'); $session->set('_security_'.$firewallContext, serialize($token)); $session->save(); From dc2c6c5f46d1619eac903618c6a5aadf1aebe184 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 11 Sep 2021 19:57:27 +0200 Subject: [PATCH 32/64] fix test method name Previously, the test was never executed because the method name did not start with the "test" prefix. --- .../Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php index 63cba7387c4a1..90cf50684d5d9 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php @@ -296,9 +296,9 @@ public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues() /** * @group legacy */ - public function legacyTestLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader() + public function testLegacyLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader() { - $this->expectDeprecation('Not defining explicitly the IdReader as value callback when query can be optimized has been deprecated in 5.1. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the choice_value instead.'); + $this->expectDeprecation('Since symfony/doctrine-bridge 5.1: Not defining explicitly the IdReader as value callback when query can be optimized is deprecated. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the "choice_value" option instead.'); $loader = new DoctrineChoiceLoader( $this->om, $this->class, From 2220959dbd0cf4135f51b2fc0afc201731a63089 Mon Sep 17 00:00:00 2001 From: Bernat Llibre Date: Sun, 12 Sep 2021 16:59:53 +0200 Subject: [PATCH 33/64] [Security Core], [Validator Component] Added Catalan translations --- .../Security/Core/Resources/translations/security.ca.xlf | 8 ++++++++ .../Validator/Resources/translations/validators.ca.xlf | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.ca.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.ca.xlf index 5a8d0c7d84880..212ca70c922e3 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.ca.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.ca.xlf @@ -70,6 +70,14 @@ Invalid or expired login link. Enllaç d'inici de sessió no vàlid o caducat. + + Too many failed login attempts, please try again in %minutes% minute. + Massa intents d'inici de sessió fallits, torneu-ho a provar en %minutes% minut. + + + Too many failed login attempts, please try again in %minutes% minutes. + Massa intents d'inici de sessió fallits, torneu-ho a provar en %minutes% minuts. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index f53eb0e61ad82..4a73556e504d7 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -386,6 +386,10 @@ This value is not a valid International Securities Identification Number (ISIN). Aquest valor no és un número d'identificació de valors internacionals (ISIN) vàlid. + + This value should be a valid expression. + Aquest valor hauria de ser una expressió vàlida. + From 08c2b1c0d9545728298651199e130816f836ec5e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 14 Sep 2021 15:34:30 +0200 Subject: [PATCH 34/64] Track unsilenced deprecation only for userland --- src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 518a76425377e..bff2db7d87257 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -146,7 +146,7 @@ public function handleError($type, $msg, $file, $line, $context = []) $msg = $deprecation->getMessage(); - if (error_reporting() & $type) { + if (\E_DEPRECATED !== $type && (error_reporting() & $type)) { $group = 'unsilenced'; } elseif ($deprecation->isLegacy()) { $group = 'legacy'; From c598d174d4a77e65eae860f0a7696ff7d0772ab5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 14 Sep 2021 11:00:07 +0200 Subject: [PATCH 35/64] [GHA] Test on PHP 8.2 as experimental and 8.1 as a regular version --- .github/workflows/unit-tests.yml | 10 +++++----- .../DateFormatter/AbstractIntlDateFormatterTest.php | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 12e4508dcea8b..a2cf4d65ec4cb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -21,12 +21,12 @@ jobs: matrix: include: - php: '7.2' - - php: '8.0' + - php: '8.1' - php: '7.4' mode: high-deps - php: '8.0' mode: low-deps - - php: '8.1' + - php: '8.2' mode: experimental fail-fast: false @@ -36,10 +36,10 @@ jobs: with: fetch-depth: 2 - - name: Configure for PHP 8.1 - if: "${{ matrix.php == '8.1' }}" + - name: Configure for PHP >= 8.2 + if: "${{ matrix.php >= '8.2' }}" run: | - composer config platform.php 8.0.99 + composer config platform.php 8.1.99 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php index e6436bb0f6807..d55d7efd824ae 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php @@ -56,6 +56,9 @@ public function testConstructorDefaultTimeZone() ); } + /** + * @group legacy + */ public function testConstructorWithoutDateType() { $formatter = $this->getDateFormatter('en', null, IntlDateFormatter::SHORT, 'UTC', IntlDateFormatter::GREGORIAN); @@ -63,6 +66,9 @@ public function testConstructorWithoutDateType() $this->assertSame('EEEE, MMMM d, y \'at\' h:mm a', $formatter->getPattern()); } + /** + * @group legacy + */ public function testConstructorWithoutTimeType() { $formatter = $this->getDateFormatter('en', IntlDateFormatter::SHORT, null, 'UTC', IntlDateFormatter::GREGORIAN); From ca347531f7e9132a7a4a45d1604c0b7ecc412ff6 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 14 Sep 2021 20:33:19 +0200 Subject: [PATCH 36/64] Pin ext-redis version in CI Signed-off-by: Alexander M. Turek --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a2cf4d65ec4cb..2125c16642326 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: Ubuntu-20.04 env: - extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis + extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis-5.3.4 strategy: matrix: From df36e0b4ee4dbbb5f3ba92c95ee3045f418b5b3d Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 14 Sep 2021 19:26:58 +0200 Subject: [PATCH 37/64] [Messenger] Fix broken Redis mocks --- .github/workflows/unit-tests.yml | 2 +- .../Bridge/Redis/Tests/Transport/ConnectionTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a2cf4d65ec4cb..2125c16642326 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: Ubuntu-20.04 env: - extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis + extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis-5.3.4 strategy: matrix: diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php index 9223d5a833135..5becdb824f49c 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php @@ -78,7 +78,7 @@ public function testFromDsnWithTls() $redis->expects($this->once()) ->method('connect') ->with('tls://127.0.0.1', 6379) - ->willReturn(null); + ->willReturn(true); Connection::fromDsn('redis://127.0.0.1?tls=1', [], $redis); } @@ -92,7 +92,7 @@ public function testFromDsnWithTlsOption() $redis->expects($this->once()) ->method('connect') ->with('tls://127.0.0.1', 6379) - ->willReturn(null); + ->willReturn(true); Connection::fromDsn('redis://127.0.0.1', ['tls' => true], $redis); } @@ -103,7 +103,7 @@ public function testFromDsnWithRedissScheme() $redis->expects($this->once()) ->method('connect') ->with('tls://127.0.0.1', 6379) - ->willReturn(null); + ->willReturn(true); Connection::fromDsn('rediss://127.0.0.1', [], $redis); } @@ -315,7 +315,7 @@ public function testMaxEntries() $redis->expects($this->exactly(1))->method('xadd') ->with('queue', '*', ['message' => '{"body":"1","headers":[]}'], 20000, true) - ->willReturn(1); + ->willReturn('1'); $connection = Connection::fromDsn('redis://localhost/queue?stream_max_entries=20000', [], $redis); // 1 = always $connection->add('1', []); @@ -355,7 +355,7 @@ public function testLastErrorGetsCleared() { $redis = $this->createMock(\Redis::class); - $redis->expects($this->once())->method('xadd')->willReturn(0); + $redis->expects($this->once())->method('xadd')->willReturn('0'); $redis->expects($this->once())->method('xack')->willReturn(0); $redis->method('getLastError')->willReturnOnConsecutiveCalls('xadd error', 'xack error'); From 8e6763a3e869506c08d3e3ac6f7980b36b0a6290 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Wed, 15 Sep 2021 14:21:05 +0200 Subject: [PATCH 38/64] [Form] Don't trim unassigned unicode characters anymore --- .../Component/Form/Tests/Util/StringUtilTest.php | 15 ++++++++++++--- src/Symfony/Component/Form/Util/StringUtil.php | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php index 1d162250d1568..3058a2e25d84d 100644 --- a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php +++ b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php @@ -16,11 +16,20 @@ class StringUtilTest extends TestCase { - public function testTrim() + public function trimProvider() { - $data = ' Foo! '; + return [ + [' Foo! ', 'Foo!'], + ["\u{1F92E}", "\u{1F92E}"], // unassigned character in PCRE versions of assertEquals('Foo!', StringUtil::trim($data)); + /** + * @dataProvider trimProvider + */ + public function testTrim($data, $expectedData) + { + $this->assertSame($expectedData, StringUtil::trim($data)); } /** diff --git a/src/Symfony/Component/Form/Util/StringUtil.php b/src/Symfony/Component/Form/Util/StringUtil.php index fe372cf196d24..623693d5635e2 100644 --- a/src/Symfony/Component/Form/Util/StringUtil.php +++ b/src/Symfony/Component/Form/Util/StringUtil.php @@ -33,7 +33,7 @@ private function __construct() */ public static function trim($string) { - if (null !== $result = @preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string)) { + if (null !== $result = @preg_replace('/^[\pZ\p{Cc}\p{Cf}]+|[\pZ\p{Cc}\p{Cf}]+$/u', '', $string)) { return $result; } From 5ab3dc3f67ad0e5c36130f863bbbed18e01d28ae Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 Sep 2021 11:31:49 +0200 Subject: [PATCH 39/64] Silence Psalm errors about Enum classes Signed-off-by: Alexander M. Turek --- psalm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index eefa7b1dabbc2..015c0ed18b21b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -21,8 +21,10 @@ - + + + From 0c159cf712397ff12ca7a7e7fa08d9affa659327 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Thu, 16 Sep 2021 13:24:03 +0200 Subject: [PATCH 40/64] Use identity operator to prevent type juggling --- .../Resources/views/Collector/config.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig index 7792ea6730a0f..6dfd27bcbc67a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig @@ -116,14 +116,14 @@ Symfony version - {% if 'n/a' != collector.env %} + {% if 'n/a' is not same as(collector.env) %}
{{ collector.env }} Environment
{% endif %} - {% if 'n/a' != collector.debug %} + {% if 'n/a' is not same as(collector.debug) %}
{{ collector.debug ? 'enabled' : 'disabled' }} Debug From 0b0c15c019929ecf51d2444e69c7dc624d162f8c Mon Sep 17 00:00:00 2001 From: Anthony Massard Date: Tue, 3 Aug 2021 15:43:15 +0200 Subject: [PATCH 41/64] [Ldap] Make LdapAuthenticator an EntryPoint --- .../Ldap/Security/LdapAuthenticator.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php b/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php index 30928f62278cd..e3f2402cbe7d6 100644 --- a/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php +++ b/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php @@ -15,8 +15,11 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; +use Symfony\Component\Security\Core\Exception\LogicException; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; +use Symfony\Component\Security\Http\Authenticator\InteractiveAuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; /** * This class decorates internal authenticators to add the LDAP integration. @@ -29,7 +32,7 @@ * * @final */ -class LdapAuthenticator implements AuthenticatorInterface +class LdapAuthenticator implements AuthenticationEntryPointInterface, InteractiveAuthenticatorInterface { private $authenticator; private $ldapServiceId; @@ -75,4 +78,18 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio { return $this->authenticator->onAuthenticationFailure($request, $exception); } + + public function start(Request $request, AuthenticationException $authException = null): Response + { + if (!$this->authenticator instanceof AuthenticationEntryPointInterface) { + throw new LogicException(sprintf('Decorated authenticator "%s" must implement interface "%s".', get_debug_type($this->authenticator), AuthenticationEntryPointInterface::class)); + } + + return $this->authenticator->start($request, $authException); + } + + public function isInteractive(): bool + { + return true; + } } From 4daad9e784233a429d10170402614c44e1f52c23 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Thu, 16 Sep 2021 15:20:10 +0200 Subject: [PATCH 42/64] Fix decorating non-entrypoint authenticators --- .../Ldap/Security/LdapAuthenticator.php | 10 ++++++--- .../Exception/NotAnEntryPointException.php | 22 +++++++++++++++++++ .../Http/Firewall/ExceptionListener.php | 22 ++++++++++++++----- 3 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 src/Symfony/Component/Security/Http/EntryPoint/Exception/NotAnEntryPointException.php diff --git a/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php b/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php index e3f2402cbe7d6..2bc3f5925b389 100644 --- a/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php +++ b/src/Symfony/Component/Ldap/Security/LdapAuthenticator.php @@ -15,11 +15,11 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; -use Symfony\Component\Security\Core\Exception\LogicException; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\InteractiveAuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Component\Security\Http\EntryPoint\Exception\NotAnEntryPointException; /** * This class decorates internal authenticators to add the LDAP integration. @@ -82,7 +82,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio public function start(Request $request, AuthenticationException $authException = null): Response { if (!$this->authenticator instanceof AuthenticationEntryPointInterface) { - throw new LogicException(sprintf('Decorated authenticator "%s" must implement interface "%s".', get_debug_type($this->authenticator), AuthenticationEntryPointInterface::class)); + throw new NotAnEntryPointException(sprintf('Decorated authenticator "%s" does not implement interface "%s".', get_debug_type($this->authenticator), AuthenticationEntryPointInterface::class)); } return $this->authenticator->start($request, $authException); @@ -90,6 +90,10 @@ public function start(Request $request, AuthenticationException $authException = public function isInteractive(): bool { - return true; + if ($this->authenticator instanceof InteractiveAuthenticatorInterface) { + return $this->authenticator->isInteractive(); + } + + return false; } } diff --git a/src/Symfony/Component/Security/Http/EntryPoint/Exception/NotAnEntryPointException.php b/src/Symfony/Component/Security/Http/EntryPoint/Exception/NotAnEntryPointException.php new file mode 100644 index 0000000000000..e421dcf0cd67b --- /dev/null +++ b/src/Symfony/Component/Security/Http/EntryPoint/Exception/NotAnEntryPointException.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Http\EntryPoint\Exception; + +/** + * Thrown by generic decorators when a decorated authenticator does not implement + * {@see AuthenticationEntryPointInterface}. + * + * @author Robin Chalas + */ +class NotAnEntryPointException extends \RuntimeException +{ +} diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php index 73f4f4553d8c0..32a1b60d60452 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php @@ -31,6 +31,7 @@ use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Component\Security\Http\EntryPoint\Exception\NotAnEntryPointException; use Symfony\Component\Security\Http\HttpUtils; use Symfony\Component\Security\Http\Util\TargetPathTrait; @@ -195,11 +196,7 @@ private function handleLogoutException(ExceptionEvent $event, LogoutException $e private function startAuthentication(Request $request, AuthenticationException $authException): Response { if (null === $this->authenticationEntryPoint) { - if (null !== $this->logger) { - $this->logger->notice(sprintf('No Authentication entry point configured, returning a %s HTTP response. Configure "entry_point" on the firewall "%s" if you want to modify the response.', Response::HTTP_UNAUTHORIZED, $this->firewallName)); - } - - throw new HttpException(Response::HTTP_UNAUTHORIZED, $authException->getMessage(), $authException, [], $authException->getCode()); + $this->throwUnauthorizedException($authException); } if (null !== $this->logger) { @@ -219,7 +216,11 @@ private function startAuthentication(Request $request, AuthenticationException $ } } - $response = $this->authenticationEntryPoint->start($request, $authException); + try { + $response = $this->authenticationEntryPoint->start($request, $authException); + } catch (NotAnEntryPointException $e) { + $this->throwUnauthorizedException($authException); + } if (!$response instanceof Response) { $given = get_debug_type($response); @@ -237,4 +238,13 @@ protected function setTargetPath(Request $request) $this->saveTargetPath($request->getSession(), $this->firewallName, $request->getUri()); } } + + private function throwUnauthorizedException(AuthenticationException $authException) + { + if (null !== $this->logger) { + $this->logger->notice(sprintf('No Authentication entry point configured, returning a %s HTTP response. Configure "entry_point" on the firewall "%s" if you want to modify the response.', Response::HTTP_UNAUTHORIZED, $this->firewallName)); + } + + throw new HttpException(Response::HTTP_UNAUTHORIZED, $authException->getMessage(), $authException, [], $authException->getCode()); + } } From 4e6ea37f99623eec31dcb9b707b70d969f7a92cc Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 Sep 2021 15:31:58 +0200 Subject: [PATCH 43/64] [Serializer] Don't pass null to preg_match() Signed-off-by: Alexander M. Turek --- .../Component/Serializer/Normalizer/DataUriNormalizer.php | 4 ++-- .../Serializer/Tests/Normalizer/DataUriNormalizerTest.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php index b1643fb4d0a4b..e93724f8ec7f5 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php @@ -109,13 +109,13 @@ public function supportsNormalization($data, $format = null) */ public function denormalize($data, $type, $format = null, array $context = []) { - if (!preg_match('/^data:([a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}\/[a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}(;[a-z0-9\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\\\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i', $data)) { + if (null === $data || !preg_match('/^data:([a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}\/[a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}(;[a-z0-9\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\\\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i', $data)) { throw new NotNormalizableValueException('The provided "data:" URI is not valid.'); } try { switch ($type) { - case 'Symfony\Component\HttpFoundation\File\File': + case File::class: return new File($data, false); case 'SplFileObject': diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php index 24c5672bea43f..02bd050bd395b 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php @@ -139,6 +139,7 @@ public function invalidUriProvider() ['data:text/html;charset,%3Ch1%3EHello!%3C%2Fh1%3E'], ['data:base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC'], [''], + [null], ['http://wikipedia.org'], ['base64'], ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC'], From 9bddf6c7f6a06be681b375cfd9451da2c66bd42a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 17 Sep 2021 10:56:36 +0200 Subject: [PATCH 44/64] [GHA] fix running "Patch return types" step --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2125c16642326..1eefe6f5583c6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -135,7 +135,7 @@ jobs: echo "::endgroup::" - name: Patch return types - if: "${{ matrix.php == '8.0' && ! matrix.mode }}" + if: "${{ matrix.php == '8.1' && ! matrix.mode }}" run: | sed -i 's/"\*\*\/Tests\/"//' composer.json composer install -q --optimize-autoloader From 0e6f77a92093596b19340a4ee99b77574221ee48 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 17 Sep 2021 11:23:31 +0200 Subject: [PATCH 45/64] [GHA] fix running "Patch return types" step --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2125c16642326..1eefe6f5583c6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -135,7 +135,7 @@ jobs: echo "::endgroup::" - name: Patch return types - if: "${{ matrix.php == '8.0' && ! matrix.mode }}" + if: "${{ matrix.php == '8.1' && ! matrix.mode }}" run: | sed -i 's/"\*\*\/Tests\/"//' composer.json composer install -q --optimize-autoloader From b9ab0ad73fcd432c577f33e06da55df6def8ba06 Mon Sep 17 00:00:00 2001 From: dima-gr Date: Fri, 17 Sep 2021 12:02:28 +0300 Subject: [PATCH 46/64] [Notifier] Update FirebaseTransport.php --- .../Component/Notifier/Bridge/Firebase/FirebaseTransport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php b/src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php index 2ad0848bf2049..526ad5eb6ac85 100644 --- a/src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php @@ -96,7 +96,7 @@ protected function doSend(MessageInterface $message): SentMessage $success = $response->toArray(false); $sentMessage = new SentMessage($message, (string) $this); - $sentMessage->setMessageId($success['results'][0]['message_id']); + $sentMessage->setMessageId($success['results'][0]['message_id'] ?? ''); return $sentMessage; } From f81b76fa076bbfff106fa85ff69912c97f17ca4c Mon Sep 17 00:00:00 2001 From: Htun Htun Htet Date: Sat, 18 Sep 2021 17:32:26 +0800 Subject: [PATCH 47/64] [Translation] Add Burmese translation --- .../Resources/translations/validators.my.xlf | 139 ++++++ .../Resources/translations/security.my.xlf | 83 ++++ .../Resources/translations/validators.my.xlf | 395 ++++++++++++++++++ 3 files changed, 617 insertions(+) create mode 100644 src/Symfony/Component/Form/Resources/translations/validators.my.xlf create mode 100644 src/Symfony/Component/Security/Core/Resources/translations/security.my.xlf create mode 100644 src/Symfony/Component/Validator/Resources/translations/validators.my.xlf diff --git a/src/Symfony/Component/Form/Resources/translations/validators.my.xlf b/src/Symfony/Component/Form/Resources/translations/validators.my.xlf new file mode 100644 index 0000000000000..b0180c551172f --- /dev/null +++ b/src/Symfony/Component/Form/Resources/translations/validators.my.xlf @@ -0,0 +1,139 @@ + + + + + + This form should not contain extra fields. + ဤ ဖောင်သည် field အပိုများ မပါ၀င်သင့်ပါ။ + + + The uploaded file was too large. Please try to upload a smaller file. + Upload တင်သောဖိုင်သည်အလွန်ကြီးလွန်းသည်။ ကျေးဇူးပြု၍ သေးငယ်သည့်ဖိုင်ကိုတင်ရန်ကြိုးစားပါ။ + + + The CSRF token is invalid. Please try to resubmit the form. + သင့်လျှော်သော် CSRF တိုကင် မဟုတ်ပါ။ ကျေးဇူးပြု၍ဖောင်ကိုပြန်တင်ပါ။ + + + This value is not a valid HTML5 color. + ဤတန်ဖိုးသည် သင့်လျှော်သော် HTML5 အရောင်မဟုတ်ပါ။ + + + Please enter a valid birthdate. + ကျေးဇူးပြု၍ မှန်ကန်သောမွေးနေ့ကိုထည့်ပါ။ + + + The selected choice is invalid. + သင့် ရွေးချယ်မှုသည်မမှန်ကန်ပါ။ + + + The collection is invalid. + ဤ collection သည်သင့်လျှော်သော် collection မဟုတ်ပါ။ + + + Please select a valid color. + ကျေးဇူးပြု၍ မှန်ကန်သောအရောင်ကိုရွေးပါ။ + + + Please select a valid country. + ကျေးဇူးပြု၍ မှန်ကန်သောနိုင်ငံကိုရွေးပါ။ + + + Please select a valid currency. + ကျေးဇူးပြု၍ မှန်ကန်သောငွေကြေးကိုရွေးပါ။ + + + Please choose a valid date interval. + ကျေးဇူးပြု၍ မှန်ကန်သောနေ ရက်စွဲကိုရွေးပါ။ + + + Please enter a valid date and time. + ကျေးဇူးပြု၍ မှန်ကန်သောနေ ရက်စွဲနှင့်အချိန် ကိုထည့်ပါ။ + + + Please enter a valid date. + ကျေးဇူးပြု၍ မှန်ကန်သောနေ ရက်စွဲကိုထည့်ပါ။ + + + Please select a valid file. + ကျေးဇူးပြု၍ မှန်ကန်သောနေ ဖိုင်ကိုရွေးချယ်ပါ။ + + + The hidden field is invalid. + မသင့် လျှော်သော် hidden field ဖြစ်နေသည်။ + + + Please enter an integer. + ကျေးဇူးပြု၍ Integer တန်ဖိုးသာထည့်ပါ။ + + + Please select a valid language. + ကျေးဇူးပြု၍ မှန်ကန်သော ဘာသာစကားကိုရွေးချယ်ပါ။ + + + Please select a valid locale. + ကျေးဇူးပြု၍ မှန်ကန်သော locale ကိုရွေးချယ်ပါ။ + + + Please enter a valid money amount. + ကျေးဇူးပြု၍ မှန်ကန်သော ပိုက်ဆံပမာဏ ကိုထည့်ပါ။ + + + Please enter a number. + ကျေးဇူးပြု၍ မှန်ကန်သော နံပါတ် ကိုရွေးချယ်ပါ။ + + + The password is invalid. + မှန်ကန်သောစကား၀ှက်မဟုတ်ပါ။ + + + Please enter a percentage value. + ကျေးဇူးပြု၍ ရာခိုင်နှုန်းတန်ဖိုးထည့်ပါ။ + + + The values do not match. + တန်ဖိုးများကိုက်ညီမှုမရှိပါ။ + + + Please enter a valid time. + ကျေးဇူးပြု၍ မှန်ကန်သောအချိန်ကိုထည့်ပါ။ + + + Please select a valid timezone. + ကျေးဇူးပြု၍ မှန်ကန်သောအချိန်ဇုန်ကိုရွေးပါ။ + + + Please enter a valid URL. + ကျေးဇူးပြု၍ သင့်လျှော်သော် URL ကိုရွေးပါ။ + + + Please enter a valid search term. + ကျေးဇူးပြု၍ သင့် လျှော်သော်ရှာဖွေမှု term များထည့်ပါ။ + + + Please provide a valid phone number. + ကျေးဇူးပြု၍ သင့် လျှော်သော်ရှာဖွေမှု ဖုန်းနံပါတ်ထည့်ပါ။ + + + The checkbox has an invalid value. + Checkbox တန်ဖိုးသည် မှန်ကန်မှုမရှိပါ။ + + + Please enter a valid email address. + ကျေးဇူးပြု၍ မှန်ကန်သော် email လိပ်စာထည့်ပါ။ + + + Please select a valid option. + ကျေးဇူးပြု၍ မှန်ကန်သော် ရွေးချယ်မှု ကိုရွေးပါ။ + + + Please select a valid range. + ကျေးဇူးပြု၍ မှန်ကန်သော အပိုင်းအခြား ကိုရွေးပါ။ + + + Please enter a valid week. + ကျေးဇူးပြု၍ မှန်ကန်သောရက်သတ္တပတ်ကိုထည့်ပါ။ + + + + diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.my.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.my.xlf new file mode 100644 index 0000000000000..df593f0e0b82b --- /dev/null +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.my.xlf @@ -0,0 +1,83 @@ + + + + + + An authentication exception occurred. + အသုံးပြုခွင့် ခြွင်းချက်တစ်ခုဖြစ်သွားသည်။ + + + Authentication credentials could not be found. + အသုံးပြုခွင့် အထောက်အထားများ ရှာမတွေ့ပါ။ + + + Authentication request could not be processed due to a system problem. + System ပြဿနာအခက်အခဲရှိ နေပါသဖြင့် အသုံးပြုခွင့်တောင်းဆိုချက်ကို ဆောင်ရွက်၍မရ နိုင်ပါ။ + + + Invalid credentials. + သင့်လျှော်သော် အထောက်အထားမဟုတ်ပါ။ + + + Cookie has already been used by someone else. + Cookie ကို တစ်စုံတစ်ယောက်မှ အသုံးပြုပြီးဖြစ်သည်။ + + + Not privileged to request the resource. + အရင်းအမြစ်ကိုတောင်းဆိုရန်အခွင့်ထူးမရပါ။ + + + Invalid CSRF token. + သင့်လျှော်သော် CSRF token မဟုတ်ပါ။ + + + No authentication provider found to support the authentication token. + အထောက်အထားစိစစ်ခြင်းသင်္ကေတကိုပံ့ပိုးရန် မည်သည့်အထောက်အထားစိစစ်ရေး ၀န်ဆောင်မှုမှမတွေ့ပါ။ + + + No session available, it either timed out or cookies are not enabled. + Session မအားလပ်ပါ။ Session အချိန်ကုန်သွားခြင်း (သို့မဟုတ်) cookies များကိုဖွင့်ထားခြင်းမရှိပါ။ + + + No token could be found. + Toke ရှာမတွေ့ပါ။ + + + Username could not be found. + အသုံးပြုသူအမည် ရှာဖွေတွေ့ရှိချင်းမရှိပါ။ + + + Account has expired. + အကောင့် သက်တမ်းကုန်လွန်သွားပါပြီ။ + + + Credentials have expired. + အထောက်အထားသက်တန်း ကုန်လွန်သွားပါပြီ။ + + + Account is disabled. + အကောင့်ပိတ်ထားပါသည်။ + + + Account is locked. + အကောင့် လောခ်ကျသွားပါပြီ။ + + + Too many failed login attempts, please try again later. + Login ၀င်ရန်ကြိုးစားမှုများလွန်းပါသည်၊ ကျေးဇူးပြု၍ နောက်မှထပ်ကြိုးစားပါ။ + + + Invalid or expired login link. + မသင့်လျှော်သော် (သို့မဟုတ်) သက်တန်းကုန်သော login link ဖြစ်ပါသည်။ + + + Too many failed login attempts, please try again in %minutes% minute. + Too many failed login attempts, please try again in %minutes% minute. + + + Too many failed login attempts, please try again in %minutes% minutes. + Login ၀င်ရန်ကြိုးစားမှုများလွန်းပါသည်၊ ကျေးဇူးပြု၍ နောက် %minutes% မှထပ်မံကြိုးစားပါ။ + + + + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf new file mode 100644 index 0000000000000..7f45aaed64f36 --- /dev/null +++ b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf @@ -0,0 +1,395 @@ + + + + + + This value should be false. + ဤတန်ဖိုးသည် false ဖြစ်ရမည်။ + + + This value should be true. + ဤတန်ဖိုးသည် true ဖြစ်ရမည်။ + + + This value should be of type {{ type }}. + ဤတန်ဖိုးသည် {{ type }} အမျိုးအစားဖြစ်ရမည်။ + + + This value should be blank. + ဤတန်ဖိုးသည် ကွပ်လပ်မဖြစ်သင့်ပါ။ + + + The value you selected is not a valid choice. + သင်ရွေးချယ်သောတန်ဖိုးသည် သင့်လျှော်သော် တန်ဖိုးမဟုတ်ပါ။ + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + သင်သည် အနည်းဆုံးရွေးချယ်မှု {{ limit }} ခုရွေးချယ်ရမည်။ + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + သင်သည်အများဆုံး {{ limit }} ခုသာရွေးချယ်ခွင့်ရှိသည်။ + + + One or more of the given values is invalid. + ပေးထားသောတန်ဖိုးတစ်ခု (သို့မဟုတ်) တစ်ခုထက်ပို၍မမှန်ကန်ပါ။ + + + This field was not expected. + ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါ။ + + + This field is missing. + ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါ။ + + + This value is not a valid date. + ဤတန်ဖိုးသည်မှန်ကန်သော်ရက်စွဲမဟုတ်ပါ။ + + + This value is not a valid datetime. + ဤတန်ဖိုးသည် မှန်ကန်သော် ရက်စွဲ/အချိန် မဟုတ်ပါ။ + + + This value is not a valid email address. + ဤတန်ဖိုးသည် မှန်ကန်သော် အီးမေးလိပ်စာ မဟုတ်ပါ။ + + + The file could not be found. + ဖိုင်ရှာမတွေ့ပါ။ + + + The file is not readable. + ဤဖိုင်ကို ဖတ်၍မရပါ။ + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + ဖိုင်အရွယ်အစား အလွန်ကြီးနေသည် ({{ size }} {{ suffix }}). ခွင့်ပြုထားသော အများဆုံး ဖိုင်ဆိုဒ်သည် {{ limit }} {{ suffix }} ဖြစ်သည်။ + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + ဖိုင်၏ mime အမျိုးအစားမမှန်ကန်ပါ ({{ type }})။ ခွင့်ပြုထားသော mime အမျိုးအစားများမှာ {{ types }}. + + + This value should be {{ limit }} or less. + ဤတန်ဖိုးသည် {{ limit }} (သို့မဟုတ်) {{ limit }} ထက်နည်းသင့်သည်။ + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + ဤတန်ဖိုးသည် အလွန်ရှည်လွန်းသည်။ ၎င်းတွင်အက္ခရာ {{ limit }} (သို့မဟုတ်) ၎င်းထက်နည်းသင့်သည်။ | ဤတန်ဖိုးသည် အလွန်ရှည်လွန်းသည်။ ၎င်းတွင်အက္ခရာ {{limit}} ခုနှင့်အထက်ရှိသင့်သည်။ + + + This value should be {{ limit }} or more. + ဤတန်ဖိုးသည် {{limit}} (သို့မဟုတ်) ထို့ထက်ပိုသင့်သည်။ + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + ဤတန်ဖိုးသည် အလွန်တိုလွန်းသည်။ ၎င်းတွင်အက္ခရာ {{limit}} (သို့မဟုတ်) ထို့ထက်ပိုရှိသင့်သည်။ | ဤတန်ဖိုးသည်တိုလွန်းသည်။ ၎င်းတွင်အက္ခရာ {{limit}} လုံးနှင့်အထက်ရှိသင့်သည်။ + + + This value should not be blank. + ဤတန်ဖိုးသည်ကွက်လပ်မဖြစ်သင့်ပါ။ + + + This value should not be null. + ဤတန်ဖိုးသည် null မဖြစ်သင့်ပါ။ + + + This value should be null. + ဤတန်ဖိုးသည် null ဖြစ်သင့်သည်။ + + + This value is not valid. + ဤတန်ဖိုးသည်မှန်ကန်သောတန်ဖိုးမဟုတ်ပါ။ + + + This value is not a valid time. + ဤတန်ဖိုးသည်မှန်ကန်သော အချိန်တန်ဖိုးမဟုတ်ပါ။ + + + This value is not a valid URL. + ဤတန်ဖိုးသည်မှန်ကန်သော URL တန်ဖိုးမဟုတ်ပါ။ + + + The two values should be equal. + တန်ဖိုးနှစ်ခုသည် တူညီသင့်သည်။ + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + ဤဖိုင်သည် အလွန်ကြီးသည်။ ခွင့်ပြုထားသည့်အများဆုံးဖိုင်အရွယ်အစားသည် {{ limit }} {{ suffix }} ဖြစ်သည်။ + + + The file is too large. + ဤဖိုင်သည် အလွန်ကြီးသည်။ + + + The file could not be uploaded. + ဤဖိုင်ကိုတင်၍မရပါ။ + + + This value should be a valid number. + ဤတန်ဖိုးသည်မှန်ကန်သောနံပါတ်ဖြစ်သင့်သည်။ + + + This file is not a valid image. + ဤဖိုင်သည်မှန်ကန်သော ဓါတ်ပုံမဟုတ်ပါ။ + + + This is not a valid IP address. + ၎င်းသည်တရားဝင် IP လိပ်စာမဟုတ်ပါ။ + + + This value is not a valid language. + ဤတန်ဖိုးသည် မှန်ကန်သောဘာသာစကားမဟုတ်ပါ။ + + + This value is not a valid locale. + ဤတန်ဖိုးသည်မှန်ကန်သောဘာသာပြန်မဟုတ်ပါ။ + + + This value is not a valid country. + ဤတန်ဖိုးသည်မှန်ကန်သောနိုင်ငံမဟုတ်ပါ။ + + + This value is already used. + ဤတန်ဖိုးသည် အသုံးပြုပြီးသားဖြစ်သည်။ + + + The size of the image could not be detected. + ဓါတ်ပုံအရွယ်အစားကိုရှာမတွေ့ပါ။ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ပုံ၏အလျားသည် ကြီးလွန်းသည် ({{ width }}px)။ ခွင့်ပြုထားသည့်အများဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်။ + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ပုံ၏အလျားသည် သေးလွန်းသည် ({{ width }}px)။ ခွင့်ပြုထားသည့်အနည်းဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်။ + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ပုံ၏အနံသည် ကြီးလွန်းသည် ({{ height }}px)။ ခွင့်ပြုထားသည့်အများဆုံးအနံသည် {{max_height}}px ဖြစ်သည်။ + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ပုံ၏အနံသည် သေးလွန်းသည် ({{ height }}px)။ ခွင့်ပြုထားသည့်အနည်းဆုံးအနံသည် {{min_height}}px ဖြစ်သည်။ + + + This value should be the user's current password. + ဤတန်ဖိုးသည်အသုံးပြုသူ၏ လက်ရှိစကားဝှက်ဖြစ်သင့်သည်။ + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ဤတန်ဖိုးသည်စာလုံး {{limit}} အတိအကျရှိသင့်သည်။ + + + The file was only partially uploaded. + ဤဖိုင်သည်တစ်စိတ်တစ်ပိုင်းသာ upload တင်ခဲ့သည်။ + + + No file was uploaded. + မည်သည့် ဖိုင်မျှ upload မလုပ်ခဲ့ပါ။ + + + No temporary folder was configured in php.ini. + php.ini တွင်ယာယီဖိုင်တွဲကိုပြင်ဆင်ထားခြင်းမရှိပါ၊ + + + Cannot write temporary file to disk. + ယာရီဖိုင်ကို disk မရေးနိုင်ပါ။ + + + A PHP extension caused the upload to fail. + PHP extension တစ်ခုကြောင့် upload တင်၍မရနိုင်ပါ။ + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + ဤ collection တွင် {{limit}} element (သို့မဟုတ်) ထို့ထက်မပိုသင့်ပါ။ + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + ဤ collection တွင် {{limit}} element (သို့မဟုတ်) ၎င်းထက်နည်းသင့်သည်။ + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + ဤစုစည်းမှုတွင် {{limit}} element အတိအကျပါသင့်သည်။ + + + Invalid card number. + ကဒ်နံပါတ်မမှန်ပါ။ + + + Unsupported card type or invalid card number. + ကဒ်အမျိုးအစားမမှန်ပါ (သို့မဟုတ်) ကဒ်နံပါတ်မမှန်ပါ။ + + + This is not a valid International Bank Account Number (IBAN). + ဤတန်ဖိုးသည် တရား၀င်နိုင်ငံတကာဘဏ်အကောင့်နံပါတ် (International Bank Account Number, IBAN) မဟုတ်ပါ။ + + + This value is not a valid ISBN-10. + ဤတန်ဖိုးသည် မှန်ကန်သော ISBN-10 တန်ဖိုးမဟုတ်ပါ၊ + + + This value is not a valid ISBN-13. + ဤတန်ဖိုးသည် မှန်ကန်သော ISBN-13 တန်ဖိုးမဟုတ်ပါ၊ + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + ဤတန်ဖိုးသည် သင့်လျှော်သော် ISBN-10 (သို့မဟုတ်) ISBN-13 တန်ဖိုးမဟုတ်ပါ၊ + + + This value is not a valid ISSN. + ဤတန်ဖိုးသည် သင့်လျှော်သော် ISSN တန်ဖိုးမဟုတ်ပါ။ + + + This value is not a valid currency. + ဤတန်ဖိုးသည် သင့်လျှော်သော် ငွေကြေးတန်ဖိုးမဟုတ်ပါ။ + + + This value should be equal to {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} နှင့်ညီသင့်သည်။ + + + This value should be greater than {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည်။ + + + This value should be greater than or equal to {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည် (သို့မဟုတ်) ဤတန်ဖိုးသည် {{ compared_value }} ညီသင့်သည်။ + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်တူညီမျှသင့်သည်။ + + + This value should be less than {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} ထက်မနဲသောတဲ့ တန်ဖိုးဖြစ်သင့်သည်။ + + + This value should be less than or equal to {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} ထက် မနည်းသောတန်ဖိုး (သို့မဟုတ်) ညီမျှသောတန်ဖိုးဖြစ်သင့်သည်။ + + + This value should not be equal to {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value }} နှင့်မညီသင့်ပါ။ + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + ဤတန်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်တူမညီမျှသင့်သည်။ + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ဤဓာတ်ပုံအချိုးအစားသည်အလွန်ကြီးလွန်းသည်။ ({{ ratio }})။ ခွင့်ပြုထားသောဓာတ်ပုံအချိုးအသားသည် {{ max_ratio }} ဖြစ်သည်။ + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ဤဓာတ်ပုံအချိုးအစားသည်အလွန်သေးလွန်းသည်။ ({{ ratio }})။ ခွင့်ပြုထားသောဓာတ်ပုံအချိုးအသားသည် {{ min_ratio }} ဖြစ်သည်။ + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + ဤဓာတ်ပုံသည် စတုရန်းဖြစ်နေသည် ({{ width }}x{{ height }}px)။ စတုရန်းဓာတ်ပုံများကို ခွင့်မပြုပါ။ + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ဤဓာတ်ပုံသည် အလျှားလိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). အလျှားလိုက်ဓာတ်ပုံများခွင့်မပြုပါ။ + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + ဤဓာတ်ပုံသည် ဒေါင်လိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). ဒေါင်လိုက်ဓာတ်ပုံများခွင့်မပြုပါ။ + + + An empty file is not allowed. + ဖိုင်အလွတ်ကိုတင်ခွင့်မပြုပါ။ + + + The host could not be resolved. + host ဖြေရှင်း၍မနိုင်ပါ။ + + + This value does not match the expected {{ charset }} charset. + ဤတန်ဖိုးသည် မျှော်မှန်းထားသော {{ charset }} စားလုံးနှင့် ကိုက်ညီမှုမရှိပါ။ + + + This is not a valid Business Identifier Code (BIC). + ၎င်းသည်မှန်ကန်သော Business Identifier Code (BIC) မဟုတ်ပါ။ + + + Error + အမှား + + + This is not a valid UUID. + ဤတန်ဖိုးသည် သင့်လျှော်သော် UUID မဟုတ်ပါ။ + + + This value should be a multiple of {{ compared_value }}. + ဤတန်ဖိုးသည် {{compared_value}} ၏ စတူတန်ဖိုးဖြစ်သင့်သည်။ + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + ဤ Business Identifier Code (BIC) သည် IBAN {{ iban }} နှင့်ဆက်စပ်မှုမရှိပါ။ + + + This value should be valid JSON. + ဤတန်ဖိုးသည် သင့်လျှော်သော် JSON တန်ဖိုးဖြစ်သင့်သည်။ + + + This collection should contain only unique elements. + ဤ collection ကိုယ်ပိုင် elements များ ပါသင့်သည်။ + + + This value should be positive. + ဤတန်ဖိုးသည် အပေါင်းဖြစ်သင့်သည်။ + + + This value should be either positive or zero. + ဤတန်ဖိုးသည် အပေါင်း (သို့မဟုတ်) သုည ဖြစ်သင့်သည်။ + + + This value should be negative. + ဤတန်ဖိုးသည် အနုတ် ဖြစ်သင့်သည်။ + + + This value should be either negative or zero. + ဤတန်ဖိုးသည် အနုတ် (သို့မဟုတ်) သုည ဖြစ်သင့်သည်။ + + + This value is not a valid timezone. + ဤတန်ဖိုးသည် မှန်ကန်သော အချိန်ဇုန်မဟုတ်ပါ။ + + + This password has been leaked in a data breach, it must not be used. Please use another password. + ဤစကားဝှက် သည် ဒေတာပေါက်ကြားမှုတစ်ခုဖြစ်ခဲ့သည်။ ဤစကား၀ှက်ကိုအသုံးမပြုရပါ။ ကျေးဇူးပြု၍ အခြားစကားဝှက်ကိုသုံးပါ။ + + + This value should be between {{ min }} and {{ max }}. + ဤတန်ဖိုးသည် {{ min }} နှင့် {{ max }} ကြားရှိသင့်သည်။ + + + This value is not a valid hostname. + ဤတန်ဖိုးသည် သင့်လျှော်သော် hostname မဟုတ်ပါ။ + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + ဤ collection တွင်ပါပါ၀င်သော elements အရေအတွက်သည် {{ compared_value }} ၏ စတူဖြစ်သင့်သည်။ + + + This value should satisfy at least one of the following constraints: + ဤတန်ဖိုးသည် အောက်ပါကန့်သတ်ချက်များအနက်မှအနည်းဆုံးတစ်ခု ဖြည့်ဆည်းပေးသင့်သည်။ + + + Each element of this collection should satisfy its own set of constraints. + ဤ collection ၏ element တစ်ခုစီသည်၎င်း၏ကိုယ်ပိုင်ကန့်သတ်ချက်များကိုဖြည့်ဆည်းသင့်သည်။ + + + This value is not a valid International Securities Identification Number (ISIN). + ဤတန်ဖိုးသည် သင့်လျှော်သော် အပြည်ပြည်ဆိုင်ရာငွေချေးသက်သေခံနံပါတ် ,International Securities Identification Number (ISIN) မဟုတ်ပါ။ + + + This value should be a valid expression. + ဤတန်ဖိုးသည်မှန်ကန်သောစကားရပ်ဖြစ်သင့်သည်။ + + + + From c6813baeac743b0be1bca08d9481bba840d0adf8 Mon Sep 17 00:00:00 2001 From: Bhavin Nakrani Date: Sun, 19 Sep 2021 19:31:48 +0530 Subject: [PATCH 48/64] [Validator] Add missing thai translation --- .../Validator/Resources/translations/validators.th.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf index 31453ff15736d..847bf3c26888b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf @@ -386,6 +386,10 @@ This value is not a valid International Securities Identification Number (ISIN). ค่า​รหัสหลักทรัพย์สากล (ISIN) ไม่ถูกต้อง + + This value should be a valid expression. + ค่านี้ควรเป็นนิพจน์ที่ถูกต้อง + From 591260883dfb1f74770058d44dc0a9db7dcbb327 Mon Sep 17 00:00:00 2001 From: Bhavin Nakrani Date: Mon, 20 Sep 2021 22:08:17 +0530 Subject: [PATCH 49/64] Add Slovak lang translation #41081 --- .../Security/Core/Resources/translations/security.sk.xlf | 8 ++++++++ .../Validator/Resources/translations/validators.sk.xlf | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.sk.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.sk.xlf index 3caa51ab01306..8e06befafdf33 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.sk.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.sk.xlf @@ -70,6 +70,14 @@ Invalid or expired login link. Neplatný alebo expirovaný odkaz na prihlásenie. + + Too many failed login attempts, please try again in %minutes% minute. + Príliš veľa neúspešných pokusov o prihlásenie. Skúste to znova o %minutes% minútu. + + + Too many failed login attempts, please try again in %minutes% minutes. + Príliš veľa neúspešných pokusov o prihlásenie. Skúste to znova o %minutes% minút. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf index a0c55ea6db146..ad61814197df9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - V php.ini nie je nastavená cesta k adresáru pre dočasné súbory. + V php.ini nie je nastavená cesta k addressáru pre dočasné súbory. Cannot write temporary file to disk. @@ -386,6 +386,10 @@ This value is not a valid International Securities Identification Number (ISIN). Táto hodnota nie je platné medzinárodné označenie cenného papiera (ISIN). + + This value should be a valid expression. + Táto hodnota by mala byť platným výrazom. + From 402f4035a3766bf8ce6450c4179cb649c6f6a732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 21 Sep 2021 08:20:06 +0200 Subject: [PATCH 50/64] Fix iterrator in ServiceConfigurator --- .../Loader/Configurator/AbstractServiceConfigurator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php b/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php index 2257edaef6daf..38e2dd06d9638 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php +++ b/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php @@ -32,8 +32,8 @@ public function __destruct() { // default tags should be added last foreach ($this->defaultTags as $name => $attributes) { - foreach ($attributes as $attributes) { - $this->definition->addTag($name, $attributes); + foreach ($attributes as $attribute) { + $this->definition->addTag($name, $attribute); } } $this->defaultTags = []; From 8859c64abde3f81ebc8a6a2297e17766301ff78d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 22 Sep 2021 09:48:00 +0200 Subject: [PATCH 51/64] Update README --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 52860457b2336..02417bc9835d2 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ If you discover a security vulnerability within Symfony, please follow our About Us -------- -Symfony development is sponsored by [SensioLabs][21], led by the -[Symfony Core Team][22] and supported by [Symfony contributors][19]. +Symfony development is led by the [Symfony Core Team][22] +and supported by [Symfony contributors][19]. [1]: https://symfony.com [2]: https://symfony.com/projects @@ -80,7 +80,6 @@ Symfony development is sponsored by [SensioLabs][21], led by the [18]: https://symfony.com/doc/current/contributing/documentation/index.html [19]: https://symfony.com/contributors [20]: https://symfony.com/security -[21]: https://sensiolabs.com [22]: https://symfony.com/doc/current/contributing/code/core_team.html [23]: https://github.com/symfony/symfony-demo [24]: https://symfony.com/coc From c2182146479593682ac7c9347cde8e230b4e2708 Mon Sep 17 00:00:00 2001 From: Ion Bazan Date: Thu, 23 Sep 2021 12:31:33 +0800 Subject: [PATCH 52/64] fix missing classes --- .../Component/Notifier/Bridge/GoogleChat/GoogleChatOptions.php | 1 - .../Security/Http/Authenticator/Passport/Badge/UserBadge.php | 1 + src/Symfony/Component/Semaphore/SemaphoreInterface.php | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Notifier/Bridge/GoogleChat/GoogleChatOptions.php b/src/Symfony/Component/Notifier/Bridge/GoogleChat/GoogleChatOptions.php index 77372cd5102c6..bc7c492fd684c 100644 --- a/src/Symfony/Component/Notifier/Bridge/GoogleChat/GoogleChatOptions.php +++ b/src/Symfony/Component/Notifier/Bridge/GoogleChat/GoogleChatOptions.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Notifier\Bridge\GoogleChat; -use Symfony\Component\Notifier\Bridge\GoogleChat\Component\Card; use Symfony\Component\Notifier\Message\ChatMessage; use Symfony\Component\Notifier\Message\MessageOptionsInterface; use Symfony\Component\Notifier\Notification\Notification; diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/UserBadge.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/UserBadge.php index dd24d488dfb52..8357158cc48b0 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/UserBadge.php +++ b/src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/UserBadge.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Http\Authenticator\Passport\Badge; +use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\AuthenticationServiceException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\EventListener\UserProviderListener; diff --git a/src/Symfony/Component/Semaphore/SemaphoreInterface.php b/src/Symfony/Component/Semaphore/SemaphoreInterface.php index 6897498145bec..363b31f4c5cb1 100644 --- a/src/Symfony/Component/Semaphore/SemaphoreInterface.php +++ b/src/Symfony/Component/Semaphore/SemaphoreInterface.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Semaphore; use Symfony\Component\Semaphore\Exception\SemaphoreAcquiringException; +use Symfony\Component\Semaphore\Exception\SemaphoreExpiredException; use Symfony\Component\Semaphore\Exception\SemaphoreReleasingException; /** From b52451c0e93b5e2894e015ae4891e323fa1b0126 Mon Sep 17 00:00:00 2001 From: noniagriconomie Date: Wed, 22 Sep 2021 18:08:42 +0200 Subject: [PATCH 53/64] [FrameworkBundle] Avoid secrets:decrypt-to-local command to fail --- .../FrameworkBundle/Command/SecretsDecryptToLocalCommand.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php index 1d3a96e982c25..6d8820443a2c1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php @@ -77,9 +77,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int foreach ($secrets as $k => $v) { if (null === $v) { - $io->error($this->vault->getLastMessage()); - - return 1; + $io->error($this->vault->getLastMessage() ?? sprintf('Secret "%s" has been skipped as there was an error reading it.', $k)); + continue; } $this->localVault->seal($k, $v); From 5a6bf504f3e7223173ed8d7ec7ded8013da8a494 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Thu, 23 Sep 2021 19:00:49 +0200 Subject: [PATCH 54/64] [Messenger] [Redis] Allow authentication with user and password --- .../Tests/Transport/RedisExt/ConnectionTest.php | 17 ++++++++++++++--- .../Messenger/Transport/RedisExt/Connection.php | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php index 3aa59d69eaeee..bf7ad591e454d 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php @@ -113,15 +113,26 @@ public function testKeepGettingPendingMessages() $this->assertNotNull($connection->get()); } - public function testAuth() + /** + * @param string|array $expected + * + * @dataProvider provideAuthDsn + */ + public function testAuth($expected, string $dsn) { $redis = $this->createMock(\Redis::class); $redis->expects($this->exactly(1))->method('auth') - ->with('password') + ->with($expected) ->willReturn(true); - Connection::fromDsn('redis://password@localhost/queue', [], $redis); + Connection::fromDsn($dsn, [], $redis); + } + + public function provideAuthDsn(): \Generator + { + yield 'Password only' => ['password', 'redis://password@localhost/queue']; + yield 'User and password' => [['user', 'password'], 'redis://user:password@localhost/queue']; } public function testNoAuthWithEmptyPassword() diff --git a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php index e7c549ecf49f8..88b1a7e5a5f28 100644 --- a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php @@ -97,7 +97,8 @@ public static function fromDsn(string $dsn, array $redisOptions = [], \Redis $re $connectionCredentials = [ 'host' => $parsedUrl['host'] ?? '127.0.0.1', 'port' => $parsedUrl['port'] ?? 6379, - 'auth' => $parsedUrl['pass'] ?? $parsedUrl['user'] ?? null, + // See: https://github.com/phpredis/phpredis/#auth + 'auth' => isset($parsedUrl['pass']) && isset($parsedUrl['user']) ? [$parsedUrl['user'], $parsedUrl['pass']] : $parsedUrl['pass'] ?? $parsedUrl['user'] ?? null, ]; if (isset($parsedUrl['query'])) { From 24d372a904ea8a7072646d9a9b5e66824e8cf842 Mon Sep 17 00:00:00 2001 From: Maxime P Date: Fri, 24 Sep 2021 15:30:14 +0200 Subject: [PATCH 55/64] Update README.md replace composer install by composer require --- src/Symfony/Component/Debug/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Debug/README.md b/src/Symfony/Component/Debug/README.md index 0627e69c35f31..31a824069f8a6 100644 --- a/src/Symfony/Component/Debug/README.md +++ b/src/Symfony/Component/Debug/README.md @@ -12,7 +12,7 @@ Getting Started --------------- ``` -$ composer install symfony/debug +$ composer require symfony/debug ``` ```php From fe83e0e45718c5f5918785ffee7abbe14377022a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 24 Sep 2021 15:17:06 +0200 Subject: [PATCH 56/64] [VarDumper] fix dumping typed references from properties --- .../Component/VarDumper/Cloner/VarCloner.php | 47 ++++++++++------ .../VarDumper/Tests/Cloner/VarClonerTest.php | 53 +++++++++++++++++-- .../VarDumper/Tests/Fixtures/Php74.php | 2 + 3 files changed, 82 insertions(+), 20 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php index 6a9002137b7c9..cd6e7dcab4804 100644 --- a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php +++ b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php @@ -82,29 +82,39 @@ protected function doClone($var) // $v is the original value or a stub object in case of hard references if (\PHP_VERSION_ID >= 70400) { - $zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k); + $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null; } else { $refs[$k] = $cookie; - $zvalIsRef = $vals[$k] === $cookie; + $zvalRef = $vals[$k] === $cookie; } - if ($zvalIsRef) { + if ($zvalRef) { $vals[$k] = &$stub; // Break hard references to make $queue completely unset($stub); // independent from the original structure - if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { - $vals[$k] = $refs[$k] = $v; + if (\PHP_VERSION_ID >= 70400 ? null !== $vals[$k] = $hardRefs[$zvalRef] ?? null : $v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { + if (\PHP_VERSION_ID >= 70400) { + $v = $vals[$k]; + } else { + $refs[$k] = $vals[$k] = $v; + } if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { ++$v->value->refCount; } ++$v->refCount; continue; } - $refs[$k] = $vals[$k] = new Stub(); - $refs[$k]->value = $v; - $h = spl_object_id($refs[$k]); - $hardRefs[$h] = &$refs[$k]; - $values[$h] = $v; + $vals[$k] = new Stub(); + $vals[$k]->value = $v; $vals[$k]->handle = ++$refsCounter; + + if (\PHP_VERSION_ID >= 70400) { + $hardRefs[$zvalRef] = $vals[$k]; + } else { + $refs[$k] = $vals[$k]; + $h = spl_object_id($refs[$k]); + $hardRefs[$h] = &$refs[$k]; + $values[$h] = $v; + } } // Create $stub when the original value $v can not be used directly // If $v is a nested structure, put that structure in array $a @@ -163,12 +173,17 @@ protected function doClone($var) unset($v[$gid]); $a = []; foreach ($v as $gk => &$gv) { - if ($v === $gv) { + if ($v === $gv && (\PHP_VERSION_ID < 70400 || !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()]))) { unset($v); $v = new Stub(); $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; $v->handle = -1; - $gv = &$hardRefs[spl_object_id($v)]; + if (\PHP_VERSION_ID >= 70400) { + $gv = &$a[$gk]; + $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv; + } else { + $gv = &$hardRefs[spl_object_id($v)]; + } $gv = $v; } @@ -270,10 +285,12 @@ protected function doClone($var) } } - if ($zvalIsRef) { - $refs[$k]->value = $stub; - } else { + if (!$zvalRef) { $vals[$k] = $stub; + } elseif (\PHP_VERSION_ID >= 70400) { + $hardRefs[$zvalRef]->value = $stub; + } else { + $refs[$k]->value = $stub; } } diff --git a/src/Symfony/Component/VarDumper/Tests/Cloner/VarClonerTest.php b/src/Symfony/Component/VarDumper/Tests/Cloner/VarClonerTest.php index a9518444db9c2..fed2d669a7654 100644 --- a/src/Symfony/Component/VarDumper/Tests/Cloner/VarClonerTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Cloner/VarClonerTest.php @@ -499,12 +499,55 @@ public function testPhp74() [p1] => 123 [p2] => Symfony\Component\VarDumper\Cloner\Stub Object ( - [type] => 4 - [class] => stdClass - [value] => + [type] => 1 + [class] => + [value] => Symfony\Component\VarDumper\Cloner\Stub Object + ( + [type] => 4 + [class] => stdClass + [value] => + [cut] => 0 + [handle] => %i + [refCount] => 1 + [position] => 0 + [attr] => Array + ( + ) + + ) + [cut] => 0 - [handle] => %i - [refCount] => 0 + [handle] => 1 + [refCount] => 1 + [position] => 0 + [attr] => Array + ( + ) + + ) + + [p3] => Symfony\Component\VarDumper\Cloner\Stub Object + ( + [type] => 1 + [class] => + [value] => Symfony\Component\VarDumper\Cloner\Stub Object + ( + [type] => 4 + [class] => stdClass + [value] => + [cut] => 0 + [handle] => %i + [refCount] => 1 + [position] => 0 + [attr] => Array + ( + ) + + ) + + [cut] => 0 + [handle] => 1 + [refCount] => 1 [position] => 0 [attr] => Array ( diff --git a/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php b/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php index 724fbeb7bdb6e..8bd4c496a1715 100644 --- a/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php +++ b/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php @@ -6,9 +6,11 @@ class Php74 { public $p1 = 123; public \stdClass $p2; + public \stdClass $p3; public function __construct() { $this->p2 = new \stdClass(); + $this->p3 = &$this->p2; } } From 5b35b8a3f7a0ab3430ed9816819d2f006a049f36 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 25 Sep 2021 09:16:24 +0200 Subject: [PATCH 57/64] relax parameter type --- .../Messenger/Bridge/Redis/Transport/Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php index d30e3e885fdf6..a5054c17315ed 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php @@ -111,7 +111,10 @@ public function __construct(array $configuration, array $connectionCredentials = $this->claimInterval = $configuration['claim_interval'] ?? self::DEFAULT_OPTIONS['claim_interval']; } - private static function initializeRedis(\Redis $redis, string $host, int $port, ?string $auth, int $serializer, int $dbIndex): \Redis + /** + * @param string|string[]|null $auth + */ + private static function initializeRedis(\Redis $redis, string $host, int $port, $auth, int $serializer, int $dbIndex): \Redis { $redis->connect($host, $port); $redis->setOption(\Redis::OPT_SERIALIZER, $serializer); From a990843f472baf55fa99cbc653bd07c264d390ad Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 25 Sep 2021 10:57:14 +0200 Subject: [PATCH 58/64] [Messenger] relax parameter type in cluster mode --- .../Messenger/Bridge/Redis/Transport/Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php index a5054c17315ed..7ffd04caa97f5 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php @@ -130,7 +130,10 @@ private static function initializeRedis(\Redis $redis, string $host, int $port, return $redis; } - private static function initializeRedisCluster(?\RedisCluster $redis, array $hosts, ?string $auth, int $serializer): \RedisCluster + /** + * @param string|string[]|null $auth + */ + private static function initializeRedisCluster(?\RedisCluster $redis, array $hosts, $auth, int $serializer): \RedisCluster { if (null === $redis) { $redis = new \RedisCluster(null, $hosts, 0.0, 0.0, false, $auth); From fda7e7e4abad63916d98cededf898ac958044369 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Fri, 24 Sep 2021 10:51:06 +0200 Subject: [PATCH 59/64] Fix Redis replication on Redis <5 --- .../Cache/Adapter/RedisTagAwareAdapter.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php index c721f35d73d4e..b8b4b6f7b3134 100644 --- a/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php @@ -15,6 +15,7 @@ use Predis\Connection\Aggregate\PredisCluster; use Predis\Connection\Aggregate\ReplicationInterface; use Predis\Response\Status; +use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\Exception\LogicException; use Symfony\Component\Cache\Marshaller\DeflateMarshaller; @@ -159,6 +160,12 @@ protected function doDeleteYieldTags(array $ids): iterable }); foreach ($results as $id => $result) { + if ($result instanceof \RedisException) { + CacheItem::log($this->logger, 'Failed to delete key "{key}": '.$result->getMessage(), ['key' => substr($id, \strlen($this->namespace)), 'exception' => $result]); + + continue; + } + try { yield $id => !\is_string($result) || '' === $result ? [] : $this->marshaller->unmarshall($result); } catch (\Exception $e) { @@ -197,6 +204,8 @@ protected function doInvalidate(array $tagIds): bool // gargage collect that set from the client side. $lua = <<<'EOLUA' + redis.replicate_commands() + local cursor = '0' local id = KEYS[1] repeat @@ -234,6 +243,8 @@ protected function doInvalidate(array $tagIds): bool }); $lua = <<<'EOLUA' + redis.replicate_commands() + local id = KEYS[1] local cursor = table.remove(ARGV) redis.call('SREM', '{'..id..'}'..id, unpack(ARGV)) @@ -241,7 +252,17 @@ protected function doInvalidate(array $tagIds): bool return redis.call('SSCAN', '{'..id..'}'..id, cursor, 'COUNT', 5000) EOLUA; - foreach ($results as $id => [$cursor, $ids]) { + $success = true; + foreach ($results as $id => $values) { + if ($values instanceof \RedisException) { + CacheItem::log($this->logger, 'Failed to invalidate key "{key}": '.$values->getMessage(), ['key' => substr($id, \strlen($this->namespace)), 'exception' => $values]); + $success = false; + + continue; + } + + [$cursor, $ids] = $values; + while ($ids || '0' !== $cursor) { $this->doDelete($ids); @@ -264,7 +285,7 @@ protected function doInvalidate(array $tagIds): bool } } - return true; + return $success; } private function getRedisEvictionPolicy(): string From 2c0f7e04e08a6bbb550992f7f964c17ed68c8a65 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 25 Sep 2021 20:09:43 +0200 Subject: [PATCH 60/64] [LDAP] Fix resource type checks & docblocks on PHP 8.1 --- .../Ldap/Adapter/ExtLdap/Connection.php | 9 ++++----- .../Component/Ldap/Adapter/ExtLdap/Query.php | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php index 2e400d29c9283..49e465d3f791c 100644 --- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php +++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Ldap\Adapter\ExtLdap; +use LDAP\Connection as LDAPConnection; use Symfony\Component\Ldap\Adapter\AbstractConnection; use Symfony\Component\Ldap\Exception\AlreadyExistsException; use Symfony\Component\Ldap\Exception\ConnectionException; @@ -32,7 +33,7 @@ class Connection extends AbstractConnection /** @var bool */ private $bound = false; - /** @var resource */ + /** @var resource|LDAPConnection */ private $connection; /** @@ -89,9 +90,7 @@ public function bind($dn = null, $password = null) } /** - * Returns a link resource. - * - * @return resource + * @return resource|LDAPConnection * * @internal */ @@ -165,7 +164,7 @@ private function connect() private function disconnect() { - if ($this->connection && \is_resource($this->connection)) { + if ($this->connection) { ldap_unbind($this->connection); } diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php index 4abcff763aaac..3fcf9bee16018 100644 --- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php +++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Ldap\Adapter\ExtLdap; +use LDAP\Connection as LDAPConnection; +use LDAP\Result; use Symfony\Component\Ldap\Adapter\AbstractQuery; use Symfony\Component\Ldap\Exception\LdapException; use Symfony\Component\Ldap\Exception\NotBoundException; @@ -27,7 +29,7 @@ class Query extends AbstractQuery /** @var Connection */ protected $connection; - /** @var resource[] */ + /** @var resource[]|Result[] */ private $results; /** @var array */ @@ -156,7 +158,7 @@ public function execute() * Returns an LDAP search resource. If this query resulted in multiple searches, only the first * page will be returned. * - * @return resource + * @return resource|Result * * @internal */ @@ -172,7 +174,7 @@ public function getResource($idx = 0) /** * Returns all LDAP search resources. * - * @return resource[] + * @return resource[]|Result[] * * @internal */ @@ -215,7 +217,7 @@ private function resetPagination() /** * Sets LDAP pagination controls. * - * @param resource $con + * @param resource|LDAPConnection $con */ private function controlPagedResult($con, int $pageSize, bool $critical, string $cookie): bool { @@ -239,8 +241,8 @@ private function controlPagedResult($con, int $pageSize, bool $critical, string /** * Retrieve LDAP pagination cookie. * - * @param resource $con - * @param resource $result + * @param resource|LDAPConnection $con + * @param resource|Result $result */ private function controlPagedResultResponse($con, $result, string $cookie = ''): string { @@ -257,9 +259,9 @@ private function controlPagedResultResponse($con, $result, string $cookie = ''): /** * Calls actual LDAP search function with the prepared options and parameters. * - * @param resource $con + * @param resource|LDAPConnection $con * - * @return resource + * @return resource|Result */ private function callSearchFunction($con, string $func, int $sizeLimit) { From d93da591e57b944352d517c9b9b3d4a507799c05 Mon Sep 17 00:00:00 2001 From: fkropfhamer Date: Thu, 23 Sep 2021 12:33:45 +0200 Subject: [PATCH 61/64] [SecurityBundle] Fixed LogicException message of FirewallAwareTrait --- .../Security/FirewallAwareTrait.php | 2 +- .../Tests/Security/UserAuthenticatorTest.php | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/SecurityBundle/Tests/Security/UserAuthenticatorTest.php diff --git a/src/Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait.php b/src/Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait.php index 70d9178f8ab19..d79d0b7a1df53 100644 --- a/src/Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait.php +++ b/src/Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait.php @@ -29,7 +29,7 @@ private function getForFirewall(): object { $serviceIdentifier = str_replace('FirewallAware', '', static::class); if (null === $request = $this->requestStack->getCurrentRequest()) { - throw new \LogicException('Cannot determine the correct '.$serviceIdentifier.' to use: there is no active Request and so, the firewall cannot be determined. Try using a specific '.$serviceIdentifier().' service.'); + throw new \LogicException('Cannot determine the correct '.$serviceIdentifier.' to use: there is no active Request and so, the firewall cannot be determined. Try using a specific '.$serviceIdentifier.' service.'); } $firewall = $this->firewallMap->getFirewallConfig($request); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Security/UserAuthenticatorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Security/UserAuthenticatorTest.php new file mode 100644 index 0000000000000..ecb9cd8e7e33d --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Security/UserAuthenticatorTest.php @@ -0,0 +1,34 @@ +expectException(\LogicException::class); + $this->expectExceptionMessage('Cannot determine the correct Symfony\Bundle\SecurityBundle\Security\UserAuthenticator to use: there is no active Request and so, the firewall cannot be determined. Try using a specific Symfony\Bundle\SecurityBundle\Security\UserAuthenticator service.'); + + $userAuthenticator->authenticateUser($user, $authenticator, $request); + } +} From 6d2b71e79f18017003a1647510d441e2af67a530 Mon Sep 17 00:00:00 2001 From: Stephan Wentz Date: Tue, 28 Sep 2021 08:39:00 +0200 Subject: [PATCH 62/64] [Workflow] Add missing audit-trail settings in framework workflow config xsd --- .../Resources/config/schema/symfony-1.0.xsd | 14 ++++++++++++++ .../DependencyInjection/Fixtures/xml/workflows.xml | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index edcaca3a90018..bc46570744d16 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -310,6 +310,7 @@ + @@ -339,6 +340,19 @@ + + + + + + + + + + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml index 290ab50e7d8da..79361af57a61f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml @@ -8,6 +8,7 @@ + draft Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest @@ -42,6 +43,7 @@ + start Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest From 6cb08765d4853df19b61cce55769872a00383884 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 Sep 2021 10:52:33 +0200 Subject: [PATCH 63/64] Update CHANGELOG for 5.3.8 --- CHANGELOG-5.3.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CHANGELOG-5.3.md b/CHANGELOG-5.3.md index c949725e03b9b..bd3f2385357e7 100644 --- a/CHANGELOG-5.3.md +++ b/CHANGELOG-5.3.md @@ -7,6 +7,38 @@ in 5.3 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v5.3.0...v5.3.1 +* 5.3.8 (2021-09-28) + + * bug #43206 [Workflow] Add missing audit-trail settings in framework workflow con… (Stephan Wentz) + * bug #42354 [Ldap][Security] Make LdapAuthenticator an EntryPoint (dcp-dev, chalasr) + * bug #43146 [SecurityBundle] Fixed LogicException message of FirewallAwareTrait (fkropfhamer) + * bug #43158 [Cache] Fix invalidating tags on Redis <5 (wouterj) + * bug #43179 [Ldap] Fix `resource` type checks & docblocks on PHP 8.1 (chalasr) + * bug #43174 [Messenger] relax parameter type (xabbuh) + * bug #43137 [FrameworkBundle] Avoid secrets:decrypt-to-local command to fail (noniagriconomie) + * bug #43171 [VarDumper] fix dumping typed references from properties (nicolas-grekas) + * bug #43124 [Messenger] [Redis] Allow authentication with user and password (GaryPEGEOT) + * bug #39350 [FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler (l-vo) + * bug #43115 [DependencyInjection] Fix iterator in ServiceConfigurator (jderusse) + * bug #43073 [Notifier] Update FirebaseTransport.php (dima-gr) + * bug #43031 [Form] Do not trim unassigned unicode characters (simonberger) + * bug #43058 [WebProfilerBundle] Fix displaying certain configs (HypeMC) + * bug #43022 [PhpUnitBridge] Track unsilenced deprecations only for userland (nicolas-grekas) + * bug #42979 [FrameworkBundle] fix session-related BC layer triggering deprecation (nicolas-grekas) + * bug #42672 [PropertyAccess] Fix Regression in PropertyAccessor::isWritable() (haase-fabian) + * bug #42976 [Mime] Allow array as input for RawMessage (derrabus) + * bug #42932 [Messenger] Support rediss in transport bridge (RuslanZavacky) + * bug #42771 [FrameworkBundle] Match 5.3 and 5.1 mailer configuration (wizardz) + * bug #42098 [PropertyInfo] Support for intersection types (derrabus) + * bug #42904 [Cache] Make sure PdoAdapter::prune() always returns a bool (derrabus) + * bug #42896 [HttpClient] Fix handling timeouts when responses are destructed (nicolas-grekas) + * bug #42862 [Framework] Clean "about" command help after Environment section was removed (GromNaN) + * bug #42835 [Cache] Fix implicit float to int cast (derrabus) + * bug #42831 [Mime] Update mime types (fabpot) + * bug #42830 [HttpKernel] Fix empty timeline in profiler (nicodmf) + * bug #42815 [DependencyInjection] Fix circular reference in autowired decorators (shyim) + * bug #42819 Fix tests failing with DBAL 3 (derrabus) + * 5.3.7 (2021-08-30) * bug #42769 [HttpClient] Don't pass float to `usleep()` (derrabus) From e5b3c3baff0300824bb87ccefca4f1e4deacc882 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 Sep 2021 10:52:39 +0200 Subject: [PATCH 64/64] Update VERSION for 5.3.8 --- 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 631d2a89ffcdd..027eef0baacf9 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -75,12 +75,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '5.3.8-DEV'; + public const VERSION = '5.3.8'; public const VERSION_ID = 50308; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 3; public const RELEASE_VERSION = 8; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2022'; public const END_OF_LIFE = '01/2022';