diff --git a/.gitattributes b/.gitattributes index d1570aff1cd79..cf8890eefbda8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,4 @@ /src/Symfony/Component/Runtime export-ignore /src/Symfony/Component/Translation/Bridge export-ignore /src/Symfony/Component/Intl/Resources/data/*/* linguist-generated=true +/.git* export-ignore diff --git a/.github/sync-packages.php b/.github/sync-packages.php new file mode 100644 index 0000000000000..d947c586d0c91 --- /dev/null +++ b/.github/sync-packages.php @@ -0,0 +1,80 @@ +defines($resname, $domain)) { $translation = $catalogue->get($resname, $domain); $metadata = $catalogue->getMetadata($resname, $domain); + } else { + $translation = $source; } $metadata['id'] = $enCatalogue->getMetadata($resname, $domain)['id']; if ($resname !== $source) { diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c21cc6e59321f..1a0dd8c254f57 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -124,6 +124,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install system dependencies run: | @@ -218,13 +220,11 @@ jobs: - name: Check for changes in translation files id: changed-translation-files run: | - if git diff --quiet HEAD~1 HEAD -- 'src/**/Resources/translations/*.xlf'; then - echo "{changed}={true}" >> $GITHUB_OUTPUT - else - echo "{changed}={false}" >> $GITHUB_OUTPUT - fi + echo 'changed='$((git diff --quiet HEAD~1 HEAD -- 'src/**/Resources/translations/*.xlf' || (echo 'true' && exit 1)) && echo 'false') >> $GITHUB_OUTPUT - name: Check Translation Status if: steps.changed-translation-files.outputs.changed == 'true' run: | php src/Symfony/Component/Translation/Resources/bin/translation-status.php -v + php .github/sync-translations.php + git diff --exit-code src/ || (echo '::error::Run "php .github/sync-translations.php" to fix XLIFF files.' && exit 1) diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml index 96b7451b7f945..0792f4e8d6da5 100644 --- a/.github/workflows/package-tests.yml +++ b/.github/workflows/package-tests.yml @@ -101,6 +101,7 @@ jobs: done exit $ok + - name: Verify symfony/deprecation-contracts requirements run: | set +e @@ -141,3 +142,9 @@ jobs: done exit $ok + + - name: Verify subtree-splits are auto-closed + run: | + php .github/sync-packages.php + git add src/ + git diff --staged --exit-code || (echo '::error::Please run "php .github/sync-packages.php".' && exit 1) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1e4e77ab46ffc..c9deba395c405 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -50,7 +50,7 @@ jobs: coverage: "none" ini-values: date.timezone=UTC,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 php-version: "${{ matrix.php }}" - extensions: "${{ env.extensions }}" + extensions: "${{ matrix.extensions || env.extensions }}" tools: flex - name: Configure environment diff --git a/CHANGELOG-7.0.md b/CHANGELOG-7.0.md index 394009335f611..93c7b7d838a49 100644 --- a/CHANGELOG-7.0.md +++ b/CHANGELOG-7.0.md @@ -7,6 +7,47 @@ in 7.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v7.0.0...v7.0.1 +* 7.0.7 (2024-04-29) + + * bug #54699 [DoctrineBridge] Update AbstractSchemaListener to adjust more database params (ywisax) + * bug #54691 [Finder] Also consider .git inside the basedir of in() directory (nickvergessen) + * bug #54724 [AssetMapper] Check asset/vendor directory is writable (smnandre) + * bug #54750 [Validator] detect wrong usages of minMessage/maxMessage in options (xabbuh) + * bug #54751 [Validator]  detect wrong e-mail validation modes (xabbuh) + * bug #54723 [Form] read form values using the chain data accessor (xabbuh) + * bug #54706 [Yaml] call substr() with integer offsets (xabbuh) + * bug #54675 [PropertyInfo] Fix PHPStan properties type in trait (mtarld) + * bug #54673 [Messenger] explicitly cast boolean SSL stream options (xabbuh) + * bug #54665 Add test for AccessTokenHeaderRegex and adjust regex (Spomky) + * bug #54635 [Serializer] Revert "Fix object normalizer when properties has the same name as their accessor" - it was a BC Break (NeilPeyssard) + * bug #54625 [Intl] Remove resources data from classmap generation (shyim) + * bug #54598 [TwigBridge]  implement NodeVisitorInterface instead of extending AbstractNodeVisitor (xabbuh) + * bug #54072 [HttpKernel] Fix datacollector caster for reference object property (ebuildy) + * bug #54395 [Serializer] Fixing PHP warning in the ObjectNormalizer with MaxDepth enabled (jaydiablo) + * bug #54564 [Translation] Skip state=needs-translation entries only when source == target (nicolas-grekas) + * bug #54579 [Cache] Always select database for persistent redis connections (uncaught) + * bug #54059 [Security] Validate that CSRF token in form login is string similar to username/password (glaubinix) + * bug #54530 [Clock] initialize the current time with midnight before modifying the date (xabbuh) + * bug #54547 [HttpKernel] Force non lazy controller services (smnandre) + * bug #54517 [HttpClient] Let curl handle transfer encoding (michaelhue) + * bug #52917 [Serializer] Fix unexpected allowed attributes (mtarld) + * bug #54063 [FrameworkBundle] Fix registration of the bundle path to translation (FlyingDR) + * bug #54392 [Messenger] Make Doctrine connection ignore unrelated tables on setup (MatTheCat) + * bug #54513 [HtmlSanitizer] Ignore Processing Instructions (smnandre) + * bug #54506 [HttpFoundation] Set content-type header in RedirectResponse (smnandre) + * bug #54505 [Serializer]  initialize serializer in trait with null (xabbuh) + * bug #52698 [Serializer] Fix XML scalar to object denormalization (mtarld) + * bug #54485 [Serializer] Ignore when using #[Ignore] on a non-accessor (nicolas-grekas) + * bug #54105 [Messenger] Improve deadlock handling on `ack()` and `reject()` (jwage) + * bug #54242 [HttpClient] [EventSourceHttpClient] Fix consuming SSEs with \r\n separator (fancyweb) + * bug #54487 [Validator] Accept `Stringable` in `ExecutionContext::build/addViolation()` (alexandre-daubois) + * bug #54456 [DomCrawler] Encode html entities only if nessecary (ausi) + * bug #54484 [Serializer] reset backed_enum priority, and re-prioritise translatable (GwendolenLynch) + * bug #54471 [Filesystem] Strengthen the check of file permissions in `dumpFile` (alexandre-daubois) + * bug #54403 [FrameworkBundle] [Command] Fix #54402: Suppress PHP warning when is_readable() tries to access dirs outside of open_basedir restrictions (Jeldrik Geraedts) + * bug #54440 [Console] return null when message with name is not set (xabbuh) + * bug #54468 [Translation] Fix LocaleSwitcher throws when intl not loaded (smnandre) + * 7.0.6 (2024-04-03) * bug #54400 [HttpClient] stop all server processes after tests have run (xabbuh) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f676651321bef..04ba9eca15947 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -32,8 +32,8 @@ The Symfony Connect username in parenthesis allows to get more information - Yonel Ceruto (yonelceruto) - Hugo Hamon (hhamon) - Tobias Nyholm (tobias) - - Samuel ROZE (sroze) - Jérôme Tamarelle (gromnan) + - Samuel ROZE (sroze) - Pascal Borreli (pborreli) - Antoine Lamirault (alamirault) - Romain Neutron @@ -58,9 +58,9 @@ The Symfony Connect username in parenthesis allows to get more information - Alexandre Salomé (alexandresalome) - Grégoire Paris (greg0ire) - William DURAND + - Vincent Langlet (deviling) - ornicar - Dany Maillard (maidmaid) - - Vincent Langlet (deviling) - Eriksen Costa - Diego Saint Esteben (dosten) - stealth35 ‏ (stealth35) @@ -77,10 +77,10 @@ The Symfony Connect username in parenthesis allows to get more information - Saša Stamenković (umpirsky) - Allison Guilhem (a_guilhem) - Mathieu Piot (mpiot) + - Simon André (simonandre) - Mathieu Santostefano (welcomattic) - Alexander Schranz (alexander-schranz) - Vasilij Duško (staff) - - Simon André (simonandre) - Sarah Khalil (saro0h) - Laurent VOULLEMIER (lvo) - Konstantin Kudryashov (everzet) @@ -92,8 +92,8 @@ The Symfony Connect username in parenthesis allows to get more information - Florin Patan (florinpatan) - Vladimir Reznichenko (kalessil) - Peter Rehm (rpet) - - Henrik Bjørnskov (henrikbjorn) - Dariusz Ruminski + - Henrik Bjørnskov (henrikbjorn) - David Buchmann (dbu) - Andrej Hudec (pulzarraider) - Jáchym Toušek (enumag) @@ -103,20 +103,20 @@ The Symfony Connect username in parenthesis allows to get more information - Denis (yethee) - Michel Weimerskirch (mweimerskirch) - Issei Murasawa (issei_m) + - Arnout Boks (aboks) - Douglas Greenshields (shieldo) - Frank A. Fiebig (fafiebig) - Baldini - Alex Pott - Fran Moreno (franmomu) - - Arnout Boks (aboks) - Charles Sarrazin (csarrazi) - Tomas Norkūnas (norkunas) - Henrik Westphal (snc) - Dariusz Górecki (canni) - Ener-Getick + - Hubert Lenoir (hubert_lenoir) - Graham Campbell (graham) - Antoine Makdessi (amakdessi) - - Hubert Lenoir (hubert_lenoir) - Tugdual Saunier (tucksaun) - Lee McDermott - Brandon Turner @@ -141,13 +141,13 @@ The Symfony Connect username in parenthesis allows to get more information - Sebastiaan Stok (sstok) - Maxime STEINHAUSSER - Rokas Mikalkėnas (rokasm) + - Tac Tacelosky (tacman1123) - gnito-org - Tim Nagel (merk) - Chris Wilkinson (thewilkybarkid) - Jérôme Vasseur (jvasseur) - Peter Kokot (peterkokot) - Brice BERNARD (brikou) - - Tac Tacelosky (tacman1123) - Michal Piotrowski - marc.weistroff - Lars Strojny (lstrojny) @@ -164,13 +164,13 @@ The Symfony Connect username in parenthesis allows to get more information - Colin Frei - excelwebzone - Paráda József (paradajozsef) + - Nicolas Philippe (nikophil) - Baptiste Clavié (talus) - Alexander Schwenn (xelaris) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - Malte Schlüter (maltemaltesich) - jeremyFreeAgent (jeremyfreeagent) - - Nicolas Philippe (nikophil) - Joshua Thijssen - Vasilij Dusko - Daniel Wehner (dawehner) @@ -190,6 +190,7 @@ The Symfony Connect username in parenthesis allows to get more information - Juti Noppornpitak (shiroyuki) - Gregor Harlan (gharlan) - Anthony MARTIN + - Andreas Schempp (aschempp) - Sebastian Hörl (blogsh) - Tigran Azatyan (tigranazatyan) - Christopher Hertel (chertel) @@ -204,7 +205,6 @@ The Symfony Connect username in parenthesis allows to get more information - Alexis Lefebvre - SpacePossum - Richard van Laak (rvanlaak) - - Andreas Schempp (aschempp) - Andreas Braun - Hugo Alliaume (kocal) - Valtteri R (valtzu) @@ -214,6 +214,7 @@ The Symfony Connect username in parenthesis allows to get more information - Dāvis Zālītis (k0d3r1s) - Rafael Dohms (rdohms) - Roman Martinuk (a2a4) + - Thomas Landauer (thomas-landauer) - jwdeitch - David Prévot (taffit) - Jérôme Parmentier (lctrs) @@ -230,7 +231,6 @@ The Symfony Connect username in parenthesis allows to get more information - Albert Casademont (acasademont) - George Mponos (gmponos) - Richard Shank (iampersistent) - - Thomas Landauer (thomas-landauer) - Roland Franssen :) - Romain Monteil (ker0x) - Sergey (upyx) @@ -240,12 +240,14 @@ The Symfony Connect username in parenthesis allows to get more information - Fabien Bourigault (fbourigault) - Olivier Dolbeau (odolbeau) - Rouven Weßling (realityking) + - Daniel Burger - Ben Davies (bendavies) - YaFou - Clemens Tolboom - Oleg Voronkovich - Helmer Aaviksoo - Alessandro Lai (jean85) + - Jan Rosier (rosier) - 77web - Gocha Ossinkine (ossinkine) - Jesse Rushlow (geeshoe) @@ -265,7 +267,6 @@ The Symfony Connect username in parenthesis allows to get more information - zairig imad (zairigimad) - Colin O'Dell (colinodell) - Sébastien Alfaiate (seb33300) - - Daniel Burger - James Halsall (jaitsu) - Christian Scheb - Guillaume (guill) @@ -275,7 +276,6 @@ The Symfony Connect username in parenthesis allows to get more information - Anthony GRASSIOT (antograssiot) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - - Jan Rosier (rosier) - Andreas Möller (localheinz) - Marek Štípek (maryo) - Daniel Espendiller @@ -307,6 +307,7 @@ The Symfony Connect username in parenthesis allows to get more information - Christian Schmidt - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) + - Bastien Jaillot (bastnic) - Stadly - Stepan Anchugov (kix) - bronze1man @@ -322,6 +323,7 @@ The Symfony Connect username in parenthesis allows to get more information - Pierre Minnieur (pminnieur) - Dominique Bongiraud - Hugo Monteiro (monteiro) + - Karoly Gossler (connorhu) - Bram Leeda (bram123) - Dmitrii Poddubnyi (karser) - Julien Pauli @@ -339,13 +341,13 @@ The Symfony Connect username in parenthesis allows to get more information - John Kary (johnkary) - Võ Xuân Tiến (tienvx) - fd6130 (fdtvui) + - Priyadi Iman Nurcahyo (priyadi) - Alan Poulain (alanpoulain) - Maciej Malarz (malarzm) - Marcin Sikoń (marphi) - Michele Orselli (orso) - Sven Paulus (subsven) - Maxime Veber (nek-) - - Bastien Jaillot (bastnic) - Soner Sayakci - Valentine Boineau (valentineboineau) - Rui Marinho (ruimarinho) @@ -369,7 +371,6 @@ The Symfony Connect username in parenthesis allows to get more information - dFayet - Rob Frawley 2nd (robfrawley) - Renan (renanbr) - - Karoly Gossler (connorhu) - Nikita Konstantinov (unkind) - Dariusz - Francois Zaninotto @@ -385,9 +386,10 @@ The Symfony Connect username in parenthesis allows to get more information - Benoît Burnichon (bburnichon) - maxime.steinhausser - Oleg Andreyev (oleg.andreyev) - - Priyadi Iman Nurcahyo (priyadi) - Roman Ring (inori) - Xavier Montaña Carreras (xmontana) + - Arjen van der Meijden + - Indra Gunawan (indragunawan) - Peter Kruithof (pkruithof) - Alex Hofbauer (alexhofbauer) - Romaric Drigon (romaricdrigon) @@ -462,9 +464,7 @@ The Symfony Connect username in parenthesis allows to get more information - Wouter Van Hecke - Baptiste Lafontaine (magnetik) - Iker Ibarguren (ikerib) - - Indra Gunawan (indragunawan) - Michael Holm (hollo) - - Arjen van der Meijden - Blanchon Vincent (blanchonvincent) - Michał (bambucha15) - Christian Schmidt @@ -487,6 +487,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bertrand Zuchuat (garfield-fr) - Marc Morera (mmoreram) - Quynh Xuan Nguyen (seriquynh) + - Asis Pattisahusiwa - Gabor Toth (tgabi333) - realmfoo - Fabien S (bafs) @@ -524,6 +525,7 @@ The Symfony Connect username in parenthesis allows to get more information - Ahmed Raafat - Philippe Segatori - Thibaut Cheymol (tcheymol) + - Aurélien Pillevesse (aurelienpillevesse) - Erin Millard - Matthew Lewinski (lewinski) - Islam Israfilov (islam93) @@ -556,6 +558,7 @@ The Symfony Connect username in parenthesis allows to get more information - FORT Pierre-Louis (plfort) - Terje Bråten - Gonzalo Vilaseca (gonzalovilaseca) + - Stiven Llupa (sllupa) - Tarmo Leppänen (tarlepp) - Jakub Kucharovic (jkucharovic) - Daniel STANCU @@ -591,7 +594,6 @@ The Symfony Connect username in parenthesis allows to get more information - Greg Thornton (xdissent) - Alex Bowers - Michel Roca (mroca) - - Asis Pattisahusiwa - Costin Bereveanu (schniper) - Andrii Dembitskyi - Gasan Guseynov (gassan) @@ -653,6 +655,7 @@ The Symfony Connect username in parenthesis allows to get more information - Jeanmonod David (jeanmonod) - Webnet team (webnet) - Tobias Bönner + - Nicolas Rigaud - Ben Ramsey (ramsey) - Berny Cantos (xphere81) - Antonio Jose Cerezo (ajcerezo) @@ -667,6 +670,7 @@ The Symfony Connect username in parenthesis allows to get more information - Matheo Daninos (mathdns) - Niklas Fiekas - Mark Challoner (markchalloner) + - Jonathan H. Wage - Markus Bachmann (baachi) - Matthieu Lempereur (mryamous) - Gunnstein Lye (glye) @@ -733,7 +737,6 @@ The Symfony Connect username in parenthesis allows to get more information - Vadim Borodavko (javer) - Tavo Nieves J (tavoniievez) - Luc Vieillescazes (iamluc) - - Stiven Llupa (sllupa) - Erik Saunier (snickers) - François Dume (franek) - Jerzy Lekowski (jlekowski) @@ -774,6 +777,7 @@ The Symfony Connect username in parenthesis allows to get more information - Nathan Dench (ndenc2) - Gijs van Lammeren - Sebastian Bergmann + - Nadim AL ABDOU (nadim) - Matthew Grasmick - Miroslav Šustek (sustmi) - Pablo Díez (pablodip) @@ -822,6 +826,7 @@ The Symfony Connect username in parenthesis allows to get more information - alexpods - Adam Szaraniec - Dariusz Ruminski + - Pierre Ambroise (dotordu) - Romain Gautier (mykiwi) - Matthieu Bontemps - Erik Trapman @@ -914,7 +919,6 @@ The Symfony Connect username in parenthesis allows to get more information - julien57 - Mátyás Somfai (smatyas) - Bastien DURAND (deamon) - - Nicolas Rigaud - Dmitry Simushev - alcaeus - Ahmed Ghanem (ahmedghanem00) @@ -938,7 +942,6 @@ The Symfony Connect username in parenthesis allows to get more information - Christin Gruber (christingruber) - Sebastian Blum - Daniel González (daniel.gonzalez) - - Jonathan H. Wage - Julien Turby - Ricky Su (ricky) - scyzoryck @@ -967,9 +970,11 @@ The Symfony Connect username in parenthesis allows to get more information - Christophe Villeger (seragan) - Krystian Marcisz (simivar) - Julien Fredon + - Neil Peyssard (nepey) - Xavier Leune (xleune) - Hany el-Kerdany - Wang Jingyu + - Baptiste CONTRERAS - Åsmund Garfors - Maxime Douailin - Jean Pasdeloup @@ -982,6 +987,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sofien Naas - Alexandre Parent - Daniel Badura + - Brajk19 - Roger Guasch (rogerguasch) - DT Inier (gam6itko) - Dustin Dobervich (dustin10) @@ -1130,7 +1136,6 @@ The Symfony Connect username in parenthesis allows to get more information - Aleksey Prilipko - Jelle Raaijmakers (gmta) - Andrew Berry - - Nadim AL ABDOU (nadim) - Sylvain BEISSIER (sylvain-beissier) - Wybren Koelmans (wybren_koelmans) - Roberto Nygaard @@ -1229,6 +1234,7 @@ The Symfony Connect username in parenthesis allows to get more information - fedor.f - Yosmany Garcia (yosmanyga) - Jeremiasz Major + - Jibé Barth (jibbarth) - Trevor North - Degory Valentine - izzyp @@ -1240,7 +1246,6 @@ The Symfony Connect username in parenthesis allows to get more information - Glodzienski - Natsuki Ikeguchi - Krzysztof Łabuś (crozin) - - Pierre Ambroise (dotordu) - Xavier Lacot (xavier) - Jon Dufresne - possum @@ -1248,6 +1253,7 @@ The Symfony Connect username in parenthesis allows to get more information - Adrien Roches (neirda24) - _sir_kane (waly) - Olivier Maisonneuve + - Gálik Pál - Andrei C. (moldman) - Mike Meier (mykon) - Pedro Miguel Maymone de Resende (pedroresende) @@ -1290,6 +1296,7 @@ The Symfony Connect username in parenthesis allows to get more information - Reen Lokum - Dennis Langen (nijusan) - Quentin Dreyer (qkdreyer) + - Francisco Alvarez (sormes) - Martin Parsiegla (spea) - Manuel Alejandro Paz Cetina - Denis Charrier (brucewouaigne) @@ -1353,6 +1360,7 @@ The Symfony Connect username in parenthesis allows to get more information - Calin Mihai Pristavu - Gabrielle Langer - Jörn Lang + - Adrian Günter (adrianguenter) - David Marín Carreño (davefx) - Fabien LUCAS (flucas2) - Alex (garrett) @@ -1573,9 +1581,11 @@ The Symfony Connect username in parenthesis allows to get more information - Chris de Kok - Eduard Bulava (nonanerz) - Andreas Kleemann (andesk) + - Ilya Levin (ilyachase) - Hubert Moreau (hmoreau) - - Brajk19 + - Nicolas Appriou - Igor Timoshenko (igor.timoshenko) + - Pierre-Emmanuel CAPEL - Manuele Menozzi - “teerasak” - Anton Babenko (antonbabenko) @@ -2115,6 +2125,7 @@ The Symfony Connect username in parenthesis allows to get more information - Arend-Jan Tetteroo - Albin Kerouaton - Sébastien HOUZÉ + - sebastian - Mbechezi Nawo - wivaku - Markus Reinhold @@ -2355,6 +2366,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alexander Janssen (tnajanssen) - Thomas Chmielowiec (chmielot) - Jānis Lukss + - simbera - Julien BERNARD - Michael Zangerle - rkerner @@ -2545,6 +2557,7 @@ The Symfony Connect username in parenthesis allows to get more information - Wing - Thomas Bibb - Stefan Koopmanschap + - George Sparrow - Joni Halme - Matt Farmer - catch @@ -2572,7 +2585,6 @@ The Symfony Connect username in parenthesis allows to get more information - Christoph König (chriskoenig) - Dmytro Pigin (dotty) - Jakub Janata (janatjak) - - Jibé Barth (jibbarth) - Jm Aribau (jmaribau) - Matthew Foster (mfoster) - Paul Seiffert (seiffert) @@ -2739,6 +2751,7 @@ The Symfony Connect username in parenthesis allows to get more information - Chris - Farid Jalilov - Christiaan Wiesenekker + - Ariful Alam - Florent Olivaud - Foxprodev - Eric Hertwig @@ -2804,6 +2817,7 @@ The Symfony Connect username in parenthesis allows to get more information - Boudry Julien - amcastror - Bram Van der Sype (brammm) + - roman joly (eltharin) - Guile (guile) - Mark Beech (jaybizzle) - Julien Moulin (lizjulien) @@ -2914,6 +2928,7 @@ The Symfony Connect username in parenthesis allows to get more information - tomasz-kusy - Rémi Blaise - Nicolas Séverin + - patrickmaynard - Houssem - Joel Marcey - zolikonta @@ -3001,6 +3016,7 @@ The Symfony Connect username in parenthesis allows to get more information - zors1 - Peter Simoncic - lerminou + - Adam Bramley - Ahmad El-Bardan - mantulo - pdragun @@ -3045,6 +3061,7 @@ The Symfony Connect username in parenthesis allows to get more information - robmro27 - Vallel Blanco - Alexis MARQUIS + - Ernesto Domato - Matheus Gontijo - Gerrit Drost - Linnaea Von Lavia @@ -3184,7 +3201,6 @@ The Symfony Connect username in parenthesis allows to get more information - Lars Moelleken - dasmfm - Claas Augner - - Baptiste CONTRERAS - Mathias Geat - Angel Fernando Quiroz Campos (angelfqc) - Arnaud Buathier (arnapou) @@ -3264,6 +3280,7 @@ The Symfony Connect username in parenthesis allows to get more information - jamogon - Vyacheslav Slinko - Benjamin Laugueux + - guangwu - Lane Shukhov - Jakub Chábek - William Pinaud (DocFX) @@ -3477,7 +3494,6 @@ The Symfony Connect username in parenthesis allows to get more information - Abdouni Karim (abdounikarim) - Temuri Takalandze (abgeo) - Bernard van der Esch (adeptofvoltron) - - Adrian Günter (adrianguenter) - Andreas Forsblom (aforsblo) - Aleksejs Kovalovs (aleksejs1) - Alex Olmos (alexolmos) @@ -3545,6 +3561,7 @@ The Symfony Connect username in parenthesis allows to get more information - Julien Manganne (juuuuuu) - Ismail Faizi (kanafghan) - Karolis Daužickas (kdauzickas) + - Kérian MONTES-MORIN (kerianmm) - Sébastien Armand (khepin) - Pierre-Chanel Gauthier (kmecnin) - Krzysztof Menżyk (krymen) @@ -3588,13 +3605,13 @@ The Symfony Connect username in parenthesis allows to get more information - Sergey Stavichenko (sergey_stavichenko) - André Filipe Gonçalves Neves (seven) - Bruno Ziegler (sfcoder) + - Ángel Guzmán Maeso (shakaran) - Andrea Giuliano (shark) - Şəhriyar İmanov (shehriyari) - Thomas Baumgartner (shoplifter) - Schuyler Jager (sjager) - Christopher Georg (sky-chris) - Volker (skydiablo) - - Francisco Alvarez (sormes) - Julien Sanchez (sumbobyboys) - Stephan Vierkant (svierkant) - Ron Gähler (t-ronx) @@ -3618,7 +3635,6 @@ The Symfony Connect username in parenthesis allows to get more information - Konrad - Kovacs Nicolas - eminjk - - Gálik Pál - craigmarvelley - Stano Turza - Antoine Leblanc diff --git a/src/Symfony/Bridge/Doctrine/.gitattributes b/src/Symfony/Bridge/Doctrine/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bridge/Doctrine/.gitattributes +++ b/src/Symfony/Bridge/Doctrine/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bridge/Doctrine/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bridge/Doctrine/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bridge/Doctrine/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bridge/Doctrine/.github/workflows/check-subtree-split.yml b/src/Symfony/Bridge/Doctrine/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bridge/Doctrine/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bridge/Doctrine/SchemaListener/AbstractSchemaListener.php b/src/Symfony/Bridge/Doctrine/SchemaListener/AbstractSchemaListener.php index 04907ee9a78bd..7d286d782cc62 100644 --- a/src/Symfony/Bridge/Doctrine/SchemaListener/AbstractSchemaListener.php +++ b/src/Symfony/Bridge/Doctrine/SchemaListener/AbstractSchemaListener.php @@ -13,6 +13,8 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception\TableNotFoundException; +use Doctrine\DBAL\Schema\Table; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; abstract class AbstractSchemaListener @@ -22,8 +24,16 @@ abstract public function postGenerateSchema(GenerateSchemaEventArgs $event): voi protected function getIsSameDatabaseChecker(Connection $connection): \Closure { return static function (\Closure $exec) use ($connection): bool { + $schemaManager = $connection->createSchemaManager(); + $checkTable = 'schema_subscriber_check_'.bin2hex(random_bytes(7)); - $connection->executeStatement(sprintf('CREATE TABLE %s (id INTEGER NOT NULL)', $checkTable)); + $table = new Table($checkTable); + $table->addColumn('id', Types::INTEGER) + ->setAutoincrement(true) + ->setNotnull(true); + $table->setPrimaryKey(['id']); + + $schemaManager->createTable($table); try { $exec(sprintf('DROP TABLE %s', $checkTable)); @@ -32,7 +42,7 @@ protected function getIsSameDatabaseChecker(Connection $connection): \Closure } try { - $connection->executeStatement(sprintf('DROP TABLE %s', $checkTable)); + $schemaManager->dropTable($checkTable); return false; } catch (TableNotFoundException) { diff --git a/src/Symfony/Bridge/Monolog/.gitattributes b/src/Symfony/Bridge/Monolog/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bridge/Monolog/.gitattributes +++ b/src/Symfony/Bridge/Monolog/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bridge/Monolog/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bridge/Monolog/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bridge/Monolog/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bridge/Monolog/.github/workflows/check-subtree-split.yml b/src/Symfony/Bridge/Monolog/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bridge/Monolog/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bridge/PhpUnit/.gitattributes b/src/Symfony/Bridge/PhpUnit/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bridge/PhpUnit/.gitattributes +++ b/src/Symfony/Bridge/PhpUnit/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bridge/PhpUnit/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bridge/PhpUnit/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bridge/PhpUnit/.github/workflows/check-subtree-split.yml b/src/Symfony/Bridge/PhpUnit/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bridge/PsrHttpMessage/.gitattributes b/src/Symfony/Bridge/PsrHttpMessage/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bridge/PsrHttpMessage/.gitattributes +++ b/src/Symfony/Bridge/PsrHttpMessage/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bridge/PsrHttpMessage/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bridge/PsrHttpMessage/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bridge/PsrHttpMessage/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bridge/PsrHttpMessage/.github/workflows/check-subtree-split.yml b/src/Symfony/Bridge/PsrHttpMessage/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bridge/PsrHttpMessage/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bridge/Twig/.gitattributes b/src/Symfony/Bridge/Twig/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bridge/Twig/.gitattributes +++ b/src/Symfony/Bridge/Twig/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bridge/Twig/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bridge/Twig/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bridge/Twig/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bridge/Twig/.github/workflows/check-subtree-split.yml b/src/Symfony/Bridge/Twig/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bridge/Twig/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index d0e3337a9239c..3449751b1ff92 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -23,12 +23,12 @@ use Twig\Node\ModuleNode; use Twig\Node\Node; use Twig\Node\SetNode; -use Twig\NodeVisitor\AbstractNodeVisitor; +use Twig\NodeVisitor\NodeVisitorInterface; /** * @author Fabien Potencier */ -final class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor +final class TranslationDefaultDomainNodeVisitor implements NodeVisitorInterface { private Scope $scope; @@ -37,7 +37,7 @@ public function __construct() $this->scope = new Scope(); } - protected function doEnterNode(Node $node, Environment $env): Node + public function enterNode(Node $node, Environment $env): Node { if ($node instanceof BlockNode || $node instanceof ModuleNode) { $this->scope = $this->scope->enter(); @@ -83,7 +83,7 @@ protected function doEnterNode(Node $node, Environment $env): Node return $node; } - protected function doLeaveNode(Node $node, Environment $env): ?Node + public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof TransDefaultDomainNode) { return null; diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php index 3a7ea67cac90b..c44a8894469f3 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php @@ -18,14 +18,14 @@ use Twig\Node\Expression\FilterExpression; use Twig\Node\Expression\FunctionExpression; use Twig\Node\Node; -use Twig\NodeVisitor\AbstractNodeVisitor; +use Twig\NodeVisitor\NodeVisitorInterface; /** * TranslationNodeVisitor extracts translation messages. * * @author Fabien Potencier */ -final class TranslationNodeVisitor extends AbstractNodeVisitor +final class TranslationNodeVisitor implements NodeVisitorInterface { public const UNDEFINED_DOMAIN = '_undefined'; @@ -49,7 +49,7 @@ public function getMessages(): array return $this->messages; } - protected function doEnterNode(Node $node, Environment $env): Node + public function enterNode(Node $node, Environment $env): Node { if (!$this->enabled) { return $node; @@ -98,7 +98,7 @@ protected function doEnterNode(Node $node, Environment $env): Node return $node; } - protected function doLeaveNode(Node $node, Environment $env): ?Node + public function leaveNode(Node $node, Environment $env): ?Node { return $node; } diff --git a/src/Symfony/Bundle/DebugBundle/.gitattributes b/src/Symfony/Bundle/DebugBundle/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bundle/DebugBundle/.gitattributes +++ b/src/Symfony/Bundle/DebugBundle/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bundle/DebugBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bundle/DebugBundle/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bundle/DebugBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bundle/DebugBundle/.github/workflows/check-subtree-split.yml b/src/Symfony/Bundle/DebugBundle/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bundle/DebugBundle/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bundle/FrameworkBundle/.gitattributes b/src/Symfony/Bundle/FrameworkBundle/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bundle/FrameworkBundle/.gitattributes +++ b/src/Symfony/Bundle/FrameworkBundle/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bundle/FrameworkBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bundle/FrameworkBundle/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bundle/FrameworkBundle/.github/workflows/check-subtree-split.yml b/src/Symfony/Bundle/FrameworkBundle/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 179f8e981dd32..cdfc7f34f3730 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -200,7 +200,7 @@ private function isNfs(string $dir): bool if (null === $mounts) { $mounts = []; - if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) { + if ('/' === \DIRECTORY_SEPARATOR && @is_readable('/proc/mounts') && $files = @file('/proc/mounts')) { foreach ($files as $mount) { $mount = \array_slice(explode(' ', $mount), 1, -3); if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php index 0c5a31ff7a326..3f5085ef2a7b4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php @@ -393,7 +393,7 @@ private function getCallableData(mixed $callable): array $data['type'] = 'closure'; $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { return $data; } $data['name'] = $r->name; diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php index 69277fecc1148..7537e3d4228e7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php @@ -403,7 +403,7 @@ protected function describeCallable(mixed $callable, array $options = []): void $string .= "\n- Type: `closure`"; $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { $this->write($string."\n"); return; diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index cbffb5fcd7495..60834250b3370 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -649,7 +649,7 @@ private function formatCallable(mixed $callable): string if ($callable instanceof \Closure) { $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { return 'Closure()'; } if ($class = $r->getClosureCalledClass()) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php index 672fb750b9480..05848b1b24f6c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php @@ -581,7 +581,7 @@ private function getCallableDocument(mixed $callable): \DOMDocument $callableXML->setAttribute('type', 'closure'); $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { return $dom; } $callableXML->setAttribute('name', $r->name); diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 26f5c1c329665..0f44e66a707f3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1481,7 +1481,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder $defaultDir = $container->getParameterBag()->resolveValue($config['default_path']); foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) { if ($container->fileExists($dir = $bundle['path'].'/Resources/translations') || $container->fileExists($dir = $bundle['path'].'/translations')) { - $dirs[] = $dir; + $dirs[] = $transPaths[] = $dir; } else { $nonExistingDirs[] = $dir; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php index 73a7f6fe7e38a..f8c7460135112 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php @@ -214,7 +214,7 @@ public function loadRoutes(LoaderInterface $loader): RouteCollection if (\is_array($controller) && [0, 1] === array_keys($controller) && $this === $controller[0]) { $route->setDefault('_controller', ['kernel', $controller[1]]); - } elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !str_contains($r->name, '{closure}')) { + } elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !str_contains($r->name, '{closure')) { $route->setDefault('_controller', ['kernel', $r->name]); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php index d46a92a02d585..bd3f863aa54b0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php @@ -115,7 +115,7 @@ ->set('serializer.normalizer.translatable', TranslatableNormalizer::class) ->args(['$translator' => service('translator')]) - ->tag('serializer.normalizer', ['priority' => -890]) + ->tag('serializer.normalizer', ['priority' => -920]) ->set('serializer.normalizer.form_error', FormErrorNormalizer::class) ->tag('serializer.normalizer', ['priority' => -915]) @@ -138,6 +138,8 @@ service('property_info')->ignoreOnInvalid(), service('serializer.mapping.class_discriminator_resolver')->ignoreOnInvalid(), null, + [], + service('property_info')->ignoreOnInvalid(), ]) ->set('serializer.denormalizer.array', ArrayDenormalizer::class) @@ -212,6 +214,6 @@ ]) ->set('serializer.normalizer.backed_enum', BackedEnumNormalizer::class) - ->tag('serializer.normalizer', ['priority' => -880]) + ->tag('serializer.normalizer', ['priority' => -915]) ; }; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php index eede5ded314c6..845056799d27a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -66,6 +66,7 @@ use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader; use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader; +use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer; use Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer; use Symfony\Component\Serializer\Normalizer\DataUriNormalizer; use Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer; @@ -1539,10 +1540,24 @@ public function testTranslatableNormalizerRegistered() $tag = $definition->getTag('serializer.normalizer'); $this->assertSame(TranslatableNormalizer::class, $definition->getClass()); - $this->assertSame(-890, $tag[0]['priority']); + $this->assertSame(-920, $tag[0]['priority']); $this->assertEquals(new Reference('translator'), $definition->getArgument('$translator')); } + /** + * @see https://github.com/symfony/symfony/issues/54478 + */ + public function testBackedEnumNormalizerRegistered() + { + $container = $this->createContainerFromFile('full'); + + $definition = $container->getDefinition('serializer.normalizer.backed_enum'); + $tag = $definition->getTag('serializer.normalizer'); + + $this->assertSame(BackedEnumNormalizer::class, $definition->getClass()); + $this->assertSame(-915, $tag[0]['priority']); + } + public function testSerializerCacheActivated() { $container = $this->createContainerFromFile('serializer_enabled'); diff --git a/src/Symfony/Bundle/SecurityBundle/.gitattributes b/src/Symfony/Bundle/SecurityBundle/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bundle/SecurityBundle/.gitattributes +++ b/src/Symfony/Bundle/SecurityBundle/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bundle/SecurityBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bundle/SecurityBundle/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bundle/SecurityBundle/.github/workflows/check-subtree-split.yml b/src/Symfony/Bundle/SecurityBundle/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bundle/SecurityBundle/Command/DebugFirewallCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/DebugFirewallCommand.php index 14b913e391128..6afabfbec9b45 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/DebugFirewallCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/DebugFirewallCommand.php @@ -238,7 +238,7 @@ private function formatCallable(mixed $callable): string if ($callable instanceof \Closure) { $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { return 'Closure()'; } if ($class = $r->getClosureCalledClass()) { diff --git a/src/Symfony/Bundle/TwigBundle/.gitattributes b/src/Symfony/Bundle/TwigBundle/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bundle/TwigBundle/.gitattributes +++ b/src/Symfony/Bundle/TwigBundle/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bundle/TwigBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bundle/TwigBundle/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bundle/TwigBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bundle/TwigBundle/.github/workflows/check-subtree-split.yml b/src/Symfony/Bundle/TwigBundle/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bundle/TwigBundle/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Bundle/WebProfilerBundle/.gitattributes b/src/Symfony/Bundle/WebProfilerBundle/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/.gitattributes +++ b/src/Symfony/Bundle/WebProfilerBundle/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Bundle/WebProfilerBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Bundle/WebProfilerBundle/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Bundle/WebProfilerBundle/.github/workflows/check-subtree-split.yml b/src/Symfony/Bundle/WebProfilerBundle/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Asset/.gitattributes b/src/Symfony/Component/Asset/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Asset/.gitattributes +++ b/src/Symfony/Component/Asset/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Asset/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Asset/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Asset/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Asset/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Asset/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Asset/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/AssetMapper/.gitattributes b/src/Symfony/Component/AssetMapper/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/AssetMapper/.gitattributes +++ b/src/Symfony/Component/AssetMapper/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/AssetMapper/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/AssetMapper/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/AssetMapper/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/AssetMapper/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/AssetMapper/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/AssetMapper/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php b/src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php index f651033b6505e..b1c0cd5966b3d 100644 --- a/src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php +++ b/src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php @@ -11,6 +11,8 @@ namespace Symfony\Component\AssetMapper\ImportMap; +use Symfony\Component\AssetMapper\Exception\RuntimeException; + /** * Manages the local storage of remote/vendor importmap packages. */ @@ -52,7 +54,9 @@ public function save(ImportMapEntry $entry, string $contents): void $vendorPath = $this->getDownloadPath($entry->packageModuleSpecifier, $entry->type); @mkdir(\dirname($vendorPath), 0777, true); - file_put_contents($vendorPath, $contents); + if (false === @file_put_contents($vendorPath, $contents)) { + throw new RuntimeException(error_get_last()['message'] ?? sprintf('Failed to write file "%s".', $vendorPath)); + } } public function saveExtraFile(ImportMapEntry $entry, string $extraFilename, string $contents): void @@ -64,7 +68,9 @@ public function saveExtraFile(ImportMapEntry $entry, string $extraFilename, stri $vendorPath = $this->getExtraFileDownloadPath($entry, $extraFilename); @mkdir(\dirname($vendorPath), 0777, true); - file_put_contents($vendorPath, $contents); + if (false === @file_put_contents($vendorPath, $contents)) { + throw new RuntimeException(error_get_last()['message'] ?? sprintf('Failed to write file "%s".', $vendorPath)); + } } /** diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php index 3198b11ee76a6..551a60492460d 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php @@ -201,15 +201,15 @@ public static function getRequirePackageTests(): iterable ]; yield 'single_package_with_a_path' => [ - 'packages' => [new PackageRequireOptions('some/module', path: self::$writableRoot.'/assets/some_file.js')], - 'expectedProviderPackageArgumentCount' => 0, - 'resolvedPackages' => [], - 'expectedImportMap' => [ - 'some/module' => [ - // converted to relative path - 'path' => './assets/some_file.js', + 'packages' => [new PackageRequireOptions('some/module', path: self::$writableRoot.'/assets/some_file.js')], + 'expectedProviderPackageArgumentCount' => 0, + 'resolvedPackages' => [], + 'expectedImportMap' => [ + 'some/module' => [ + // converted to relative path + 'path' => './assets/some_file.js', + ], ], - ], ]; } diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php index 4d41f4b61ce1f..0019f604cc8c5 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php @@ -25,7 +25,7 @@ class RemotePackageStorageTest extends TestCase protected function setUp(): void { $this->filesystem = new Filesystem(); - if (!file_exists(self::$writableRoot)) { + if (!$this->filesystem->exists(self::$writableRoot)) { $this->filesystem->mkdir(self::$writableRoot); } } @@ -41,14 +41,30 @@ public function testGetStorageDir() $this->assertSame(realpath(self::$writableRoot.'/assets/vendor'), realpath($storage->getStorageDir())); } + public function testSaveThrowsWhenVendorDirectoryIsNotWritable() + { + $this->filesystem->mkdir($vendorDir = self::$writableRoot.'/assets/acme/vendor'); + $this->filesystem->chmod($vendorDir, 0555); + + $storage = new RemotePackageStorage($vendorDir); + $entry = ImportMapEntry::createRemote('foo', ImportMapType::JS, '/does/not/matter', '1.0.0', 'module_specifier', false); + + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('file_put_contents('.$vendorDir.'/module_specifier/module_specifier.index.js): Failed to open stream: No such file or directory'); + $storage->save($entry, 'any content'); + + $this->filesystem->remove($vendorDir); + } + public function testIsDownloaded() { $storage = new RemotePackageStorage(self::$writableRoot.'/assets/vendor'); $entry = ImportMapEntry::createRemote('foo', ImportMapType::JS, '/does/not/matter', '1.0.0', 'module_specifier', false); $this->assertFalse($storage->isDownloaded($entry)); + $targetPath = self::$writableRoot.'/assets/vendor/module_specifier/module_specifier.index.js'; - @mkdir(\dirname($targetPath), 0777, true); - file_put_contents($targetPath, 'any content'); + $this->filesystem->mkdir(\dirname($targetPath)); + $this->filesystem->dumpFile($targetPath, 'any content'); $this->assertTrue($storage->isDownloaded($entry)); } @@ -57,9 +73,10 @@ public function testIsExtraFileDownloaded() $storage = new RemotePackageStorage(self::$writableRoot.'/assets/vendor'); $entry = ImportMapEntry::createRemote('foo', ImportMapType::JS, '/does/not/matter', '1.0.0', 'module_specifier', false); $this->assertFalse($storage->isExtraFileDownloaded($entry, '/path/to/extra.woff')); + $targetPath = self::$writableRoot.'/assets/vendor/module_specifier/path/to/extra.woff'; - @mkdir(\dirname($targetPath), 0777, true); - file_put_contents($targetPath, 'any content'); + $this->filesystem->mkdir(\dirname($targetPath)); + $this->filesystem->dumpFile($targetPath, 'any content'); $this->assertTrue($storage->isExtraFileDownloaded($entry, '/path/to/extra.woff')); } @@ -92,7 +109,7 @@ public function testGetDownloadedPath(string $packageModuleSpecifier, ImportMapT $this->assertSame($expectedPath, $storage->getDownloadPath($packageModuleSpecifier, $importMapType)); } - public static function getDownloadPathTests() + public static function getDownloadPathTests(): iterable { yield 'javascript bare package' => [ 'packageModuleSpecifier' => 'foo', diff --git a/src/Symfony/Component/BrowserKit/.gitattributes b/src/Symfony/Component/BrowserKit/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/BrowserKit/.gitattributes +++ b/src/Symfony/Component/BrowserKit/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/BrowserKit/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/BrowserKit/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/BrowserKit/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/BrowserKit/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/BrowserKit/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/BrowserKit/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Cache/.gitattributes b/src/Symfony/Component/Cache/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Cache/.gitattributes +++ b/src/Symfony/Component/Cache/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Cache/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Cache/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Cache/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Cache/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Cache/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Cache/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php b/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php index 5c382fb89a71c..36f57f09a6605 100644 --- a/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php +++ b/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php @@ -19,15 +19,16 @@ class RedisProxiesTest extends TestCase { /** - * @requires extension redis < 6 + * @requires extension redis * * @testWith ["Redis"] * ["RedisCluster"] */ - public function testRedis5Proxy($class) + public function testRedisProxy($class) { - $proxy = file_get_contents(\dirname(__DIR__, 2)."/Traits/{$class}5Proxy.php"); - $proxy = substr($proxy, 0, 4 + strpos($proxy, '[];')); + $version = version_compare(phpversion('redis'), '6', '>') ? '6' : '5'; + $proxy = file_get_contents(\dirname(__DIR__, 2)."/Traits/{$class}{$version}Proxy.php"); + $expected = substr($proxy, 0, 4 + strpos($proxy, '[];')); $methods = []; foreach ((new \ReflectionClass($class))->getMethods() as $method) { @@ -44,9 +45,13 @@ public function testRedis5Proxy($class) } uksort($methods, 'strnatcmp'); - $proxy .= implode('', $methods)."}\n"; + $expected .= implode('', $methods)."}\n"; + + if (!str_contains($expected, '#[\SensitiveParameter] ')) { + $proxy = str_replace('#[\SensitiveParameter] ', '', $proxy); + } - $this->assertStringEqualsFile(\dirname(__DIR__, 2)."/Traits/{$class}5Proxy.php", $proxy); + $this->assertSame($expected, $proxy); } /** @@ -76,50 +81,4 @@ public function testRelayProxy() $this->assertStringEqualsFile(\dirname(__DIR__, 2).'/Traits/RelayProxy.php', $proxy); } - - /** - * @requires extension openssl - * - * @testWith ["Redis", "redis"] - * ["RedisCluster", "redis_cluster"] - */ - public function testRedis6Proxy($class, $stub) - { - if (version_compare(phpversion('redis'), '6.0.2', '>')) { - $stub = file_get_contents("https://raw.githubusercontent.com/phpredis/phpredis/develop/{$stub}.stub.php"); - } else { - $stub = file_get_contents("https://raw.githubusercontent.com/phpredis/phpredis/6.0.2/{$stub}.stub.php"); - } - - $stub = preg_replace('/^class /m', 'return; \0', $stub); - $stub = preg_replace('/^return; class ([a-zA-Z]++)/m', 'interface \1StubInterface', $stub, 1); - $stub = preg_replace('/^ public const .*/m', '', $stub); - eval(substr($stub, 5)); - - $this->assertEquals(self::dumpMethods(new \ReflectionClass($class.'StubInterface')), self::dumpMethods(new \ReflectionClass(sprintf('Symfony\Component\Cache\Traits\%s6Proxy', $class)))); - } - - private static function dumpMethods(\ReflectionClass $class): string - { - $methods = []; - - foreach ($class->getMethods() as $method) { - if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name)) { - continue; - } - - $return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return '; - $signature = ProxyHelper::exportSignature($method, false, $args); - $methods[] = "\n ".str_replace('timeout = 0.0', 'timeout = 0', $signature)."\n".<<lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args}); - } - - EOPHP; - } - - usort($methods, 'strnatcmp'); - - return implode("\n", $methods); - } } diff --git a/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php b/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php index 2d0348c72a0c3..04665608c8f7f 100644 --- a/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php +++ b/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php @@ -31,7 +31,9 @@ public function testCreateConnection(string $dsn, string $expectedClass) self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.'); } - $mock = self::getObjectForTrait(RedisTrait::class); + $mock = new class () { + use RedisTrait; + }; $connection = $mock::createConnection($dsn); self::assertInstanceOf($expectedClass, $connection); @@ -43,7 +45,9 @@ public function testUrlDecodeParameters() self::markTestSkipped('REDIS_AUTHENTICATED_HOST env var is not defined.'); } - $mock = self::getObjectForTrait(RedisTrait::class); + $mock = new class () { + use RedisTrait; + }; $connection = $mock::createConnection('redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST')); self::assertInstanceOf(\Redis::class, $connection); @@ -73,4 +77,59 @@ public static function provideCreateConnection(): array ], ]; } + + /** + * Due to a bug in phpredis, the persistent connection will keep its last selected database. So when re-using + * a persistent connection, the database has to be re-selected, too. + * + * @see https://github.com/phpredis/phpredis/issues/1920 + * + * @group integration + */ + public function testPconnectSelectsCorrectDatabase() + { + if (!class_exists(\Redis::class)) { + throw new SkippedTestSuiteError('The "Redis" class is required.'); + } + if (!getenv('REDIS_HOST')) { + throw new SkippedTestSuiteError('REDIS_HOST env var is not defined.'); + } + if (!\ini_get('redis.pconnect.pooling_enabled')) { + throw new SkippedTestSuiteError('The bug only occurs when pooling is enabled.'); + } + + // Limit the connection pool size to 1: + if (false === $prevPoolSize = ini_set('redis.pconnect.connection_limit', 1)) { + throw new SkippedTestSuiteError('Unable to set pool size'); + } + + try { + $mock = new class () { + use RedisTrait; + }; + + $dsn = 'redis://'.getenv('REDIS_HOST'); + + $cacheKey = 'testPconnectSelectsCorrectDatabase'; + $cacheValueOnDb1 = 'I should only be on database 1'; + + // First connect to database 1 and set a value there so we can identify this database: + $db1 = $mock::createConnection($dsn, ['dbindex' => 1, 'persistent' => 1]); + self::assertInstanceOf(\Redis::class, $db1); + self::assertSame(1, $db1->getDbNum()); + $db1->set($cacheKey, $cacheValueOnDb1); + self::assertSame($cacheValueOnDb1, $db1->get($cacheKey)); + + // Unset the connection - do not use `close()` or we will lose the persistent connection: + unset($db1); + + // Now connect to database 0 and see that we do not actually ended up on database 1 by checking the value: + $db0 = $mock::createConnection($dsn, ['dbindex' => 0, 'persistent' => 1]); + self::assertInstanceOf(\Redis::class, $db0); + self::assertSame(0, $db0->getDbNum()); // Redis is lying here! We could actually be on any database! + self::assertNotSame($cacheValueOnDb1, $db0->get($cacheKey)); // This value should not exist if we are actually on db 0 + } finally { + ini_set('redis.pconnect.connection_limit', $prevPoolSize); + } + } } diff --git a/src/Symfony/Component/Cache/Traits/Redis5Proxy.php b/src/Symfony/Component/Cache/Traits/Redis5Proxy.php index 06130cc33b9cc..0b2794ee18b46 100644 --- a/src/Symfony/Component/Cache/Traits/Redis5Proxy.php +++ b/src/Symfony/Component/Cache/Traits/Redis5Proxy.php @@ -81,7 +81,7 @@ public function append($key, $value) return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->append(...\func_get_args()); } - public function auth($auth) + public function auth(#[\SensitiveParameter] $auth) { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->auth(...\func_get_args()); } diff --git a/src/Symfony/Component/Cache/Traits/Redis6Proxy.php b/src/Symfony/Component/Cache/Traits/Redis6Proxy.php index e41c0d10cc030..0680404fc1eee 100644 --- a/src/Symfony/Component/Cache/Traits/Redis6Proxy.php +++ b/src/Symfony/Component/Cache/Traits/Redis6Proxy.php @@ -28,7 +28,6 @@ class Redis6Proxy extends \Redis implements ResetInterface, LazyObjectInterface use LazyProxyTrait { resetLazyObject as reset; } - use Redis6ProxyTrait; private const LAZY_OBJECT_PROPERTY_SCOPES = []; @@ -227,6 +226,11 @@ public function discard(): \Redis|bool return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->discard(...\func_get_args()); } + public function dump($key): \Redis|string + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); + } + public function echo($str): \Redis|false|string { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); @@ -647,6 +651,11 @@ public function ltrim($key, $start, $end): \Redis|bool return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ltrim(...\func_get_args()); } + public function mget($keys): \Redis|array + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); + } + public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $replace = false, #[\SensitiveParameter] $credentials = null): \Redis|bool { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->migrate(...\func_get_args()); diff --git a/src/Symfony/Component/Cache/Traits/Redis6ProxyTrait.php b/src/Symfony/Component/Cache/Traits/Redis6ProxyTrait.php deleted file mode 100644 index d086d5b3e8a09..0000000000000 --- a/src/Symfony/Component/Cache/Traits/Redis6ProxyTrait.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Cache\Traits; - -if (version_compare(phpversion('redis'), '6.0.2', '>')) { - /** - * @internal - */ - trait Redis6ProxyTrait - { - public function dump($key): \Redis|false|string - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); - } - - public function mget($keys): \Redis|array|false - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); - } - - public function waitaof($numlocal, $numreplicas, $timeout): \Redis|array|false - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->waitaof(...\func_get_args()); - } - } -} else { - /** - * @internal - */ - trait Redis6ProxyTrait - { - public function dump($key): \Redis|string - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); - } - - public function mget($keys): \Redis|array - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); - } - } -} diff --git a/src/Symfony/Component/Cache/Traits/RedisCluster5Proxy.php b/src/Symfony/Component/Cache/Traits/RedisCluster5Proxy.php index da23e0f881e1b..511c53dd718a3 100644 --- a/src/Symfony/Component/Cache/Traits/RedisCluster5Proxy.php +++ b/src/Symfony/Component/Cache/Traits/RedisCluster5Proxy.php @@ -31,7 +31,7 @@ class RedisCluster5Proxy extends \RedisCluster implements ResetInterface, LazyOb private const LAZY_OBJECT_PROPERTY_SCOPES = []; - public function __construct($name, $seeds = null, $timeout = null, $read_timeout = null, $persistent = null, $auth = null) + public function __construct($name, $seeds = null, $timeout = null, $read_timeout = null, $persistent = null, #[\SensitiveParameter] $auth = null) { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->__construct(...\func_get_args()); } diff --git a/src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php b/src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php index 6e06b075f27d7..fafc4acf2df06 100644 --- a/src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php +++ b/src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php @@ -28,7 +28,6 @@ class RedisCluster6Proxy extends \RedisCluster implements ResetInterface, LazyOb use LazyProxyTrait { resetLazyObject as reset; } - use RedisCluster6ProxyTrait; private const LAZY_OBJECT_PROPERTY_SCOPES = []; @@ -657,6 +656,11 @@ public function pttl($key): \RedisCluster|false|int return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pttl(...\func_get_args()); } + public function publish($channel, $message): \RedisCluster|bool + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); + } + public function pubsub($key_or_address, ...$values): mixed { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pubsub(...\func_get_args()); diff --git a/src/Symfony/Component/Cache/Traits/RedisCluster6ProxyTrait.php b/src/Symfony/Component/Cache/Traits/RedisCluster6ProxyTrait.php deleted file mode 100644 index 389c6e1adf347..0000000000000 --- a/src/Symfony/Component/Cache/Traits/RedisCluster6ProxyTrait.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Cache\Traits; - -if (version_compare(phpversion('redis'), '6.0.2', '>')) { - /** - * @internal - */ - trait RedisCluster6ProxyTrait - { - public function publish($channel, $message): \RedisCluster|bool|int - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); - } - - public function waitaof($key_or_address, $numlocal, $numreplicas, $timeout): \RedisCluster|array|false - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->waitaof(...\func_get_args()); - } - } -} else { - /** - * @internal - */ - trait RedisCluster6ProxyTrait - { - public function publish($channel, $message): \RedisCluster|bool - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); - } - } -} diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 032a290c72dbe..7209e9ebadeaf 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -293,7 +293,10 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra } if ((null !== $auth && !$redis->auth($auth)) - || ($params['dbindex'] && !$redis->select($params['dbindex'])) + // Due to a bug in phpredis we must always select the dbindex if persistent pooling is enabled + // @see https://github.com/phpredis/phpredis/issues/1920 + // @see https://github.com/symfony/symfony/issues/51578 + || (($params['dbindex'] || ('pconnect' === $connect && '0' !== \ini_get('redis.pconnect.pooling_enabled'))) && !$redis->select($params['dbindex'])) ) { $e = preg_replace('/^ERR /', '', $redis->getLastError()); throw new InvalidArgumentException('Redis connection failed: '.$e.'.'); diff --git a/src/Symfony/Component/Clock/.gitattributes b/src/Symfony/Component/Clock/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Clock/.gitattributes +++ b/src/Symfony/Component/Clock/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Clock/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Clock/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Clock/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Clock/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Clock/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Clock/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Clock/DatePoint.php b/src/Symfony/Component/Clock/DatePoint.php index 5d8ace6374bc8..5623e3b8702d9 100644 --- a/src/Symfony/Component/Clock/DatePoint.php +++ b/src/Symfony/Component/Clock/DatePoint.php @@ -32,15 +32,21 @@ public function __construct(string $datetime = 'now', ?\DateTimeZone $timezone = if (\PHP_VERSION_ID < 80300) { try { - $timezone = (new parent($datetime, $timezone ?? $now->getTimezone()))->getTimezone(); + $builtInDate = new parent($datetime, $timezone ?? $now->getTimezone()); + $timezone = $builtInDate->getTimezone(); } catch (\Exception $e) { throw new \DateMalformedStringException($e->getMessage(), $e->getCode(), $e); } } else { - $timezone = (new parent($datetime, $timezone ?? $now->getTimezone()))->getTimezone(); + $builtInDate = new parent($datetime, $timezone ?? $now->getTimezone()); + $timezone = $builtInDate->getTimezone(); } $now = $now->setTimezone($timezone)->modify($datetime); + + if ('00:00:00.000000' === $builtInDate->format('H:i:s.u')) { + $now = $now->setTime(0, 0); + } } elseif (null !== $timezone) { $now = $now->setTimezone($timezone); } diff --git a/src/Symfony/Component/Clock/Tests/DatePointTest.php b/src/Symfony/Component/Clock/Tests/DatePointTest.php index c9d7ddf10a803..191c1195465de 100644 --- a/src/Symfony/Component/Clock/Tests/DatePointTest.php +++ b/src/Symfony/Component/Clock/Tests/DatePointTest.php @@ -57,4 +57,19 @@ public function testModify() $this->expectExceptionMessage('Failed to parse time string (Bad Date)'); $date->modify('Bad Date'); } + + /** + * @testWith ["2024-04-01 00:00:00.000000", "2024-04"] + * ["2024-04-09 00:00:00.000000", "2024-04-09"] + * ["2024-04-09 03:00:00.000000", "2024-04-09 03:00"] + * ["2024-04-09 00:00:00.123456", "2024-04-09 00:00:00.123456"] + */ + public function testTimeDefaultsToMidnight(string $expected, string $datetime) + { + $date = new \DateTimeImmutable($datetime); + $this->assertSame($expected, $date->format('Y-m-d H:i:s.u')); + + $date = new DatePoint($datetime); + $this->assertSame($expected, $date->format('Y-m-d H:i:s.u')); + } } diff --git a/src/Symfony/Component/Config/.gitattributes b/src/Symfony/Component/Config/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Config/.gitattributes +++ b/src/Symfony/Component/Config/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Config/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Config/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Config/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Config/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Config/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Config/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Console/.gitattributes b/src/Symfony/Component/Console/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Console/.gitattributes +++ b/src/Symfony/Component/Console/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Console/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Console/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Console/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Console/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Console/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Console/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php index 4dff078ae72dd..a5a0eca245080 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php @@ -1267,4 +1267,11 @@ public function testMultiLineFormatIsFullyCorrectlyWithManuallyCleanup() stream_get_contents($output->getStream()) ); } + + public function testGetNotSetMessage() + { + $progressBar = new ProgressBar($this->getOutputStream()); + + $this->assertNull($progressBar->getMessage()); + } } diff --git a/src/Symfony/Component/CssSelector/.gitattributes b/src/Symfony/Component/CssSelector/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/CssSelector/.gitattributes +++ b/src/Symfony/Component/CssSelector/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/CssSelector/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/CssSelector/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/CssSelector/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/CssSelector/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/CssSelector/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/CssSelector/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/DependencyInjection/.gitattributes b/src/Symfony/Component/DependencyInjection/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/DependencyInjection/.gitattributes +++ b/src/Symfony/Component/DependencyInjection/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/DependencyInjection/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/DependencyInjection/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/DependencyInjection/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/DependencyInjection/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/DomCrawler/.gitattributes b/src/Symfony/Component/DomCrawler/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/DomCrawler/.gitattributes +++ b/src/Symfony/Component/DomCrawler/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/DomCrawler/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/DomCrawler/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/DomCrawler/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/DomCrawler/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/DomCrawler/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/DomCrawler/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index 85d9c1eb36c7e..98829d4aaa49f 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -1061,12 +1061,30 @@ protected function sibling(\DOMNode $node, string $siblingDir = 'nextSibling'): private function parseHtml5(string $htmlContent, string $charset = 'UTF-8'): \DOMDocument { - return $this->html5Parser->parse($this->convertToHtmlEntities($htmlContent, $charset)); + if (!$this->supportsEncoding($charset)) { + $htmlContent = $this->convertToHtmlEntities($htmlContent, $charset); + $charset = 'UTF-8'; + } + + return $this->html5Parser->parse($htmlContent, ['encoding' => $charset]); + } + + private function supportsEncoding(string $encoding): bool + { + try { + return '' === @mb_convert_encoding('', $encoding, 'UTF-8'); + } catch (\Throwable $e) { + return false; + } } private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DOMDocument { - $htmlContent = $this->convertToHtmlEntities($htmlContent, $charset); + if ('UTF-8' === $charset && preg_match('//u', $htmlContent)) { + $htmlContent = ''.$htmlContent; + } else { + $htmlContent = $this->convertToHtmlEntities($htmlContent, $charset); + } $internalErrors = libxml_use_internal_errors(true); diff --git a/src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTestCase.php b/src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTestCase.php index 90c97e7452ce7..97b16b9fe6073 100644 --- a/src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTestCase.php +++ b/src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTestCase.php @@ -184,6 +184,10 @@ public function testAddContent() $crawler = $this->createCrawler(); $crawler->addContent($this->getDoctype().'
'); $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() ignores bad charset'); + + $crawler = $this->createCrawler(); + $crawler->addContent($this->getDoctype().'', 'text/html; charset=UTF-8'); + $this->assertEquals('var foo = "bär";', $crawler->filterXPath('//script')->text(), '->addContent() does not interfere with script content'); } /** diff --git a/src/Symfony/Component/Dotenv/.gitattributes b/src/Symfony/Component/Dotenv/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Dotenv/.gitattributes +++ b/src/Symfony/Component/Dotenv/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Dotenv/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Dotenv/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Dotenv/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Dotenv/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Dotenv/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Dotenv/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/ErrorHandler/.gitattributes b/src/Symfony/Component/ErrorHandler/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/ErrorHandler/.gitattributes +++ b/src/Symfony/Component/ErrorHandler/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/ErrorHandler/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/ErrorHandler/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/ErrorHandler/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/ErrorHandler/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/ErrorHandler/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/ErrorHandler/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php index 2e13fc40e71b7..e6d3e7d5b95a5 100644 --- a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php @@ -161,7 +161,7 @@ public function testCallErrorExceptionInfo() $this->assertSame('Undefined variable $foo', $e->getMessage()); $this->assertSame(__FILE__, $e->getFile()); $this->assertSame(0, $e->getCode()); - $this->assertSame('Symfony\Component\ErrorHandler\{closure}', $trace[0]['function']); + $this->assertStringMatchesFormat('%A{closure%A}', $trace[0]['function']); $this->assertSame(ErrorHandler::class, $trace[0]['class']); $this->assertSame('triggerNotice', $trace[1]['function']); $this->assertSame(__CLASS__, $trace[1]['class']); diff --git a/src/Symfony/Component/EventDispatcher/.gitattributes b/src/Symfony/Component/EventDispatcher/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/EventDispatcher/.gitattributes +++ b/src/Symfony/Component/EventDispatcher/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/EventDispatcher/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/EventDispatcher/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/EventDispatcher/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php index 240d1d296f2de..c8c6af8cebfbf 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php +++ b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php @@ -48,7 +48,7 @@ public function __construct(callable|array $listener, ?string $name, Stopwatch $ $this->callableRef .= '::'.$listener[1]; } elseif ($listener instanceof \Closure) { $r = new \ReflectionFunction($listener); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { $this->pretty = $this->name = 'closure'; } elseif ($class = $r->getClosureCalledClass()) { $this->name = $class->name; diff --git a/src/Symfony/Component/ExpressionLanguage/.gitattributes b/src/Symfony/Component/ExpressionLanguage/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/ExpressionLanguage/.gitattributes +++ b/src/Symfony/Component/ExpressionLanguage/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/ExpressionLanguage/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/ExpressionLanguage/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/ExpressionLanguage/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/ExpressionLanguage/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/ExpressionLanguage/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/ExpressionLanguage/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Filesystem/.gitattributes b/src/Symfony/Component/Filesystem/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Filesystem/.gitattributes +++ b/src/Symfony/Component/Filesystem/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Filesystem/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Filesystem/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Filesystem/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Filesystem/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Filesystem/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Filesystem/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 176535d13c267..af25dce4bba52 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -662,7 +662,7 @@ public function dumpFile(string $filename, $content): void throw new IOException(sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename); } - self::box('chmod', $tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask()); + self::box('chmod', $tmpFile, @fileperms($filename) ?: 0666 & ~umask()); $this->rename($tmpFile, $filename, true); } finally { diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 2c222fd06b2db..bc8a5cecaa259 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -14,6 +14,8 @@ use Symfony\Component\Filesystem\Exception\InvalidArgumentException; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Path; +use Symfony\Component\Process\PhpExecutableFinder; +use Symfony\Component\Process\Process; /** * Test class for Filesystem. @@ -162,23 +164,32 @@ public function testCopyCreatesTargetDirectoryIfItDoesNotExist() $this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE'); } - /** - * @group network - */ public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy() { - if (!\in_array('https', stream_get_wrappers())) { - $this->markTestSkipped('"https" stream wrapper is not enabled.'); + if (!\in_array('http', stream_get_wrappers())) { + $this->markTestSkipped('"http" stream wrapper is not enabled.'); } - $sourceFilePath = 'https://symfony.com/images/common/logo/logo_symfony_header.png'; - $targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file'; - file_put_contents($targetFilePath, 'TARGET FILE'); + $finder = new PhpExecutableFinder(); + $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8057'])); + $process->setWorkingDirectory(__DIR__.'/Fixtures/web'); - $this->filesystem->copy($sourceFilePath, $targetFilePath, false); + $process->start(); - $this->assertFileExists($targetFilePath); - $this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath)); + do { + usleep(50000); + } while (!@fopen('http://localhost:8057', 'r')); + + try { + $sourceFilePath = 'http://localhost:8057/logo_symfony_header.png'; + $targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file'; + file_put_contents($targetFilePath, 'TARGET FILE'); + $this->filesystem->copy($sourceFilePath, $targetFilePath, false); + $this->assertFileExists($targetFilePath); + $this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath)); + } finally { + $process->stop(); + } } public function testMkdirCreatesDirectoriesRecursively() diff --git a/src/Symfony/Component/Filesystem/Tests/Fixtures/web/index.php b/src/Symfony/Component/Filesystem/Tests/Fixtures/web/index.php new file mode 100644 index 0000000000000..b3d9bbc7f3711 --- /dev/null +++ b/src/Symfony/Component/Filesystem/Tests/Fixtures/web/index.php @@ -0,0 +1 @@ +=8.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" + "symfony/polyfill-mbstring": "~1.8", + "symfony/process": "^6.4|^7.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" }, diff --git a/src/Symfony/Component/Finder/.gitattributes b/src/Symfony/Component/Finder/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Finder/.gitattributes +++ b/src/Symfony/Component/Finder/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Finder/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Finder/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Finder/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Finder/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Finder/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Finder/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php b/src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php index ddd7007728a7f..b278706e9f340 100644 --- a/src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php @@ -37,9 +37,9 @@ public function __construct(\Iterator $iterator, string $baseDir) { $this->baseDir = $this->normalizePath($baseDir); - foreach ($this->parentDirectoriesUpwards($this->baseDir) as $parentDirectory) { - if (@is_dir("{$parentDirectory}/.git")) { - $this->baseDir = $parentDirectory; + foreach ([$this->baseDir, ...$this->parentDirectoriesUpwards($this->baseDir)] as $directory) { + if (@is_dir("{$directory}/.git")) { + $this->baseDir = $directory; break; } } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php index 3ebe481f559c5..f725374d815e7 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php @@ -34,7 +34,7 @@ protected function tearDown(): void * * @dataProvider getAcceptData */ - public function testAccept(array $gitIgnoreFiles, array $otherFileNames, array $expectedResult) + public function testAccept(array $gitIgnoreFiles, array $otherFileNames, array $expectedResult, string $baseDir = '') { $otherFileNames = $this->toAbsolute($otherFileNames); foreach ($otherFileNames as $path) { @@ -51,7 +51,8 @@ public function testAccept(array $gitIgnoreFiles, array $otherFileNames, array $ $inner = new InnerNameIterator($otherFileNames); - $iterator = new VcsIgnoredFilterIterator($inner, $this->tmpDir); + $baseDir = $this->tmpDir.('' !== $baseDir ? '/'.$baseDir : ''); + $iterator = new VcsIgnoredFilterIterator($inner, $baseDir); $this->assertIterator($this->toAbsolute($expectedResult), $iterator); } @@ -74,6 +75,55 @@ public static function getAcceptData(): iterable ], ]; + yield 'simple file - .gitignore and in() from repository root' => [ + [ + '.gitignore' => 'a.txt', + ], + [ + '.git', + 'a.txt', + 'b.txt', + 'dir/', + 'dir/a.txt', + ], + [ + '.git', + 'b.txt', + 'dir', + ], + ]; + + yield 'nested git repositories only consider .gitignore files of the most inner repository' => [ + [ + '.gitignore' => "nested/*\na.txt", + 'nested/.gitignore' => 'c.txt', + 'nested/dir/.gitignore' => 'f.txt', + ], + [ + '.git', + 'a.txt', + 'b.txt', + 'nested/', + 'nested/.git', + 'nested/c.txt', + 'nested/d.txt', + 'nested/dir/', + 'nested/dir/e.txt', + 'nested/dir/f.txt', + ], + [ + '.git', + 'a.txt', + 'b.txt', + 'nested', + 'nested/.git', + 'nested/d.txt', + 'nested/dir', + 'nested/dir/e.txt', + ], + 'nested', + ]; + yield 'simple file at root' => [ [ '.gitignore' => '/a.txt', diff --git a/src/Symfony/Component/Form/.gitattributes b/src/Symfony/Component/Form/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Form/.gitattributes +++ b/src/Symfony/Component/Form/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Form/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Form/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Form/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Form/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Form/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Form/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Form/Extension/Core/DataAccessor/PropertyPathAccessor.php b/src/Symfony/Component/Form/Extension/Core/DataAccessor/PropertyPathAccessor.php index c845c10f6d89a..f5c25dfc1c221 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataAccessor/PropertyPathAccessor.php +++ b/src/Symfony/Component/Form/Extension/Core/DataAccessor/PropertyPathAccessor.php @@ -12,7 +12,9 @@ namespace Symfony\Component\Form\Extension\Core\DataAccessor; use Symfony\Component\Form\DataAccessorInterface; +use Symfony\Component\Form\DataMapperInterface; use Symfony\Component\Form\Exception\AccessException; +use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper; use Symfony\Component\Form\FormInterface; use Symfony\Component\PropertyAccess\Exception\AccessException as PropertyAccessException; use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException; @@ -51,15 +53,25 @@ public function setValue(object|array &$data, mixed $value, FormInterface $form) throw new AccessException('Unable to write the given value as no property path is defined.'); } + $getValue = function () use ($data, $form, $propertyPath) { + $dataMapper = $this->getDataMapper($form); + + if ($dataMapper instanceof DataMapper && null !== $dataAccessor = $dataMapper->getDataAccessor()) { + return $dataAccessor->getValue($data, $form); + } + + return $this->getPropertyValue($data, $propertyPath); + }; + // If the field is of type DateTimeInterface and the data is the same skip the update to // keep the original object hash - if ($value instanceof \DateTimeInterface && $value == $this->getPropertyValue($data, $propertyPath)) { + if ($value instanceof \DateTimeInterface && $value == $getValue()) { return; } // If the data is identical to the value in $data, we are // dealing with a reference - if (!\is_object($data) || !$form->getConfig()->getByReference() || $value !== $this->getPropertyValue($data, $propertyPath)) { + if (!\is_object($data) || !$form->getConfig()->getByReference() || $value !== $getValue()) { $this->propertyAccessor->setValue($data, $propertyPath, $value); } } @@ -93,4 +105,13 @@ private function getPropertyValue(object|array $data, PropertyPathInterface $pro return null; } } + + private function getDataMapper(FormInterface $form): ?DataMapperInterface + { + do { + $dataMapper = $form->getConfig()->getDataMapper(); + } while (null === $dataMapper && null !== $form = $form->getParent()); + + return $dataMapper; + } } diff --git a/src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php b/src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php index f27f9d14bff98..a7bf98032202e 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php +++ b/src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php @@ -74,4 +74,12 @@ public function mapFormsToData(\Traversable $forms, mixed &$data): void } } } + + /** + * @internal + */ + public function getDataAccessor(): DataAccessorInterface + { + return $this->dataAccessor; + } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/DataMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/DataMapperTest.php index fafd0e9d032fc..1a8f2678dd74a 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/DataMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/DataMapperTest.php @@ -16,6 +16,8 @@ use Symfony\Component\Form\Extension\Core\DataAccessor\PropertyPathAccessor; use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper; use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\Extension\Core\Type\FormType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormConfigBuilder; use Symfony\Component\Form\FormFactoryBuilder; @@ -403,6 +405,25 @@ public function testMapFormsToDataMapsDateTimeInstanceToArrayIfNotSetBefore() $this->assertEquals(['date' => new \DateTime('2022-08-04', new \DateTimeZone('UTC'))], $form->getData()); } + + public function testMapFormToDataWithOnlyGetterConfigured() + { + $person = new DummyPerson('foo'); + $form = (new FormFactoryBuilder()) + ->getFormFactory() + ->createBuilder(FormType::class, $person) + ->add('name', TextType::class, [ + 'getter' => function (DummyPerson $person) { + return $person->myName(); + }, + ]) + ->getForm(); + $form->submit([ + 'name' => 'bar', + ]); + + $this->assertSame('bar', $person->myName()); + } } class SubmittedForm extends Form @@ -439,4 +460,9 @@ public function rename($name): void { $this->name = $name; } + + public function setName($name): void + { + $this->name = $name; + } } diff --git a/src/Symfony/Component/HtmlSanitizer/.gitattributes b/src/Symfony/Component/HtmlSanitizer/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/HtmlSanitizer/.gitattributes +++ b/src/Symfony/Component/HtmlSanitizer/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/HtmlSanitizer/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/HtmlSanitizer/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/HtmlSanitizer/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/HtmlSanitizer/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/HtmlSanitizer/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/HtmlSanitizer/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php b/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php index a0a15116b3137..90436cae631a7 100644 --- a/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php +++ b/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php @@ -309,6 +309,12 @@ public static function provideSanitizeBody() 'Lorem ipsum ', ], + // Processing instructions + [ + 'Lorem ipsumfoo', + 'Lorem ipsumfoo', + ], + // Normal tags [ 'Lorem ipsum', diff --git a/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php b/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php index 4c2eba0c16198..8cda8cf2a8bd0 100644 --- a/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php +++ b/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php @@ -134,9 +134,10 @@ private function visitChildren(\DOMNode $domNode, Cursor $cursor): void if ('#text' === $child->nodeName) { // Add text directly for performance $cursor->node->addChild(new TextNode($cursor->node, $child->nodeValue)); - } elseif (!$child instanceof \DOMText) { + } elseif (!$child instanceof \DOMText && !$child instanceof \DOMProcessingInstruction) { // Otherwise continue the visit recursively // Ignore comments for security reasons (interpreted differently by browsers) + // Ignore processing instructions (treated as comments) $this->visitNode($child, $cursor); } } diff --git a/src/Symfony/Component/HttpClient/.gitattributes b/src/Symfony/Component/HttpClient/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/HttpClient/.gitattributes +++ b/src/Symfony/Component/HttpClient/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/HttpClient/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/HttpClient/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/HttpClient/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/HttpClient/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/HttpClient/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/HttpClient/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index 4446a031e9695..fef0ad09a9079 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -250,9 +250,8 @@ public function request(string $method, string $url, array $options = []): Respo if (isset($options['normalized_headers']['content-length'][0])) { $curlopts[\CURLOPT_INFILESIZE] = (int) substr($options['normalized_headers']['content-length'][0], \strlen('Content-Length: ')); - } - if (!isset($options['normalized_headers']['transfer-encoding'])) { - $curlopts[\CURLOPT_HTTPHEADER][] = 'Transfer-Encoding:'.(isset($curlopts[\CURLOPT_INFILESIZE]) ? '' : ' chunked'); + } elseif (!isset($options['normalized_headers']['transfer-encoding'])) { + $curlopts[\CURLOPT_INFILESIZE] = -1; } if ('POST' !== $method) { diff --git a/src/Symfony/Component/HttpClient/EventSourceHttpClient.php b/src/Symfony/Component/HttpClient/EventSourceHttpClient.php index 80022eaf26653..4e551ac0409f6 100644 --- a/src/Symfony/Component/HttpClient/EventSourceHttpClient.php +++ b/src/Symfony/Component/HttpClient/EventSourceHttpClient.php @@ -121,7 +121,7 @@ public function request(string $method, string $url, array $options = []): Respo return; } - $rx = '/((?:\r\n|[\r\n]){2,})/'; + $rx = '/((?:\r\n){2,}|\r{2,}|\n{2,})/'; $content = $state->buffer.$chunk->getContent(); if ($chunk->isLast()) { diff --git a/src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php index e4b1986d34e18..629655392ce81 100644 --- a/src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php @@ -27,9 +27,14 @@ */ class EventSourceHttpClientTest extends TestCase { - public function testGetServerSentEvents() + /** + * @testWith ["\n"] + * ["\r"] + * ["\r\n"] + */ + public function testGetServerSentEvents(string $sep) { - $data = << false, 'http_method' => 'GET', 'url' => 'http://localhost:8080/events', 'response_headers' => ['content-type: text/event-stream']]); @@ -83,11 +89,11 @@ public function testGetServerSentEvents() $expected = [ new FirstChunk(), - new ServerSentEvent("event: builderror\nid: 46\ndata: {\"foo\": \"bar\"}\n\n"), - new ServerSentEvent("event: reload\nid: 47\ndata: {}\n\n"), - new ServerSentEvent("event: reload\nid: 48\ndata: {}\n\n"), - new ServerSentEvent("data: test\ndata:test\nid: 49\nevent: testEvent\n\n\n"), - new ServerSentEvent("id: 50\ndata: \ndata\ndata: \ndata\ndata: \n\n"), + new ServerSentEvent(str_replace("\n", $sep, "event: builderror\nid: 46\ndata: {\"foo\": \"bar\"}\n\n")), + new ServerSentEvent(str_replace("\n", $sep, "event: reload\nid: 47\ndata: {}\n\n")), + new ServerSentEvent(str_replace("\n", $sep, "event: reload\nid: 48\ndata: {}\n\n")), + new ServerSentEvent(str_replace("\n", $sep, "data: test\ndata:test\nid: 49\nevent: testEvent\n\n\n")), + new ServerSentEvent(str_replace("\n", $sep, "id: 50\ndata: \ndata\ndata: \ndata\ndata: \n\n")), ]; $i = 0; diff --git a/src/Symfony/Component/HttpFoundation/.gitattributes b/src/Symfony/Component/HttpFoundation/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/HttpFoundation/.gitattributes +++ b/src/Symfony/Component/HttpFoundation/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/HttpFoundation/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/HttpFoundation/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/HttpFoundation/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/HttpFoundation/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/HttpFoundation/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/HttpFoundation/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/HttpFoundation/RedirectResponse.php b/src/Symfony/Component/HttpFoundation/RedirectResponse.php index abb0c4c1b766c..3c2e4b620b6e1 100644 --- a/src/Symfony/Component/HttpFoundation/RedirectResponse.php +++ b/src/Symfony/Component/HttpFoundation/RedirectResponse.php @@ -85,6 +85,7 @@ public function setTargetUrl(string $url): static ', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8'))); $this->headers->set('Location', $url); + $this->headers->set('Content-Type', 'text/html; charset=utf-8'); return $this; } diff --git a/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php index 3ed50c3fa36c8..fede448b30669 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php @@ -44,6 +44,13 @@ public function testGenerateLocationHeader() $this->assertEquals('foo.bar', $response->headers->get('Location')); } + public function testGenerateContentTypeHeader() + { + $response = new RedirectResponse('foo.bar'); + + $this->assertSame('text/html; charset=utf-8', $response->headers->get('Content-Type')); + } + public function testGetTargetUrl() { $response = new RedirectResponse('foo.bar'); diff --git a/src/Symfony/Component/HttpKernel/.gitattributes b/src/Symfony/Component/HttpKernel/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/HttpKernel/.gitattributes +++ b/src/Symfony/Component/HttpKernel/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/HttpKernel/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/HttpKernel/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/HttpKernel/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/HttpKernel/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/HttpKernel/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/HttpKernel/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php index 5a6a90974bb90..3a3f0485a790d 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -240,7 +240,7 @@ private function checkController(Request $request, callable $controller): callab $r = new \ReflectionFunction($controller); $name = $r->name; - if (str_contains($name, '{closure}')) { + if (str_contains($name, '{closure')) { $name = $class = \Closure::class; } elseif ($class = $r->getClosureCalledClass()) { $class = $class->name; diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php index 46de0b7aee873..607bb81538eae 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -60,9 +60,21 @@ protected function getCasters(): array $casters = [ '*' => function ($v, array $a, Stub $s, $isNested) { if (!$v instanceof Stub) { + $b = $a; foreach ($a as $k => $v) { - if (\is_object($v) && !$v instanceof \DateTimeInterface && !$v instanceof Stub) { - $a[$k] = new CutStub($v); + if (!\is_object($v) || $v instanceof \DateTimeInterface || $v instanceof Stub) { + continue; + } + + try { + $a[$k] = $s = new CutStub($v); + + if ($b[$k] === $s) { + // we've hit a non-typed reference + $a[$k] = $v; + } + } catch (\TypeError $e) { + // we've hit a typed reference } } } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index 6b6eb33d8d9d0..1b9c04476661a 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -469,7 +469,7 @@ private function parseController(array|object|string|null $controller): array|st 'line' => $r->getStartLine(), ]; - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { return $controller; } $controller['method'] = $r->name; diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index ff15502ce74fa..66626d199bfa2 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -56,6 +56,7 @@ public function process(ContainerBuilder $container): void foreach ($container->findTaggedServiceIds('controller.service_arguments', true) as $id => $tags) { $def = $container->getDefinition($id); $def->setPublic(true); + $def->setLazy(false); $class = $def->getClass(); $autowire = $def->isAutowired(); $bindings = $def->getBindings(); diff --git a/src/Symfony/Component/HttpKernel/Event/ControllerEvent.php b/src/Symfony/Component/HttpKernel/Event/ControllerEvent.php index 1f8520d29b1ba..5278200a79bb8 100644 --- a/src/Symfony/Component/HttpKernel/Event/ControllerEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/ControllerEvent.php @@ -98,7 +98,7 @@ public function getAttributes(?string $className = null): array } elseif (\is_string($this->controller) && false !== $i = strpos($this->controller, '::')) { $class = new \ReflectionClass(substr($this->controller, 0, $i)); } else { - $class = str_contains($this->controllerReflector->name, '{closure}') ? null : $this->controllerReflector->getClosureCalledClass(); + $class = str_contains($this->controllerReflector->name, '{closure') ? null : $this->controllerReflector->getClosureCalledClass(); } $this->attributes = []; diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 31bbe239be275..181ba1c667f76 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '7.0.6'; - public const VERSION_ID = 70006; + public const VERSION = '7.0.7'; + public const VERSION_ID = 70007; public const MAJOR_VERSION = 7; public const MINOR_VERSION = 0; - public const RELEASE_VERSION = 6; + public const RELEASE_VERSION = 7; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '07/2024'; diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DataCollectorTest.php index ae79a3c93c504..4463e30e7bbb6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DataCollectorTest.php @@ -15,6 +15,8 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector\CloneVarDataCollector; +use Symfony\Component\HttpKernel\Tests\Fixtures\UsePropertyInDestruct; +use Symfony\Component\HttpKernel\Tests\Fixtures\WithPublicObjectProperty; use Symfony\Component\VarDumper\Cloner\VarCloner; class DataCollectorTest extends TestCase @@ -35,4 +37,56 @@ public function testCloneVarExistingFilePath() $this->assertSame($filePath, $c->getData()[0]); } + + public function testClassPublicObjectProperty() + { + $parent = new WithPublicObjectProperty(); + $child = new WithPublicObjectProperty(); + + $child->parent = $parent; + + $c = new CloneVarDataCollector($child); + $c->collect(new Request(), new Response()); + + $this->assertNotNull($c->getData()->parent); + } + + public function testClassPublicObjectPropertyAsReference() + { + $parent = new WithPublicObjectProperty(); + $child = new WithPublicObjectProperty(); + + $child->parent = &$parent; + + $c = new CloneVarDataCollector($child); + $c->collect(new Request(), new Response()); + + $this->assertNotNull($c->getData()->parent); + } + + public function testClassUsePropertyInDestruct() + { + $parent = new UsePropertyInDestruct(); + $child = new UsePropertyInDestruct(); + + $child->parent = $parent; + + $c = new CloneVarDataCollector($child); + $c->collect(new Request(), new Response()); + + $this->assertNotNull($c->getData()->parent); + } + + public function testClassUsePropertyAsReferenceInDestruct() + { + $parent = new UsePropertyInDestruct(); + $child = new UsePropertyInDestruct(); + + $child->parent = &$parent; + + $c = new CloneVarDataCollector($child); + $c->collect(new Request(), new Response()); + + $this->assertNotNull($c->getData()->parent); + } } diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php index fdc42e4ac02e9..04649f9ef35a2 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -118,7 +118,7 @@ public static function provideControllerCallables(): array 'Closure', fn () => 'foo', [ - 'class' => __NAMESPACE__.'\{closure}', + 'class' => \PHP_VERSION_ID >= 80400 ? sprintf('{closure:%s():%d}', __METHOD__, __LINE__ - 2) : __NAMESPACE__.'\{closure}', 'method' => null, 'file' => __FILE__, 'line' => __LINE__ - 5, diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index eb5193ae5f48b..d2927b16f43e8 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -31,6 +31,7 @@ use Symfony\Component\DependencyInjection\TypedReference; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DependencyInjection\RegisterControllerArgumentLocatorsPass; +use Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector\DummyController; use Symfony\Component\HttpKernel\Tests\Fixtures\Suit; class RegisterControllerArgumentLocatorsPassTest extends TestCase @@ -290,6 +291,21 @@ public function testControllersAreMadePublic() $this->assertTrue($container->getDefinition('foo')->isPublic()); } + public function testControllersAreMadeNonLazy() + { + $container = new ContainerBuilder(); + $container->register('argument_resolver.service')->addArgument([]); + + $container->register('foo', DummyController::class) + ->addTag('controller.service_arguments') + ->setLazy(true); + + $pass = new RegisterControllerArgumentLocatorsPass(); + $pass->process($container); + + $this->assertFalse($container->getDefinition('foo')->isLazy()); + } + /** * @dataProvider provideBindings */ diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/UsePropertyInDestruct.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/UsePropertyInDestruct.php new file mode 100644 index 0000000000000..74225d355aadf --- /dev/null +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/UsePropertyInDestruct.php @@ -0,0 +1,16 @@ +parent !== null) { + $this->parent->name = ''; + } + } +} diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/WithPublicObjectProperty.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/WithPublicObjectProperty.php new file mode 100644 index 0000000000000..92ebdb04dd429 --- /dev/null +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/WithPublicObjectProperty.php @@ -0,0 +1,8 @@ +assertNull($doctrineEnvelope); } + public function testGetWithSkipLockedWithForUpdateMethod() + { + if (!method_exists(QueryBuilder::class, 'forUpdate')) { + $this->markTestSkipped('This test is for when forUpdate method exists.'); + } + + $queryBuilder = $this->getQueryBuilderMock(); + $driverConnection = $this->getDBALConnectionMock(); + $stmt = $this->getResultMock(false); + + $queryBuilder + ->method('getParameters') + ->willReturn([]); + $queryBuilder + ->method('getParameterTypes') + ->willReturn([]); + $queryBuilder + ->method('forUpdate') + ->with(ConflictResolutionMode::SKIP_LOCKED) + ->willReturn($queryBuilder); + $queryBuilder + ->method('getSQL') + ->willReturn('SELECT FOR UPDATE SKIP LOCKED'); + $driverConnection->expects($this->once()) + ->method('createQueryBuilder') + ->willReturn($queryBuilder); + $driverConnection->expects($this->never()) + ->method('update'); + $driverConnection + ->method('executeQuery') + ->with($this->callback(function ($sql) { + return str_contains($sql, 'SKIP LOCKED'); + })) + ->willReturn($stmt); + + $connection = new Connection(['skip_locked' => true], $driverConnection); + $doctrineEnvelope = $connection->get(); + $this->assertNull($doctrineEnvelope); + } + + public function testGetWithSkipLockedWithoutForUpdateMethod() + { + if (method_exists(QueryBuilder::class, 'forUpdate')) { + $this->markTestSkipped('This test is for when forUpdate method does not exist.'); + } + + $queryBuilder = $this->getQueryBuilderMock(); + $driverConnection = $this->getDBALConnectionMock(); + $stmt = $this->getResultMock(false); + + $queryBuilder + ->method('getParameters') + ->willReturn([]); + $queryBuilder + ->method('getParameterTypes') + ->willReturn([]); + $queryBuilder + ->method('getSQL') + ->willReturn('SELECT'); + $driverConnection->expects($this->once()) + ->method('createQueryBuilder') + ->willReturn($queryBuilder); + $driverConnection->expects($this->never()) + ->method('update'); + $driverConnection + ->method('executeQuery') + ->with($this->callback(function ($sql) { + return str_contains($sql, 'SKIP LOCKED'); + })) + ->willReturn($stmt); + + $connection = new Connection(['skip_locked' => true], $driverConnection); + $doctrineEnvelope = $connection->get(); + $this->assertNull($doctrineEnvelope); + } + public function testItThrowsATransportExceptionIfItCannotAcknowledgeMessage() { $this->expectException(TransportException::class); @@ -223,7 +300,7 @@ private function getDBALConnectionMock() $platform = $this->createMock(AbstractPlatform::class); if (!method_exists(QueryBuilder::class, 'forUpdate')) { - $platform->method('getWriteLockSQL')->willReturn('FOR UPDATE'); + $platform->method('getWriteLockSQL')->willReturn('FOR UPDATE SKIP LOCKED'); } $configuration = $this->createMock(\Doctrine\DBAL\Configuration::class); @@ -496,20 +573,20 @@ class_exists(MySQLPlatform::class) ? new MySQLPlatform() : new MySQL57Platform() yield 'SQL Server' => [ class_exists(SQLServerPlatform::class) && !class_exists(SQLServer2012Platform::class) ? new SQLServerPlatform() : new SQLServer2012Platform(), - 'SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK) WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ', + sprintf('SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK%s) WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ', method_exists(QueryBuilder::class, 'forUpdate') ? ', READPAST' : ''), ]; if (!class_exists(MySQL57Platform::class)) { // DBAL >= 4 yield 'Oracle' => [ new OraclePlatform(), - 'SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC FETCH NEXT 1 ROWS ONLY) FOR UPDATE', + 'SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC FETCH NEXT 1 ROWS ONLY) FOR UPDATE SKIP LOCKED', ]; } else { // DBAL < 4 yield 'Oracle' => [ new OraclePlatform(), - 'SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT a.id FROM (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE', + sprintf('SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT a.id FROM (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE%s', method_exists(QueryBuilder::class, 'forUpdate') ? ' SKIP LOCKED' : ''), ]; } } diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php index 3310aac5948e6..fbb50bf42e215 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php @@ -191,6 +191,7 @@ public function testItRetrieveTheMessageThatIsOlderThanRedeliverTimeout() public function testTheTransportIsSetupOnGet() { + $this->driverConnection->executeStatement('CREATE TABLE unrelated (unknown_type_column)'); $this->assertFalse($this->driverConnection->createSchemaManager()->tablesExist(['messenger_messages'])); $this->assertNull($this->connection->get()); diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlIntegrationTest.php index 60f39eb434eea..392f991c0f541 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlIntegrationTest.php @@ -64,4 +64,17 @@ public function testPostgreSqlConnectionSendAndGet() $this->assertNull($this->connection->get()); } + + public function testSkipLocked() + { + $connection = new PostgreSqlConnection(['table_name' => 'queue_table', 'skip_locked' => true], $this->driverConnection); + + $connection->send('{"message": "Hi"}', ['type' => DummyMessage::class]); + + $encoded = $connection->get(); + $this->assertEquals('{"message": "Hi"}', $encoded['body']); + $this->assertEquals(['type' => DummyMessage::class], $encoded['headers']); + + $this->assertNull($connection->get()); + } } diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlRegularIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlRegularIntegrationTest.php index c8abedee48f66..f462d4599a0bf 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlRegularIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlRegularIntegrationTest.php @@ -57,6 +57,20 @@ public function testSendAndGetWithAutoSetupEnabledAndSetupAlready() $this->assertNull($this->connection->get()); } + public function testSendAndGetWithSkipLockedEnabled() + { + $connection = new Connection(['table_name' => 'queue_table', 'skip_locked' => true], $this->driverConnection); + $connection->setup(); + + $connection->send('{"message": "Hi"}', ['type' => DummyMessage::class]); + + $encoded = $connection->get(); + $this->assertSame('{"message": "Hi"}', $encoded['body']); + $this->assertSame(['type' => DummyMessage::class], $encoded['headers']); + + $this->assertNull($this->connection->get()); + } + protected function setUp(): void { if (!$host = getenv('POSTGRES_HOST')) { diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineReceiverTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineReceiverTest.php index 3ec11c6c99d8c..b37b7db25fe0f 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineReceiverTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineReceiverTest.php @@ -119,6 +119,188 @@ public function testFind() $this->assertEquals(new DummyMessage('Hi'), $actualEnvelope->getMessage()); } + public function testAck() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $connection + ->expects($this->once()) + ->method('ack') + ->with('1') + ->willReturn(true); + + $receiver->ack($envelope); + } + + public function testAckThrowsRetryableException() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001)); + if (!class_exists(Version::class)) { + // This is doctrine/dbal 3.x + $deadlockException = new DeadlockException($driverException, null); + } else { + $deadlockException = new DeadlockException('Deadlock', $driverException); + } + + $connection + ->expects($this->exactly(2)) + ->method('ack') + ->with('1') + ->willReturnOnConsecutiveCalls( + $this->throwException($deadlockException), + true, + ); + + $receiver->ack($envelope); + } + + public function testAckThrowsRetryableExceptionAndRetriesFail() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001)); + if (!class_exists(Version::class)) { + // This is doctrine/dbal 3.x + $deadlockException = new DeadlockException($driverException, null); + } else { + $deadlockException = new DeadlockException('Deadlock', $driverException); + } + + $connection + ->expects($this->exactly(4)) + ->method('ack') + ->with('1') + ->willThrowException($deadlockException); + + self::expectException(TransportException::class); + $receiver->ack($envelope); + } + + public function testAckThrowsException() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $exception = new \RuntimeException(); + + $connection + ->expects($this->once()) + ->method('ack') + ->with('1') + ->willThrowException($exception); + + self::expectException($exception::class); + $receiver->ack($envelope); + } + + public function testReject() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $connection + ->expects($this->once()) + ->method('reject') + ->with('1') + ->willReturn(true); + + $receiver->reject($envelope); + } + + public function testRejectThrowsRetryableException() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001)); + if (!class_exists(Version::class)) { + // This is doctrine/dbal 3.x + $deadlockException = new DeadlockException($driverException, null); + } else { + $deadlockException = new DeadlockException('Deadlock', $driverException); + } + + $connection + ->expects($this->exactly(2)) + ->method('reject') + ->with('1') + ->willReturnOnConsecutiveCalls( + $this->throwException($deadlockException), + true, + ); + + $receiver->reject($envelope); + } + + public function testRejectThrowsRetryableExceptionAndRetriesFail() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $driverException = class_exists(Exception::class) ? Exception::new(new \PDOException('Deadlock', 40001)) : new PDOException(new \PDOException('Deadlock', 40001)); + if (!class_exists(Version::class)) { + // This is doctrine/dbal 3.x + $deadlockException = new DeadlockException($driverException, null); + } else { + $deadlockException = new DeadlockException('Deadlock', $driverException); + } + + $connection + ->expects($this->exactly(4)) + ->method('reject') + ->with('1') + ->willThrowException($deadlockException); + + self::expectException(TransportException::class); + $receiver->reject($envelope); + } + + public function testRejectThrowsException() + { + $serializer = $this->createSerializer(); + $connection = $this->createMock(Connection::class); + + $envelope = new Envelope(new \stdClass(), [new DoctrineReceivedStamp('1')]); + $receiver = new DoctrineReceiver($connection, $serializer); + + $exception = new \RuntimeException(); + + $connection + ->expects($this->once()) + ->method('reject') + ->with('1') + ->willThrowException($exception); + + self::expectException($exception::class); + $receiver->reject($envelope); + } + private function createDoctrineEnvelope(): array { return [ diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php index e0b0c8c8b8d6b..dc4c5d8bd905d 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php @@ -19,6 +19,7 @@ use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; +use Doctrine\DBAL\Query\ForUpdate\ConflictResolutionMode; use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Result; use Doctrine\DBAL\Schema\Schema; @@ -182,15 +183,22 @@ public function get(): ?array ->setParameters($query->getParameters(), $query->getParameterTypes()); if (method_exists(QueryBuilder::class, 'forUpdate')) { - $query->forUpdate(); + $query->forUpdate(ConflictResolutionMode::SKIP_LOCKED); } $sql = $query->getSQL(); } elseif (method_exists(QueryBuilder::class, 'forUpdate')) { - $query->forUpdate(); + $query->forUpdate(ConflictResolutionMode::SKIP_LOCKED); try { $sql = $query->getSQL(); } catch (DBALException $e) { + // If SKIP_LOCKED is not supported, fallback to without SKIP_LOCKED + $query->forUpdate(); + + try { + $sql = $query->getSQL(); + } catch (DBALException $e) { + } } } elseif (preg_match('/FROM (.+) WHERE/', (string) $sql, $matches)) { $fromClause = $matches[1]; @@ -281,7 +289,7 @@ public function setup(): void { $configuration = $this->driverConnection->getConfiguration(); $assetFilter = $configuration->getSchemaAssetsFilter(); - $configuration->setSchemaAssetsFilter(static fn () => true); + $configuration->setSchemaAssetsFilter(fn (string $tableName) => $tableName === $this->configuration['table_name']); $this->updateSchema(); $configuration->setSchemaAssetsFilter($assetFilter); $this->autoSetup = false; diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineReceiver.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineReceiver.php index 2f6e4a5a823ad..20bd61151c44e 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineReceiver.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineReceiver.php @@ -67,20 +67,16 @@ public function get(): iterable public function ack(Envelope $envelope): void { - try { + $this->withRetryableExceptionRetry(function() use ($envelope) { $this->connection->ack($this->findDoctrineReceivedStamp($envelope)->getId()); - } catch (DBALException $exception) { - throw new TransportException($exception->getMessage(), 0, $exception); - } + }); } public function reject(Envelope $envelope): void { - try { + $this->withRetryableExceptionRetry(function() use ($envelope) { $this->connection->reject($this->findDoctrineReceivedStamp($envelope)->getId()); - } catch (DBALException $exception) { - throw new TransportException($exception->getMessage(), 0, $exception); - } + }); } public function getMessageCount(): int @@ -150,4 +146,32 @@ private function createEnvelopeFromData(array $data): Envelope new TransportMessageIdStamp($data['id']) ); } + + private function withRetryableExceptionRetry(callable $callable): void + { + $delay = 100; + $multiplier = 2; + $jitter = 0.1; + $retries = 0; + + retry: + try { + $callable(); + } catch (RetryableException $exception) { + if (++$retries <= self::MAX_RETRIES) { + $delay *= $multiplier; + + $randomness = (int) ($delay * $jitter); + $delay += random_int(-$randomness, +$randomness); + + usleep($delay * 1000); + + goto retry; + } + + throw new TransportException($exception->getMessage(), 0, $exception); + } catch (DBALException $exception) { + throw new TransportException($exception->getMessage(), 0, $exception); + } + } } diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/.gitattributes b/src/Symfony/Component/Messenger/Bridge/Redis/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/.gitattributes +++ b/src/Symfony/Component/Messenger/Bridge/Redis/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Messenger/Bridge/Redis/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Messenger/Bridge/Redis/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Messenger/Bridge/Redis/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Messenger/Bridge/Redis/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php index 6fb7f2f5f3cf8..46401a66d6ca0 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php @@ -88,6 +88,22 @@ public function __construct(array $options, \Redis|Relay|\RedisCluster|null $red throw new InvalidArgumentException('Cannot configure Redis Sentinel and Redis Cluster instance at the same time.'); } + $booleanStreamOptions = [ + 'allow_self_signed', + 'capture_peer_cert', + 'capture_peer_cert_chain', + 'disable_compression', + 'SNI_enabled', + 'verify_peer', + 'verify_peer_name', + ]; + + foreach ($options['ssl'] ?? [] as $streamOption => $value) { + if (\in_array($streamOption, $booleanStreamOptions, true) && \is_string($value)) { + $options['ssl'][$streamOption] = filter_var($value, \FILTER_VALIDATE_BOOL); + } + } + if ((\is_array($host) && null === $sentinelMaster) || $redis instanceof \RedisCluster) { $hosts = \is_string($host) ? [$host.':'.$port] : $host; // Always ensure we have an array $this->redis = static fn () => self::initializeRedisCluster($redis, $hosts, $auth, $options); @@ -330,7 +346,7 @@ private function claimOldPendingMessages(): void try { // This could soon be optimized with https://github.com/antirez/redis/issues/5212 or // https://github.com/antirez/redis/issues/6256 - $pendingMessages = $this->getRedis()->xpending($this->stream, $this->group, '-', '+', 1); + $pendingMessages = $this->getRedis()->xpending($this->stream, $this->group, '-', '+', 1) ?: []; } catch (\RedisException|\Relay\Exception $e) { throw new TransportException($e->getMessage(), 0, $e); } diff --git a/src/Symfony/Component/Messenger/Handler/HandlerDescriptor.php b/src/Symfony/Component/Messenger/Handler/HandlerDescriptor.php index 9dab4ada4327e..5a10dbc676a0f 100644 --- a/src/Symfony/Component/Messenger/Handler/HandlerDescriptor.php +++ b/src/Symfony/Component/Messenger/Handler/HandlerDescriptor.php @@ -32,7 +32,7 @@ public function __construct(callable $handler, array $options = []) $r = new \ReflectionFunction($handler); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { $this->name = 'Closure'; } elseif (!$handler = $r->getClosureThis()) { $class = $r->getClosureCalledClass(); diff --git a/src/Symfony/Component/Mime/.gitattributes b/src/Symfony/Component/Mime/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Mime/.gitattributes +++ b/src/Symfony/Component/Mime/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Mime/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Mime/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Mime/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Mime/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Mime/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Mime/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Mime/Tests/Part/DataPartTest.php b/src/Symfony/Component/Mime/Tests/Part/DataPartTest.php index ffddcbca70c38..70ab2d7c30a8c 100644 --- a/src/Symfony/Component/Mime/Tests/Part/DataPartTest.php +++ b/src/Symfony/Component/Mime/Tests/Part/DataPartTest.php @@ -138,32 +138,35 @@ public function testFromPathWithNotAFile() public function testFromPathWithUrl() { - if (!\in_array('https', stream_get_wrappers())) { - $this->markTestSkipped('"https" stream wrapper is not enabled.'); + if (!\in_array('http', stream_get_wrappers())) { + $this->markTestSkipped('"http" stream wrapper is not enabled.'); } $finder = new PhpExecutableFinder(); - $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', '127.0.0.1:8057'])); + $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8057'])); $process->setWorkingDirectory(__DIR__.'/../Fixtures/web'); $process->start(); - do { - usleep(50000); - } while (!@fopen('http://127.0.0.1:8057', 'r')); - - $p = DataPart::fromPath($file = 'http://localhost:8057/logo_symfony_header.png'); - $content = file_get_contents($file); - $this->assertEquals($content, $p->getBody()); - $maxLineLength = 76; - $this->assertEquals(substr(base64_encode($content), 0, $maxLineLength), substr($p->bodyToString(), 0, $maxLineLength)); - $this->assertEquals(substr(base64_encode($content), 0, $maxLineLength), substr(implode('', iterator_to_array($p->bodyToIterable())), 0, $maxLineLength)); - $this->assertEquals('image', $p->getMediaType()); - $this->assertEquals('png', $p->getMediaSubType()); - $this->assertEquals(new Headers( - new ParameterizedHeader('Content-Type', 'image/png', ['name' => 'logo_symfony_header.png']), - new UnstructuredHeader('Content-Transfer-Encoding', 'base64'), - new ParameterizedHeader('Content-Disposition', 'attachment', ['name' => 'logo_symfony_header.png', 'filename' => 'logo_symfony_header.png']) - ), $p->getPreparedHeaders()); + try { + do { + usleep(50000); + } while (!@fopen('http://localhost:8057', 'r')); + $p = DataPart::fromPath($file = 'http://localhost:8057/logo_symfony_header.png'); + $content = file_get_contents($file); + $this->assertEquals($content, $p->getBody()); + $maxLineLength = 76; + $this->assertEquals(substr(base64_encode($content), 0, $maxLineLength), substr($p->bodyToString(), 0, $maxLineLength)); + $this->assertEquals(substr(base64_encode($content), 0, $maxLineLength), substr(implode('', iterator_to_array($p->bodyToIterable())), 0, $maxLineLength)); + $this->assertEquals('image', $p->getMediaType()); + $this->assertEquals('png', $p->getMediaSubType()); + $this->assertEquals(new Headers( + new ParameterizedHeader('Content-Type', 'image/png', ['name' => 'logo_symfony_header.png']), + new UnstructuredHeader('Content-Transfer-Encoding', 'base64'), + new ParameterizedHeader('Content-Disposition', 'attachment', ['name' => 'logo_symfony_header.png', 'filename' => 'logo_symfony_header.png']) + ), $p->getPreparedHeaders()); + } finally { + $process->stop(); + } } public function testHasContentId() diff --git a/src/Symfony/Component/Notifier/.gitattributes b/src/Symfony/Component/Notifier/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/.gitattributes +++ b/src/Symfony/Component/Notifier/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/AllMySms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/AllMySms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/AllMySms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/AllMySms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/AllMySms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/AmazonSns/.gitattributes b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/AmazonSns/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/AmazonSns/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Bandwidth/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Bandwidth/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Bandwidth/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Brevo/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Brevo/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Brevo/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Brevo/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Brevo/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Brevo/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Brevo/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Brevo/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Brevo/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Brevo/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Chatwork/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Chatwork/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Chatwork/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Chatwork/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Chatwork/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/ClickSend/.gitattributes b/src/Symfony/Component/Notifier/Bridge/ClickSend/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/ClickSend/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/ClickSend/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/ClickSend/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Clickatell/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Clickatell/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Clickatell/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Clickatell/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Clickatell/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.gitattributes b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/ContactEveryone/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Discord/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Discord/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Discord/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Discord/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Discord/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Discord/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Discord/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Engagespot/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Engagespot/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Engagespot/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Engagespot/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Engagespot/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Esendex/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Esendex/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Esendex/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Esendex/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Esendex/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Esendex/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Esendex/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Esendex/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Esendex/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Esendex/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Expo/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Expo/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Expo/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Expo/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Expo/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Expo/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Expo/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Expo/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Expo/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Expo/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/FakeChat/.gitattributes b/src/Symfony/Component/Notifier/Bridge/FakeChat/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/FakeChat/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/FakeChat/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FakeChat/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/FakeSms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/FakeSms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/FakeSms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/FakeSms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FakeSms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Firebase/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Firebase/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Firebase/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Firebase/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Firebase/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Firebase/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Firebase/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Firebase/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Firebase/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Firebase/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/FortySixElks/.gitattributes b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/FortySixElks/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FortySixElks/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/FreeMobile/.gitattributes b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/FreeMobile/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/FreeMobile/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/.gitattributes b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/GatewayApi/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Gitter/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Gitter/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Gitter/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Gitter/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Gitter/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Gitter/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Gitter/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Gitter/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Gitter/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Gitter/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/GoIp/.gitattributes b/src/Symfony/Component/Notifier/Bridge/GoIp/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/GoIp/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/GoIp/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/GoIp/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/GoIp/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GoIp/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/GoIp/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/GoIp/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GoIp/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/GoogleChat/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Infobip/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Infobip/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Infobip/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Infobip/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Infobip/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Infobip/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Infobip/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Iqsms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Iqsms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Iqsms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Iqsms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Iqsms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Isendpro/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Isendpro/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Isendpro/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Isendpro/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Isendpro/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.gitattributes b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/LightSms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/LightSms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/LightSms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/LightSms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/LightSms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/LightSms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LightSms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/LightSms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/LightSms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LightSms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/LineNotify/.gitattributes b/src/Symfony/Component/Notifier/Bridge/LineNotify/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/LineNotify/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/LineNotify/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LineNotify/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/LinkedIn/.gitattributes b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/LinkedIn/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/LinkedIn/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Mailjet/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mailjet/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mailjet/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mailjet/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mailjet/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Mastodon/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mastodon/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mastodon/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mastodon/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mastodon/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Mattermost/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mattermost/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mattermost/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mattermost/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mattermost/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Mercure/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mercure/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mercure/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mercure/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Mercure/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Mercure/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mercure/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Mercure/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Mercure/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mercure/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/MessageBird/.gitattributes b/src/Symfony/Component/Notifier/Bridge/MessageBird/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/MessageBird/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/MessageBird/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MessageBird/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/MessageMedia/.gitattributes b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/MessageMedia/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MessageMedia/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.gitattributes b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Mobyt/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Mobyt/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Novu/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Novu/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Novu/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Novu/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Novu/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Novu/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Novu/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Novu/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Novu/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Novu/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Ntfy/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Ntfy/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Ntfy/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Ntfy/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Ntfy/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Octopush/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Octopush/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Octopush/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Octopush/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Octopush/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Octopush/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Octopush/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Octopush/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Octopush/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Octopush/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/OneSignal/.gitattributes b/src/Symfony/Component/Notifier/Bridge/OneSignal/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/OneSignal/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/OneSignal/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OneSignal/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/OrangeSms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/OrangeSms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OrangeSms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/OvhCloud/.gitattributes b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/OvhCloud/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/OvhCloud/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/PagerDuty/.gitattributes b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/PagerDuty/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/PagerDuty/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Plivo/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Plivo/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Plivo/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Plivo/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Plivo/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Plivo/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Plivo/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Plivo/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Plivo/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Plivo/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Pushover/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Pushover/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Pushover/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Pushover/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Pushover/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Pushover/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Pushover/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Pushover/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Pushover/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Pushover/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Redlink/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Redlink/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Redlink/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Redlink/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Redlink/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Redlink/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Redlink/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Redlink/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Redlink/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Redlink/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/RingCentral/.gitattributes b/src/Symfony/Component/Notifier/Bridge/RingCentral/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/RingCentral/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/RingCentral/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/RingCentral/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/RocketChat/.gitattributes b/src/Symfony/Component/Notifier/Bridge/RocketChat/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/RocketChat/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/RocketChat/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/RocketChat/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Sendberry/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Sendberry/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Sendberry/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Sendberry/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sendberry/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.gitattributes b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SimpleTextin/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Sinch/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Sinch/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Sinch/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Sinch/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Sinch/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Sinch/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sinch/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Sinch/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Sinch/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sinch/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Slack/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Slack/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Slack/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Slack/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Slack/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Slack/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Slack/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Slack/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Slack/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Slack/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Sms77/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Sms77/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Sms77/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Sms77/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Sms77/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Sms77/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sms77/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Sms77/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Sms77/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Sms77/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.gitattributes b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SmsBiuras/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/SmsFactor/.gitattributes b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/SmsFactor/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SmsFactor/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Smsapi/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsapi/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Smsc/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Smsc/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Smsc/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Smsc/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Smsc/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Smsc/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsc/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Smsc/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Smsc/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsc/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Smsmode/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Smsmode/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Smsmode/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Smsmode/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Smsmode/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/SpotHit/.gitattributes b/src/Symfony/Component/Notifier/Bridge/SpotHit/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/SpotHit/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/SpotHit/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/SpotHit/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Telegram/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Telegram/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Telegram/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Telegram/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Telegram/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Telegram/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Telegram/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Telegram/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Telegram/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Telegram/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Telnyx/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Telnyx/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Telnyx/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Telnyx/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Telnyx/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Termii/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Termii/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Termii/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Termii/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Termii/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Termii/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Termii/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Termii/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Termii/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Termii/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/TurboSms/.gitattributes b/src/Symfony/Component/Notifier/Bridge/TurboSms/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/TurboSms/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/TurboSms/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/TurboSms/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Twilio/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Twilio/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Twilio/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Twilio/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Twilio/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Twilio/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Twilio/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Twilio/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Twilio/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Twilio/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Twitter/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Twitter/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Twitter/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Twitter/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Twitter/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Twitter/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Twitter/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Twitter/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Twitter/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Twitter/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Vonage/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Vonage/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Vonage/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Vonage/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Vonage/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Vonage/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Vonage/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Vonage/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Vonage/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Vonage/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Yunpian/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Yunpian/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Yunpian/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Yunpian/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Yunpian/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Zendesk/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Zendesk/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Zendesk/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Zendesk/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Zendesk/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes b/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes +++ b/src/Symfony/Component/Notifier/Bridge/Zulip/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Notifier/Bridge/Zulip/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Notifier/Bridge/Zulip/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Zulip/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Notifier/Bridge/Zulip/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Notifier/Bridge/Zulip/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Notifier/Bridge/Zulip/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/OptionsResolver/.gitattributes b/src/Symfony/Component/OptionsResolver/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/OptionsResolver/.gitattributes +++ b/src/Symfony/Component/OptionsResolver/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/OptionsResolver/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/OptionsResolver/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/OptionsResolver/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/OptionsResolver/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/OptionsResolver/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/OptionsResolver/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/PasswordHasher/.gitattributes b/src/Symfony/Component/PasswordHasher/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/PasswordHasher/.gitattributes +++ b/src/Symfony/Component/PasswordHasher/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/PasswordHasher/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/PasswordHasher/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/PasswordHasher/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/PasswordHasher/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/PasswordHasher/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/PasswordHasher/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php index 5dc301916eed3..4cf708b806296 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php @@ -103,7 +103,11 @@ public function testBcryptWithNulByte() $hasher = new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT); $plainPassword = "a\0b"; - $this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword)); + if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) { + // password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5 + $this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword)); + } + $this->assertTrue($hasher->verify($hasher->hash($plainPassword), $plainPassword)); } diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php index 3dc97c768f6f1..101c09fc46ed3 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php @@ -78,7 +78,11 @@ public function testBcryptWithNulByte() $hasher = new SodiumPasswordHasher(null, null); $plainPassword = "a\0b"; - $this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword)); + if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) { + // password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5 + $this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword)); + } + $this->assertTrue($hasher->verify((new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT))->hash($plainPassword), $plainPassword)); } diff --git a/src/Symfony/Component/Process/.gitattributes b/src/Symfony/Component/Process/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Process/.gitattributes +++ b/src/Symfony/Component/Process/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Process/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Process/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Process/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Process/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Process/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Process/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/PropertyAccess/.gitattributes b/src/Symfony/Component/PropertyAccess/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/PropertyAccess/.gitattributes +++ b/src/Symfony/Component/PropertyAccess/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/PropertyAccess/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/PropertyAccess/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/PropertyAccess/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/PropertyAccess/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/PropertyAccess/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/PropertyAccess/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php index 070d3b3934cf1..21c36c5e6dbdb 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php +++ b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php @@ -40,7 +40,7 @@ public function __get(string $property) } } - public function __isset(string $property) + public function __isset(string $property): bool { return \in_array($property, ['magicProperty', 'constantMagicProperty'], true); } diff --git a/src/Symfony/Component/PropertyInfo/.gitattributes b/src/Symfony/Component/PropertyInfo/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/PropertyInfo/.gitattributes +++ b/src/Symfony/Component/PropertyInfo/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/PropertyInfo/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/PropertyInfo/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/PropertyInfo/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/PropertyInfo/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/PropertyInfo/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/PropertyInfo/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php index 5762e58e32971..44888a6875229 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php @@ -232,6 +232,14 @@ private function getDocBlockFromProperty(string $class, string $property): ?arra return null; } + $reflector = $reflectionProperty->getDeclaringClass(); + + foreach ($reflector->getTraits() as $trait) { + if ($trait->hasProperty($property)) { + return $this->getDocBlockFromProperty($trait->getName(), $property); + } + } + // Type can be inside property docblock as `@var` $rawDocNode = $reflectionProperty->getDocComment(); $phpDocNode = $rawDocNode ? $this->getPhpDocNode($rawDocNode) : null; diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php index d81c44685e5fb..74ef738ab2dde 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php @@ -21,6 +21,7 @@ use Symfony\Component\PropertyInfo\Tests\Fixtures\Php80Dummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\Php80PromotedDummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\RootDummy\RootDummyItem; +use Symfony\Component\PropertyInfo\Tests\Fixtures\TraitUsage\AnotherNamespace\DummyInAnotherNamespace; use Symfony\Component\PropertyInfo\Tests\Fixtures\TraitUsage\DummyUsedInTrait; use Symfony\Component\PropertyInfo\Tests\Fixtures\TraitUsage\DummyUsingTrait; use Symfony\Component\PropertyInfo\Type; @@ -306,6 +307,7 @@ public static function propertiesDefinedByTraitsProvider(): array ['propertyInTraitPrimitiveType', new Type(Type::BUILTIN_TYPE_STRING)], ['propertyInTraitObjectSameNamespace', new Type(Type::BUILTIN_TYPE_OBJECT, false, DummyUsedInTrait::class)], ['propertyInTraitObjectDifferentNamespace', new Type(Type::BUILTIN_TYPE_OBJECT, false, Dummy::class)], + ['dummyInAnotherNamespace', new Type(Type::BUILTIN_TYPE_OBJECT, false, DummyInAnotherNamespace::class)], ]; } diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/TraitUsage/AnotherNamespace/DummyInAnotherNamespace.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/TraitUsage/AnotherNamespace/DummyInAnotherNamespace.php new file mode 100644 index 0000000000000..5ae6b60b59731 --- /dev/null +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/TraitUsage/AnotherNamespace/DummyInAnotherNamespace.php @@ -0,0 +1,7 @@ + Authentication credentials could not be found. - Loginoplysninger kan ikke findes. + Loginoplysninger kunne ikke findes. Authentication request could not be processed due to a system problem. - Godkendelsesanmodning kan ikke behandles på grund af et systemfejl. + Godkendelsesanmodningen kunne ikke behandles på grund af en systemfejl. Invalid credentials. @@ -20,7 +20,7 @@ Cookie has already been used by someone else. - Cookie er allerede brugt af en anden. + Cookie er allerede blevet brugt af en anden. Not privileged to request the resource. @@ -32,19 +32,19 @@ No authentication provider found to support the authentication token. - Ingen godkendelsesudbyder er fundet til understøttelsen af godkendelsestoken. + Ingen godkendelsesudbyder blev fundet til at understøtte godkendelsestoken. No session available, it either timed out or cookies are not enabled. - Ingen session tilgængelig, sessionen er enten udløbet eller cookies er ikke aktiveret. + Ingen session er tilgængelig. Den er enten udløbet eller cookies er ikke aktiveret. No token could be found. - Ingen token kan findes. + Ingen token kunne findes. Username could not be found. - Brugernavn kan ikke findes. + Brugernavn kunne ikke findes. Account has expired. @@ -64,15 +64,15 @@ Too many failed login attempts, please try again later. - For mange fejlede login forsøg, prøv venligst senere. + For mange mislykkede loginforsøg. Prøv venligst igen senere. Invalid or expired login link. - Ugyldigt eller udløbet login link. + Ugyldigt eller udløbet login-link. Too many failed login attempts, please try again in %minutes% minute. - For mange fejlede login forsøg, prøv igen om %minutes% minut. + For mange mislykkede loginforsøg. Prøv venligst igen om %minutes% minut. diff --git a/src/Symfony/Component/Security/Csrf/.gitattributes b/src/Symfony/Component/Security/Csrf/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Security/Csrf/.gitattributes +++ b/src/Symfony/Component/Security/Csrf/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Security/Csrf/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Security/Csrf/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Security/Csrf/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Security/Csrf/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Security/Csrf/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Security/Csrf/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Security/Http/.gitattributes b/src/Symfony/Component/Security/Http/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Security/Http/.gitattributes +++ b/src/Symfony/Component/Security/Http/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Security/Http/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Security/Http/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Security/Http/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Security/Http/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Security/Http/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Security/Http/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Security/Http/AccessToken/HeaderAccessTokenExtractor.php b/src/Symfony/Component/Security/Http/AccessToken/HeaderAccessTokenExtractor.php index 487b87c24633d..0903d178babc3 100644 --- a/src/Symfony/Component/Security/Http/AccessToken/HeaderAccessTokenExtractor.php +++ b/src/Symfony/Component/Security/Http/AccessToken/HeaderAccessTokenExtractor.php @@ -29,7 +29,7 @@ public function __construct( private readonly string $tokenType = 'Bearer' ) { $this->regex = sprintf( - '/^%s([a-zA-Z0-9\-_\+~\/\.]+)$/', + '/^%s([a-zA-Z0-9\-_\+~\/\.]+=*)$/', '' === $this->tokenType ? '' : preg_quote($this->tokenType).'\s+' ); } diff --git a/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php b/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php index 08c265e67129b..c475880b83ff2 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php +++ b/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php @@ -135,6 +135,10 @@ private function getCredentials(Request $request): array throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['password_parameter'], \gettype($credentials['password']))); } + if (!\is_string($credentials['csrf_token'] ?? '') && (!\is_object($credentials['csrf_token']) || !method_exists($credentials['csrf_token'], '__toString'))) { + throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['csrf_parameter'], \gettype($credentials['csrf_token']))); + } + return $credentials; } diff --git a/src/Symfony/Component/Security/Http/Tests/Authenticator/AccessTokenAuthenticatorTest.php b/src/Symfony/Component/Security/Http/Tests/Authenticator/AccessTokenAuthenticatorTest.php index 4f010000429dd..5ee4869b431ae 100644 --- a/src/Symfony/Component/Security/Http/Tests/Authenticator/AccessTokenAuthenticatorTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Authenticator/AccessTokenAuthenticatorTest.php @@ -18,6 +18,7 @@ use Symfony\Component\Security\Core\User\InMemoryUserProvider; use Symfony\Component\Security\Http\AccessToken\AccessTokenExtractorInterface; use Symfony\Component\Security\Http\AccessToken\AccessTokenHandlerInterface; +use Symfony\Component\Security\Http\AccessToken\HeaderAccessTokenExtractor; use Symfony\Component\Security\Http\Authenticator\AccessTokenAuthenticator; use Symfony\Component\Security\Http\Authenticator\FallbackUserLoader; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; @@ -159,4 +160,31 @@ public function testAuthenticateWithFallbackUserLoader() $this->assertEquals('test', $passport->getUser()->getUserIdentifier()); } + + /** + * @dataProvider provideAccessTokenHeaderRegex + */ + public function testAccessTokenHeaderRegex(string $input, ?string $expectedToken) + { + // Given + $extractor = new HeaderAccessTokenExtractor(); + $request = Request::create('/test', 'GET', [], [], [], ['HTTP_AUTHORIZATION' => $input]); + + // When + $token = $extractor->extractAccessToken($request); + + // Then + $this->assertEquals($expectedToken, $token); + } + + public function provideAccessTokenHeaderRegex(): array + { + return [ + ['Bearer token', 'token'], + ['Bearer mF_9.B5f-4.1JqM', 'mF_9.B5f-4.1JqM'], + ['Bearer d3JvbmdfcmVnZXhwX2V4bWFwbGU=', 'd3JvbmdfcmVnZXhwX2V4bWFwbGU='], + ['Bearer Not Valid', null], + ['Bearer (NotOK123)', null], + ]; + } } diff --git a/src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php b/src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php index b0b44d94ea73b..83c355d91c6ed 100644 --- a/src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php @@ -165,6 +165,54 @@ public function __toString() $this->assertSame('s$cr$t', $credentialsBadge->getPassword()); } + /** + * @dataProvider postOnlyDataProvider + */ + public function testHandleNonStringCsrfTokenWithArray($postOnly) + { + $request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => []]); + $request->setSession($this->createSession()); + + $this->setUpAuthenticator(['post_only' => $postOnly]); + + $this->expectException(BadRequestHttpException::class); + $this->expectExceptionMessage('The key "_csrf_token" must be a string, "array" given.'); + + $this->authenticator->authenticate($request); + } + + /** + * @dataProvider postOnlyDataProvider + */ + public function testHandleNonStringCsrfTokenWithInt($postOnly) + { + $request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => 42]); + $request->setSession($this->createSession()); + + $this->setUpAuthenticator(['post_only' => $postOnly]); + + $this->expectException(BadRequestHttpException::class); + $this->expectExceptionMessage('The key "_csrf_token" must be a string, "integer" given.'); + + $this->authenticator->authenticate($request); + } + + /** + * @dataProvider postOnlyDataProvider + */ + public function testHandleNonStringCsrfTokenWithObject($postOnly) + { + $request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => new \stdClass()]); + $request->setSession($this->createSession()); + + $this->setUpAuthenticator(['post_only' => $postOnly]); + + $this->expectException(BadRequestHttpException::class); + $this->expectExceptionMessage('The key "_csrf_token" must be a string, "object" given.'); + + $this->authenticator->authenticate($request); + } + public static function postOnlyDataProvider() { yield [true]; diff --git a/src/Symfony/Component/Semaphore/.gitattributes b/src/Symfony/Component/Semaphore/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Semaphore/.gitattributes +++ b/src/Symfony/Component/Semaphore/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Semaphore/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Semaphore/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Semaphore/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Semaphore/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Semaphore/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Semaphore/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Serializer/.gitattributes b/src/Symfony/Component/Serializer/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Serializer/.gitattributes +++ b/src/Symfony/Component/Serializer/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Serializer/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Serializer/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Serializer/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Serializer/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Serializer/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Serializer/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php b/src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php index ecb328dd651f4..f365ac8df2d70 100644 --- a/src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php +++ b/src/Symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php @@ -104,17 +104,25 @@ public function withAllowExtraAttributes(?bool $allowExtraAttributes): static } /** - * Configures an hashmap of classes containing hashmaps of constructor argument => default value. + * Configures a hashmap of classes containing hashmaps of constructor argument => default value. * * The names need to match the parameter names in the constructor arguments. * * Eg: [Foo::class => ['foo' => true, 'bar' => 0]] * - * @param array>|null $defaultContructorArguments + * @param array>|null $defaultConstructorArguments + */ + public function withDefaultConstructorArguments(?array $defaultConstructorArguments): static + { + return $this->with(AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS, $defaultConstructorArguments); + } + + /** + * Deprecated in Symfony 7.1, use withDefaultConstructorArguments() instead. */ public function withDefaultContructorArguments(?array $defaultContructorArguments): static { - return $this->with(AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS, $defaultContructorArguments); + return self::withDefaultConstructorArguments($defaultContructorArguments); } /** diff --git a/src/Symfony/Component/Serializer/Mapping/Loader/AttributeLoader.php b/src/Symfony/Component/Serializer/Mapping/Loader/AttributeLoader.php index 7643d9a561923..ddb4671641c42 100644 --- a/src/Symfony/Component/Serializer/Mapping/Loader/AttributeLoader.php +++ b/src/Symfony/Component/Serializer/Mapping/Loader/AttributeLoader.php @@ -125,7 +125,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool $accessorOrMutator = preg_match('/^(get|is|has|set)(.+)$/i', $method->name, $matches); if ($accessorOrMutator) { - $attributeName = $reflectionClass->hasProperty($method->name) ? $method->name : lcfirst($matches[2]); + $attributeName = lcfirst($matches[2]); if (isset($attributesMetadata[$attributeName])) { $attributeMetadata = $attributesMetadata[$attributeName]; @@ -163,11 +163,9 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool $attributeMetadata->setSerializedPath($annotation->getSerializedPath()); } elseif ($annotation instanceof Ignore) { - if (!$accessorOrMutator) { - throw new MappingException(sprintf('Ignore on "%s::%s()" cannot be added. Ignore can only be added on methods beginning with "get", "is", "has" or "set".', $className, $method->name)); + if ($accessorOrMutator) { + $attributeMetadata->setIgnore(true); } - - $attributeMetadata->setIgnore(true); } elseif ($annotation instanceof Context) { if (!$accessorOrMutator) { throw new MappingException(sprintf('Context on "%s::%s()" cannot be added. Context can only be added on methods beginning with "get", "is", "has" or "set".', $className, $method->name)); diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index 3d5e24adb47aa..9400616bddcd2 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -142,6 +142,8 @@ public function supportsNormalization(mixed $data, ?string $format = null, array public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { + $context['_read_attributes'] = true; + if (!isset($context['cache_key'])) { $context['cache_key'] = $this->getCacheKey($format, $context); } @@ -283,6 +285,8 @@ public function supportsDenormalization(mixed $data, string $type, ?string $form public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { + $context['_read_attributes'] = false; + if (!isset($context['cache_key'])) { $context['cache_key'] = $this->getCacheKey($format, $context); } @@ -293,6 +297,10 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a return null; } + if (XmlEncoder::FORMAT === $format && !\is_array($data)) { + $data = ['#' => $data]; + } + $allowedAttributes = $this->getAllowedAttributes($type, $context, true); $normalizedData = $this->prepareForDenormalization($data); $extraAttributes = []; @@ -676,7 +684,7 @@ private function updateData(array $data, string $attribute, mixed $attributeValu private function isMaxDepthReached(array $attributesMetadata, string $class, string $attribute, array &$context): bool { if (!($enableMaxDepth = $context[self::ENABLE_MAX_DEPTH] ?? $this->defaultContext[self::ENABLE_MAX_DEPTH] ?? false) - || null === $maxDepth = $attributesMetadata[$attribute]?->getMaxDepth() + || !isset($attributesMetadata[$attribute]) || null === $maxDepth = $attributesMetadata[$attribute]?->getMaxDepth() ) { return false; } diff --git a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php index e050bc153c906..33ca1effc6ef3 100644 --- a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php @@ -37,6 +37,7 @@ */ final class GetSetMethodNormalizer extends AbstractObjectNormalizer { + private static $reflectionCache = []; private static array $setterAccessibleCache = []; public function getSupportedTypes(?string $format): array @@ -46,27 +47,31 @@ public function getSupportedTypes(?string $format): array public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return parent::supportsNormalization($data, $format) && $this->supports($data::class); + return parent::supportsNormalization($data, $format) && $this->supports($data::class, true); } public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return parent::supportsDenormalization($data, $type, $format) && $this->supports($type); + return parent::supportsDenormalization($data, $type, $format) && $this->supports($type, false); } /** - * Checks if the given class has any getter method. + * Checks if the given class has any getter or setter method. */ - private function supports(string $class): bool + private function supports(string $class, bool $readAttributes): bool { if ($this->classDiscriminatorResolver?->getMappingForClass($class)) { return true; } - $class = new \ReflectionClass($class); - $methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC); - foreach ($methods as $method) { - if ($this->isGetMethod($method)) { + if (!isset(self::$reflectionCache[$class])) { + self::$reflectionCache[$class] = new \ReflectionClass($class); + } + + $reflection = self::$reflectionCache[$class]; + + foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) { + if ($readAttributes ? $this->isGetMethod($reflectionMethod) : $this->isSetMethod($reflectionMethod)) { return true; } } @@ -87,6 +92,17 @@ private function isGetMethod(\ReflectionMethod $method): bool ); } + /** + * Checks if a method's name matches /^set.+$/ and can be called non-statically with one parameter. + */ + private function isSetMethod(\ReflectionMethod $method): bool + { + return !$method->isStatic() + && !$method->getAttributes(Ignore::class) + && 1 === $method->getNumberOfRequiredParameters() + && str_starts_with($method->name, 'set'); + } + protected function extractAttributes(object $object, ?string $format = null, array $context = []): array { $reflectionObject = new \ReflectionObject($object); @@ -110,19 +126,17 @@ protected function extractAttributes(object $object, ?string $format = null, arr protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []): mixed { - $ucfirsted = ucfirst($attribute); - - $getter = 'get'.$ucfirsted; + $getter = 'get'.$attribute; if (method_exists($object, $getter) && \is_callable([$object, $getter])) { return $object->$getter(); } - $isser = 'is'.$ucfirsted; + $isser = 'is'.$attribute; if (method_exists($object, $isser) && \is_callable([$object, $isser])) { return $object->$isser(); } - $haser = 'has'.$ucfirsted; + $haser = 'has'.$attribute; if (method_exists($object, $haser) && \is_callable([$object, $haser])) { return $object->$haser(); } @@ -132,7 +146,7 @@ protected function getAttributeValue(object $object, string $attribute, ?string protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []): void { - $setter = 'set'.ucfirst($attribute); + $setter = 'set'.$attribute; $key = $object::class.':'.$setter; if (!isset(self::$setterAccessibleCache[$key])) { @@ -143,4 +157,48 @@ protected function setAttributeValue(object $object, string $attribute, mixed $v $object->$setter($value); } } + + protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []): bool + { + if (!parent::isAllowedAttribute($classOrObject, $attribute, $format, $context)) { + return false; + } + + $class = \is_object($classOrObject) ? \get_class($classOrObject) : $classOrObject; + + if (!isset(self::$reflectionCache[$class])) { + self::$reflectionCache[$class] = new \ReflectionClass($class); + } + + $reflection = self::$reflectionCache[$class]; + + if ($context['_read_attributes'] ?? true) { + foreach (['get', 'is', 'has'] as $getterPrefix) { + $getter = $getterPrefix.$attribute; + $reflectionMethod = $reflection->hasMethod($getter) ? $reflection->getMethod($getter) : null; + if ($reflectionMethod && $this->isGetMethod($reflectionMethod)) { + return true; + } + } + + return false; + } + + $setter = 'set'.$attribute; + if ($reflection->hasMethod($setter) && $this->isSetMethod($reflection->getMethod($setter))) { + return true; + } + + $constructor = $reflection->getConstructor(); + + if ($constructor && $constructor->isPublic()) { + foreach ($constructor->getParameters() as $parameter) { + if ($parameter->getName() === $attribute) { + return true; + } + } + } + + return false; + } } diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php index 083d3dd3f7999..5aff910d62dec 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php @@ -14,7 +14,11 @@ use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; +use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; +use Symfony\Component\PropertyInfo\PropertyWriteInfo; +use Symfony\Component\Serializer\Annotation\Ignore; use Symfony\Component\Serializer\Exception\LogicException; use Symfony\Component\Serializer\Mapping\AttributeMetadata; use Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface; @@ -28,11 +32,14 @@ */ final class ObjectNormalizer extends AbstractObjectNormalizer { + private static $reflectionCache = []; + protected PropertyAccessorInterface $propertyAccessor; + protected $propertyInfoExtractor; private readonly \Closure $objectClassResolver; - public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory = null, ?NameConverterInterface $nameConverter = null, ?PropertyAccessorInterface $propertyAccessor = null, ?PropertyTypeExtractorInterface $propertyTypeExtractor = null, ?ClassDiscriminatorResolverInterface $classDiscriminatorResolver = null, ?callable $objectClassResolver = null, array $defaultContext = []) + public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory = null, ?NameConverterInterface $nameConverter = null, ?PropertyAccessorInterface $propertyAccessor = null, ?PropertyTypeExtractorInterface $propertyTypeExtractor = null, ?ClassDiscriminatorResolverInterface $classDiscriminatorResolver = null, ?callable $objectClassResolver = null, array $defaultContext = [], ?PropertyInfoExtractorInterface $propertyInfoExtractor = null) { if (!class_exists(PropertyAccess::class)) { throw new LogicException('The ObjectNormalizer class requires the "PropertyAccess" component. Try running "composer require symfony/property-access".'); @@ -43,6 +50,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor(); $this->objectClassResolver = ($objectClassResolver ?? static fn ($class) => \is_object($class) ? $class::class : $class)(...); + $this->propertyInfoExtractor = $propertyInfoExtractor ?: new ReflectionExtractor(); } public function getSupportedTypes(?string $format): array @@ -78,25 +86,17 @@ protected function extractAttributes(object $object, ?string $format = null, arr if (str_starts_with($name, 'get') || str_starts_with($name, 'has') || str_starts_with($name, 'can')) { // getters, hassers and canners - $attributeName = $name; + $attributeName = substr($name, 3); if (!$reflClass->hasProperty($attributeName)) { - $attributeName = substr($attributeName, 3); - - if (!$reflClass->hasProperty($attributeName)) { - $attributeName = lcfirst($attributeName); - } + $attributeName = lcfirst($attributeName); } } elseif (str_starts_with($name, 'is')) { // issers - $attributeName = $name; + $attributeName = substr($name, 2); if (!$reflClass->hasProperty($attributeName)) { - $attributeName = substr($attributeName, 2); - - if (!$reflClass->hasProperty($attributeName)) { - $attributeName = lcfirst($attributeName); - } + $attributeName = lcfirst($attributeName); } } @@ -162,4 +162,38 @@ protected function getAllowedAttributes(string|object $classOrObject, array $con return $allowedAttributes; } + + protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []): bool + { + if (!parent::isAllowedAttribute($classOrObject, $attribute, $format, $context)) { + return false; + } + $class = \is_object($classOrObject) ? \get_class($classOrObject) : $classOrObject; + + if ($context['_read_attributes'] ?? true) { + return $this->propertyInfoExtractor->isReadable($class, $attribute) || $this->hasAttributeAccessorMethod($class, $attribute); + } + + return $this->propertyInfoExtractor->isWritable($class, $attribute) + || ($writeInfo = $this->propertyInfoExtractor->getWriteInfo($class, $attribute)) && PropertyWriteInfo::TYPE_NONE !== $writeInfo->getType(); + } + + private function hasAttributeAccessorMethod(string $class, string $attribute): bool + { + if (!isset(self::$reflectionCache[$class])) { + self::$reflectionCache[$class] = new \ReflectionClass($class); + } + + $reflection = self::$reflectionCache[$class]; + + if (!$reflection->hasMethod($attribute)) { + return false; + } + + $method = $reflection->getMethod($attribute); + + return !$method->isStatic() + && !$method->getAttributes(Ignore::class) + && !$method->getNumberOfRequiredParameters(); + } } diff --git a/src/Symfony/Component/Serializer/SerializerAwareTrait.php b/src/Symfony/Component/Serializer/SerializerAwareTrait.php index e4ba0ecb9c225..495e5889ce818 100644 --- a/src/Symfony/Component/Serializer/SerializerAwareTrait.php +++ b/src/Symfony/Component/Serializer/SerializerAwareTrait.php @@ -16,7 +16,7 @@ */ trait SerializerAwareTrait { - protected SerializerInterface $serializer; + protected ?SerializerInterface $serializer = null; public function setSerializer(SerializerInterface $serializer): void { diff --git a/src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php b/src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php index 158fa8feacf7a..4b8f0cc3f7dc8 100644 --- a/src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Context/Normalizer/AbstractNormalizerContextBuilderTest.php @@ -41,7 +41,7 @@ public function testWithers(array $values) ->withGroups($values[AbstractNormalizer::GROUPS]) ->withAttributes($values[AbstractNormalizer::ATTRIBUTES]) ->withAllowExtraAttributes($values[AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES]) - ->withDefaultContructorArguments($values[AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS]) + ->withDefaultConstructorArguments($values[AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS]) ->withCallbacks($values[AbstractNormalizer::CALLBACKS]) ->withCircularReferenceHandler($values[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER]) ->withIgnoredAttributes($values[AbstractNormalizer::IGNORED_ATTRIBUTES]) diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodDummy.php b/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodDummy.php deleted file mode 100644 index 89c8fcb9c399c..0000000000000 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodDummy.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Serializer\Tests\Fixtures; - -class SamePropertyAsMethodDummy -{ - private $freeTrial; - private $hasSubscribe; - private $getReady; - private $isActive; - - public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) - { - $this->freeTrial = $freeTrial; - $this->hasSubscribe = $hasSubscribe; - $this->getReady = $getReady; - $this->isActive = $isActive; - } - - public function getFreeTrial() - { - return $this->freeTrial; - } - - public function hasSubscribe() - { - return $this->hasSubscribe; - } - - public function getReady() - { - return $this->getReady; - } - - public function isActive() - { - return $this->isActive; - } -} diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithMethodSerializedNameDummy.php b/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithMethodSerializedNameDummy.php deleted file mode 100644 index 203118885853e..0000000000000 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithMethodSerializedNameDummy.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Serializer\Tests\Fixtures; - -use Symfony\Component\Serializer\Annotation\SerializedName; - -class SamePropertyAsMethodWithMethodSerializedNameDummy -{ - private $freeTrial; - private $hasSubscribe; - private $getReady; - private $isActive; - - public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) - { - $this->freeTrial = $freeTrial; - $this->hasSubscribe = $hasSubscribe; - $this->getReady = $getReady; - $this->isActive = $isActive; - } - - #[SerializedName('free_trial_method')] - public function getFreeTrial() - { - return $this->freeTrial; - } - - #[SerializedName('has_subscribe_method')] - public function hasSubscribe() - { - return $this->hasSubscribe; - } - - #[SerializedName('get_ready_method')] - public function getReady() - { - return $this->getReady; - } - - #[SerializedName('is_active_method')] - public function isActive() - { - return $this->isActive; - } -} diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithPropertySerializedNameDummy.php b/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithPropertySerializedNameDummy.php deleted file mode 100644 index 0b681934f2fab..0000000000000 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithPropertySerializedNameDummy.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Serializer\Tests\Fixtures; - -use Symfony\Component\Serializer\Annotation\SerializedName; - -class SamePropertyAsMethodWithPropertySerializedNameDummy -{ - #[SerializedName('free_trial_property')] - private $freeTrial; - - #[SerializedName('has_subscribe_property')] - private $hasSubscribe; - - #[SerializedName('get_ready_property')] - private $getReady; - - #[SerializedName('is_active_property')] - private $isActive; - - public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) - { - $this->freeTrial = $freeTrial; - $this->hasSubscribe = $hasSubscribe; - $this->getReady = $getReady; - $this->isActive = $isActive; - } - - public function getFreeTrial() - { - return $this->freeTrial; - } - - public function hasSubscribe() - { - return $this->hasSubscribe; - } - - public function getReady() - { - return $this->getReady; - } - - public function isActive() - { - return $this->isActive; - } -} diff --git a/src/Symfony/Component/Serializer/Tests/Mapping/Loader/AttributeLoaderTest.php b/src/Symfony/Component/Serializer/Tests/Mapping/Loader/AttributeLoaderTest.php index f2353c8fad1b7..a76595506081d 100644 --- a/src/Symfony/Component/Serializer/Tests/Mapping/Loader/AttributeLoaderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Mapping/Loader/AttributeLoaderTest.php @@ -173,13 +173,12 @@ public function testThrowsOnContextOnInvalidMethod() public function testCanHandleUnrelatedIgnoredMethods() { - $this->expectException(MappingException::class); - $this->expectExceptionMessage(sprintf('Ignore on "%s::badIgnore()" cannot be added', Entity45016::class)); - $metadata = new ClassMetadata(Entity45016::class); $loader = $this->getLoaderForContextMapping(); $loader->loadClassMetadata($metadata); + + $this->assertSame(['id'], array_keys($metadata->getAttributesMetadata())); } public function testIgnoreGetterWithRequiredParameterIfIgnoreAnnotationIsUsed() diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php index d92f50e22ac84..3922a37e96586 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php @@ -1030,6 +1030,53 @@ protected function createChildContext(array $parentContext, string $attribute, ? $this->assertFalse($normalizer->childContextCacheKey); } + + public function testDenormalizeXmlScalar() + { + $normalizer = new class () extends AbstractObjectNormalizer + { + public function __construct() + { + parent::__construct(null, new MetadataAwareNameConverter(new ClassMetadataFactory(new AttributeLoader()))); + } + + protected function extractAttributes(object $object, ?string $format = null, array $context = []): array + { + return []; + } + + protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []): mixed + { + return null; + } + + protected function setAttributeValue(object $object, string $attribute, $value, ?string $format = null, array $context = []): void + { + $object->$attribute = $value; + } + + public function getSupportedTypes(?string $format): array + { + return ['*' => false]; + } + }; + + $this->assertSame('scalar', $normalizer->denormalize('scalar', XmlScalarDummy::class, 'xml')->value); + } + + public function testNormalizationWithMaxDepthOnStdclassObjectDoesNotThrowWarning() + { + $object = new \stdClass(); + $object->string = 'yes'; + + $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); + $normalizer = new ObjectNormalizer($classMetadataFactory); + $normalized = $normalizer->normalize($object, context: [ + AbstractObjectNormalizer::ENABLE_MAX_DEPTH => true, + ]); + + $this->assertSame(['string' => 'yes'], $normalized); + } } class AbstractObjectNormalizerDummy extends AbstractObjectNormalizer @@ -1292,6 +1339,12 @@ class DummyChild public $bar; } +class XmlScalarDummy +{ + #[SerializedName('#')] + public $value; +} + class SerializerCollectionDummy implements SerializerInterface, DenormalizerInterface { private array $normalizers; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index e3e8873799e45..bed1577de4094 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -526,6 +526,23 @@ public function testDenormalizeWithDiscriminator() $this->assertEquals($denormalized, $normalizer->denormalize(['type' => 'two', 'url' => 'url'], GetSetMethodDummyInterface::class)); } + + public function testSupportsAndNormalizeWithOnlyParentGetter() + { + $obj = new GetSetDummyChild(); + $obj->setFoo('foo'); + + $this->assertTrue($this->normalizer->supportsNormalization($obj)); + $this->assertSame(['foo' => 'foo'], $this->normalizer->normalize($obj)); + } + + public function testSupportsAndDenormalizeWithOnlyParentSetter() + { + $this->assertTrue($this->normalizer->supportsDenormalization(['foo' => 'foo'], GetSetDummyChild::class)); + + $obj = $this->normalizer->denormalize(['foo' => 'foo'], GetSetDummyChild::class); + $this->assertSame('foo', $obj->getFoo()); + } } class GetSetDummy @@ -828,3 +845,22 @@ public function setUrl(string $url): void $this->url = $url; } } + +class GetSetDummyChild extends GetSetDummyParent +{ +} + +class GetSetDummyParent +{ + private $foo; + + public function getFoo() + { + return $this->foo; + } + + public function setFoo($foo) + { + $this->foo = $foo; + } +} diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php index 8285dd88ee22b..fbe3d64d96b82 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php @@ -18,6 +18,7 @@ use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor; use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\PropertyInfo\PropertyInfoExtractor; +use Symfony\Component\Serializer\Attribute\Ignore; use Symfony\Component\Serializer\Exception\LogicException; use Symfony\Component\Serializer\Exception\RuntimeException; use Symfony\Component\Serializer\Exception\UnexpectedValueException; @@ -41,9 +42,6 @@ use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Php74DummyPrivate; use Symfony\Component\Serializer\Tests\Fixtures\Php80Dummy; -use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodDummy; -use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodWithMethodSerializedNameDummy; -use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodWithPropertySerializedNameDummy; use Symfony\Component\Serializer\Tests\Fixtures\SiblingHolder; use Symfony\Component\Serializer\Tests\Normalizer\Features\AttributesTestTrait; use Symfony\Component\Serializer\Tests\Normalizer\Features\CacheableObjectAttributesTestTrait; @@ -839,51 +837,39 @@ public function testNormalizeStdClass() $this->assertSame(['baz' => 'baz'], $this->normalizer->normalize($o2)); } - public function testSamePropertyAsMethod() + public function testNormalizeWithoutSerializerSet() { - $object = new SamePropertyAsMethodDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active'); - $expected = [ - 'freeTrial' => 'free_trial', - 'hasSubscribe' => 'has_subscribe', - 'getReady' => 'get_ready', - 'isActive' => 'is_active', - ]; + $normalizer = new ObjectNormalizer(new ClassMetadataFactory(new AttributeLoader())); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('Cannot normalize attribute "foo" because the injected serializer is not a normalizer.'); - $this->assertSame($expected, $this->normalizer->normalize($object)); + $normalizer->normalize(new ObjectConstructorDummy([], [], [])); } - public function testSamePropertyAsMethodWithPropertySerializedName() + public function testNormalizeWithIgnoreAttributeAndPrivateProperties() { $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); - $this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory)); - $this->normalizer->setSerializer($this->serializer); - - $object = new SamePropertyAsMethodWithPropertySerializedNameDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active'); - $expected = [ - 'free_trial_property' => 'free_trial', - 'has_subscribe_property' => 'has_subscribe', - 'get_ready_property' => 'get_ready', - 'is_active_property' => 'is_active', - ]; + $normalizer = new ObjectNormalizer($classMetadataFactory); - $this->assertSame($expected, $this->normalizer->normalize($object)); + $this->assertSame(['foo' => 'foo'], $normalizer->normalize(new ObjectDummyWithIgnoreAttributeAndPrivateProperty())); } - public function testSamePropertyAsMethodWithMethodSerializedName() + public function testDenormalizeWithIgnoreAttributeAndPrivateProperties() { $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); - $this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory)); - $this->normalizer->setSerializer($this->serializer); + $normalizer = new ObjectNormalizer($classMetadataFactory); - $object = new SamePropertyAsMethodWithMethodSerializedNameDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active'); - $expected = [ - 'free_trial_method' => 'free_trial', - 'has_subscribe_method' => 'has_subscribe', - 'get_ready_method' => 'get_ready', - 'is_active_method' => 'is_active', - ]; + $obj = $normalizer->denormalize([ + 'foo' => 'set', + 'ignore' => 'set', + 'private' => 'set', + ], ObjectDummyWithIgnoreAttributeAndPrivateProperty::class); + + $expected = new ObjectDummyWithIgnoreAttributeAndPrivateProperty(); + $expected->foo = 'set'; - $this->assertSame($expected, $this->normalizer->normalize($object)); + $this->assertEquals($expected, $obj); } } @@ -1060,7 +1046,7 @@ public function __get($name) } } - public function __isset($name) + public function __isset($name): bool { return 'foo' === $name; } @@ -1157,3 +1143,13 @@ public function getInner() return $this->inner; } } + +class ObjectDummyWithIgnoreAttributeAndPrivateProperty +{ + public $foo = 'foo'; + + #[Ignore] + public $ignored = 'ignored'; + + private $private = 'private'; +} diff --git a/src/Symfony/Component/Stopwatch/.gitattributes b/src/Symfony/Component/Stopwatch/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Stopwatch/.gitattributes +++ b/src/Symfony/Component/Stopwatch/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Stopwatch/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Stopwatch/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Stopwatch/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Stopwatch/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Stopwatch/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Stopwatch/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/String/.gitattributes b/src/Symfony/Component/String/.gitattributes index 0f57d864c994d..166549d614199 100644 --- a/src/Symfony/Component/String/.gitattributes +++ b/src/Symfony/Component/String/.gitattributes @@ -2,5 +2,4 @@ /Resources/WcswidthDataGenerator.php export-ignore /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/String/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/String/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/String/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/String/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/String/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/String/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/String/LazyString.php b/src/Symfony/Component/String/LazyString.php index 519b54ab9df31..5e5df82be9224 100644 --- a/src/Symfony/Component/String/LazyString.php +++ b/src/Symfony/Component/String/LazyString.php @@ -129,7 +129,7 @@ private static function getPrettyName(callable $callback): string } elseif ($callback instanceof \Closure) { $r = new \ReflectionFunction($callback); - if (str_contains($r->name, '{closure}') || !$class = $r->getClosureCalledClass()) { + if (str_contains($r->name, '{closure') || !$class = $r->getClosureCalledClass()) { return $r->name; } diff --git a/src/Symfony/Component/String/Tests/LazyStringTest.php b/src/Symfony/Component/String/Tests/LazyStringTest.php index f2d24ebcb23f4..b5405bbc465cc 100644 --- a/src/Symfony/Component/String/Tests/LazyStringTest.php +++ b/src/Symfony/Component/String/Tests/LazyStringTest.php @@ -39,7 +39,7 @@ public function testReturnTypeError() $s = LazyString::fromCallable(fn () => []); $this->expectException(\TypeError::class); - $this->expectExceptionMessage('Return value of '.__NAMESPACE__.'\{closure}() passed to '.LazyString::class.'::fromCallable() must be of the type string, array returned.'); + $this->expectExceptionMessageMatches('{^Return value of .*\{closure.*\}\(\) passed to '.preg_quote(LazyString::class).'::fromCallable\(\) must be of the type string, array returned\.$}'); (string) $s; } diff --git a/src/Symfony/Component/Translation/.gitattributes b/src/Symfony/Component/Translation/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Translation/.gitattributes +++ b/src/Symfony/Component/Translation/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Translation/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Translation/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Translation/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Translation/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Translation/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Translation/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Translation/Bridge/Crowdin/.gitattributes b/src/Symfony/Component/Translation/Bridge/Crowdin/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Translation/Bridge/Crowdin/.gitattributes +++ b/src/Symfony/Component/Translation/Bridge/Crowdin/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Translation/Bridge/Crowdin/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Translation/Bridge/Crowdin/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Crowdin/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Translation/Bridge/Crowdin/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Translation/Bridge/Crowdin/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Crowdin/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Translation/Bridge/Loco/.gitattributes b/src/Symfony/Component/Translation/Bridge/Loco/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Translation/Bridge/Loco/.gitattributes +++ b/src/Symfony/Component/Translation/Bridge/Loco/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Translation/Bridge/Loco/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Translation/Bridge/Loco/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Loco/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Translation/Bridge/Loco/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Translation/Bridge/Loco/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Loco/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/.gitattributes b/src/Symfony/Component/Translation/Bridge/Lokalise/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Translation/Bridge/Lokalise/.gitattributes +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Translation/Bridge/Lokalise/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Translation/Bridge/Lokalise/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Translation/Bridge/Phrase/.gitattributes b/src/Symfony/Component/Translation/Bridge/Phrase/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Translation/Bridge/Phrase/.gitattributes +++ b/src/Symfony/Component/Translation/Bridge/Phrase/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Translation/Bridge/Phrase/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Translation/Bridge/Phrase/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Phrase/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Translation/Bridge/Phrase/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Translation/Bridge/Phrase/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Translation/Bridge/Phrase/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 31b3251baed92..ffe4bbbd89ed5 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -112,16 +112,20 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s continue; } - if (isset($translation->target) && 'needs-translation' === (string) $translation->target->attributes()['state']) { + $source = (string) (isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source); + + if (isset($translation->target) + && 'needs-translation' === (string) $translation->target->attributes()['state'] + && \in_array((string) $translation->target, [$source, (string) $translation->source], true) + ) { continue; } - $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; // If the xlf file has another encoding specified, try to convert it because // simple_xml will always return utf-8 encoded values $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); - $catalogue->set((string) $source, $target, $domain); + $catalogue->set($source, $target, $domain); $metadata = [ 'source' => (string) $translation->source, @@ -144,7 +148,7 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s $metadata['id'] = (string) $attributes['id']; } - $catalogue->setMetadata((string) $source, $metadata, $domain); + $catalogue->setMetadata($source, $metadata, $domain); } } } diff --git a/src/Symfony/Component/Translation/LocaleSwitcher.php b/src/Symfony/Component/Translation/LocaleSwitcher.php index c07809c58cbcc..4950a56bbb682 100644 --- a/src/Symfony/Component/Translation/LocaleSwitcher.php +++ b/src/Symfony/Component/Translation/LocaleSwitcher.php @@ -34,9 +34,14 @@ public function __construct( public function setLocale(string $locale): void { - if (class_exists(\Locale::class)) { - \Locale::setDefault($locale); + // Silently ignore if the intl extension is not loaded + try { + if (class_exists(\Locale::class, false)) { + \Locale::setDefault($locale); + } + } catch (\Exception) { } + $this->locale = $locale; $this->requestContext?->setParameter('_locale', $locale); diff --git a/src/Symfony/Component/Translation/Resources/bin/translation-status.php b/src/Symfony/Component/Translation/Resources/bin/translation-status.php index 8064190d86e39..42fa1c69b33be 100644 --- a/src/Symfony/Component/Translation/Resources/bin/translation-status.php +++ b/src/Symfony/Component/Translation/Resources/bin/translation-status.php @@ -162,11 +162,11 @@ function extractLocaleFromFilePath($filePath) function extractTranslationKeys($filePath): array { $translationKeys = []; - $contents = new \SimpleXMLElement(file_get_contents($filePath)); + $contents = new SimpleXMLElement(file_get_contents($filePath)); foreach ($contents->file->body->{'trans-unit'} as $translationKey) { $translationId = (string) $translationKey['id']; - $translationKey = (string) $translationKey->source; + $translationKey = (string) ($translationKey['resname'] ?? $translationKey->source); $translationKeys[$translationId] = $translationKey; } diff --git a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php index b64b6f9511519..d8a08bbbf2a8d 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php @@ -52,9 +52,17 @@ public function testLoadRawXliff() test - with + with note + + baz + baz + + + baz + buz + @@ -65,6 +73,7 @@ public function testLoadRawXliff() $this->assertEquals('en', $catalogue->getLocale()); $this->assertSame([], libxml_get_errors()); $this->assertContainsOnly('string', $catalogue->all('domain1')); + $this->assertSame(['foo', 'extra', 'key', 'test'], array_keys($catalogue->all('domain1'))); } public function testLoadWithInternalErrorsEnabled() diff --git a/src/Symfony/Component/Uid/.gitattributes b/src/Symfony/Component/Uid/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Uid/.gitattributes +++ b/src/Symfony/Component/Uid/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Uid/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Uid/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Uid/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Uid/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Uid/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Uid/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Validator/.gitattributes b/src/Symfony/Component/Validator/.gitattributes index c34694db5f725..b9f8f3944ce62 100644 --- a/src/Symfony/Component/Validator/.gitattributes +++ b/src/Symfony/Component/Validator/.gitattributes @@ -1,5 +1,4 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore /Resources/bin/sync-iban-formats.php export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Validator/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Validator/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Validator/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Validator/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Validator/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Validator/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Validator/Constraints/Email.php b/src/Symfony/Component/Validator/Constraints/Email.php index 214c94b80cb69..148bfba54aebd 100644 --- a/src/Symfony/Component/Validator/Constraints/Email.php +++ b/src/Symfony/Component/Validator/Constraints/Email.php @@ -55,6 +55,10 @@ public function __construct( throw new InvalidArgumentException('The "mode" parameter value is not valid.'); } + if (null !== $mode && !\in_array($mode, self::VALIDATION_MODES, true)) { + throw new InvalidArgumentException('The "mode" parameter value is not valid.'); + } + parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; diff --git a/src/Symfony/Component/Validator/Constraints/Range.php b/src/Symfony/Component/Validator/Constraints/Range.php index 55359f6b6634c..d3523a812cb6d 100644 --- a/src/Symfony/Component/Validator/Constraints/Range.php +++ b/src/Symfony/Component/Validator/Constraints/Range.php @@ -87,7 +87,7 @@ public function __construct( throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option. Try running "composer require symfony/property-access".', static::class)); } - if (null !== $this->min && null !== $this->max && ($minMessage || $maxMessage)) { + if (null !== $this->min && null !== $this->max && ($minMessage || $maxMessage || isset($options['minMessage']) || isset($options['maxMessage']))) { throw new ConstraintDefinitionException(sprintf('The "%s" constraint can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.', static::class)); } } diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index f21ed90fbd40e..8ab1ec4d5ca82 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -139,7 +139,7 @@ public function setConstraint(Constraint $constraint): void $this->constraint = $constraint; } - public function addViolation(string $message, array $parameters = []): void + public function addViolation(string|\Stringable $message, array $parameters = []): void { $this->violations->add(new ConstraintViolation( $this->translator->trans($message, $parameters, $this->translationDomain), @@ -154,7 +154,7 @@ public function addViolation(string $message, array $parameters = []): void )); } - public function buildViolation(string $message, array $parameters = []): ConstraintViolationBuilderInterface + public function buildViolation(string|\Stringable $message, array $parameters = []): ConstraintViolationBuilderInterface { return new ConstraintViolationBuilder( $this->violations, diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf index 387fb9a649711..f975fc5164edb 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Hierdie waarde is nie 'n geldige MAC-adres nie. + + This URL is missing a top-level domain. + Die URL mis 'n topvlakdomein. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf index dfd398ae95a4f..08012ac233bdd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. هذه القيمة ليست عنوان MAC صالحًا. + + This URL is missing a top-level domain. + هذا الرابط يفتقر إلى نطاق المستوى الأعلى. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf index b6152e99dabc0..2eeae5f8a69ce 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Bu dəyər etibarlı bir MAC ünvanı deyil. + + This URL is missing a top-level domain. + Bu URL yuxarı səviyyəli domeni çatışmır. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf index ea7001957572b..a0665388e4bee 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Гэта значэнне не з'яўляецца сапраўдным MAC-адрасам. + + This URL is missing a top-level domain. + Гэтаму URL бракуе дамен верхняга ўзроўню. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf index 5705364f80f84..d2405339f0c35 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Mime типа на файла е невалиден ({{ type }}). Разрешени mime типове са {{ types }}. + Mime типът на файла е невалиден ({{ type }}). Разрешени mime типове са {{ types }}. This value should be {{ limit }} or less. @@ -136,7 +136,7 @@ This value is not a valid IP address. - Тази стойност не е валиден IP адрес. + Стойността не е валиден IP адрес. This value is not a valid language. @@ -156,7 +156,7 @@ The size of the image could not be detected. - Размера на изображението не може да бъде определен. + Размерът на изображението не може да бъде определен. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - В php.ini не е конфигурирана временна директория, или конфигурираната директория не съществува. + В php.ini не е конфигурирана временна директория или конфигурираната директория не съществува. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Тази стойност не е валиден международен банков сметка номер (IBAN). + Стойността не е валиден Международен номер на банкова сметка (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Тази стойност не е валиден код за идентификация на бизнеса (BIC). + Стойността не е валиден Бизнес идентификационен код (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Тази стойност не е валиден UUID. + Стойността не е валиден UUID. This value should be a multiple of {{ compared_value }}. @@ -328,7 +328,7 @@ This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Бизнес идентификационния код (BIC) не е свързан с IBAN {{ iban }}. + Бизнес идентификационният код (BIC) не е свързан с IBAN {{ iban }}. This value should be valid JSON. @@ -360,7 +360,7 @@ 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 }}. @@ -436,7 +436,11 @@ This value is not a valid MAC address. - Тази стойност не е валиден MAC адрес. + Стойността не е валиден MAC адрес. + + + This URL is missing a top-level domain. + На този URL липсва домейн от най-високо ниво. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf index bff1c8b441e2c..9fd444a59efff 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ova vrijednost nije valjana MAC adresa. + + This URL is missing a top-level domain. + Ovom URL-u nedostaje domena najvišeg nivoa. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index 2f301e784ac03..652c0a48d693c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -108,7 +108,7 @@ This value is not a valid URL. - Aquest valor no és una URL vàlida. + Aquest valor no és un URL vàlid. The two values should be equal. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - L'arxiu és massa gran. El tamany màxim permés és {{ limit }} {{ suffix }}. + L'arxiu és massa gran. La mida màxima permesa és {{ limit }} {{ suffix }}. The file is too large. @@ -136,7 +136,7 @@ This value is not a valid IP address. - Aquest valor no és una adreça IP vàlida. + Aquest valor no és una adreça IP vàlida. This value is not a valid language. @@ -160,19 +160,19 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - L'amplària de la imatge és massa gran ({{ width }}px). L'amplària màxima permesa són {{ max_width }}px. + L'amplària de la imatge és massa gran ({{ width }}px). L'amplària màxima permesa és {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - L'amplària de la imatge és massa petita ({{ width }}px). L'amplària mínima requerida són {{ min_width }}px. + L'amplària de la imatge és massa petita ({{ width }}px). L'amplària mínima requerida és {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - L'altura de la imatge és massa gran ({{ height }}px). L'altura màxima permesa són {{ max_height }}px. + L'altura de la imatge és massa gran ({{ height }}px). L'altura màxima permesa és {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - L'altura de la imatge és massa petita ({{ height }}px). L'altura mínima requerida són {{ min_height }}px. + L'altura de la imatge és massa petita ({{ height }}px). L'altura mínima requerida és {{ min_height }}px. This value should be the user's current password. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - No s'ha configurat cap carpeta temporal en php.ini, o la carpeta configurada no existeix. + No s'ha configurat cap carpeta temporal en php.ini, o la carpeta configurada no existeix. Cannot write temporary file to disk. @@ -200,7 +200,7 @@ A PHP extension caused the upload to fail. - Una extensió de PHP va fer que la pujada fallara. + Una extensió de PHP va fer que la pujada fallarà. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Aquest valor no és un Número de Compte Bancari Internacional (IBAN) vàlid. + Aquest valor no és un Número de Compte Bancari Internacional (IBAN) vàlid. This value is not a valid ISBN-10. @@ -276,31 +276,31 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Aquest valor no hauria de idèntic a {{ compared_value_type }} {{ compared_value }}. + Aquest valor no hauria de ser idèntic a {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - La proporció de l'imatge és massa gran ({{ ratio }}). La màxima proporció permesa és {{ max_ratio }}. + La proporció de la imatge és massa gran ({{ ratio }}). La màxima proporció permesa és {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - La proporció de l'imatge és massa petita ({{ ratio }}). La mínima proporció permesa és {{ max_ratio }}. + La proporció de la imatge és massa petita ({{ ratio }}). La mínima proporció permesa és {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - L'imatge és quadrada({{ width }}x{{ height }}px). Les imatges quadrades no estan permeses. + La imatge és quadrada({{ width }}x{{ height }}px). Les imatges quadrades no estan permeses. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - L'imatge està orientada horitzontalment ({{ width }}x{{ height }}px). Les imatges orientades horitzontalment no estan permeses. + La imatge està orientada horitzontalment ({{ width }}x{{ height }}px). Les imatges orientades horitzontalment no estan permeses. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - L'imatge està orientada verticalment ({{ width }}x{{ height }}px). Les imatges orientades verticalment no estan permeses. + La imatge està orientada verticalment ({{ width }}x{{ height }}px). Les imatges orientades verticalment no estan permeses. An empty file is not allowed. - No està permès un fixter buit. + No està permès un fitxer buit. The host could not be resolved. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Aquest valor no és un Codi d'Identificador de Negocis (BIC) vàlid. + Aquest valor no és un Codi d'identificació bancari (BIC) vàlid. Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Aquest valor no és un UUID vàlid. + Aquest valor no és un UUID vàlid. This value should be a multiple of {{ compared_value }}. @@ -428,15 +428,19 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - L'extensió del fitxer no és vàlida ({{ extension }}). Les extensions permeses són {{ extensions }}. + L'extensió del fitxer no és vàlida ({{ extension }}). Les extensions permeses són {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - S'ha detectat que la codificació de caràcters no és vàlida ({{ detected }}). Les codificacions permeses són {{ encodings }}. + S'ha detectat que la codificació de caràcters no és vàlida ({{ detected }}). Les codificacions permeses són {{ encodings }}. This value is not a valid MAC address. - Aquest valor no és una adreça MAC vàlida. + Aquest valor no és una adreça MAC vàlida. + + + This URL is missing a top-level domain. + Aquesta URL no conté un domini de primer nivell. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf index 9ca83564ebadc..2c4c54d9f60af 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Tato hodnota není platnou MAC adresou. + + This URL is missing a top-level domain. + Této URL chybí doména nejvyššího řádu. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf index fd984989e3597..a1ebdf7f81e24 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Nid yw'r gwerth hwn yn gyfeiriad MAC dilys. + + This URL is missing a top-level domain. + Mae'r URL hwn yn colli parth lefel uchaf. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf index 826ef10c955db..808d8c6ad66d9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Denne værdi er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL mangler et topdomæne. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 9f145fdeed911..3b65306314922 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Dieser Wert ist keine gültige MAC-Adresse. + + This URL is missing a top-level domain. + Dieser URL fehlt eine Top-Level-Domain. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf index db927e1d51e65..a60471835745b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Αυτή η IP διεύθυνση δεν είναι έγκυρη. + Αυτή η IP διεύθυνση δεν είναι έγκυρη. This value is not a valid language. @@ -320,7 +320,7 @@ This value is not a valid UUID. - Αυτός ο αριθμός δεν είναι έγκυρη UUID. + Αυτός ο αριθμός δεν είναι έγκυρη UUID. This value should be a multiple of {{ compared_value }}. @@ -438,6 +438,10 @@ This value is not a valid MAC address. Αυτός ο αριθμός δεν είναι έγκυρη διεύθυνση MAC. + + This URL is missing a top-level domain. + Αυτή η διεύθυνση URL λείπει ένας τομέας ανώτατου επιπέδου. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 35196e572e0f0..721139011caec 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. This value is not a valid MAC address. + + This URL is missing a top-level domain. + This URL is missing a top-level domain. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index abe75d5304ae3..d58045471c70c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -404,7 +404,7 @@ The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. - El nombre del archivo es demasido largo. Debe tener {{ filename_max_length }} carácter o menos.|El nombre del archivo es demasido largo. Debe tener {{ filename_max_length }} caracteres o menos. + El nombre del archivo es demasiado largo. Debe tener {{ filename_max_length }} carácter o menos.|El nombre del archivo es demasiado largo. Debe tener {{ filename_max_length }} caracteres o menos. The password strength is too low. Please use a stronger password. @@ -438,6 +438,10 @@ This value is not a valid MAC address. Este valor no es una dirección MAC válida. + + This URL is missing a top-level domain. + Esta URL no contiene una extensión de dominio (TLD). + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf index 0af593467f591..d9d641322976b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. See väärtus ei ole kehtiv MAC-aadress. + + This URL is missing a top-level domain. + Sellel URL-il puudub ülataseme domeen. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index 6094d1cbca575..bdcbaa393e6a1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Balio hau ez da MAC helbide baliozko bat. + + This URL is missing a top-level domain. + URL honek ez du goi-mailako domeinurik. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf index 1db553c9ffb18..0f2cf5bbf1fed 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. این مقدار یک آدرس MAC معتبر نیست. + + This URL is missing a top-level domain. + این URL فاقد دامنه سطح بالا است. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf index 324df2c276b79..e9ca6c83347a6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Tämä arvo ei ole kelvollinen MAC-osoite. + + This URL is missing a top-level domain. + Tästä URL-osoitteesta puuttuu ylätason verkkotunnus. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index e2d747a49bffe..4e949d838cae7 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Cette valeur n'est pas une adresse MAC valide. + + This URL is missing a top-level domain. + Cette URL doit contenir un domaine de premier niveau. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf index 2723983c5a99d..2a1199bed5c71 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Este valor non é un enderezo MAC válido. + + This URL is missing a top-level domain. + Esta URL non contén un dominio de nivel superior. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf index b1bb894a7fe4b..cd406b4eb86c8 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. ערך זה אינו כתובת MAC תקפה. + + This URL is missing a top-level domain. + לכתובת URL זו חסר דומיין רמה עליונה. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index eed237ce27e40..a7542a9353293 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ova vrijednost nije valjana MAC adresa. + + This URL is missing a top-level domain. + Ovom URL-u nedostaje vršna domena. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index df39afd709671..a31848c775fde 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ez az érték nem érvényes MAC-cím. + + This URL is missing a top-level domain. + Az URL-ből hiányzik a legfelső szintű tartomány (top-level domain). + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf index 707301d18c037..d8ff322e6ed76 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Այս արժեքը վավեր MAC հասցե չէ։ + + This URL is missing a top-level domain. + Այս URL-ը չունի վերին մակարդակի դոմեյն: + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf index 1cc60c4d8f9a2..b894c69d855d6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - Tidak ada folder sementara yang dikonfigurasi di php.ini, atau folder yang dikonfigurasi tidak ada. + Tidak ada folder sementara yang dikonfigurasi di php.ini, atau folder yang dikonfigurasi tidak ada. Cannot write temporary file to disk. @@ -438,6 +438,10 @@ This value is not a valid MAC address. Nilai ini bukan alamat MAC yang valid. + + This URL is missing a top-level domain. + URL ini tidak memiliki domain tingkat atas. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index bd7b25882d82c..74f3a75b0c97e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Questo valore non è un indirizzo MAC valido. + + This URL is missing a top-level domain. + Questo URL è privo di un dominio di primo livello. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf index 0524cd0511e15..c977df4a3e186 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. この値は有効なMACアドレスではありません。 + + This URL is missing a top-level domain. + このURLはトップレベルドメインがありません。 + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf index 548d82da41683..28d1eff019aac 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Dëse Wäert ass keng gülteg MAC-Adress. + + This URL is missing a top-level domain. + Dësen URL feelt eng Top-Level-Domain. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf index b3ee199fe4c73..e16daea93b80f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Ši vertė nėra galiojantis IP adresas. + Ši reikšmė nėra tinkamas IP adresas. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - php.ini nesukonfigūruotas laikinas aplankas, arba sukonfigūruotas aplankas neegzistuoja. + php.ini nesukonfigūruotas laikinas aplankas arba sukonfigūruotas aplankas neegzistuoja. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Ši vertė nėra galiojantis Tarptautinis Banko Sąskaitos Numeris (IBAN). + Ši reikšmė nėra tinkamas Tarptautinis Banko Sąskaitos Numeris (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Ši vertė nėra galiojantis Verslo Identifikavimo Kodas (BIC). + Ši reikšmė nėra tinkamas Verslo Identifikavimo Kodas (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Ši vertė nėra galiojantis UUID. + Ši reikšmė nėra tinkamas UUID. This value should be a multiple of {{ compared_value }}. @@ -432,11 +432,15 @@ The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - Nustatyta simbolių koduotė yra netinkama ({{ detected }}). Leidžiamos koduotės yra {{ encodings }}. + Aptikta simbolių koduotė yra netinkama ({{ detected }}). Leidžiamos koduotės yra {{ encodings }}. This value is not a valid MAC address. - Ši vertė nėra galiojantis MAC adresas. + Ši reikšmė nėra tinkamas MAC adresas. + + + This URL is missing a top-level domain. + Šiam URL trūksta aukščiausio lygio domeno. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf index d1222f02b72a5..66e370fea944d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Šī vērtība nav derīga MAC adrese. + + This URL is missing a top-level domain. + Šim URL trūkst augšējā līmeņa domēna. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf index 9d6dec6288b8a..d941f59ea8c8c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Оваа вредност не е валидна MAC адреса. + + This URL is missing a top-level domain. + На овој URL недостасува домен од највисоко ниво. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf index 4984bb127cab1..4f997a7031592 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Энэ утга хүчинтэй MAC хаяг биш юм. + + This URL is missing a top-level domain. + Энэ URL дээд түвшингийн домейн дутуу байна. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf index e4858336c1c7d..57b6e276dc9c5 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. ဤတန်ဖိုးသည် မှန်ကန်သော MAC လိပ်စာ မဟုတ်ပါ။ + + This URL is missing a top-level domain. + ဤ URL တွင် အမြင့်ဆုံးအဆင့်ဒိုမိန်း ပါဝင်မရှိပါ။ + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf index 8b317449ef4e8..27a4d3c55a1ef 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Denne verdien er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en mangler et toppnivådomene. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index 81d57cab48eec..7596799d0d904 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -64,11 +64,11 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Het bestand is te groot ({{ size }} {{ suffix }}). Toegestane maximum grootte is {{ limit }} {{ suffix }}. + Het bestand is te groot ({{ size }} {{ suffix }}). De maximale grootte is {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Het mime type van het bestand is ongeldig ({{ type }}). Toegestane mime types zijn {{ types }}. + Het mediatype van het bestand is ongeldig ({{ type }}). De toegestane mediatypes zijn {{ types }}. This value should be {{ limit }} or less. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Het bestand is te groot. Toegestane maximum grootte is {{ limit }} {{ suffix }}. + Het bestand is te groot. De maximale grootte is {{ limit }} {{ suffix }}. The file is too large. @@ -144,7 +144,7 @@ This value is not a valid locale. - Deze waarde is geen geldige locale. + Deze waarde is geen geldige landinstelling. This value is not a valid country. @@ -160,7 +160,7 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - De afbeelding is te breed ({{ width }}px). De maximaal toegestane breedte is {{ max_width }}px. + De afbeelding is te breed ({{ width }}px). De maximaal breedte is {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. @@ -168,7 +168,7 @@ The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - De afbeelding is te hoog ({{ height }}px). De maximaal toegestane hoogte is {{ max_height }}px. + De afbeelding is te hoog ({{ height }}px). De maximaal hoogte is {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. @@ -280,11 +280,11 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - De afbeeldingsverhouding is te groot ({{ ratio }}). Maximale verhouding is {{ max_ratio }}. + De afbeeldingsverhouding is te groot ({{ ratio }}). De maximale verhouding is {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - De afbeeldingsverhouding is te klein ({{ ratio }}). Minimale verhouding is {{ min_ratio }}. + De afbeeldingsverhouding is te klein ({{ ratio }}). De minimale verhouding is {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -324,7 +324,7 @@ This value should be a multiple of {{ compared_value }}. - Deze waarde zou een meervoud van {{ compared_value }} moeten zijn. + Deze waarde moet een meervoud van {{ compared_value }} zijn. This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. @@ -336,7 +336,7 @@ This collection should contain only unique elements. - Deze collectie moet alleen unieke elementen bevatten. + Deze collectie mag alleen unieke elementen bevatten. This value should be positive. @@ -396,7 +396,7 @@ This value is not a valid CIDR notation. - Deze waarde is geen geldige CIDR notatie. + Deze waarde is geen geldige CIDR-notatie. The value of the netmask should be between {{ min }} and {{ max }}. @@ -404,11 +404,11 @@ The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. - De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakter of minder zijn. + De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakter of minder zijn.|De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakters of minder zijn. The password strength is too low. Please use a stronger password. - De wachtwoordsterkte is te laag. Gebruik alstublieft een sterker wachtwoord. + Het wachtwoord is niet sterk genoeg. Probeer een sterker wachtwoord. This value contains characters that are not allowed by the current restriction-level. @@ -428,16 +428,20 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - De extensie van het bestand is ongeldig ({{ extension }}). Toegestane extensies zijn {{ extensions }}. + De bestandsextensie is ongeldig ({{ extension }}). De toegestane extensies zijn {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - De gedetecteerde karaktercodering is ongeldig ({{ detected }}). Toegestane coderingen zijn {{ encodings }}. + De gedetecteerde karaktercodering is ongeldig ({{ detected }}). De toegestane coderingen zijn {{ encodings }}. This value is not a valid MAC address. Deze waarde is geen geldig MAC-adres. + + This URL is missing a top-level domain. + Deze URL mist een top-level domein. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf index 4e1a41dab84d7..de400b7d5115c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Denne verdien er ikkje ein gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en manglar eit toppnivådomene. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf index 8b317449ef4e8..27a4d3c55a1ef 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Denne verdien er ikke en gyldig MAC-adresse. + + This URL is missing a top-level domain. + Denne URL-en mangler et toppnivådomene. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 29180984e6dfb..42b6e9571b349 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ta wartość nie jest prawidłowym adresem MAC. + + This URL is missing a top-level domain. + Podany URL nie zawiera domeny najwyższego poziomu. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index 5861a6d1434c6..ed28ee31ea639 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Este valor não é um endereço MAC válido. + + This URL is missing a top-level domain. + Esta URL está faltando um domínio de topo. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf index 4372885085282..e5fe095eace75 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Este valor não é um endereço MAC válido. + + This URL is missing a top-level domain. + Esta URL está faltando um domínio de topo. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf index 426f6319cee20..3d0b819a95441 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Această valoare nu este o adresă MAC validă. + + This URL is missing a top-level domain. + Acest URL îi lipsește un domeniu de nivel superior. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf index 22900d5c266b5..dbee06a984b2c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Это значение не является действительным MAC-адресом. + + This URL is missing a top-level domain. + В этом URL отсутствует домен верхнего уровня. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf index 9b06bdfb8c12e..8886395e6e8c7 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Táto hodnota nie je platnou MAC adresou. + + This URL is missing a top-level domain. + Tomuto URL chýba doména najvyššej úrovne. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index 596a66166cf4d..03e750b8af75b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ta vrednost ni veljaven MAC naslov. + + This URL is missing a top-level domain. + Temu URL manjka domena najvišje ravni. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf index 3ac3603144ca2..e9b31b88258d9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf @@ -447,6 +447,10 @@ This value is not a valid MAC address. Kjo nuk është një adresë e vlefshme e Kontrollit të Qasjes në Media (MAC). + + This URL is missing a top-level domain. + Kësaj URL i mungon një domain i nivelit të lartë. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf index b73cde9bac4a9..0550626d03f4d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ова вредност није валидна MAC адреса. + + This URL is missing a top-level domain. + Овом URL недостаје домен највишег нивоа. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf index cd4ccfb3f3c03..5a85bd764d3cc 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ova vrednost nije validna MAC adresa. + + This URL is missing a top-level domain. + Ovom URL nedostaje domen najvišeg nivoa. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index ec106fa78ebb7..d7be868c10e96 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Värdet är inte en giltig MAC-adress. + + This URL is missing a top-level domain. + Denna URL saknar en toppdomän. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf index f109024bfeaf3..0d811ed040f88 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. ค่านี้ไม่ใช่ที่อยู่ MAC ที่ถูกต้อง + + This URL is missing a top-level domain. + URL นี้ขาดโดเมนระดับสูงสุด. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf index 632efbc3f3f95..8e8146a0faade 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Ang halagang ito ay hindi isang wastong MAC address. + + This URL is missing a top-level domain. + Kulang ang URL na ito sa top-level domain. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf index 4d66ce8bcbc58..3553af7b74ddd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Bu değer geçerli bir MAC adresi değil. + + This URL is missing a top-level domain. + Bu URL bir üst düzey alan adı eksik. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index fcf63e0f675f3..7b9918910b151 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - Це значення не є дійсною IP-адресою. + Це значення не є дійсною IP-адресою. This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - У php.ini не було налаштовано тимчасової теки, або налаштована тека не існує. + У php.ini не було налаштовано тимчасової теки, або налаштована тека не існує. Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - Це значення не є дійсним Міжнародним банківським рахунком (IBAN). + Це значення не є дійсним міжнародним номером банківського рахунку (IBAN). This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - Це значення не є дійсним Кодом ідентифікації бізнесу (BIC). + Це значення не є дійсним банківським кодом (BIC). Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - Це значення не є дійсним UUID. + Це значення не є дійсним UUID. This value should be a multiple of {{ compared_value }}. @@ -436,7 +436,11 @@ This value is not a valid MAC address. - Це значення не є дійсною MAC-адресою. + Це значення не є дійсною MAC-адресою. + + + This URL is missing a top-level domain. + Цьому URL не вистачає домену верхнього рівня. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf index 65719c64ebc4a..f994cb57a84e2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. یہ قیمت کوئی درست MAC پتہ نہیں ہے۔ + + This URL is missing a top-level domain. + اس URL میں ٹاپ لیول ڈومین موجود نہیں ہے۔ + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf index bf5a2d5f4d9de..1e43fb0fff8cf 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Bu qiymat haqiqiy MAC manzil emas. + + This URL is missing a top-level domain. + Bu URL yuqori darajali domenni o'z ichiga olmaydi. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf index eadf61467c8bc..b3073cc7370a0 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. Giá trị này không phải là địa chỉ MAC hợp lệ. + + This URL is missing a top-level domain. + URL này thiếu miền cấp cao. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf index 155871cd38df4..fabf86d3b0e13 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. 该值不是有效的MAC地址。 + + This URL is missing a top-level domain. + 此URL缺少顶级域名。 + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf index 1a90678627e97..feee108a1bd3d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf @@ -438,6 +438,10 @@ This value is not a valid MAC address. 這不是一個有效的MAC地址。 + + This URL is missing a top-level domain. + 此URL缺少頂級域名。 + diff --git a/src/Symfony/Component/Validator/Tests/Constraints/EmailTest.php b/src/Symfony/Component/Validator/Tests/Constraints/EmailTest.php index b6f710ffc7ad2..8489f9cfecb62 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/EmailTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/EmailTest.php @@ -40,6 +40,13 @@ public function testUnknownModesTriggerException() new Email(['mode' => 'Unknown Mode']); } + public function testUnknownModeArgumentsTriggerException() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The "mode" parameter value is not valid.'); + new Email(null, null, 'Unknown Mode'); + } + public function testNormalizerCanBeSet() { $email = new Email(['normalizer' => 'trim']); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php index 132be131d4073..a306b104a5763 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php @@ -30,7 +30,7 @@ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPath() public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPathNamed() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('requires only one of the "min" or "minPropertyPath" options to be set, not both.'); new Range(min: 'min', minPropertyPath: 'minPropertyPath'); } @@ -47,7 +47,7 @@ public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath() public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPathNamed() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('requires only one of the "max" or "maxPropertyPath" options to be set, not both.'); new Range(max: 'max', maxPropertyPath: 'maxPropertyPath'); } @@ -65,10 +65,58 @@ public function testThrowsNoDefaultOptionConfiguredException() new Range('value'); } - public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageOrMaxMessage() + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageAndMaxMessage() { - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); + $this->expectException(ConstraintDefinitionException::class); $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); new Range(min: 'min', max: 'max', minMessage: 'minMessage', maxMessage: 'maxMessage'); } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessage() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range(min: 'min', max: 'max', minMessage: 'minMessage'); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMessage() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range(min: 'min', max: 'max', maxMessage: 'maxMessage'); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageAndMaxMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'minMessage' => 'minMessage', + 'max' => 'max', + 'maxMessage' => 'maxMessage', + ]); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'minMessage' => 'minMessage', + 'max' => 'max', + ]); + } + + public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMaxMessageOptions() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + new Range([ + 'min' => 'min', + 'max' => 'max', + 'maxMessage' => 'maxMessage', + ]); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php index 876595c37fc94..c0eb5e61703a9 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -1037,30 +1037,6 @@ public static function provideMessageIfMinAndMaxSet(): array 'not_in_range_message', Range::NOT_IN_RANGE_ERROR, ], - [ - ['minMessage' => 'min_message'], - 0, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['maxMessage' => 'max_message'], - 0, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['minMessage' => 'min_message'], - 15, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], - [ - ['maxMessage' => 'max_message'], - 15, - $notInRangeMessage, - Range::NOT_IN_RANGE_ERROR, - ], ]; } diff --git a/src/Symfony/Component/VarDumper/.gitattributes b/src/Symfony/Component/VarDumper/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/VarDumper/.gitattributes +++ b/src/Symfony/Component/VarDumper/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/VarDumper/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/VarDumper/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/VarDumper/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/VarDumper/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/VarDumper/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/VarDumper/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php index 137917b63e95c..d5802ec0cdc9c 100644 --- a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php @@ -42,7 +42,7 @@ public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNe $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); - if (!str_contains($c->name, '{closure}')) { + if (!str_contains($c->name, '{closure')) { $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; unset($a[$prefix.'class']); } diff --git a/src/Symfony/Component/VarExporter/.gitattributes b/src/Symfony/Component/VarExporter/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/VarExporter/.gitattributes +++ b/src/Symfony/Component/VarExporter/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/VarExporter/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/VarExporter/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/VarExporter/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/VarExporter/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/VarExporter/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/VarExporter/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/WebLink/.gitattributes b/src/Symfony/Component/WebLink/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/WebLink/.gitattributes +++ b/src/Symfony/Component/WebLink/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/WebLink/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/WebLink/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/WebLink/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/WebLink/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/WebLink/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/WebLink/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Webhook/.gitattributes b/src/Symfony/Component/Webhook/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Webhook/.gitattributes +++ b/src/Symfony/Component/Webhook/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Webhook/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Webhook/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Webhook/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Webhook/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Webhook/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Webhook/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Workflow/.gitattributes b/src/Symfony/Component/Workflow/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Workflow/.gitattributes +++ b/src/Symfony/Component/Workflow/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Workflow/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Workflow/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Workflow/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Workflow/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Workflow/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Workflow/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Workflow/DataCollector/WorkflowDataCollector.php b/src/Symfony/Component/Workflow/DataCollector/WorkflowDataCollector.php index bdb032f5a3151..fd9a45f03ca14 100644 --- a/src/Symfony/Component/Workflow/DataCollector/WorkflowDataCollector.php +++ b/src/Symfony/Component/Workflow/DataCollector/WorkflowDataCollector.php @@ -171,7 +171,7 @@ private function summarizeListener(callable $callable, ?string $eventName = null if ($callable instanceof \Closure) { $r = new \ReflectionFunction($callable); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { $title = (string) $r; } elseif ($class = $r->getClosureCalledClass()) { $title = $class->name.'::'.$r->name.'()'; diff --git a/src/Symfony/Component/Yaml/.gitattributes b/src/Symfony/Component/Yaml/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Component/Yaml/.gitattributes +++ b/src/Symfony/Component/Yaml/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Component/Yaml/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Component/Yaml/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Component/Yaml/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Component/Yaml/.github/workflows/check-subtree-split.yml b/src/Symfony/Component/Yaml/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Component/Yaml/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 1109f8568dd52..2f6e3a5f6efb5 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -633,12 +633,12 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence = } if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); + $data[] = substr($this->currentLine, $newIndent ?? 0); continue; } if ($indent >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); + $data[] = substr($this->currentLine, $newIndent ?? 0); } elseif ($this->isCurrentLineComment()) { $data[] = $this->currentLine; } elseif (0 == $indent) { diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index c34af87388b7f..753d2c126d768 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -1475,13 +1475,13 @@ public static function getBinaryData() data: !!binary | SGVsbG8gd29ybGQ= EOT - ], + ], 'containing spaces in block scalar' => [ <<<'EOT' data: !!binary | SGVs bG8gd 29ybGQ= EOT - ], + ], ]; } @@ -2957,6 +2957,11 @@ public function testParseIdeographicSpaces() ], $this->parser->parse($expected)); } + public function testSkipBlankLines() + { + $this->assertSame(['foo' => [null]], (new Parser())->parse("foo:\n-\n\n")); + } + private function assertSameData($expected, $actual) { $this->assertEquals($expected, $actual); diff --git a/src/Symfony/Contracts/.gitattributes b/src/Symfony/Contracts/.gitattributes index 84c7add058fb5..14c3c35940427 100644 --- a/src/Symfony/Contracts/.gitattributes +++ b/src/Symfony/Contracts/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/Cache/.gitattributes b/src/Symfony/Contracts/Cache/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/Cache/.gitattributes +++ b/src/Symfony/Contracts/Cache/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/Cache/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/Cache/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/Cache/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/Cache/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/Cache/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/Cache/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/Deprecation/.gitattributes b/src/Symfony/Contracts/Deprecation/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/Deprecation/.gitattributes +++ b/src/Symfony/Contracts/Deprecation/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/Deprecation/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/Deprecation/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/Deprecation/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/Deprecation/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/Deprecation/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/Deprecation/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/EventDispatcher/.gitattributes b/src/Symfony/Contracts/EventDispatcher/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/EventDispatcher/.gitattributes +++ b/src/Symfony/Contracts/EventDispatcher/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/EventDispatcher/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/EventDispatcher/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/HttpClient/.gitattributes b/src/Symfony/Contracts/HttpClient/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/HttpClient/.gitattributes +++ b/src/Symfony/Contracts/HttpClient/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/HttpClient/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/HttpClient/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/HttpClient/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/HttpClient/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/HttpClient/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/HttpClient/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/Service/.gitattributes b/src/Symfony/Contracts/Service/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/Service/.gitattributes +++ b/src/Symfony/Contracts/Service/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/Service/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/Service/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/Service/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/Service/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/Service/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/Service/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + } diff --git a/src/Symfony/Contracts/Translation/.gitattributes b/src/Symfony/Contracts/Translation/.gitattributes index 3a01b37292e30..825312826d129 100644 --- a/src/Symfony/Contracts/Translation/.gitattributes +++ b/src/Symfony/Contracts/Translation/.gitattributes @@ -1,2 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore diff --git a/src/Symfony/Contracts/Translation/.github/PULL_REQUEST_TEMPLATE.md b/src/Symfony/Contracts/Translation/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000..4689c4dad430e --- /dev/null +++ b/src/Symfony/Contracts/Translation/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +Please do not submit any Pull Requests here. They will be closed. +--- + +Please submit your PR here instead: +https://github.com/symfony/symfony + +This repository is what we call a "subtree split": a read-only subset of that main repository. +We're looking forward to your PR there! diff --git a/src/Symfony/Contracts/Translation/.github/workflows/check-subtree-split.yml b/src/Symfony/Contracts/Translation/.github/workflows/check-subtree-split.yml new file mode 100644 index 0000000000000..16be48bae3113 --- /dev/null +++ b/src/Symfony/Contracts/Translation/.github/workflows/check-subtree-split.yml @@ -0,0 +1,37 @@ +name: Check subtree split + +on: + pull_request_target: + +jobs: + close-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Close pull request + uses: actions/github-script@v6 + with: + script: | + if (context.repo.owner === "symfony") { + github.rest.issues.createComment({ + owner: "symfony", + repo: context.repo.repo, + issue_number: context.issue.number, + body: ` + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/symfony + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! + ` + }); + + github.rest.pulls.update({ + owner: "symfony", + repo: context.repo.repo, + pull_number: context.issue.number, + state: "closed" + }); + }