diff --git a/.github/build-packages.php b/.github/build-packages.php index 56112b753ad32..b67a699609d66 100644 --- a/.github/build-packages.php +++ b/.github/build-packages.php @@ -49,8 +49,8 @@ $packages[$package->name][$package->version] = $package; - $versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json'); - $versions = json_decode($versions)->package->versions; + $versions = file_get_contents('https://packagist.org/p/'.$package->name.'.json'); + $versions = json_decode($versions)->packages->{$package->name}; if ($package->version === str_replace('-dev', '.x-dev', $versions->{'dev-master'}->extra->{'branch-alias'}->{'dev-master'})) { unset($versions->{'dev-master'}); diff --git a/.travis.yml b/.travis.yml index c60334e87483e..35a0105e7e736 100644 --- a/.travis.yml +++ b/.travis.yml @@ -195,7 +195,7 @@ install: elif [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'" elif [[ $PHP = hhvm* ]]; then - $PHPUNIT --exclude-group benchmark,intl-data + $PHPUNIT --exclude-group no-hhvm,benchmark,intl-data else echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}" tfold tty-group $PHPUNIT --group tty diff --git a/CHANGELOG-3.3.md b/CHANGELOG-3.3.md index eeb42846f5f5e..fe698c1e6dc39 100644 --- a/CHANGELOG-3.3.md +++ b/CHANGELOG-3.3.md @@ -7,6 +7,43 @@ in 3.3 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.3.0...v3.3.1 +* 3.3.15 (2018-01-05) + + * bug #25532 [HttpKernel] Disable CSP header on exception pages (ostrolucky) + * bug #25491 [Routing] Use the default host even if context is empty (sroze) + * bug #25672 [WebServerBundle] use interface_exists instead of class_exists (kbond) + * bug #25662 Dumper shouldn't use html format for phpdbg / cli-server (jhoff) + * bug #25529 [Validator] Fix access to root object when using composite constraint (ostrolucky) + * bug #25430 Fixes for Oracle in PdoSessionHandler (elislenio) + * bug #25599 Add application/ld+json format associated to json (vincentchalamon) + * bug #25623 [HttpFoundation] Fix false-positive ConflictingHeadersException (nicolas-grekas) + * bug #25624 [WebServerBundle] Fix escaping of php binary with arguments (nicolas-grekas) + * bug #25567 [Process] Fix setting empty env vars (nicolas-grekas) + * bug #25407 [Console] Commands with an alias should not be recognized as ambiguous (Simperfit) + * bug #25523 [WebServerBundle] fix a bug where require would not require the good file because of env (Simperfit) + * bug #25559 [Process] Dont use getenv(), it returns arrays and can introduce subtle breaks accros PHP versions (nicolas-grekas) + * bug #25552 [WebProfilerBundle] Let fetch() cast URL to string (ro0NL) + * bug #25521 [Console] fix a bug when you are passing a default value and passing -n would output the index (Simperfit) + * bug #25489 [FrameworkBundle] remove esi/ssi renderers if inactive (dmaicher) + * bug #25427 Preserve percent-encoding in URLs when performing redirects in the UrlMatcher (mpdude) + * bug #25480 [FrameworkBundle] add missing validation options to XSD file (xabbuh) + * bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit) + * bug #25425 When available use AnnotationRegistry::registerUniqueLoader (jrjohnson) + * bug #24594 [Translation] Fix InvalidArgumentException when using untranslated plural forms from .po files (BjornTwachtmann) + * bug #25233 [TwigBridge][Form] Fix hidden currency element with Bootstrap 3 theme (julienfalque) + * bug #25413 [HttpKernel] detect deprecations thrown by container initialization during tests (nicolas-grekas) + * bug #25408 [Debug] Fix catching fatal errors in case of nested error handlers (nicolas-grekas) + * bug #25330 [HttpFoundation] Support 0 bit netmask in IPv6 (`::/0`) (stephank) + * bug #25378 [VarDumper] Fixed file links leave blank pages when ide is configured (antalaron) + * bug #25410 [HttpKernel] Fix logging of post-terminate errors/exceptions (nicolas-grekas) + * bug #25417 [Process] Dont rely on putenv(), it fails on ZTS PHP (nicolas-grekas) + * bug #25333 [DI] Impossible to set an environment variable and then an array as container parameter (Phantas0s) + * bug #25438 [Yaml] empty lines don't count for indent detection (xabbuh) + * bug #25389 [Yaml] fix some edge cases with indented blocks (xabbuh) + * bug #25340 [Serializer] Unset attributes when creating child context (dunglas) + * bug #25323 [ExpressionLanguage] throw an SyntaxError instead of an undefined index notice (Simperfit) + * bug #25364 [DependencyInjection] Prevent a loop in aliases within the `findDefinition` method (sroze) + * 3.3.14 (2017-12-04) * bug #25304 [Bridge/PhpUnit] Prefer $_SERVER['argv'] over $argv (ricknox) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 38a2d7c9a7a33..39bdf7acc9a6f 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,57 @@ in 3.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.4.0...v3.4.1 +* 3.4.4 (2018-01-29) + + * bug #25932 Don't stop PSR-4 service discovery if a parent class is missing (derrabus) + * bug #25922 [HttpFoundation] Use the correct syntax for session gc based on Pdo driver (tanasecosminromeo) + * bug #25933 Disable CSP header on exception pages only in debug (ostrolucky) + * bug #25926 [Form] Fixed Button::setParent() when already submitted (HeahDude) + * bug #25927 [Form] Fixed submitting disabled buttons (HeahDude) + * bug #25397 [Console] Provide a DX where an array could be passed (Simperfit) + * bug #25858 [DI] Fix initialization of legacy containers by delaying include_once (nicolas-grekas) + * bug #25891 [DependencyInjection] allow null values for root nodes in YAML configs (xabbuh) + * bug #24864 Have weak_vendors ignore deprecations from outside (greg0ire) + * bug #25848 [Validator] add missing parent isset and add test (Simperfit) + * bug #25869 [Process] Skip environment variables with false value in Process (francoispluchino) + * bug #25864 [Yaml] don't split lines on carriage returns when dumping (xabbuh) + * bug #25861 do not conflict with egulias/email-validator 2.0+ (xabbuh) + * bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric) + * bug #25837 [SecurityBundle] Don't register in memory users as services (chalasr) + * bug #25835 [HttpKernel] DebugHandlersListener should always replace the existing exception handler (nicolas-grekas) + * bug #25829 [Debug] Always decorate existing exception handlers to deal with fatal errors (nicolas-grekas) + * bug #25823 [Security] Notify that symfony/expression-language is not installed if ExpressionLanguage is used (giovannialbero1992) + * bug #25824 Fixing a bug where the dump() function depended on bundle ordering (weaverryan) + * bug #25763 [OptionsResolver] Fix options resolver with array allowed types (mcg-web) + * bug #25789 Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen) + * bug #25822 [Cache] Fix handling of apcu_fetch() edgy behavior (nicolas-grekas) + * bug #25816 Problem in phar see mergerequest #25579 (betzholz) + * bug #25781 [Form] Disallow transform dates beyond the year 9999 (curry684) + * bug #25287 [Serializer] DateTimeNormalizer handling of null and empty values (returning it instead of new object) (Simperfit) + * bug #25249 [Form] Avoid button label translation when it's set to false (TeLiXj) + * bug #25127 [TwigBridge] Pass the form-check-inline in parent (Simperfit) + * bug #25812 Copied NO language files to the new NB locale (derrabus) + * bug #25753 [Console] Fix restoring exception handler (nicolas-grekas, fancyweb) + * bug #25801 [Router] Skip anonymous classes when loading annotated routes (pierredup) + * bug #25508 [FrameworkBundle] Auto-enable CSRF if the component *+ session* are loaded (nicolas-grekas) + * bug #25657 [Security] Fix fatal error on non string username (chalasr) + * bug #25791 [Routing] Make sure we only build routes once (sroze) + * bug #25799 Fixed Request::__toString ignoring cookies (Toflar) + * bug #25755 [Debug] prevent infinite loop with faulty exception handlers (nicolas-grekas) + * bug #25771 [Validator] 19 digits VISA card numbers are valid (xabbuh) + * bug #25751 [FrameworkBundle] Add the missing `enabled` session attribute (sroze) + * bug #25750 [HttpKernel] Turn bad hosts into 400 instead of 500 (nicolas-grekas) + * bug #25699 [HttpKernel] Fix session handling: decouple "save" from setting response "private" (nicolas-grekas) + * bug #25490 [Serializer] Fixed throwing exception with option JSON_PARTIAL_OUTPUT_ON_ERROR (diversantvlz) + * bug #25737 [TwigBridge] swap filter/function and package names (xabbuh) + * bug #25731 [HttpFoundation] Always call proxied handler::destroy() in StrictSessionHandler (nicolas-grekas) + * bug #25733 [HttpKernel] Fix compile error when a legacy container is fresh again (nicolas-grekas) + * bug #25709 Tweaked some styles in the profiler tables (javiereguiluz) + * bug #25719 [HttpKernel] Uses cookies to track the requests redirection (sroze) + * bug #25696 [FrameworkBundle] Fix using "annotations.cached_reader" in after-removing passes (nicolas-grekas) + * feature #25669 [Security] Fail gracefully if the security token cannot be unserialized from the session (thewilkybarkid) + * bug #25700 Run simple-phpunit with --no-suggest option (ro0NL) + * 3.4.3 (2018-01-05) * bug #25685 Use triggering file to determine weak vendors if when the test is run in a separate process (alexpott) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 30d8ae3f828ed..85b3003b2abc6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,13 +13,13 @@ Symfony is the result of the work of many people who made the code better - Jordi Boggiano (seldaek) - Victor Berchet (victor) - Johannes S (johannes) - - Jakub Zalas (jakubzalas) - Kévin Dunglas (dunglas) + - Jakub Zalas (jakubzalas) - Kris Wallsmith (kriswallsmith) - Ryan Weaver (weaverryan) + - Robin Chalas (chalas_r) - Javier Eguiluz (javier.eguiluz) - Maxime Steinhausser (ogizanagi) - - Robin Chalas (chalas_r) - Hugo Hamon (hhamon) - Abdellatif Ait boudad (aitboudad) - Grégoire Pineau (lyrixx) @@ -48,21 +48,22 @@ Symfony is the result of the work of many people who made the code better - stealth35 (stealth35) - Alexander Mols (asm89) - Iltar van der Berg (kjarli) + - Yonel Ceruto (yonelceruto) - Bulat Shakirzyanov (avalanche123) - Peter Rehm (rpet) - Saša Stamenković (umpirsky) - Henrik Bjørnskov (henrikbjorn) - - Yonel Ceruto (yonelceruto) - Miha Vrhovnik - Matthias Pigulla (mpdude) - Diego Saint Esteben (dii3g0) + - Dany Maillard (maidmaid) - Konstantin Kudryashov (everzet) - - Bilal Amarni (bamarni) - Kevin Bond (kbond) - - Dany Maillard (maidmaid) + - Bilal Amarni (bamarni) - Pierre du Plessis (pierredup) - Florin Patan (florinpatan) - Jérémy DERUSSÉ (jderusse) + - Amrouche Hamza (simperfit) - Gábor Egyed (1ed) - Michel Weimerskirch (mweimerskirch) - Andrej Hudec (pulzarraider) @@ -70,16 +71,17 @@ Symfony is the result of the work of many people who made the code better - Eric Clemmons (ericclemmons) - Jáchym Toušek (enumag) - Charles Sarrazin (csarrazi) + - Titouan Galopin (tgalopin) + - Samuel ROZE (sroze) - Konstantin Myakshin (koc) - Christian Raue - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - - Titouan Galopin (tgalopin) + - Issei Murasawa (issei_m) - Douglas Greenshields (shieldo) - Tobias Nyholm (tobias) - - Issei Murasawa (issei_m) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) @@ -97,12 +99,11 @@ Symfony is the result of the work of many people who made the code better - Arnaud Le Blanc (arnaud-lb) - Maxime STEINHAUSSER - Michal Piotrowski (eventhorizon) - - Samuel ROZE (sroze) - Tim Nagel (merk) - - Amrouche Hamza (simperfit) + - Vladimir Reznichenko (kalessil) - Brice BERNARD (brikou) + - David Maicher (dmaicher) - Baptiste Clavié (talus) - - Vladimir Reznichenko (kalessil) - marc.weistroff - lenar - Alexander Schwenn (xelaris) @@ -118,17 +119,16 @@ Symfony is the result of the work of many people who made the code better - Tomáš Votruba (tomas_votruba) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - - David Maicher (dmaicher) - Eric GELOEN (gelo) - Daniel Wehner (dawehner) - Tugdual Saunier (tucksaun) + - Grégoire Paris (greg0ire) - Théo FIDRY (theofidry) - Robert Schönthal (digitalkaoz) - Florian Lonqueu-Brochard (florianlb) - Sebastiaan Stok (sstok) - Stefano Sala (stefano.sala) - Evgeniy (ewgraf) - - Grégoire Paris (greg0ire) - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) - Tigran Azatyan (tigranazatyan) @@ -139,6 +139,8 @@ Symfony is the result of the work of many people who made the code better - Pablo Godel (pgodel) - Jérémie Augustin (jaugustin) - Andréia Bohner (andreia) + - Alex Pott + - Julien Falque (julienfalque) - Rafael Dohms (rdohms) - Arnaud Kleinpeter (nanocom) - jwdeitch @@ -147,11 +149,9 @@ Symfony is the result of the work of many people who made the code better - Jérôme Vasseur (jvasseur) - Oleg Voronkovich - Philipp Wahala (hifi) - - Alex Pott - Vyacheslav Pavlov - Richard van Laak (rvanlaak) - Javier Spagnoletti (phansys) - - Julien Falque (julienfalque) - Richard Shank (iampersistent) - Thomas Rabaix (rande) - Rouven Weßling (realityking) @@ -174,6 +174,7 @@ Symfony is the result of the work of many people who made the code better - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - Daniel Espendiller + - Valentin Udaltsov (vudaltsov) - Possum - Dorian Villet (gnutix) - Sergey Linnik (linniksa) @@ -190,7 +191,6 @@ Symfony is the result of the work of many people who made the code better - Stepan Anchugov (kix) - bronze1man - sun (sun) - - Valentin Udaltsov (vudaltsov) - Larry Garfield (crell) - Martin Schuhfuß (usefulthink) - apetitpa @@ -247,11 +247,13 @@ Symfony is the result of the work of many people who made the code better - Alessandro Chitolina - Kristen Gilden (kgilden) - Pierre-Yves LEBECQ (pylebecq) + - Niels Keurentjes (curry684) - Jordan Samouh (jordansamouh) - Jakub Kucharovic (jkucharovic) - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto + - Gabriel Ostrolucký - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon @@ -270,9 +272,11 @@ Symfony is the result of the work of many people who made the code better - DQNEO - jdhoek - Pavel Batanov (scaytrase) + - Bob den Otter (bopp) - Nikita Konstantinov - Wodor Wodorski - Oskar Stark (oskarstark) + - Dariusz - Thomas Lallement (raziel057) - Giorgio Premi - Matthieu Napoli (mnapoli) @@ -284,6 +288,7 @@ Symfony is the result of the work of many people who made the code better - Kim Hemsø Rasmussen (kimhemsoe) - Wouter Van Hecke - Jérôme Parmentier (lctrs) + - Michael Babker (mbabker) - Peter Kruithof (pkruithof) - Michael Holm (hollo) - Marc Weistroff (futurecat) @@ -301,6 +306,7 @@ Symfony is the result of the work of many people who made the code better - Andrey Esaulov (andremaha) - Grégoire Passault (gregwar) - Jerzy Zawadzki (jzawadzki) + - Wouter J - Ismael Ambrosi (iambrosi) - Baptiste Lafontaine - Aurelijus Valeiša (aurelijus) @@ -311,7 +317,6 @@ Symfony is the result of the work of many people who made the code better - Tiago Ribeiro (fixe) - Hidde Boomsma (hboomsma) - John Bafford (jbafford) - - Bob den Otter (bopp) - Adrian Rudnik (kreischweide) - Francesc Rosàs (frosas) - Massimiliano Arione (garak) @@ -324,7 +329,6 @@ Symfony is the result of the work of many people who made the code better - Thierry Thuon (lepiaf) - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) - - Dariusz - Gennady Telegin (gtelegin) - Ben Davies (bendavies) - Erin Millard @@ -339,16 +343,15 @@ Symfony is the result of the work of many people who made the code better - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Tomasz Kowalczyk (thunderer) - - Michael Babker (mbabker) - François-Xavier de Guillebon (de-gui_f) - Damien Alexandre (damienalexandre) - Felix Labrecque - Yaroslav Kiliba - Terje Bråten + - Yanick Witschi (toflar) - Robbert Klarenbeek (robbertkl) - Edi Modrić (emodric) - Thomas Calvet (fancyweb) - - Niels Keurentjes (curry684) - JhonnyL - David Badura (davidbadura) - hossein zolfi (ocean) @@ -414,6 +417,7 @@ Symfony is the result of the work of many people who made the code better - Jan Schumann - Niklas Fiekas - Markus Bachmann (baachi) + - Gabriel Caruso - lancergr - Mihai Stancu - Olivier Dolbeau (odolbeau) @@ -450,7 +454,6 @@ Symfony is the result of the work of many people who made the code better - Anton Bakai - Maxime Veber (nek-) - Alex Bakhturin - - Yanick Witschi (toflar) - Alexander Obuhovich (aik099) - boombatower - Fabrice Bernhard (fabriceb) @@ -478,7 +481,6 @@ Symfony is the result of the work of many people who made the code better - Roy Van Ginneken (rvanginneken) - ondrowan - Barry vd. Heuvel (barryvdh) - - Wouter J - Florent Mata - Evan S Kaufman (evanskaufman) - mcben @@ -562,6 +564,7 @@ Symfony is the result of the work of many people who made the code better - Max Rath (drak3) - Stéphane Escandell (sescandell) - Konstantin S. M. Möllers (ksmmoellers) + - Alessandro Lai (jean85) - James Johnston - Sinan Eldem - Alexandre Dupuy (satchette) @@ -617,6 +620,7 @@ Symfony is the result of the work of many people who made the code better - Antoine Corcy - Sascha Grossenbacher - Szijarto Tamas + - Robin Lehrmann (robinlehrmann) - Catalin Dan - Stephan Vock - Benjamin Zikarsky (bzikarsky) @@ -692,6 +696,7 @@ Symfony is the result of the work of many people who made the code better - Andrew Hilobok (hilobok) - Noah Heck (myesain) - Christian Soronellas (theunic) + - Johann Pardanaud - Adam Szaraniec (mimol) - Yosmany Garcia (yosmanyga) - Wouter de Wild @@ -811,6 +816,7 @@ Symfony is the result of the work of many people who made the code better - Gábor Tóth - Daniel Cestari - David Lima + - Brian Freytag (brianfreytag) - Brunet Laurent (lbrunet) - Mikhail Yurasov (mym) - LOUARDI Abdeltif (ouardisoft) @@ -843,9 +849,9 @@ Symfony is the result of the work of many people who made the code better - Colin O'Dell (colinodell) - xaav - Mahmoud Mostafa (mahmoud) - - Alessandro Lai - Pieter - Michael Tibben + - Billie Thompson - Sander Marechal - Radosław Benkel - jean pasqualini (darkilliant) @@ -898,10 +904,10 @@ Symfony is the result of the work of many people who made the code better - Goran Juric - Laurent Ghirardotti (laurentg) - Nicolas Macherey + - Guido Donnari - AKeeman (akeeman) - Lin Clark - Jeremy David (jeremy.david) - - Robin Lehrmann (robinlehrmann) - Troy McCabe - Ville Mattila - ilyes kooli @@ -952,6 +958,7 @@ Symfony is the result of the work of many people who made the code better - DerManoMann - Olaf Klischat - orlovv + - Haralan Dobrev (hkdobrev) - Jhonny Lidfors (jhonny) - Julien Bianchi (jubianchi) - Robert Meijers @@ -967,7 +974,6 @@ Symfony is the result of the work of many people who made the code better - Alex Bowers - Jeremy Bush - wizhippo - - Gabriel Ostrolucký - Viacheslav Sychov - Carlos Ortega Huetos - rpg600 @@ -1033,6 +1039,7 @@ Symfony is the result of the work of many people who made the code better - Marco - Marc Torres - Alberto Aldegheri + - Dalibor Karlović - heccjj - Alexandre Melard - Jay Klehr @@ -1042,6 +1049,7 @@ Symfony is the result of the work of many people who made the code better - Jakub Kulhan - Ilia (aliance) - Mo Di (modi) + - Pablo Schläpfer - Jelte Steijaert (jelte) - Quique Porta (quiqueporta) - stoccc @@ -1084,6 +1092,7 @@ Symfony is the result of the work of many people who made the code better - Grzegorz Zdanowski (kiler129) - sl_toto (sl_toto) - Walter Dal Mut (wdalmut) + - Matthieu - Albin Kerouaton - Sébastien HOUZÉ - Jingyu Wang @@ -1103,6 +1112,7 @@ Symfony is the result of the work of many people who made the code better - Jules Lamur - Renato Mendes Figueiredo - ShiraNai7 + - Antal Áron (antalaron) - Markus Fasselt (digilist) - Vašek Purchart (vasek-purchart) - Janusz Jabłoński (yanoosh) @@ -1144,6 +1154,7 @@ Symfony is the result of the work of many people who made the code better - Tomaz Ahlin - Marcus Stöhr (dafish) - Emmanuel Vella (emmanuel.vella) + - Jonathan Johnson (jrjohnson) - Carsten Nielsen (phreaknerd) - Mathieu Rochette - Jay Severson @@ -1218,6 +1229,7 @@ Symfony is the result of the work of many people who made the code better - Antoine Bellion (abellion) - Ramon Kleiss (akathos) - César Suárez (csuarez) + - Bjorn Twachtmann (dotbjorn) - Nicolas Badey (nico-b) - Shane Preece (shane) - Johannes Goslar @@ -1266,6 +1278,7 @@ Symfony is the result of the work of many people who made the code better - Stefan Hüsges (tronsha) - Dan Blows - Matt Wells + - Nicolas Appriou - stloyd - Chris Tickner - Andrew Coulton @@ -1281,7 +1294,9 @@ Symfony is the result of the work of many people who made the code better - Matthew Donadio - Andreas - Thomas Chmielowiec + - shdev - Andrey Ryaguzov + - Stefan - Peter Bex - Manatsawin Hanmongkolchai - Gunther Konig @@ -1350,6 +1365,7 @@ Symfony is the result of the work of many people who made the code better - Grinbergs Reinis (shima5) - Artem Lopata (bumz) - Nicole Cordes + - Roman Orlov - VolCh - Alexey Popkov - Gijs Kunze @@ -1372,12 +1388,13 @@ Symfony is the result of the work of many people who made the code better - Dmitry Korotovsky - mcorteel - Michael van Tricht + - Tim Strehle - Sam Ward - Walther Lalk - Adam + - Stéphan Kochen - devel - taiiiraaa - - Johann Pardanaud - Trevor Suarez - gedrox - Alan Bondarchuk @@ -1393,6 +1410,7 @@ Symfony is the result of the work of many people who made the code better - bertillon - Bertalan Attila - Yannick Bensacq (cibou) + - Frédéric G. Marand (fgm) - Freek Van der Herten (freekmurze) - Luca Genuzio (genuzio) - Hans Nilsson (hansnilsson) @@ -1440,9 +1458,11 @@ Symfony is the result of the work of many people who made the code better - Alex Pods - hadriengem - timaschew + - Jochen Mandl - Ian Phillips - Haritz - Matthieu Prat + - Ion Bazan - Grummfy - Filipe Guerra - Gerben Wijnja @@ -1469,6 +1489,7 @@ Symfony is the result of the work of many people who made the code better - Juan M Martínez - Gilles Gauthier - ddebree + - Kuba Werłos - Tomas Liubinas - Alex - Klaas Naaijkens @@ -1541,6 +1562,7 @@ Symfony is the result of the work of many people who made the code better - Kristof Van Cauwenbergh (kristofvc) - Paulius Jarmalavičius (pjarmalavicius) - Ramon Henrique Ornelas (ramonornela) + - Ricardo de Vries (ricknox) - Markus S. (staabm) - Till Klampaeckel (till) - Tobias Weinert (tweini) @@ -1548,6 +1570,7 @@ Symfony is the result of the work of many people who made the code better - Wotre - goohib - Xavier HAUSHERR + - Ron Gähler - Edwin Hageman - Mantas Urnieža - Cas @@ -1563,12 +1586,14 @@ Symfony is the result of the work of many people who made the code better - BenjaminBeck - Aurelijus Rožėnas - Vladimir Tsykun + - Jordan Hoff - znerol - Christian Eikermann - Antonio Angelino - Matt Fields - Niklas Keller - Vladimir Sazhin + - Tomas Kmieliauskas - Billie Thompson - lol768 - jamogon @@ -1582,6 +1607,7 @@ Symfony is the result of the work of many people who made the code better - patrick-mcdougle - Dariusz Czech - Anonymous User + - Paweł Tomulik - Eric J. Duran - Alexandru Bucur - cmfcmf @@ -1605,7 +1631,6 @@ Symfony is the result of the work of many people who made the code better - vlechemin - Brian Corrigan - Ladislav Tánczos - - Brian Freytag - Skorney - fmarchalemisys - mieszko4 @@ -1617,6 +1642,7 @@ Symfony is the result of the work of many people who made the code better - Markus Staab - Pierre-Louis LAUNAY - djama + - Michael Gwynne - Eduardo Conceição - Jon Cave - Sébastien HOUZE @@ -1626,6 +1652,7 @@ Symfony is the result of the work of many people who made the code better - Shude - Ondřej Führer - Sema + - Michael Käfer - Elan Ruusamäe - Thorsten Hallwas - Michael Squires @@ -1653,6 +1680,7 @@ Symfony is the result of the work of many people who made the code better - Diego Campoy - TeLiXj - Oncle Tom + - Sam Anthony - Christian Stocker - Dawid Nowak - Lesnykh Ilia @@ -1671,6 +1699,7 @@ Symfony is the result of the work of many people who made the code better - arduanov - sualko - Bilge + - ADmad - Nicolas Roudaire - Alfonso (afgar) - Andreas Forsblom (aforsblo) @@ -1764,6 +1793,7 @@ Symfony is the result of the work of many people who made the code better - Moritz Kraft (userfriendly) - Víctor Mateo (victormateo) - Vincent (vincent1870) + - Vincent CHALAMON (vincentchalamon) - Eugene Babushkin (warl) - Wouter Sioen (wouter_sioen) - Xavier Amado (xamado) @@ -1786,6 +1816,7 @@ Symfony is the result of the work of many people who made the code better - Michael - fh-github@fholzhauer.de - AbdElKader Bouadjadja + - DSeemiller - Jan Emrich - Mark Topper - Xavier REN @@ -1799,6 +1830,7 @@ Symfony is the result of the work of many people who made the code better - Marc Lemay (flug) - Henne Van Och (hennevo) - Jeroen De Dauw (jeroendedauw) + - Daniel Alejandro Castro Arellano (lexcast) - Maxime COLIN (maximecolin) - Muharrem Demirci (mdemirci) - Evgeny Z (meze) @@ -1808,3 +1840,4 @@ Symfony is the result of the work of many people who made the code better - Thomas BERTRAND (sevrahk) - Matej Žilák (teo_sk) - Vladislav Vlastovskiy (vlastv) + - RENAUDIN Xavier (xorrox) diff --git a/README.md b/README.md index 16a7e1b489c4d..9db99a74c0cc0 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,7 @@ Drupal and Magento). Installation ------------ -* [Install Symfony][4] with Composer or with our own installer (see - [requirements details][3]). +* [Install Symfony][4] with Composer (see [requirements details][3]). * Symfony follows the [semantic versioning][5] strictly, publishes "Long Term Support" (LTS) versions and has a [release process][6] that is predictable and business-friendly. diff --git a/appveyor.yml b/appveyor.yml index 6cee17f6feedf..cc1de26c5f8ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,6 +27,7 @@ install: - 7z x php_memcache-3.0.8-5.5-nts-vc11-x86.zip -y >nul - cd .. - copy /Y php.ini-development php.ini-min + - echo memory_limit=-1 >> php.ini-min - echo serialize_precision=14 >> php.ini-min - echo max_execution_time=1200 >> php.ini-min - echo date.timezone="America/Los_Angeles" >> php.ini-min diff --git a/composer.json b/composer.json index 977024f6cd5bc..e1c3fa6b450c5 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,7 @@ "symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php56": "~1.0", - "symfony/polyfill-php70": "~1.6", - "symfony/polyfill-util": "~1.0" + "symfony/polyfill-php70": "~1.6" }, "replace": { "symfony/asset": "self.version", diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 2f1bd008fa31b..dcdb0df8efddf 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -75,9 +75,12 @@ public static function register($mode = 0) } } } - $path = realpath($path) ?: $path; + $realPath = realpath($path); + if (false === $realPath && '-' !== $path && 'Standard input code' !== $path) { + return true; + } foreach ($vendors as $vendor) { - if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) { + if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) { return true; } } @@ -228,7 +231,7 @@ public static function register($mode = 0) uasort($deprecations[$group], $cmp); foreach ($deprecations[$group] as $msg => $notices) { - echo "\n", rtrim($msg, '.'), ': ', $notices['count'], "x\n"; + echo "\n ", $notices['count'], 'x: ', $msg, "\n"; arsort($notices); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt index cd733724870cd..39a3e985865fd 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt @@ -63,20 +63,20 @@ $foo->testNonLegacyBar(); --EXPECTF-- Unsilenced deprecation notices (3) -unsilenced foo deprecation: 2x + 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo -unsilenced bar deprecation: 1x + 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Remaining deprecation notices (1) -silenced bar deprecation: 1x + 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (1) -root deprecation: 1x + 1x: root deprecation diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation.phar b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation.phar new file mode 100644 index 0000000000000..20e1203bd058a Binary files /dev/null and b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation.phar differ diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation/deprecation.php b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation/deprecation.php new file mode 100644 index 0000000000000..b9e23e7692156 --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation/deprecation.php @@ -0,0 +1,3 @@ +buildFromDirectory(__DIR__.DIRECTORY_SEPARATOR.'deprecation'); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_eval_d_deprecation.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_eval_d_deprecation.phpt new file mode 100644 index 0000000000000..6bba1c86be5ac --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_eval_d_deprecation.phpt @@ -0,0 +1,23 @@ +--TEST-- +Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation +--FILE-- + +--EXPECTF-- + +Other deprecation notices (1) diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt index 7568d54a9ce91..e20c7adf6ba1f 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt @@ -55,20 +55,20 @@ $foo->testNonLegacyBar(); --EXPECTF-- Unsilenced deprecation notices (3) -unsilenced foo deprecation: 2x + 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo -unsilenced bar deprecation: 1x + 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Remaining deprecation notices (1) -silenced bar deprecation: 1x + 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (1) -root deprecation: 1x + 1x: root deprecation diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_phar_deprecation.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_phar_deprecation.phpt new file mode 100644 index 0000000000000..4c4879e61156d --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_phar_deprecation.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation +The phar can be regenerated by running php src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/generate_phar.php +--FILE-- + +--EXPECTF-- + +Other deprecation notices (1) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index edf11e7a3ef38..fbcedeca8c6ab 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -92,7 +92,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ } $prevRoot = getenv('COMPOSER_ROOT_VERSION'); putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99"); - $exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", array(), $p, getcwd(), null, array('bypass_shell' => true))); + $exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-suggest --no-progress --ansi", array(), $p, getcwd(), null, array('bypass_shell' => true))); putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : '')); if ($exit) { exit($exit); diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 4e4e9facc3a22..15413f1c9a0fe 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -74,6 +74,10 @@ {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-check-input')|trim}) -%} {% if 'checkbox-inline' in parent_label_class %} {{- form_label(form, null, { widget: parent() }) -}} + {% elseif 'form-check-inline' in parent_label_class %} +
*/
class DebugHandlersListenerTest extends TestCase
@@ -132,4 +130,26 @@ public function testConsoleEvent()
$xHandler(new \Exception());
}
+
+ public function testReplaceExistingExceptionHandler()
+ {
+ $userHandler = function () {};
+ $listener = new DebugHandlersListener($userHandler);
+ $eHandler = new ErrorHandler();
+ $eHandler->setExceptionHandler('var_dump');
+
+ $exception = null;
+ set_exception_handler(array($eHandler, 'handleException'));
+ try {
+ $listener->configure();
+ } catch (\Exception $exception) {
+ }
+ restore_exception_handler();
+
+ if (null !== $exception) {
+ throw $exception;
+ }
+
+ $this->assertSame($userHandler, $eHandler->setExceptionHandler('var_dump'));
+ }
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
index db34f9187bd1f..3cb0b298bb07a 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
@@ -134,7 +134,7 @@ public function testCSPHeaderIsRemoved()
return new Response($request->getRequestFormat());
}));
- $listener = new ExceptionListener('foo', $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock());
+ $listener = new ExceptionListener('foo', $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(), true);
$dispatcher->addSubscriber($listener);
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
index 8ef2dc29f7a25..342dfc367527d 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
@@ -208,4 +208,19 @@ public function testNoRoutingConfigurationResponse()
$this->assertSame(404, $response->getStatusCode());
$this->assertContains('Welcome', $response->getContent());
}
+
+ /**
+ * @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
+ */
+ public function testRequestWithBadHost()
+ {
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
+ $request = Request::create('http://bad host %22/');
+ $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
+
+ $requestMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock();
+
+ $listener = new RouterListener($requestMatcher, $this->requestStack, new RequestContext());
+ $listener->onKernelRequest($event);
+ }
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/SaveSessionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SaveSessionListenerTest.php
index 80200881c5a05..5492c3d784805 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/SaveSessionListenerTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SaveSessionListenerTest.php
@@ -32,7 +32,7 @@ public function testOnlyTriggeredOnMasterRequest()
$listener->onKernelResponse($event);
}
- public function testSessionSavedAndResponsePrivate()
+ public function testSessionSaved()
{
$listener = new SaveSessionListener();
$kernel = $this->getMockBuilder(HttpKernelInterface::class)->disableOriginalConstructor()->getMock();
@@ -45,9 +45,5 @@ public function testSessionSavedAndResponsePrivate()
$request->setSession($session);
$response = new Response();
$listener->onKernelResponse(new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response));
-
- $this->assertTrue($response->headers->hasCacheControlDirective('private'));
- $this->assertTrue($response->headers->hasCacheControlDirective('must-revalidate'));
- $this->assertSame('0', $response->headers->getCacheControlDirective('max-age'));
}
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php
new file mode 100644
index 0000000000000..34598363c8914
--- /dev/null
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php
@@ -0,0 +1,79 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Tests\EventListener;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\Session;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;
+use Symfony\Component\HttpKernel\EventListener\SessionListener;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+
+class SessionListenerTest extends TestCase
+{
+ public function testOnlyTriggeredOnMasterRequest()
+ {
+ $listener = $this->getMockForAbstractClass(AbstractSessionListener::class);
+ $event = $this->getMockBuilder(GetResponseEvent::class)->disableOriginalConstructor()->getMock();
+ $event->expects($this->once())->method('isMasterRequest')->willReturn(false);
+ $event->expects($this->never())->method('getRequest');
+
+ // sub request
+ $listener->onKernelRequest($event);
+ }
+
+ public function testSessionIsSet()
+ {
+ $session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
+
+ $container = new Container();
+ $container->set('session', $session);
+
+ $request = new Request();
+ $listener = new SessionListener($container);
+
+ $event = $this->getMockBuilder(GetResponseEvent::class)->disableOriginalConstructor()->getMock();
+ $event->expects($this->once())->method('isMasterRequest')->willReturn(true);
+ $event->expects($this->once())->method('getRequest')->willReturn($request);
+
+ $listener->onKernelRequest($event);
+
+ $this->assertTrue($request->hasSession());
+ $this->assertSame($session, $request->getSession());
+ }
+
+ public function testResponseIsPrivate()
+ {
+ $session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
+ $session->expects($this->once())->method('isStarted')->willReturn(false);
+ $session->expects($this->once())->method('hasBeenStarted')->willReturn(true);
+
+ $container = new Container();
+ $container->set('session', $session);
+
+ $listener = new SessionListener($container);
+ $kernel = $this->getMockBuilder(HttpKernelInterface::class)->disableOriginalConstructor()->getMock();
+
+ $request = new Request();
+ $response = new Response();
+ $listener->onKernelRequest(new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST));
+ $listener->onKernelResponse(new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response));
+
+ $this->assertTrue($response->headers->hasCacheControlDirective('private'));
+ $this->assertTrue($response->headers->hasCacheControlDirective('must-revalidate'));
+ $this->assertSame('0', $response->headers->getCacheControlDirective('max-age'));
+ }
+}
diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json
index 2d134e5b14943..b33675763f6e5 100644
--- a/src/Symfony/Component/HttpKernel/composer.json
+++ b/src/Symfony/Component/HttpKernel/composer.json
@@ -18,7 +18,7 @@
"require": {
"php": "^5.5.9|>=7.0.8",
"symfony/event-dispatcher": "~2.8|~3.0|~4.0",
- "symfony/http-foundation": "^3.3.11|~4.0",
+ "symfony/http-foundation": "^3.4.4|^4.0.4",
"symfony/debug": "~2.8|~3.0|~4.0",
"psr/log": "~1.0"
},
diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php
index f5b84f05b4d5c..95a492de94bb8 100644
--- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php
+++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php
@@ -883,7 +883,7 @@ private function verifyTypes($type, $value, array &$invalidTypes)
$invalidValues = array_filter( // Filter out valid values, keeping invalid values in the resulting array
$value,
function ($value) use ($type) {
- return (function_exists($isFunction = 'is_'.$type) && !$isFunction($value)) || !$value instanceof $type;
+ return !self::isValueValidType($type, $value);
}
);
@@ -896,7 +896,7 @@ function ($value) use ($type) {
return false;
}
- if ((function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type) {
+ if (self::isValueValidType($type, $value)) {
return true;
}
@@ -1073,4 +1073,9 @@ private function formatValues(array $values)
return implode(', ', $values);
}
+
+ private static function isValueValidType($type, $value)
+ {
+ return (function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
+ }
}
diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
index fb15b1843b809..440af8b5787e6 100644
--- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
+++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
@@ -486,6 +486,15 @@ public function testSetAllowedTypesFailsIfUnknownOption()
$this->resolver->setAllowedTypes('foo', 'string');
}
+ public function testResolveTypedArray()
+ {
+ $this->resolver->setDefined('foo');
+ $this->resolver->setAllowedTypes('foo', 'string[]');
+ $options = $this->resolver->resolve(array('foo' => array('bar', 'baz')));
+
+ $this->assertSame(array('foo' => array('bar', 'baz')), $options);
+ }
+
/**
* @expectedException \Symfony\Component\OptionsResolver\Exception\AccessException
*/
diff --git a/src/Symfony/Component/Process/InputStream.php b/src/Symfony/Component/Process/InputStream.php
index 831b10932599d..9bd917a7ef7ce 100644
--- a/src/Symfony/Component/Process/InputStream.php
+++ b/src/Symfony/Component/Process/InputStream.php
@@ -20,6 +20,7 @@
*/
class InputStream implements \IteratorAggregate
{
+ /** @var null|callable */
private $onEmpty = null;
private $input = array();
private $open = true;
@@ -35,7 +36,8 @@ public function onEmpty(callable $onEmpty = null)
/**
* Appends an input to the write buffer.
*
- * @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable
+ * @param resource|string|int|float|bool|\Traversable|null The input to append as scalar,
+ * stream resource or \Traversable
*/
public function write($input)
{
diff --git a/src/Symfony/Component/Process/Pipes/AbstractPipes.php b/src/Symfony/Component/Process/Pipes/AbstractPipes.php
index ba79c32702df8..2bd1fe75b7ff9 100644
--- a/src/Symfony/Component/Process/Pipes/AbstractPipes.php
+++ b/src/Symfony/Component/Process/Pipes/AbstractPipes.php
@@ -27,7 +27,7 @@ abstract class AbstractPipes implements PipesInterface
private $blocked = true;
/**
- * @param resource|scalar|\Iterator|null $input
+ * @param resource|string|int|float|bool|\Iterator|null $input
*/
public function __construct($input)
{
diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php
index 1b17f8984d1a6..830c623e0dc3b 100644
--- a/src/Symfony/Component/Process/Process.php
+++ b/src/Symfony/Component/Process/Process.php
@@ -331,7 +331,9 @@ public function start(callable $callback = null/*, array $env = array()*/)
} else {
$envPairs = array();
foreach ($env as $k => $v) {
- $envPairs[] = $k.'='.$v;
+ if (false !== $v) {
+ $envPairs[] = $k.'='.$v;
+ }
}
}
@@ -1123,7 +1125,7 @@ public function getEnv()
/**
* Sets the environment variables.
*
- * An environment variable value should be a string.
+ * Each environment variable value should be a string.
* If it is an array, the variable is ignored.
* If it is false or null, it will be removed when
* env vars are otherwise inherited.
@@ -1162,7 +1164,7 @@ public function getInput()
*
* This content will be passed to the underlying process standard input.
*
- * @param resource|scalar|\Traversable|null $input The content
+ * @param string|int|float|bool|resource|\Traversable|null $input The content
*
* @return self The current Process instance
*
diff --git a/src/Symfony/Component/Process/ProcessBuilder.php b/src/Symfony/Component/Process/ProcessBuilder.php
index 26257c21e64d5..a91147cb9f0d2 100644
--- a/src/Symfony/Component/Process/ProcessBuilder.php
+++ b/src/Symfony/Component/Process/ProcessBuilder.php
@@ -167,7 +167,7 @@ public function addEnvironmentVariables(array $variables)
/**
* Sets the input of the process.
*
- * @param resource|scalar|\Traversable|null $input The input content
+ * @param resource|string|int|float|bool|\Traversable|null $input The input content
*
* @return $this
*
diff --git a/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php
index 0ff9c9647c2cf..cf9f0704c4987 100644
--- a/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php
+++ b/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php
@@ -112,22 +112,22 @@ protected function findClass($file)
}
if (T_CLASS === $token[0]) {
- // Skip usage of ::class constant
- $isClassConstant = false;
+ // Skip usage of ::class constant and anonymous classes
+ $skipClassToken = false;
for ($j = $i - 1; $j > 0; --$j) {
if (!isset($tokens[$j][1])) {
break;
}
- if (T_DOUBLE_COLON === $tokens[$j][0]) {
- $isClassConstant = true;
+ if (T_DOUBLE_COLON === $tokens[$j][0] || T_NEW === $tokens[$j][0]) {
+ $skipClassToken = true;
break;
} elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
break;
}
}
- if (!$isClassConstant) {
+ if (!$skipClassToken) {
$class = true;
}
}
diff --git a/src/Symfony/Component/Routing/RouteCollectionBuilder.php b/src/Symfony/Component/Routing/RouteCollectionBuilder.php
index 1d9c857aa2e9f..e8a9a165d6734 100644
--- a/src/Symfony/Component/Routing/RouteCollectionBuilder.php
+++ b/src/Symfony/Component/Routing/RouteCollectionBuilder.php
@@ -76,11 +76,11 @@ public function import($resource, $prefix = '/', $type = null)
foreach ($collection->getResources() as $resource) {
$builder->addResource($resource);
}
-
- // mount into this builder
- $this->mount($prefix, $builder);
}
+ // mount into this builder
+ $this->mount($prefix, $builder);
+
return $builder;
}
diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php b/src/Symfony/Component/Routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php
new file mode 100644
index 0000000000000..de87895649491
--- /dev/null
+++ b/src/Symfony/Component/Routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php
@@ -0,0 +1,24 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Routing\Tests\Fixtures\OtherAnnotatedClasses;
+
+trait AnonymousClassInTrait
+{
+ public function test()
+ {
+ return new class() {
+ public function foo()
+ {
+ }
+ };
+ }
+}
diff --git a/src/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php
index 5d54f9f99f665..7f1d5765574a4 100644
--- a/src/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php
+++ b/src/Symfony/Component/Routing/Tests/Loader/AnnotationFileLoaderTest.php
@@ -67,6 +67,17 @@ public function testLoadVariadic()
$this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/VariadicClass.php');
}
+ /**
+ * @requires PHP 7.0
+ */
+ public function testLoadAnonymousClass()
+ {
+ $this->reader->expects($this->never())->method('getClassAnnotation');
+ $this->reader->expects($this->never())->method('getMethodAnnotations');
+
+ $this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php');
+ }
+
public function testSupports()
{
$fixture = __DIR__.'/../Fixtures/annotated.php';
diff --git a/src/Symfony/Component/Routing/Tests/RouteCollectionBuilderTest.php b/src/Symfony/Component/Routing/Tests/RouteCollectionBuilderTest.php
index 6fc592affc607..f6af600bd4221 100644
--- a/src/Symfony/Component/Routing/Tests/RouteCollectionBuilderTest.php
+++ b/src/Symfony/Component/Routing/Tests/RouteCollectionBuilderTest.php
@@ -335,4 +335,30 @@ public function testAutomaticRouteNamesDoNotConflict()
// there are 2 routes (i.e. with non-conflicting names)
$this->assertCount(3, $collection->all());
}
+
+ public function testAddsThePrefixOnlyOnceWhenLoadingMultipleCollections()
+ {
+ $firstCollection = new RouteCollection();
+ $firstCollection->add('a', new Route('/a'));
+
+ $secondCollection = new RouteCollection();
+ $secondCollection->add('b', new Route('/b'));
+
+ $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
+ $loader->expects($this->any())
+ ->method('supports')
+ ->will($this->returnValue(true));
+ $loader
+ ->expects($this->any())
+ ->method('load')
+ ->will($this->returnValue(array($firstCollection, $secondCollection)));
+
+ $routeCollectionBuilder = new RouteCollectionBuilder($loader);
+ $routeCollectionBuilder->import('/directory/recurse/*', '/other/', 'glob');
+ $routes = $routeCollectionBuilder->build()->all();
+
+ $this->assertEquals(2, count($routes));
+ $this->assertEquals('/other/a', $routes['a']->getPath());
+ $this->assertEquals('/other/b', $routes['b']->getPath());
+ }
}
diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
index a2c6e0e4f9f16..84fdb4b00c086 100644
--- a/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Security\Core\Authentication\Token;
+use Symfony\Component\Security\Core\Role\RoleInterface;
+
/**
* PreAuthenticatedToken implements a pre-authenticated token.
*
diff --git a/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php b/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php
index d4c8f33e06491..0778ba78d4869 100644
--- a/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php
+++ b/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php
@@ -13,23 +13,27 @@
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
-/**
- * Adds some function to the default ExpressionLanguage.
- *
- * @author Fabien Potencier