From 6856faf6e55c208905aa2acfdcefea1fedcc51a1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 25 Oct 2016 14:37:33 +0200 Subject: [PATCH 01/66] [SecurityBundle] Fix twig-bridge lowest dep --- src/Symfony/Bundle/SecurityBundle/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index 5c80d97691403..ee1faf659a260 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -31,7 +31,7 @@ "symfony/framework-bundle": "~2.7", "symfony/http-foundation": "~2.3", "symfony/twig-bundle": "~2.7", - "symfony/twig-bridge": "~2.7", + "symfony/twig-bridge": "~2.7,>=2.7.4", "symfony/process": "~2.0,>=2.0.5", "symfony/validator": "~2.5", "symfony/yaml": "~2.0,>=2.0.5", From 9b49723426f5cdd143cac27bcb5c8e4d2147ef80 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Wed, 26 Oct 2016 12:44:26 -0400 Subject: [PATCH 02/66] remove dead code --- .../Bridge/Doctrine/Form/Type/DoctrineType.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 5919ca95734a0..b28b9d51ad67b 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -20,14 +20,10 @@ use Symfony\Bridge\Doctrine\Form\EventListener\MergeDoctrineCollectionListener; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator; -use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface; -use Symfony\Component\Form\ChoiceList\Factory\DefaultChoiceListFactory; -use Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator; use Symfony\Component\Form\Exception\RuntimeException; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; -use Symfony\Component\PropertyAccess\PropertyAccessorInterface; abstract class DoctrineType extends AbstractType { @@ -36,11 +32,6 @@ abstract class DoctrineType extends AbstractType */ protected $registry; - /** - * @var ChoiceListFactoryInterface - */ - private $choiceListFactory; - /** * @var IdReader[] */ @@ -108,15 +99,9 @@ public function getQueryBuilderPartsForCachingHash($queryBuilder) return false; } - public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null) + public function __construct(ManagerRegistry $registry) { $this->registry = $registry; - $this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator( - new PropertyAccessDecorator( - new DefaultChoiceListFactory(), - $propertyAccessor - ) - ); } public function buildForm(FormBuilderInterface $builder, array $options) From 3dadbe6e2facb7f35ea95641460f68a7c5ae1dca Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 18:36:58 -0700 Subject: [PATCH 03/66] updated CHANGELOG for 2.7.20 --- CHANGELOG-2.7.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md index e05a5f9bf7142..c6f63e1b6c2b5 100644 --- a/CHANGELOG-2.7.md +++ b/CHANGELOG-2.7.md @@ -7,6 +7,28 @@ in 2.7 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1 +* 2.7.20 (2016-10-27) + + * bug #20289 Fix edge case with StreamedResponse where headers are sent twice (Nicofuma) + * bug #20278 [DependencyInjection] merge tags instead of completely replacing them (xabbuh) + * bug #20271 Changes related to Twig 1.27 (fabpot) + * bug #20252 Trim constant values in XmlFileLoader (lstrojny) + * bug #20253 [TwigBridge] Use non-deprecated Twig_Node::getTemplateLine() (fabpot) + * bug #20235 [DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions (klausi, nicolas-grekas) + * bug #20224 [Twig] removed deprecations added in Twig 1.27 (fabpot) + * bug #19478 fixed Filesystem:makePathRelative and added 2 more testcases (muhammedeminakbulut) + * bug #20218 [HttpFoundation] no 304 response if method is not cacheable (xabbuh) + * bug #20207 [DependencyInjection] move tags from decorated to decorating service (xabbuh) + * bug #20205 [HttpCache] fix: do not cache OPTIONS request (dmaicher) + * bug #20146 [Validator] Prevent infinite loop in PropertyMetadata (wesleylancel) + * bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr) + * bug #19725 [Security] $attributes can be anything, but RoleVoter assumes strings (Jonatan Männchen) + * bug #20127 [HttpFoundation] JSONP callback validation (ro0NL) + * bug #20163 add missing use statement (xabbuh) + * bug #19961 [Console] Escape question text and default value in SymfonyStyle::ask() (chalasr) + * bug #20141 [Console] Fix validation of empty values using SymfonyQuestionHelper::ask() (chalasr) + * bug #20147 [FrameworkBundle] Alter container class instead of kernel name in cache:clear command (nicolas-grekas) + * 2.7.19 (2016-10-03) * bug #20102 [Validator] Url validator not validating hosts ending in a number (gwkunze) From 7891a33175a2d5525b0fc91a09d77e8fd9a9cc9c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 18:37:04 -0700 Subject: [PATCH 04/66] update CONTRIBUTORS for 2.7.20 --- CONTRIBUTORS.md | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b0646cc1303cd..41c883159c8e2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -33,8 +33,8 @@ Symfony is the result of the work of many people who made the code better - Igor Wiedler (igorw) - Grégoire Pineau (lyrixx) - Eriksen Costa (eriksencosta) - - Sarah Khalil (saro0h) - Jules Pietri (heah) + - Sarah Khalil (saro0h) - Maxime Steinhausser (ogizanagi) - Jonathan Wage (jwage) - Diego Saint Esteben (dosten) @@ -49,13 +49,13 @@ Symfony is the result of the work of many people who made the code better - Henrik Bjørnskov (henrikbjorn) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) + - Robin Chalas (chalas_r) - Ener-Getick (energetick) - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - Peter Rehm (rpet) - Iltar van der Berg (kjarli) - - Robin Chalas (chalas_r) - Kevin Bond (kbond) - Andrej Hudec (pulzarraider) - Gábor Egyed (1ed) @@ -69,6 +69,7 @@ Symfony is the result of the work of many people who made the code better - Henrik Westphal (snc) - Dariusz Górecki (canni) - Douglas Greenshields (shieldo) + - Konstantin Myakshin (koc) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) @@ -76,7 +77,6 @@ Symfony is the result of the work of many people who made the code better - Titouan Galopin (tgalopin) - Daniel Holmes (dholmes) - Pierre du Plessis (pierredup) - - Konstantin Myakshin (koc) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) - John Wards (johnwards) @@ -84,17 +84,19 @@ Symfony is the result of the work of many people who made the code better - Fran Moreno (franmomu) - Antoine Hérault (herzult) - Paráda József (paradajozsef) + - Jáchym Toušek (enumag) - Arnaud Le Blanc (arnaud-lb) - Jérôme Tamarelle (gromnan) - Michal Piotrowski (eventhorizon) - Tim Nagel (merk) + - Dariusz Ruminski - Brice BERNARD (brikou) - Alexander M. Turek (derrabus) - - Dariusz Ruminski - marc.weistroff - Issei Murasawa (issei_m) - lenar - Włodzimierz Gajda (gajdaw) + - Roland Franssen (ro0) - Baptiste Clavié (talus) - Alexander Schwenn (xelaris) - Florian Voutzinos (florianv) @@ -104,8 +106,6 @@ Symfony is the result of the work of many people who made the code better - Peter Kokot (maastermedia) - excelwebzone - Jacob Dreesen (jdreesen) - - Jáchym Toušek (enumag) - - Roland Franssen (ro0) - Jérémy DERUSSÉ (jderusse) - Vladimir Reznichenko (kalessil) - Tomáš Votruba (tomas_votruba) @@ -131,6 +131,7 @@ Symfony is the result of the work of many people who made the code better - Andréia Bohner (andreia) - Rafael Dohms (rdohms) - Arnaud Kleinpeter (nanocom) + - jwdeitch - Joel Wurtz (brouznouf) - Philipp Wahala (hifi) - Vyacheslav Pavlov @@ -139,6 +140,7 @@ Symfony is the result of the work of many people who made the code better - Thomas Rabaix (rande) - Vincent AUBERT (vincent) - Rouven Weßling (realityking) + - Teoh Han Hui (teohhanhui) - Mikael Pajunen - Clemens Tolboom - Helmer Aaviksoo @@ -149,7 +151,6 @@ Symfony is the result of the work of many people who made the code better - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba - - Teoh Han Hui (teohhanhui) - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) @@ -159,10 +160,12 @@ Symfony is the result of the work of many people who made the code better - Richard Miller (mr_r_miller) - Mario A. Alvarez Garcia (nomack84) - Dennis Benkert (denderello) + - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - Benjamin Dulau (dbenjamin) - Mathieu Lemoine (lemoinem) - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) + - Lars Strojny (lstrojny) - Yonel Ceruto González (yonelceruto) - Stepan Anchugov (kix) - bronze1man @@ -185,13 +188,11 @@ Symfony is the result of the work of many people who made the code better - Michele Orselli (orso) - Tom Van Looy (tvlooy) - Sven Paulus (subsven) - - Lars Strojny (lstrojny) - Rui Marinho (ruimarinho) - Daniel Espendiller - Dawid Nowak - Eugene Wissner - Julien Brochet (mewt) - - jeremyFreeAgent (jeremyfreeagent) - Sergey Linnik (linniksa) - Michaël Perrin (michael.perrin) - Marcel Beerta (mazen) @@ -226,6 +227,7 @@ Symfony is the result of the work of many people who made the code better - Jakub Kucharovic (jkucharovic) - Eugene Leonovich (rybakit) - Filippo Tessarotto + - Tristan Darricau (nicofuma) - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon @@ -262,7 +264,6 @@ Symfony is the result of the work of many people who made the code better - Oleg Voronkovich - Manuel Kiessling (manuelkiessling) - Daniel Wehner - - Tristan Darricau (nicofuma) - Atsuhiro KUBO (iteman) - Andrew Moore (finewolf) - Bertrand Zuchuat (garfield-fr) @@ -387,6 +388,7 @@ Symfony is the result of the work of many people who made the code better - Ariel Ferrandini (aferrandini) - Dirk Pahl (dirkaholic) - cedric lombardot (cedriclombardot) + - David Maicher (dmaicher) - Jonas Flodén (flojon) - Christian Schmidt - Marcin Sikoń (marphi) @@ -535,6 +537,7 @@ Symfony is the result of the work of many people who made the code better - Daisuke Ohata - Vincent Simonin - Alex Bogomazov (alebo) + - maxime.steinhausser - Stefan Warman - Tristan Maindron (tmaindron) - Ke WANG (yktd26) @@ -546,11 +549,11 @@ Symfony is the result of the work of many people who made the code better - Ulumuddin Yunus (joenoez) - Luc Vieillescazes (iamluc) - Johann Saunier (prophet777) + - Michael Devery (mickadoo) - Antoine Corcy - Artur Eshenbrener - Arturs Vonda - Sascha Grossenbacher - - David Maicher (dmaicher) - Szijarto Tamas - Catalin Dan - Stephan Vock @@ -593,6 +596,7 @@ Symfony is the result of the work of many people who made the code better - Vladyslav Petrovych - Alex Xandra Albert Sim - Carson Full + - Andrey Astakhov (aast) - Trent Steel (trsteel88) - Yuen-Chi Lian - Besnik Br @@ -602,12 +606,14 @@ Symfony is the result of the work of many people who made the code better - avorobiev - Venu - Lars Vierbergen + - Jonatan Männchen - Dennis Hotson - Andrew Tchircoff (andrewtch) - michaelwilliams - 1emming - Victor Bocharsky (bocharsky_bw) - Leevi Graham (leevigraham) + - Jordan Deitch - Casper Valdemar Poulsen - Josiah (josiah) - Joschi Kuphal @@ -740,6 +746,7 @@ Symfony is the result of the work of many people who made the code better - Alexandru Furculita (afurculita) - Ben Ramsey (ramsey) - Christian Jul Jensen + - Alexandre GESLIN (alexandregeslin) - The Whole Life to Learn - Farhad Safarov - Liverbool (liverbool) @@ -870,12 +877,14 @@ Symfony is the result of the work of many people who made the code better - James Gilliland - Rhodri Pugh (rodnaph) - David de Boer (ddeboer) + - Klaus Purer - Gilles Doge (gido) - abulford - antograssiot - Brooks Boyd - Roger Webb - Dmitriy Simushev + - Ivo Bathke (ivoba) - Max Voloshin (maxvoloshin) - Nicolas Fabre (nfabre) - Raul Rodriguez (raul782) @@ -964,7 +973,6 @@ Symfony is the result of the work of many people who made the code better - ChrisC - Ilya Biryukov - Kim Laï Trinh - - Jonatan Männchen - Jason Desrosiers - m.chwedziak - Philip Frank @@ -994,7 +1002,6 @@ Symfony is the result of the work of many people who made the code better - Emmanuel Vella (emmanuel.vella) - Carsten Nielsen (phreaknerd) - Mathieu Rochette - - maxime.steinhausser - Jay Severson - René Kerner - Nathaniel Catchpole @@ -1044,7 +1051,6 @@ Symfony is the result of the work of many people who made the code better - Benjamin Bender - Konrad Mohrfeldt - Lance Chen - - Andrey Astakhov (aast) - Andrew (drew) - Nikolay Labinskiy (e-moe) - kor3k kor3k (kor3k) @@ -1055,6 +1061,7 @@ Symfony is the result of the work of many people who made the code better - Mephistofeles - Hoffmann András - Olivier + - Wesley Lancel - pscheit - Zdeněk Drahoš - Dan Harper @@ -1160,6 +1167,7 @@ Symfony is the result of the work of many people who made the code better - JakeFr - Simon Sargeant - efeen + - Muhammed Akbulut - Michał Dąbrowski (defrag) - Simone Fumagalli (hpatoio) - Brian Graham (incognito) @@ -1176,6 +1184,7 @@ Symfony is the result of the work of many people who made the code better - Artem Lopata (bumz) - Nicole Cordes - Alexey Popkov + - Gijs Kunze - Artyom Protaskin - Nathanael d. Noblet - helmer @@ -1445,6 +1454,7 @@ Symfony is the result of the work of many people who made the code better - Matthias Althaus - Michaël VEROUX - Julia + - Lin Lu - arduanov - sualko - Nicolas Roudaire From 8beacd2dd885742983c7fefbe69b7f4658d8187d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 18:37:19 -0700 Subject: [PATCH 05/66] updated VERSION for 2.7.20 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index a4d715cad3665..836d786e7e6bc 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.20-DEV'; + const VERSION = '2.7.20'; const VERSION_ID = 20720; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; const RELEASE_VERSION = 20; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From ed11f2236065241b9416fe458e2aecd1a028af53 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 19:12:15 -0700 Subject: [PATCH 06/66] bumped Symfony version to 2.7.21 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 836d786e7e6bc..5bd08cbd1537b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.20'; - const VERSION_ID = 20720; + const VERSION = '2.7.21-DEV'; + const VERSION_ID = 20721; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; - const RELEASE_VERSION = 20; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 21; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From 5ea7fcc92bf070901fa15fe69c97ee12e3101d9c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 19:18:10 -0700 Subject: [PATCH 07/66] updated CHANGELOG for 2.8.13 --- CHANGELOG-2.8.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index edb544ab415a8..8f0a5d2bd6bf9 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,32 @@ in 2.8 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.8.0...v2.8.1 +* 2.8.13 (2016-10-27) + + * bug #20289 Fix edge case with StreamedResponse where headers are sent twice (Nicofuma) + * bug #20267 [DependencyInjection] A decorated service should not keep the autowiring types (chalasr) + * bug #20278 [DependencyInjection] merge tags instead of completely replacing them (xabbuh) + * bug #20271 Changes related to Twig 1.27 (fabpot) + * bug #20252 Trim constant values in XmlFileLoader (lstrojny) + * bug #20253 [TwigBridge] Use non-deprecated Twig_Node::getTemplateLine() (fabpot) + * bug #20243 [WebProfilerBundle][btn-link] add `cursor: pointer` (aitboudad) + * bug #20175 [VarDumper] Fix source links with latests Twig versions (nicolas-grekas) + * bug #20235 [DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions (klausi, nicolas-grekas) + * bug #20224 [Twig] removed deprecations added in Twig 1.27 (fabpot) + * bug #19478 fixed Filesystem:makePathRelative and added 2 more testcases (muhammedeminakbulut) + * bug #20218 [HttpFoundation] no 304 response if method is not cacheable (xabbuh) + * bug #20207 [DependencyInjection] move tags from decorated to decorating service (xabbuh) + * bug #20205 [HttpCache] fix: do not cache OPTIONS request (dmaicher) + * bug #20146 [Validator] Prevent infinite loop in PropertyMetadata (wesleylancel) + * bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr) + * bug #20154 [PropertyInfo] Fix edge cases in ReflectionExtractor (nicolas-grekas) + * bug #19725 [Security] $attributes can be anything, but RoleVoter assumes strings (Jonatan Männchen) + * bug #20127 [HttpFoundation] JSONP callback validation (ro0NL) + * bug #20163 add missing use statement (xabbuh) + * bug #19961 [Console] Escape question text and default value in SymfonyStyle::ask() (chalasr) + * bug #20141 [Console] Fix validation of empty values using SymfonyQuestionHelper::ask() (chalasr) + * bug #20147 [FrameworkBundle] Alter container class instead of kernel name in cache:clear command (nicolas-grekas) + * 2.8.12 (2016-10-03) * bug #20102 [Validator] Url validator not validating hosts ending in a number (gwkunze) From 10b7b5da3b5aaf995251acede7a57044cb149f53 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 19:18:22 -0700 Subject: [PATCH 08/66] updated VERSION for 2.8.13 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index f286285766815..b7a9462a9a9eb 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.13-DEV'; + const VERSION = '2.8.13'; const VERSION_ID = 20813; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 13; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From 5abd889480e208f32ccafcc76da6f440c275a2f2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 19:36:03 -0700 Subject: [PATCH 09/66] bumped Symfony version to 2.8.14 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index b7a9462a9a9eb..62c27c0322e16 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.13'; - const VERSION_ID = 20813; + const VERSION = '2.8.14-DEV'; + const VERSION_ID = 20814; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 13; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 14; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From 0dc1a3dab156e14ae6aea0d1b72aadd27a3246d9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Oct 2016 19:53:37 -0700 Subject: [PATCH 10/66] bumped Symfony version to 3.1.7 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index e6f9f4ab3da40..e923c098b00af 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.1.6'; - const VERSION_ID = 30106; + const VERSION = '3.1.7-DEV'; + const VERSION_ID = 30107; const MAJOR_VERSION = 3; const MINOR_VERSION = 1; - const RELEASE_VERSION = 6; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 7; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2017'; const END_OF_LIFE = '07/2017'; From d090159fb27a7e4026df2ef10c27b48db6e6b713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haso=C5=88?= Date: Thu, 27 Oct 2016 10:29:18 +0200 Subject: [PATCH 11/66] [DependencyInjection] Remove old code in XML loader --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 32b62820190b1..77420ba98d407 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -152,7 +152,7 @@ private function parseDefinition(\DOMElement $service, $file) foreach (array('class', 'shared', 'public', 'synthetic', 'lazy', 'abstract') as $key) { if ($value = $service->getAttribute($key)) { - $method = 'set'.str_replace('-', '', $key); + $method = 'set'.$key; $definition->$method(XmlUtils::phpize($value)); } } From f2f232d599d114c0a186aefe8dc011aa4bb8ead2 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 25 Oct 2016 10:15:38 +0200 Subject: [PATCH 12/66] Enhance GAE compat by removing some realpath() --- .../AbstractDoctrineExtension.php | 5 +---- .../CompilerPass/DoctrineValidationPass.php | 2 +- .../Bridge/Twig/Translation/TwigExtractor.php | 2 +- .../FrameworkExtension.php | 22 +++++++++---------- .../FrameworkExtensionTest.php | 4 ++-- .../ClassLoader/ClassCollectionLoader.php | 2 +- .../ClassLoader/ClassMapGenerator.php | 2 +- .../Config/Resource/FileResource.php | 2 +- .../Iterator/DateRangeFilterIterator.php | 2 +- .../Finder/Iterator/SortableIterator.php | 4 ++-- src/Symfony/Component/Intl/Intl.php | 2 +- 11 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index e1cbbbfb1a36e..940ca6fdf9fbd 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -134,10 +134,7 @@ protected function setMappingDriverConfig(array $mappingConfig, $mappingName) throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName)); } - if (substr($mappingDirectory, 0, 7) !== 'phar://') { - $mappingDirectory = realpath($mappingDirectory); - } - $this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory; + $this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingDirectory) ?: $mappingDirectory; } /** diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php index 96f05eb5b60c9..f8382ed2ebfb8 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php @@ -61,7 +61,7 @@ private function updateValidatorMappingFiles(ContainerBuilder $container, $mappi foreach ($container->getParameter('kernel.bundles') as $bundle) { $reflection = new \ReflectionClass($bundle); if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) { - $files[] = realpath($file); + $files[] = $file; $container->addResource(new FileResource($file)); } } diff --git a/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php b/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php index 917687ad34eee..950c4d0810db0 100644 --- a/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php +++ b/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php @@ -64,7 +64,7 @@ public function extract($resource, MessageCatalogue $catalogue) if ($file instanceof SplFileInfo) { $e->setTemplateName($file->getRelativePathname()); } elseif ($file instanceof \SplFileInfo) { - $e->setTemplateName($file->getRealPath()); + $e->setTemplateName($file->getRealPath() ?: $file->getPathname()); } throw $e; diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index c8e105cddcc41..278b8b9b7d672 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -52,7 +52,7 @@ class FrameworkExtension extends Extension */ public function load(array $configs, ContainerBuilder $container) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config')); $loader->load('web.xml'); $loader->load('services.xml'); @@ -689,7 +689,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) { $r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException'); - $dirs[] = dirname($r->getFileName()).'/../Resources/translations'; + $dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations'; } $rootDir = $container->getParameter('kernel.root_dir'); foreach ($container->getParameter('kernel.bundles') as $bundle => $class) { @@ -811,21 +811,21 @@ private function getValidatorMappingFiles(ContainerBuilder $container) $dirname = dirname($reflection->getFileName()); if (is_file($file = $dirname.'/Resources/config/validation.xml')) { - $files[0][] = realpath($file); + $files[0][] = $file; $container->addResource(new FileResource($file)); } if (is_file($file = $dirname.'/Resources/config/validation.yml')) { - $files[1][] = realpath($file); + $files[1][] = $file; $container->addResource(new FileResource($file)); } if (is_dir($dir = $dirname.'/Resources/config/validation')) { foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) { - $files[0][] = $file->getRealPath(); + $files[0][] = $file->getPathname(); } foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) { - $files[1][] = $file->getRealPath(); + $files[1][] = $file->getPathname(); } $container->addResource(new DirectoryResource($dir)); @@ -926,7 +926,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder $dirname = dirname($reflection->getFileName()); if (is_file($file = $dirname.'/Resources/config/serialization.xml')) { - $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array(realpath($file))); + $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file)); $definition->setPublic(false); $serializerLoaders[] = $definition; @@ -934,7 +934,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder } if (is_file($file = $dirname.'/Resources/config/serialization.yml')) { - $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array(realpath($file))); + $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file)); $definition->setPublic(false); $serializerLoaders[] = $definition; @@ -943,13 +943,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder if (is_dir($dir = $dirname.'/Resources/config/serialization')) { foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) { - $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealPath())); + $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getPathname())); $definition->setPublic(false); $serializerLoaders[] = $definition; } foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) { - $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath())); + $definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname())); $definition->setPublic(false); $serializerLoaders[] = $definition; @@ -996,7 +996,7 @@ private function getKernelRootHash(ContainerBuilder $container) */ public function getXsdValidationBasePath() { - return __DIR__.'/../Resources/config/schema'; + return dirname(__DIR__).'/Resources/config/schema'; } public function getNamespace() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 9d93263963f9b..922d6f95738f6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -363,11 +363,11 @@ public function testValidationPaths() // Testing symfony/framework-bundle with deps=high $this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]); } - $this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.xml', $xmlMappings[1]); + $this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]); $yamlMappings = $calls[4][1][0]; $this->assertCount(1, $yamlMappings); - $this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlMappings[0]); + $this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]); } public function testValidationNoStaticMethod() diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index 18e22a5bca603..9f2001839b1da 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -62,7 +62,7 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) { throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir)); } - $cacheDir = rtrim(realpath($cacheDir), '/'.DIRECTORY_SEPARATOR); + $cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR); $cache = $cacheDir.DIRECTORY_SEPARATOR.$name.$extension; // auto-reload diff --git a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php index 07c974f4283dd..2976eb81c09cf 100644 --- a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php +++ b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php @@ -64,7 +64,7 @@ public static function createMap($dir) continue; } - $path = $file->getRealPath(); + $path = $file->getRealPath() ?: $file->getPathname(); if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') { continue; diff --git a/src/Symfony/Component/Config/Resource/FileResource.php b/src/Symfony/Component/Config/Resource/FileResource.php index 4c00ae4140abc..0723ddf0e1f20 100644 --- a/src/Symfony/Component/Config/Resource/FileResource.php +++ b/src/Symfony/Component/Config/Resource/FileResource.php @@ -32,7 +32,7 @@ class FileResource implements ResourceInterface, \Serializable */ public function __construct($resource) { - $this->resource = realpath($resource); + $this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false); } /** diff --git a/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php b/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php index 4d5ef9a4bc431..0f2d48f39ef99 100644 --- a/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php @@ -44,7 +44,7 @@ public function accept() { $fileinfo = $this->current(); - if (!file_exists($fileinfo->getRealPath())) { + if (!file_exists($fileinfo->getPathname())) { return false; } diff --git a/src/Symfony/Component/Finder/Iterator/SortableIterator.php b/src/Symfony/Component/Finder/Iterator/SortableIterator.php index fa3458077acf1..f1134c00b9489 100644 --- a/src/Symfony/Component/Finder/Iterator/SortableIterator.php +++ b/src/Symfony/Component/Finder/Iterator/SortableIterator.php @@ -41,7 +41,7 @@ public function __construct(\Traversable $iterator, $sort) if (self::SORT_BY_NAME === $sort) { $this->sort = function ($a, $b) { - return strcmp($a->getRealpath(), $b->getRealpath()); + return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_TYPE === $sort) { $this->sort = function ($a, $b) { @@ -51,7 +51,7 @@ public function __construct(\Traversable $iterator, $sort) return 1; } - return strcmp($a->getRealpath(), $b->getRealpath()); + return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { $this->sort = function ($a, $b) { diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php index 15816cbfa17c6..d49a6c9127608 100644 --- a/src/Symfony/Component/Intl/Intl.php +++ b/src/Symfony/Component/Intl/Intl.php @@ -244,7 +244,7 @@ public static function getIcuStubVersion() */ public static function getDataDirectory() { - return realpath(__DIR__.'/Resources/data'); + return __DIR__.'/Resources/data'; } /** From f16d44dbc6766c0c8bbdd6c4182cb70e7167a963 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 27 Oct 2016 13:18:01 +0200 Subject: [PATCH 13/66] [VarDumper] Fix dumping Twig source in stack traces --- .../HttpKernel/DataCollector/DumpDataCollector.php | 4 ++-- .../Component/VarDumper/Caster/ExceptionCaster.php | 3 ++- .../VarDumper/Tests/Caster/ExceptionCasterTest.php | 14 +++++--------- .../Component/VarDumper/Tests/CliDumperTest.php | 2 +- .../Component/VarDumper/Tests/Fixtures/Twig.php | 10 ++++++---- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index 538d73c783ba3..3f5e6acf63444 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -103,7 +103,7 @@ public function dump(Data $data) $info = $template->getDebugInfo(); if (isset($info[$trace[$i - 1]['line']])) { $line = $info[$trace[$i - 1]['line']]; - $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : false; + $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null; if ($src) { $src = explode("\n", $src); @@ -266,7 +266,7 @@ private function doDump($data, $name, $file, $line) if (PHP_VERSION_ID >= 50400 && $this->dumper instanceof CliDumper) { $contextDumper = function ($name, $file, $line, $fileLinkFormat) { if ($this instanceof HtmlDumper) { - if ('' !== $file) { + if ($file) { $s = $this->style('meta', '%s'); $name = strip_tags($this->style('', $name)); $file = strip_tags($this->style('', $file)); diff --git a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php index 173d79dd41d64..25635399f7bd7 100644 --- a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php @@ -149,7 +149,8 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $is $src[$f['file'].':'.$f['line']] = self::extractSource(explode("\n", file_get_contents($f['file'])), $f['line'], self::$srcContext); if (!empty($f['class']) && is_subclass_of($f['class'], 'Twig_Template') && method_exists($f['class'], 'getDebugInfo')) { - $template = isset($f['object']) ? $f['object'] : new $f['class'](new \Twig_Environment(new \Twig_Loader_Filesystem())); + $template = isset($f['object']) ? $f['object'] : unserialize(sprintf('O:%d:"%s":0:{}', strlen($f['class']), $f['class'])); + $templateName = $template->getTemplateName(); $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); $templateInfo = $template->getDebugInfo(); diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php index 4c72eb1f7529b..1614f58a9ae9b 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php @@ -26,15 +26,14 @@ public function testFrameWithTwig() $f = array( new FrameStub(array( 'file' => dirname(__DIR__).'/Fixtures/Twig.php', - 'line' => 19, + 'line' => 21, 'class' => '__TwigTemplate_VarDumperFixture_u75a09', - 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(new \Twig_Environment(new \Twig_Loader_Filesystem())), )), new FrameStub(array( 'file' => dirname(__DIR__).'/Fixtures/Twig.php', - 'line' => 19, + 'line' => 21, 'class' => '__TwigTemplate_VarDumperFixture_u75a09', - 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(new \Twig_Environment(new \Twig_Loader_Filesystem()), null), + 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, false), )), ); @@ -42,11 +41,8 @@ public function testFrameWithTwig() array:2 [ 0 => { class: "__TwigTemplate_VarDumperFixture_u75a09" - object: __TwigTemplate_VarDumperFixture_u75a09 { - %A - } src: { - %sTwig.php:19: """ + %sTwig.php:21: """ // line 2\n throw new \Exception('Foobar');\n }\n @@ -64,7 +60,7 @@ class: "__TwigTemplate_VarDumperFixture_u75a09" %A } src: { - %sTwig.php:19: """ + %sTwig.php:21: """ // line 2\n throw new \Exception('Foobar');\n }\n diff --git a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php index 36d45b6b5bb11..7a5ee0c5c3c0d 100644 --- a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php @@ -254,7 +254,7 @@ public function testThrowingCaster() -trace: { %d. __TwigTemplate_VarDumperFixture_u75a09->doDisplay() ==> new Exception(): { src: { - %sTwig.php:19: """ + %sTwig.php:21: """ // line 2\\n throw new \Exception('Foobar');\\n }\\n diff --git a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php index 7ffdd2bd54a63..9eaa39c88909c 100644 --- a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php +++ b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php @@ -5,9 +5,11 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig_Template { private $filename; - public function __construct(Twig_Environment $env, $filename = 'bar.twig') + public function __construct(Twig_Environment $env = null, $filename = null) { - parent::__construct($env); + if (null !== $env) { + parent::__construct($env); + } $this->parent = false; $this->blocks = array(); $this->filename = $filename; @@ -26,11 +28,11 @@ public function getTemplateName() public function getDebugInfo() { - return array(19 => 2); + return array(21 => 2); } public function getSourceContext() { - return new Twig_Source(" foo bar\n twig source\n\n", 'foo.twig', $this->filename); + return new Twig_Source(" foo bar\n twig source\n\n", 'foo.twig', false === $this->filename ? null : ($this->filename ?: 'bar.twig')); } } From 6bfd0f1f45e6c65f8b71c7057522e096eb9289f3 Mon Sep 17 00:00:00 2001 From: Victor Bocharsky Date: Thu, 27 Oct 2016 17:15:50 +0300 Subject: [PATCH 14/66] Remove extra line in doc-block comment --- src/Symfony/Component/Form/Extension/Core/Type/TextType.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TextType.php b/src/Symfony/Component/Form/Extension/Core/Type/TextType.php index 4776ebc4287b8..0944c38b61a2c 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TextType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TextType.php @@ -59,7 +59,6 @@ public function transform($data) /** * {@inheritdoc} - *. */ public function reverseTransform($data) { From 77c5395a79328a26c7098eb6f1282afa5356eca1 Mon Sep 17 00:00:00 2001 From: Xavier HAUSHERR Date: Thu, 27 Oct 2016 09:19:56 +0200 Subject: [PATCH 15/66] Compatibility with Twig 1.27 --- .../Bundle/TwigBundle/Loader/FilesystemLoader.php | 7 ++++++- .../Tests/Loader/FilesystemLoaderTest.php | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php index 4e0bef365ebbb..53fe300e29a62 100644 --- a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php @@ -58,6 +58,7 @@ public function exists($name) * Otherwise the template is located using the locator from the twig library. * * @param string|TemplateReferenceInterface $template The template + * @param bool $throw When true, a \Twig_Error_Loader exception will be thrown if a template could not be found * * @return string The path to the template file * @@ -87,7 +88,11 @@ protected function findTemplate($template, $throw = true) } if (false === $file || null === $file) { - throw $twigLoaderException; + if ($throw) { + throw $twigLoaderException; + } + + return false; } return $this->cache[$logicalName] = $file; diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php index 9804c08a1923b..132893e23b1d4 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php @@ -115,4 +115,17 @@ public function testTwigErrorIfTemplateDoesNotExist() $method->setAccessible(true); $method->invoke($loader, 'name.format.engine'); } + + public function testTwigSoftErrorIfTemplateDoesNotExist() + { + $parser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface'); + $locator = $this->getMock('Symfony\Component\Config\FileLocatorInterface'); + + $loader = new FilesystemLoader($locator, $parser); + $loader->addPath(__DIR__.'/../DependencyInjection/Fixtures/Resources/views'); + + $method = new \ReflectionMethod('Symfony\Bundle\TwigBundle\Loader\FilesystemLoader', 'findTemplate'); + $method->setAccessible(true); + $this->assertFalse($method->invoke($loader, 'name.format.engine', false)); + } } From c4cc3927c39f62fb27e62b444b142aef0cd9465c Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 28 Oct 2016 09:07:59 +0200 Subject: [PATCH 16/66] [PhpUnitBridge] Fix undefined variable Otherwise `$mode` is not defined on line 115 --- src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index cdf36b479dbba..0d4deb9a9bdcb 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -68,7 +68,8 @@ public static function register($mode = 0) 'other' => array(), ); $deprecationHandler = function ($type, $msg, $file, $line, $context) use (&$deprecations, $getMode) { - if (E_USER_DEPRECATED !== $type || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) { + $mode = $getMode(); + if (E_USER_DEPRECATED !== $type || DeprecationErrorHandler::MODE_DISABLED === $mode) { return \PHPUnit_Util_ErrorHandler::handleError($type, $msg, $file, $line, $context); } From 8c787a539a7117cb08f567ff0c1e18e08b8ffeb0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 28 Oct 2016 10:50:54 +0200 Subject: [PATCH 17/66] [SecurityBundle] Fix test context --- .../Tests/Functional/UserPasswordEncoderCommandTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php index 86a69fdb7624c..bdba22d2b3f0e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php @@ -144,6 +144,7 @@ protected function setUp() $kernel->boot(); $application = new Application($kernel); + $application->setTerminalDimensions(120, 80); $application->add(new UserPasswordEncoderCommand()); $passwordEncoderCommand = $application->find('security:encode-password'); From a55058f097cc6bb30b5f732a8fa01c84e0026eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Romey?= Date: Tue, 25 Oct 2016 21:57:41 +0200 Subject: [PATCH 18/66] [SecurityBundle] Changed encoder configuration example to bcrypt --- .../DependencyInjection/MainConfiguration.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index 36dbcdf89a1bd..a3e5e233f9d71 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -407,11 +407,10 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode) ->children() ->arrayNode('encoders') ->example(array( - 'Acme\DemoBundle\Entity\User1' => 'sha512', - 'Acme\DemoBundle\Entity\User2' => array( - 'algorithm' => 'sha512', - 'encode_as_base64' => 'true', - 'iterations' => 5000, + 'AppBundle\Entity\User1' => 'bcrypt', + 'AppBundle\Entity\User2' => array( + 'algorithm' => 'bcrypt', + 'cost' => 13, ), )) ->requiresAtLeastOneElement() From 46dd3b9acb19c279b56be28fb3062f9a961b51ea Mon Sep 17 00:00:00 2001 From: Maxime STEINHAUSSER Date: Fri, 28 Oct 2016 15:52:16 +0200 Subject: [PATCH 19/66] [Form] Fix UrlType transforms valid protocols --- .../EventListener/FixUrlProtocolListener.php | 2 +- .../FixUrlProtocolListenerTest.php | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php index a08337ec51908..e9a51cc988b7e 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php @@ -38,7 +38,7 @@ public function onSubmit(FormEvent $event) { $data = $event->getData(); - if ($this->defaultProtocol && $data && !preg_match('~^\w+://~', $data)) { + if ($this->defaultProtocol && $data && !preg_match('~^[\w+.-]+://~', $data)) { $event->setData($this->defaultProtocol.'://'.$data); } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php index a971ea215c02b..c3c9d08463efa 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php @@ -40,15 +40,28 @@ public function testSkipKnownUrl() $this->assertEquals('http://www.symfony.com', $event->getData()); } - public function testSkipOtherProtocol() + public function provideUrlsWithSupportedProtocols() + { + return array( + array('ftp://www.symfony.com'), + array('chrome-extension://foo'), + array('h323://foo'), + array('iris.beep://foo'), + array('foo+bar://foo'), + ); + } + + /** + * @dataProvider provideUrlsWithSupportedProtocols + */ + public function testSkipOtherProtocol($url) { - $data = 'ftp://www.symfony.com'; $form = $this->getMock('Symfony\Component\Form\Test\FormInterface'); - $event = new FormEvent($form, $data); + $event = new FormEvent($form, $url); $filter = new FixUrlProtocolListener('http'); $filter->onSubmit($event); - $this->assertEquals('ftp://www.symfony.com', $event->getData()); + $this->assertEquals($url, $event->getData()); } } From 0aca9bf03cf01438810cd1510f68c5ad509113ff Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 31 Oct 2016 11:00:03 -0700 Subject: [PATCH 20/66] [Console] simplified code --- .../Console/Helper/ProgressIndicator.php | 19 +------------------ .../Tests/Helper/ProgressIndicatorTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Component/Console/Helper/ProgressIndicator.php b/src/Symfony/Component/Console/Helper/ProgressIndicator.php index ccf9771bcf9e4..2e43bc3f5a3b8 100644 --- a/src/Symfony/Component/Console/Helper/ProgressIndicator.php +++ b/src/Symfony/Component/Console/Helper/ProgressIndicator.php @@ -28,7 +28,6 @@ class ProgressIndicator private $indicatorCurrent; private $indicatorChangeInterval; private $indicatorUpdateTime; - private $lastMessagesLength; private $started = false; private static $formatters; @@ -125,7 +124,6 @@ public function start($message) $this->message = $message; $this->started = true; - $this->lastMessagesLength = 0; $this->startTime = time(); $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; $this->indicatorCurrent = 0; @@ -262,27 +260,12 @@ private function determineBestFormat() */ private function overwrite($message) { - // append whitespace to match the line's length - if (null !== $this->lastMessagesLength) { - if ($this->lastMessagesLength > Helper::strlenWithoutDecoration($this->output->getFormatter(), $message)) { - $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); - } - } - if ($this->output->isDecorated()) { - $this->output->write("\x0D"); + $this->output->write("\x0D\x1B[2K"); $this->output->write($message); } else { $this->output->writeln($message); } - - $this->lastMessagesLength = 0; - - $len = Helper::strlenWithoutDecoration($this->output->getFormatter(), $message); - - if ($len > $this->lastMessagesLength) { - $this->lastMessagesLength = $len; - } } private function getCurrentTimeInMilliseconds() diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressIndicatorTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressIndicatorTest.php index 192625263db87..2f72d3094b9bb 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressIndicatorTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressIndicatorTest.php @@ -44,11 +44,11 @@ public function testDefaultIndicator() $this->generateOutput(' \\ Starting...'). $this->generateOutput(' \\ Advancing...'). $this->generateOutput(' | Advancing...'). - $this->generateOutput(' | Done... '). + $this->generateOutput(' | Done...'). PHP_EOL. $this->generateOutput(' - Starting Again...'). $this->generateOutput(' \\ Starting Again...'). - $this->generateOutput(' \\ Done Again... '). + $this->generateOutput(' \\ Done Again...'). PHP_EOL, stream_get_contents($output->getStream()) ); @@ -70,8 +70,8 @@ public function testNonDecoratedOutput() $this->assertEquals( ' Starting...'.PHP_EOL. - ' Midway... '.PHP_EOL. - ' Done... '.PHP_EOL.PHP_EOL, + ' Midway...'.PHP_EOL. + ' Done...'.PHP_EOL.PHP_EOL, stream_get_contents($output->getStream()) ); } @@ -177,6 +177,6 @@ protected function generateOutput($expected) { $count = substr_count($expected, "\n"); - return "\x0D".($count ? sprintf("\033[%dA", $count) : '').$expected; + return "\x0D\x1B[2K".($count ? sprintf("\033[%dA", $count) : '').$expected; } } From e3420568751cb72e3c64b3e0b77f610c52ed09d6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 2 Nov 2016 11:26:05 +0100 Subject: [PATCH 21/66] [SecurityBundle] Fix term width in UserPasswordEncoderCommandTest --- .../Tests/Functional/UserPasswordEncoderCommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php index bdba22d2b3f0e..844349ff8c576 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php @@ -144,7 +144,7 @@ protected function setUp() $kernel->boot(); $application = new Application($kernel); - $application->setTerminalDimensions(120, 80); + $application->setTerminalDimensions(119 + strlen(PHP_EOL), 80); $application->add(new UserPasswordEncoderCommand()); $passwordEncoderCommand = $application->find('security:encode-password'); From 0423d894f43a60da6d1625906f1fea536dcb5513 Mon Sep 17 00:00:00 2001 From: VJ Date: Tue, 1 Nov 2016 13:31:37 -0400 Subject: [PATCH 22/66] [HttpFoundation][Session] memcached connection should not be closed --- .../Session/Storage/Handler/MemcacheSessionHandler.php | 2 +- .../Session/Storage/Handler/MemcacheSessionHandlerTest.php | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php index a386bdd184e43..962a3878d9767 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -71,7 +71,7 @@ public function open($savePath, $sessionName) */ public function close() { - return $this->memcache->close(); + return true; } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php index 0c579d7724846..6745a22455edd 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php @@ -56,12 +56,6 @@ public function testOpenSession() public function testCloseSession() { - $this->memcache - ->expects($this->once()) - ->method('close') - ->will($this->returnValue(true)) - ; - $this->assertTrue($this->storage->close()); } From 7520f7b937a717dc4d4ba87ffaefcb9a57a06ba9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 2 Nov 2016 14:42:53 +0100 Subject: [PATCH 23/66] [Yaml] Clean some messages + add test case --- src/Symfony/Component/Yaml/Inline.php | 8 ++++---- src/Symfony/Component/Yaml/Tests/InlineTest.php | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 125def97fb04b..7f2a75b8c70b5 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -249,7 +249,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter $output = $match[1]; $i += strlen($output); } else { - throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $scalar)); } if ($evaluate) { @@ -273,7 +273,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter private static function parseQuotedScalar($scalar, &$i) { if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { - throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', substr($scalar, $i))); } $output = substr($match[0], 1, strlen($match[0]) - 2); @@ -346,7 +346,7 @@ private static function parseSequence($sequence, &$i = 0, $references = array()) ++$i; } - throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $sequence)); } /** @@ -434,7 +434,7 @@ private static function parseMapping($mapping, &$i = 0, $references = array()) } } - throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); + throw new ParseException(sprintf('Malformed inline YAML string: %s.', $mapping)); } /** diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 0e03e36a87a8a..755dfce592df8 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -401,4 +401,13 @@ public function getTestsForDump() array('{ foo: { bar: { 1: 2, baz: 3 } } }', array('foo' => array('bar' => array(1 => 2, 'baz' => 3)))), ); } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Malformed inline YAML string: {this, is not, supported}. + */ + public function testNotSupportedMissingValue() + { + Inline::parse('{this, is not, supported}'); + } } From 22d4e156344727877d94e9ea792e6ccd9ca6ff16 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sun, 30 Oct 2016 10:34:06 +0100 Subject: [PATCH 24/66] CS: apply rules --- .../Doctrine/Form/Type/DoctrineType.php | 1 - .../DoctrineExtensionTest.php | 2 +- .../Bridge/Twig/Command/DebugCommand.php | 2 +- .../Bridge/Twig/Command/LintCommand.php | 2 +- .../Command/ConfigDebugCommand.php | 2 +- .../Command/EventDispatcherDebugCommand.php | 2 +- .../Command/ServerStartCommand.php | 2 +- .../Command/ServerStopCommand.php | 2 +- .../Command/TranslationDebugCommand.php | 2 +- .../Command/YamlLintCommand.php | 2 +- .../views/Form/number_widget.html.php | 2 +- .../views/Form/password_widget.html.php | 2 +- .../views/Form/percent_widget.html.php | 2 +- .../views/Form/reset_widget.html.php | 2 +- .../views/Form/search_widget.html.php | 2 +- .../views/Form/submit_widget.html.php | 2 +- .../Resources/views/Form/url_widget.html.php | 2 +- .../Bundle/FrameworkBundle/Routing/Router.php | 1 - .../Tests/Command/RouterMatchCommandTest.php | 1 - .../Command/TranslationDebugCommandTest.php | 4 +- .../Command/TranslationUpdateCommandTest.php | 4 +- .../Descriptor/AbstractDescriptorTest.php | 1 + .../Console/Descriptor/ObjectsProvider.php | 2 + .../Resources/views/translation.html.php | 2 +- .../DataCollector/SecurityDataCollector.php | 2 +- .../Factory/SecurityFactoryInterface.php | 4 +- .../Controller/PreviewErrorControllerTest.php | 1 - .../Dumper/XmlReferenceDumperTest.php | 2 +- .../Tests/Helper/LegacyTableHelperTest.php | 4 +- .../Tests/Helper/ProcessHelperTest.php | 12 +++--- .../Console/Tests/Helper/ProgressBarTest.php | 3 -- .../Console/Tests/Helper/TableTest.php | 40 +++++++++---------- .../Component/CssSelector/Parser/Reader.php | 2 - .../Debug/Resources/ext/tests/001.phpt | 26 ++++++------ .../Debug/Resources/ext/tests/002.phpt | 3 +- .../Debug/Resources/ext/tests/002_1.phpt | 3 +- .../Debug/Resources/ext/tests/003.phpt | 2 +- .../Compiler/ExtensionCompilerPass.php | 2 +- .../Tests/ContainerBuilderTest.php | 11 +++-- .../Tests/Fixtures/includes/createphar.php | 4 +- src/Symfony/Component/DomCrawler/Crawler.php | 2 +- .../Component/DomCrawler/Tests/FormTest.php | 3 +- .../Debug/TraceableEventDispatcherTest.php | 14 +++---- .../Tests/Node/NodeTest.php | 2 +- .../Tests/Iterator/PathFilterIteratorTest.php | 1 - .../Tests/Iterator/SortableIteratorTest.php | 6 +-- .../Extension/Core/Type/FormTypeTest.php | 2 - .../Component/Form/Tests/SimpleFormTest.php | 26 ++++++------ .../HttpFoundation/Tests/RequestTest.php | 1 - .../DateFormatter/IntlDateFormatterTest.php | 4 +- .../Tests/Encoder/XmlEncoderTest.php | 6 +-- .../Tests/Normalizer/ObjectNormalizerTest.php | 28 ++++++------- .../Translation/Dumper/IcuResFileDumper.php | 2 +- .../Component/Translation/Translator.php | 6 +-- .../Validator/ConstraintValidator.php | 2 +- .../Validator/Constraints/IsbnValidator.php | 14 +++---- .../Validator/Constraints/IssnValidator.php | 14 +++---- .../Validator/Constraints/LuhnValidator.php | 4 +- .../Validator/Constraints/UuidValidator.php | 20 +++++----- .../Constraints/CallbackValidatorTest.php | 6 --- .../Component/Validator/Util/PropertyPath.php | 2 +- .../RecursiveContextualValidator.php | 1 + .../Component/VarDumper/Dumper/CliDumper.php | 2 +- .../Component/VarDumper/Dumper/HtmlDumper.php | 2 +- .../VarDumper/Tests/CliDumperTest.php | 12 +++--- .../VarDumper/Tests/HtmlDumperTest.php | 2 +- .../Component/Yaml/Tests/ParserTest.php | 30 +++++++------- src/Symfony/Component/Yaml/Unescaper.php | 2 +- 68 files changed, 185 insertions(+), 200 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 324611fba1ced..2dd139750c7bd 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -138,7 +138,6 @@ public function configureOptions(OptionsResolver $resolver) $type = $this; $choiceLoader = function (Options $options) use ($choiceListFactory, &$choiceLoaders, $type) { - // Unless the choices are given explicitly, load them on demand if (null === $options['choices']) { $hash = null; diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index 760c0fada0fab..f917f73eaa15b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -44,7 +44,7 @@ protected function setUp() $this->extension->expects($this->any()) ->method('getObjectManagerElementName') ->will($this->returnCallback(function ($name) { - return 'doctrine.orm.'.$name; + return 'doctrine.orm.'.$name; })); } diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index 898e0e2233bb6..39b910d6b4f61 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -60,7 +60,7 @@ protected function configure() new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (text or json)', 'text'), )) ->setDescription('Shows a list of twig functions, filters, globals and tests') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command outputs a list of twig functions, filters, globals and tests. Output can be filtered with an optional argument. diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index df603f93fddda..e2880f9e4b67d 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -61,7 +61,7 @@ protected function configure() ->setDescription('Lints a template and outputs encountered errors') ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') ->addArgument('filename', InputArgument::IS_ARRAY) - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command lints a template and outputs to STDOUT the first encountered syntax error. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php index 20deffcc3339f..9059905e04f54 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php @@ -39,7 +39,7 @@ protected function configure() new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'), )) ->setDescription('Dumps the current configuration for an extension') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command dumps the current configuration for an extension/bundle. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php index f30b59cf62ac8..f9bc810d0fa27 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php @@ -38,7 +38,7 @@ protected function configure() new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'), )) ->setDescription('Displays configured listeners for an application') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command displays all configured listeners: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php index 04906317fa944..2c45de91680f9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php @@ -39,7 +39,7 @@ protected function configure() )) ->setName('server:start') ->setDescription('Starts PHP built-in web server in the background') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% runs PHP's built-in web server: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php index 9b0656c220b66..84ed54c41e7a6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php @@ -33,7 +33,7 @@ protected function configure() )) ->setName('server:stop') ->setDescription('Stops PHP\'s built-in web server that was started with the server:start command') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% stops PHP's built-in web server: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index 30d44493d4c4b..64beda52656b3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -50,7 +50,7 @@ protected function configure() new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'), )) ->setDescription('Displays translation messages information') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command helps finding unused or missing translation messages and comparing them with the fallback ones by inspecting the templates and translation files of a given bundle or the app folder. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index b41f5f3479ebe..ca39257462dd3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -34,7 +34,7 @@ protected function configure() ->setDescription('Lints a file and outputs encountered errors') ->addArgument('filename', null, 'A file or a directory or STDIN') ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command lints a YAML file and outputs to STDOUT the first encountered syntax error. diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php index 324eb4782c2cc..bf4a4c478502b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php index 4390687a69330..ec96cfb46b24c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php index 59b29f4cbcfaa..8519da429b188 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> % +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> % diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php index 1575e8292801e..e8fa18e488df8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> +block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php index 4e442f6ef47ae..48a33f4aa2dbc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php index d42bb2a78ffe9..6bf71f5a1e1c9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> +block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php index 0ce4ed2ca79fd..9e26318497b3c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php index c0b68a2d17a46..4ef5f0a4bd1c4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php @@ -164,7 +164,6 @@ private function resolve($value) gettype($resolved) ) ); - }, $value); return str_replace('%%', '%', $escapedValue); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php index 93c2468dc15ae..fc7e2155537fe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php @@ -88,7 +88,6 @@ private function getContainer() ->will($this->returnValueMap(array( array('router', 1, $router), array('controller_name_converter', 1, $loader), - ))); return $container; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index c99c0ace2ac77..27f61c4383f24 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -136,7 +136,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar ->method('extract') ->will( $this->returnCallback(function ($path, $catalogue) use ($extractedMessages) { - $catalogue->add($extractedMessages); + $catalogue->add($extractedMessages); }) ); @@ -146,7 +146,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar ->method('loadMessages') ->will( $this->returnCallback(function ($path, $catalogue) use ($loadedMessages) { - $catalogue->add($loadedMessages); + $catalogue->add($loadedMessages); }) ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php index a04a0cccad77c..24a4f625f6db5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php @@ -74,7 +74,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar ->method('extract') ->will( $this->returnCallback(function ($path, $catalogue) use ($extractedMessages) { - $catalogue->add($extractedMessages); + $catalogue->add($extractedMessages); }) ); @@ -84,7 +84,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar ->method('loadMessages') ->will( $this->returnCallback(function ($path, $catalogue) use ($loadedMessages) { - $catalogue->add($loadedMessages); + $catalogue->add($loadedMessages); }) ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php index 192ba44bf737c..46249c8e7c153 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php @@ -141,6 +141,7 @@ public function getDescribeCallableTestData() } abstract protected function getDescriptor(); + abstract protected function getFormat(); private function assertDescription($expectedDescription, $describedObject, array $options = array()) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php index 52a6665416923..d6fc8b24ad264 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php @@ -191,9 +191,11 @@ class CallableClass public function __invoke() { } + public static function staticMethod() { } + public function method() { } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php index 04df261863f48..c0ae6ec5c6604 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php @@ -1,7 +1,7 @@ This template is used for translation message extraction tests trans('single-quoted key') ?> trans('double-quoted key') ?> -trans(<<trans(<<<'EOF' heredoc key EOF ) ?> diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index bd81d4927142b..092c627fa9862 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -81,7 +81,7 @@ public function collect(Request $request, Response $response, \Exception $except 'authenticated' => $token->isAuthenticated(), 'token_class' => get_class($token), 'user' => $token->getUsername(), - 'roles' => array_map(function (RoleInterface $role) { return $role->getRole();}, $assignedRoles), + 'roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $assignedRoles), 'inherited_roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $inheritedRoles), 'supports_role_hierarchy' => null !== $this->roleHierarchy, ); diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php index 2b3310c61aae4..028e885246f61 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php @@ -25,7 +25,7 @@ interface SecurityFactoryInterface * Configures the container services required to use the authentication listener. * * @param ContainerBuilder $container - * @param string $id The unique id of the firewall + * @param string $id The unique id of the firewall * @param array $config The options array for the listener * @param string $userProvider The service id of the user provider * @param string $defaultEntryPoint @@ -48,7 +48,7 @@ public function getPosition(); /** * Defines the configuration key used to reference the provider * in the firewall configuration. - * + * * @return string */ public function getKey(); diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php index 7bef647a7e283..e4a47a07694b5 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php @@ -34,7 +34,6 @@ public function testForwardRequestToConfiguredController() ->method('handle') ->with( $this->callback(function (Request $request) use ($self, $logicalControllerName, $code) { - $self->assertEquals($logicalControllerName, $request->attributes->get('_controller')); $exception = $request->attributes->get('exception'); diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php index ff043f1862382..42207b0399e37 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php @@ -34,7 +34,7 @@ public function testNamespaceDumper() private function getConfigurationAsString() { - return str_replace("\n", PHP_EOL, << diff --git a/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php index cf9ad13a78080..4875f79285f36 100644 --- a/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php @@ -112,7 +112,7 @@ public function testRenderProvider() array('ISBN', 'Title', 'Author'), $books, TableHelper::LAYOUT_COMPACT, -<<42';" OUT 42 RES Command ran successfully EOT; - $successOutputProcessDebug = <<getOutputStream()); @@ -588,7 +586,6 @@ public function testAnsiColorsAndEmojis() rewind($output->getStream()); $this->assertEquals( - " \033[44;37m Starting the demo... fingers crossed \033[0m\n". ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n". " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m" diff --git a/src/Symfony/Component/Console/Tests/Helper/TableTest.php b/src/Symfony/Component/Console/Tests/Helper/TableTest.php index 9628bc36faaee..a691405c6b30f 100644 --- a/src/Symfony/Component/Console/Tests/Helper/TableTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/TableTest.php @@ -96,7 +96,7 @@ public function testRenderProvider() array('ISBN', 'Title', 'Author'), $books, 'default', -<<
Charles Dickens'), ), 'default', -<<
render(); $expected = -<<
render(); $expected = -<<
render(); $expected = -<<
position += $length; } - /** - */ public function moveToEnd() { $this->position = $this->length; diff --git a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt index 4d41417b436e3..15e183a70615c 100644 --- a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt +++ b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt @@ -1,14 +1,14 @@ --TEST-- Test symfony_zval_info API --SKIPIF-- - + --FILE-- $int, - 'float' => $float, - 'str' => $str, - 'object' => $object, - 'array' => $array, - 'resource' => $resource, - 'null' => $null, - 'bool' => $bool, - 'refcount' => &$refcount2); +$var = array( + 'int' => $int, + 'float' => $float, + 'str' => $str, + 'object' => $object, + 'array' => $array, + 'resource' => $resource, + 'null' => $null, + 'bool' => $bool, + 'refcount' => &$refcount2, +); var_dump(symfony_zval_info('int', $var)); var_dump(symfony_zval_info('float', $var)); diff --git a/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt b/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt index ebe2f32d8f303..2bc6d71274d82 100644 --- a/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt +++ b/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt @@ -1,7 +1,7 @@ --TEST-- Test symfony_debug_backtrace in case of fatal error --SKIPIF-- - + --FILE-- + --FILE-- + --FILE-- diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 6b49b1e34fb85..eab8fccbdfcaa 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -756,12 +756,11 @@ public function testLazyLoadedService() { $loader = new ClosureLoader($container = new ContainerBuilder()); $loader->load(function (ContainerBuilder $container) { - $container->set('a', new \BazClass()); - $definition = new Definition('BazClass'); - $definition->setLazy(true); - $container->setDefinition('a', $definition); - } - ); + $container->set('a', new \BazClass()); + $definition = new Definition('BazClass'); + $definition->setLazy(true); + $container->setDefinition('a', $definition); + }); $container->setResourceTracking(true); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php index 5fa06a0eb50e6..c675478fd639c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php @@ -6,7 +6,7 @@ } $phar = new Phar($file, 0, 'ProjectWithXsdExtensionInPhar.phar'); -$phar->addFromString('ProjectWithXsdExtensionInPhar.php', <<addFromString('ProjectWithXsdExtensionInPhar.php', <<<'EOT' addFromString('schema/project-1.0.xsd', <<addFromString('schema/project-1.0.xsd', <<<'EOT' createForm('
'.$form.''); $this->assertEquals( $values, - array_map(function ($field) { + array_map( + function ($field) { $class = get_class($field); return array(substr($class, strrpos($class, '\\') + 1), $field->getValue()); diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 4aa6226e49297..9717099bf9dd6 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -25,7 +25,7 @@ public function testAddRemoveListener() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $listeners = $dispatcher->getListeners('foo'); $this->assertCount(1, $listeners); $this->assertSame($listener, $listeners[0]); @@ -39,7 +39,7 @@ public function testGetListeners() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); } @@ -51,7 +51,7 @@ public function testHasListeners() $this->assertFalse($dispatcher->hasListeners('foo')); $this->assertFalse($tdispatcher->hasListeners('foo')); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertTrue($dispatcher->hasListeners('foo')); $this->assertTrue($tdispatcher->hasListeners('foo')); } @@ -76,7 +76,7 @@ public function testGetCalledListeners() { $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getNotCalledListeners()); @@ -107,8 +107,8 @@ public function testLogger() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); - $tdispatcher->addListener('foo', $listener1 = function () {; }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener1 = function () { }); + $tdispatcher->addListener('foo', $listener2 = function () { }); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Notified event "foo" to listener "closure".'); @@ -123,7 +123,7 @@ public function testLoggerWithStoppedEvent() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener2 = function () { }); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Listener "closure" stopped propagation of the event "foo".'); diff --git a/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php b/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php index 6063c27ba4809..6901329a5e711 100644 --- a/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php +++ b/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php @@ -20,7 +20,7 @@ public function testToString() { $node = new Node(array(new ConstantNode('foo'))); - $this->assertEquals(<<assertEquals(<<<'EOF' Node( ConstantNode(value: 'foo') ) diff --git a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php index 579beed2ed444..6e10550c06e44 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php @@ -77,7 +77,6 @@ public function getTestFilterData() array($inner, array('copy/A'), array(), array('abc.dat.copy', 'ab.dat.copy', 'a.dat.copy')), array($inner, array('copy/A/B'), array(), array('abc.dat.copy', 'ab.dat.copy')), array($inner, array('copy/A/B/C'), array(), array('abc.dat.copy')), - ); } } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php index 6a3124d352a90..4750f250d736c 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php @@ -32,7 +32,7 @@ public function testAccept($mode, $expected) { if (!is_callable($mode)) { switch ($mode) { - case SortableIterator::SORT_BY_ACCESSED_TIME : + case SortableIterator::SORT_BY_ACCESSED_TIME: if ('\\' === DIRECTORY_SEPARATOR) { touch(self::toAbsolute('.git')); } else { @@ -41,12 +41,12 @@ public function testAccept($mode, $expected) sleep(1); file_get_contents(self::toAbsolute('.bar')); break; - case SortableIterator::SORT_BY_CHANGED_TIME : + case SortableIterator::SORT_BY_CHANGED_TIME: file_put_contents(self::toAbsolute('test.php'), 'foo'); sleep(1); file_put_contents(self::toAbsolute('test.py'), 'foo'); break; - case SortableIterator::SORT_BY_MODIFIED_TIME : + case SortableIterator::SORT_BY_MODIFIED_TIME: file_put_contents(self::toAbsolute('test.php'), 'foo'); sleep(1); file_put_contents(self::toAbsolute('test.py'), 'foo'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index 2b4b255b0daab..d00b8d4233506 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -436,7 +436,6 @@ public function testSubformCallsSettersIfReferenceIsScalar() $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( function () {}, function ($value) { // reverseTransform - return 'foobar'; } )); @@ -462,7 +461,6 @@ public function testSubformAlwaysInsertsIntoArrays() $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( function () {}, function ($value) use ($ref2) { // reverseTransform - return $ref2; } )); diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index ae174f045d773..8774ad0468e4d 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -641,10 +641,10 @@ public function testEmptyDataCreatedBeforeTransforming() $form = $this->getBuilder() ->setEmptyData('foo') ->addViewTransformer(new FixedDataTransformer(array( - '' => '', - // direction is reversed! - 'bar' => 'foo', - ))) + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) ->getForm(); $form->submit(''); @@ -657,17 +657,17 @@ public function testEmptyDataFromClosure() $test = $this; $form = $this->getBuilder() ->setEmptyData(function ($form) use ($test) { - // the form instance is passed to the closure to allow use - // of form data when creating the empty value - $test->assertInstanceOf('Symfony\Component\Form\FormInterface', $form); + // the form instance is passed to the closure to allow use + // of form data when creating the empty value + $test->assertInstanceOf('Symfony\Component\Form\FormInterface', $form); - return 'foo'; - }) + return 'foo'; + }) ->addViewTransformer(new FixedDataTransformer(array( - '' => '', - // direction is reversed! - 'bar' => 'foo', - ))) + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) ->getForm(); $form->submit(''); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 0c54c16b29cfc..2fa72d9aacfed 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -1090,7 +1090,6 @@ public function provideOverloadedMethods() array('put'), array('delete'), array('patch'), - ); } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index fde3bcde558de..1a2c35ffb7513 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -222,7 +222,7 @@ protected function isIntlFailure($errorCode) private function notImplemented(array $dataSets) { return array_map(function ($row) { - return array($row[0], $row[1], 0); - }, $dataSets); + return array($row[0], $row[1], 0); + }, $dataSets); } } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php index 5742b0c70acc7..256ed2fc90f9c 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php @@ -141,7 +141,7 @@ public function testEncodeXmlAttributes() public function testContext() { $array = array('person' => array('name' => 'George Abitbol')); - $expected = << @@ -255,7 +255,7 @@ public function testEncodeTraversableWhenNormalizable() $serializer = new Serializer(array(new CustomNormalizer()), array('xml' => new XmlEncoder())); $this->encoder->setSerializer($serializer); - $expected = << normalizedFoonormalizedBar @@ -366,7 +366,7 @@ public function testDecodeArray() public function testDecodeIgnoreWhiteSpace() { - $source = << diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php index 398a579b9fa75..e3780e55c0bf4 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php @@ -343,8 +343,8 @@ public function provideCallbacks() array( array( 'bar' => function ($bar) { - return 'baz'; - }, + return 'baz'; + }, ), 'baz', array('foo' => '', 'bar' => 'baz', 'baz' => true), @@ -353,8 +353,8 @@ public function provideCallbacks() array( array( 'bar' => function ($bar) { - return; - }, + return; + }, ), 'baz', array('foo' => '', 'bar' => null, 'baz' => true), @@ -363,8 +363,8 @@ public function provideCallbacks() array( array( 'bar' => function ($bar) { - return $bar->format('d-m-Y H:i:s'); - }, + return $bar->format('d-m-Y H:i:s'); + }, ), new \DateTime('2011-09-10 06:30:00'), array('foo' => '', 'bar' => '10-09-2011 06:30:00', 'baz' => true), @@ -373,13 +373,13 @@ public function provideCallbacks() array( array( 'bar' => function ($bars) { - $foos = ''; - foreach ($bars as $bar) { - $foos .= $bar->getFoo(); - } + $foos = ''; + foreach ($bars as $bar) { + $foos .= $bar->getFoo(); + } - return $foos; - }, + return $foos; + }, ), array(new ObjectConstructorDummy('baz', '', false), new ObjectConstructorDummy('quux', '', false)), array('foo' => '', 'bar' => 'bazquux', 'baz' => true), @@ -388,8 +388,8 @@ public function provideCallbacks() array( array( 'bar' => function ($bars) { - return count($bars); - }, + return count($bars); + }, ), array(new ObjectConstructorDummy('baz', '', false), new ObjectConstructorDummy('quux', '', false)), array('foo' => '', 'bar' => 2, 'baz' => true), diff --git a/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php b/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php index 126e9b7e8ac64..0fd5b35ae333b 100644 --- a/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php @@ -34,7 +34,7 @@ public function format(MessageCatalogue $messages, $domain = 'messages') foreach ($messages->all($domain) as $source => $target) { $indexes .= pack('v', strlen($data) + 28); - $data .= $source."\0"; + $data .= $source."\0"; } $data .= $this->writePadding($data); diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 1369e9783bd68..48a801d375446 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -376,9 +376,9 @@ private function getFallbackContent(MessageCatalogue $catalogue) $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); - $fallbackContent .= sprintf(<<addFallbackCatalogue(\$catalogue%s); + $fallbackContent .= sprintf(<<<'EOF' +$catalogue%s = new MessageCatalogue('%s', %s); +$catalogue%s->addFallbackCatalogue($catalogue%s); EOF , diff --git a/src/Symfony/Component/Validator/ConstraintValidator.php b/src/Symfony/Component/Validator/ConstraintValidator.php index c0db7e29eff5c..b156c6dde9a16 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -119,7 +119,7 @@ protected function formatTypeOf($value) * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped * in double quotes ("). Objects, arrays and resources are formatted as * "object", "array" and "resource". If the $format bitmask contains - * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted + * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted * as RFC-3339 dates ("Y-m-d H:i:s"). * * Be careful when passing message parameters to a constraint violation diff --git a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php index aaf52dc561c3c..6ca8488a5c725 100644 --- a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php @@ -144,14 +144,14 @@ protected function validateIsbn10($isbn) // If we test the length before the loop, we get an ERROR_TOO_SHORT // when actually an ERROR_INVALID_CHARACTERS is wanted, e.g. for // "0-45122_5244" (typo) - if (!isset($isbn{$i})) { + if (!isset($isbn[$i])) { return Isbn::TOO_SHORT_ERROR; } - if ('X' === $isbn{$i}) { + if ('X' === $isbn[$i]) { $digit = 10; - } elseif (ctype_digit($isbn{$i})) { - $digit = $isbn{$i}; + } elseif (ctype_digit($isbn[$i])) { + $digit = $isbn[$i]; } else { return Isbn::INVALID_CHARACTERS_ERROR; } @@ -159,7 +159,7 @@ protected function validateIsbn10($isbn) $checkSum += $digit * (10 - $i); } - if (isset($isbn{$i})) { + if (isset($isbn[$i])) { return Isbn::TOO_LONG_ERROR; } @@ -190,11 +190,11 @@ protected function validateIsbn13($isbn) $checkSum = 0; for ($i = 0; $i < 13; $i += 2) { - $checkSum += $isbn{$i}; + $checkSum += $isbn[$i]; } for ($i = 1; $i < 12; $i += 2) { - $checkSum += $isbn{$i} + $checkSum += $isbn[$i] * 3; } diff --git a/src/Symfony/Component/Validator/Constraints/IssnValidator.php b/src/Symfony/Component/Validator/Constraints/IssnValidator.php index 000af74f282fa..1405acfc7099a 100644 --- a/src/Symfony/Component/Validator/Constraints/IssnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IssnValidator.php @@ -48,7 +48,7 @@ public function validate($value, Constraint $constraint) // 1234-567X // ^ - if (isset($canonical{4}) && '-' === $canonical{4}) { + if (isset($canonical[4]) && '-' === $canonical[4]) { // remove hyphen $canonical = substr($canonical, 0, 4).substr($canonical, 5); } elseif ($constraint->requireHyphen) { @@ -121,7 +121,7 @@ public function validate($value, Constraint $constraint) // 1234567X // ^ digit, x or X - if (!ctype_digit($canonical{7}) && 'x' !== $canonical{7} && 'X' !== $canonical{7}) { + if (!ctype_digit($canonical[7]) && 'x' !== $canonical[7] && 'X' !== $canonical[7]) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -139,7 +139,7 @@ public function validate($value, Constraint $constraint) // 1234567X // ^ case-sensitive? - if ($constraint->caseSensitive && 'x' === $canonical{7}) { + if ($constraint->caseSensitive && 'x' === $canonical[7]) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -156,14 +156,14 @@ public function validate($value, Constraint $constraint) } // Calculate a checksum. "X" equals 10. - $checkSum = 'X' === $canonical{7} - || 'x' === $canonical{7} + $checkSum = 'X' === $canonical[7] + || 'x' === $canonical[7] ? 10 - : $canonical{7}; + : $canonical[7]; for ($i = 0; $i < 7; ++$i) { // Multiply the first digit by 8, the second by 7, etc. - $checkSum += (8 - $i) * $canonical{$i}; + $checkSum += (8 - $i) * $canonical[$i]; } if (0 !== $checkSum % 11) { diff --git a/src/Symfony/Component/Validator/Constraints/LuhnValidator.php b/src/Symfony/Component/Validator/Constraints/LuhnValidator.php index 31d4497d6e3a4..e971ab153db5a 100644 --- a/src/Symfony/Component/Validator/Constraints/LuhnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LuhnValidator.php @@ -81,7 +81,7 @@ public function validate($value, Constraint $constraint) // ^ ^ ^ ^ ^ ^ // = 7 + 9 + 7 + 9 + 7 + 3 for ($i = $length - 1; $i >= 0; $i -= 2) { - $checkSum += $value{$i}; + $checkSum += $value[$i]; } // Starting with the second last digit and walking left, double every @@ -91,7 +91,7 @@ public function validate($value, Constraint $constraint) // ^ ^ ^ ^ ^ // = 1+8 + 4 + 6 + 1+6 + 2 for ($i = $length - 2; $i >= 0; $i -= 2) { - $checkSum += array_sum(str_split($value{$i} * 2)); + $checkSum += array_sum(str_split($value[$i] * 2)); } if (0 === $checkSum || 0 !== $checkSum % 10) { diff --git a/src/Symfony/Component/Validator/Constraints/UuidValidator.php b/src/Symfony/Component/Validator/Constraints/UuidValidator.php index 02ec0b23f59f5..d025a560d28aa 100644 --- a/src/Symfony/Component/Validator/Constraints/UuidValidator.php +++ b/src/Symfony/Component/Validator/Constraints/UuidValidator.php @@ -118,7 +118,7 @@ private function validateLoose($value, Uuid $constraint) for ($i = 0; $i < $l; ++$i) { // Check length - if (!isset($trimmed{$i})) { + if (!isset($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -137,7 +137,7 @@ private function validateLoose($value, Uuid $constraint) // Hyphens must occur every fifth position // xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx // ^ ^ ^ ^ ^ ^ ^ - if ('-' === $trimmed{$i}) { + if ('-' === $trimmed[$i]) { if ($i !== $h) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) @@ -166,7 +166,7 @@ private function validateLoose($value, Uuid $constraint) } // Check characters - if (!ctype_xdigit($trimmed{$i})) { + if (!ctype_xdigit($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -184,7 +184,7 @@ private function validateLoose($value, Uuid $constraint) } // Check length again - if (isset($trimmed{$i})) { + if (isset($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -213,7 +213,7 @@ private function validateStrict($value, Uuid $constraint) for ($i = 0; $i < self::STRICT_LENGTH; ++$i) { // Check length - if (!isset($value{$i})) { + if (!isset($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -232,7 +232,7 @@ private function validateStrict($value, Uuid $constraint) // Check hyphen placement // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // ^ ^ ^ ^ - if ('-' === $value{$i}) { + if ('-' === $value[$i]) { if ($i !== $h) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) @@ -259,7 +259,7 @@ private function validateStrict($value, Uuid $constraint) } // Check characters - if (!ctype_xdigit($value{$i})) { + if (!ctype_xdigit($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -294,7 +294,7 @@ private function validateStrict($value, Uuid $constraint) } // Check length again - if (isset($value{$i})) { + if (isset($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -309,7 +309,7 @@ private function validateStrict($value, Uuid $constraint) } // Check version - if (!in_array($value{self::STRICT_VERSION_POSITION}, $constraint->versions)) { + if (!in_array($value[self::STRICT_VERSION_POSITION], $constraint->versions)) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -327,7 +327,7 @@ private function validateStrict($value, Uuid $constraint) // 0b10xx // & 0b1100 (12) // = 0b1000 (8) - if ((hexdec($value{self::STRICT_VARIANT_POSITION}) & 12) !== 8) { + if ((hexdec($value[self::STRICT_VARIANT_POSITION]) & 12) !== 8) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php index 5ad8276563344..6bd7735f0d7d5 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php @@ -185,7 +185,6 @@ public function testArrayCallableExplicitName() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -201,7 +200,6 @@ public function testLegacySingleMethodBc() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -217,7 +215,6 @@ public function testLegacySingleMethodBcExplicitName() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -235,7 +232,6 @@ public function testLegacyMultipleMethodsBc() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -255,7 +251,6 @@ public function testLegacyMultipleMethodsBcExplicitName() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -273,7 +268,6 @@ public function testLegacySingleStaticMethodBc() ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ diff --git a/src/Symfony/Component/Validator/Util/PropertyPath.php b/src/Symfony/Component/Validator/Util/PropertyPath.php index 52546c5ea9df0..4108a02c24f25 100644 --- a/src/Symfony/Component/Validator/Util/PropertyPath.php +++ b/src/Symfony/Component/Validator/Util/PropertyPath.php @@ -37,7 +37,7 @@ class PropertyPath public static function append($basePath, $subPath) { if ('' !== (string) $subPath) { - if ('[' === $subPath{0}) { + if ('[' === $subPath[0]) { return $basePath.$subPath; } diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index ebbc6a38837c9..6bcf44cb538b0 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -314,6 +314,7 @@ protected function normalizeGroups($groups) return array($groups); } + /** * Validates an object against the constraints defined for its class. * diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index a529cd4dfb26e..59ba119e42914 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -59,7 +59,7 @@ public function __construct($output = null, $charset = null) parent::__construct($output, $charset); if ('\\' === DIRECTORY_SEPARATOR && 'ON' !== @getenv('ConEmuANSI') && 'xterm' !== @getenv('TERM')) { - // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI + // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI $this->setStyles(array( 'default' => '31', 'num' => '1;34', diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index bd69f2eddf371..4f572caea3f8c 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -441,7 +441,7 @@ function ($m) { if (0xF0 <= $m[$i]) { $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; } else { $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; } diff --git a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php index cfbfa82684796..519e6a126b7dc 100644 --- a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php @@ -120,7 +120,7 @@ public function testXmlResource() $var = xml_parser_create(); $this->assertDumpMatchesFormat( - <<assertDumpMatchesFormat( - << {} "1" => &1 null @@ -161,7 +161,7 @@ public function testObjectCast() $var->{1} = 2; $this->assertDumpMatchesFormat( - <<getSpecialVars(); $this->assertDumpEquals( - << array:1 [ 0 => &1 array:1 [ @@ -342,7 +342,7 @@ public function testGlobalsNoExt() $dumper->dump($data); $this->assertSame( - << array:1 [ "GLOBALS" => &1 array:1 [ @@ -384,7 +384,7 @@ public function testBuggyRefs() }); $this->assertSame( - << array:1 [ 0 => array:1 [ diff --git a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php index 30495f7c40580..e6fd489448bd0 100644 --- a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php @@ -135,7 +135,7 @@ public function testCharset() $out = stream_get_contents($out, -1, 0); $this->assertStringMatchesFormat( - <<b"Словарь" diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 1b6193a6926ba..42b764e03e7f5 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -444,7 +444,7 @@ public function testObjectSupportDisabledButNoExceptions($input) public function testObjectForMapEnabledWithMapping() { - $yaml = << @@ -1011,7 +1011,7 @@ public function getCommentLikeStringInScalarBlockData() public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1023,7 +1023,7 @@ public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • may be a good example
EOT @@ -1035,7 +1035,7 @@ public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1047,7 +1047,7 @@ public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • @@ -1080,7 +1080,7 @@ public function parserThrowsExceptionWithCorrectLineNumberProvider() return array( array( 4, - << Date: Thu, 3 Nov 2016 08:46:56 +0100 Subject: [PATCH 25/66] Remove trailing space --- .../Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php index 132893e23b1d4..64ba490388f9f 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Loader/FilesystemLoaderTest.php @@ -115,7 +115,7 @@ public function testTwigErrorIfTemplateDoesNotExist() $method->setAccessible(true); $method->invoke($loader, 'name.format.engine'); } - + public function testTwigSoftErrorIfTemplateDoesNotExist() { $parser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface'); From 4eb003b653377de7aa9598cff6b8f04105628064 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 3 Nov 2016 08:49:30 +0100 Subject: [PATCH 26/66] CS fixes --- .../Tests/Debug/TraceableEventDispatcherTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 9717099bf9dd6..25a9533da4ece 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -25,7 +25,7 @@ public function testAddRemoveListener() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { }); + $tdispatcher->addListener('foo', $listener = function () {}); $listeners = $dispatcher->getListeners('foo'); $this->assertCount(1, $listeners); $this->assertSame($listener, $listeners[0]); @@ -39,7 +39,7 @@ public function testGetListeners() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { }); + $tdispatcher->addListener('foo', $listener = function () {}); $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); } @@ -51,7 +51,7 @@ public function testHasListeners() $this->assertFalse($dispatcher->hasListeners('foo')); $this->assertFalse($tdispatcher->hasListeners('foo')); - $tdispatcher->addListener('foo', $listener = function () { }); + $tdispatcher->addListener('foo', $listener = function () {}); $this->assertTrue($dispatcher->hasListeners('foo')); $this->assertTrue($tdispatcher->hasListeners('foo')); } @@ -76,7 +76,7 @@ public function testGetCalledListeners() { $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { }); + $tdispatcher->addListener('foo', $listener = function () {}); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getNotCalledListeners()); @@ -107,8 +107,8 @@ public function testLogger() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); - $tdispatcher->addListener('foo', $listener1 = function () { }); - $tdispatcher->addListener('foo', $listener2 = function () { }); + $tdispatcher->addListener('foo', $listener1 = function () {}); + $tdispatcher->addListener('foo', $listener2 = function () {}); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Notified event "foo" to listener "closure".'); @@ -123,7 +123,7 @@ public function testLoggerWithStoppedEvent() $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); - $tdispatcher->addListener('foo', $listener2 = function () { }); + $tdispatcher->addListener('foo', $listener2 = function () {}); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Listener "closure" stopped propagation of the event "foo".'); From 2b0cec528a19bb9ec22b46ccba95a93bfaf3e4c7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 3 Nov 2016 09:05:06 +0100 Subject: [PATCH 27/66] Remove trailing space --- .../Component/Translation/Catalogue/TargetOperation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Translation/Catalogue/TargetOperation.php b/src/Symfony/Component/Translation/Catalogue/TargetOperation.php index e081e139a33fa..f3b0a29dfb996 100644 --- a/src/Symfony/Component/Translation/Catalogue/TargetOperation.php +++ b/src/Symfony/Component/Translation/Catalogue/TargetOperation.php @@ -17,7 +17,7 @@ * all = intersection ∪ (target ∖ intersection) = target * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} * obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} - * Basically, the result contains messages from the target catalogue. + * Basically, the result contains messages from the target catalogue. * * @author Michael Lee */ @@ -34,12 +34,12 @@ protected function processDomain($domain) 'obsolete' => array(), ); - // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, + // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} // // For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} - // + // // For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} From e64de1eac65779f1aa3c9c9c4203ea2e64558907 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 1 Nov 2016 20:56:21 +0100 Subject: [PATCH 28/66] =?UTF-8?q?[Console]=C2=A0Fix=20infinite=20loop=20on?= =?UTF-8?q?=20missing=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Console] Use console exception for missing input Backport Console RuntimeException in 2.7 --- .../Console/Exception/RuntimeException.php | 19 ++++++++++++ .../Console/Helper/QuestionHelper.php | 9 ++++-- .../Tests/Helper/QuestionHelperTest.php | 31 +++++++++++++++++++ .../Helper/SymfonyQuestionHelperTest.php | 12 +++++++ 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 src/Symfony/Component/Console/Exception/RuntimeException.php diff --git a/src/Symfony/Component/Console/Exception/RuntimeException.php b/src/Symfony/Component/Console/Exception/RuntimeException.php new file mode 100644 index 0000000000000..1324558a7b912 --- /dev/null +++ b/src/Symfony/Component/Console/Exception/RuntimeException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * @author Jérôme Tamarelle + */ +class RuntimeException extends \RuntimeException +{ +} diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 6d6850d1ae826..90055b8a7029e 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Exception\RuntimeException; /** * The QuestionHelper class provides helpers to interact with the user. @@ -134,7 +135,7 @@ public function doAsk(OutputInterface $output, Question $question) if (false === $ret) { $ret = fgets($inputStream, 4096); if (false === $ret) { - throw new \RuntimeException('Aborted'); + throw new RuntimeException('Aborted'); } $ret = trim($ret); } @@ -354,7 +355,7 @@ private function getHiddenResponse(OutputInterface $output, $inputStream) shell_exec(sprintf('stty %s', $sttyMode)); if (false === $value) { - throw new \RuntimeException('Aborted'); + throw new RuntimeException('Aborted'); } $value = trim($value); @@ -372,7 +373,7 @@ private function getHiddenResponse(OutputInterface $output, $inputStream) return $value; } - throw new \RuntimeException('Unable to hide the response.'); + throw new RuntimeException('Unable to hide the response.'); } /** @@ -397,6 +398,8 @@ private function validateAttempts($interviewer, OutputInterface $output, Questio try { return call_user_func($question->getValidator(), $interviewer()); + } catch (RuntimeException $e) { + throw $e; } catch (\Exception $error) { } } diff --git a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index 6a4f8aceae9fe..86ad446c1b396 100644 --- a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -402,6 +402,37 @@ public function testChoiceOutputFormattingQuestionForUtf8Keys() $dialog->ask($this->createInputInterfaceMock(), $output, $question); } + /** + * @expectedException \Symfony\Component\Console\Exception\RuntimeException + * @expectedExceptionMessage Aborted + */ + public function testAskThrowsExceptionOnMissingInput() + { + $dialog = new QuestionHelper(); + $dialog->setInputStream($this->getInputStream('')); + + $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), new Question('What\'s your name?')); + } + + /** + * @expectedException \Symfony\Component\Console\Exception\RuntimeException + * @expectedExceptionMessage Aborted + */ + public function testAskThrowsExceptionOnMissingInputWithValidator() + { + $dialog = new QuestionHelper(); + $dialog->setInputStream($this->getInputStream('')); + + $question = new Question('What\'s your name?'); + $question->setValidator(function () { + if (!$value) { + throw new \Exception('A value is required.'); + } + }); + + $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); + } + protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); diff --git a/src/Symfony/Component/Console/Tests/Helper/SymfonyQuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/SymfonyQuestionHelperTest.php index 91f51245acd7e..f57d65070e076 100644 --- a/src/Symfony/Component/Console/Tests/Helper/SymfonyQuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/SymfonyQuestionHelperTest.php @@ -101,6 +101,18 @@ public function testAskEscapeLabel() $this->assertOutputContains('Do you want a \?', $output); } + /** + * @expectedException \Symfony\Component\Console\Exception\RuntimeException + * @expectedExceptionMessage Aborted + */ + public function testAskThrowsExceptionOnMissingInput() + { + $dialog = new SymfonyQuestionHelper(); + + $dialog->setInputStream($this->getInputStream('')); + $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), new Question('What\'s your name?')); + } + protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); From ad54d83c902a80367d27d946b00b6f3808e1e26b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 4 Nov 2016 11:57:19 +0100 Subject: [PATCH 29/66] [Yaml] set arguments depending on the PHP version --- src/Symfony/Component/Yaml/Tests/InlineTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index e414abd38bf12..83d20cc96c82a 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -507,7 +507,12 @@ public function testParseTimestampAsDateTimeObject($yaml, $year, $month, $day, $ $expected = new \DateTime($yaml); $expected->setTimeZone(new \DateTimeZone('UTC')); $expected->setDate($year, $month, $day); - @$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second)); + + if (PHP_VERSION_ID >= 70100) { + $expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second)); + } else { + $expected->setTime($hour, $minute, $second); + } $this->assertEquals($expected, Inline::parse($yaml, Yaml::PARSE_DATETIME)); } From d030a9d4036894a2a77af2100e3d23e597a0b65c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 25 Oct 2016 11:20:09 +0200 Subject: [PATCH 30/66] Improved the design of the metrics in the profiler --- .../Resources/views/Collector/time.html.twig | 20 ++++++++++--------- .../views/Profiler/profiler.css.twig | 10 ++++++++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index 98ea6c3265d2a..6860230243106 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -60,10 +60,19 @@ Symfony initialization + {% if profile.collectors.memory %} +
    + {{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} MB + Peak memory usage +
    + {% endif %} + {% if profile.children|length > 0 %} +
    +
    {{ profile.children|length }} - Sub-Requests + Sub-Request{{ profile.children|length > 1 ? 's' }}
    {% set subrequests_time = 0 %} @@ -73,14 +82,7 @@
    {{ subrequests_time }} ms - Sub-Requests time -
    - {% endif %} - - {% if profile.collectors.memory %} -
    - {{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} MB - Peak memory usage + Sub-Request{{ profile.children|length > 1 ? 's' }} time
    {% endif %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig index 4d458d3242c97..b807d0bcf9b5b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig @@ -250,12 +250,12 @@ table tbody ul { {# Metrics ------------------------------------------------------------------------- #} .metrics { - margin: 1em 0; + margin: 1em 0 0; overflow: auto; } .metrics .metric { float: left; - margin-right: 1em; + margin: 0 1em 1em 0; } .metric { @@ -310,6 +310,12 @@ table tbody ul { vertical-align: middle; } +.metric-divider { + float: left; + margin: 0 1em; + min-height: 1px; {# required to apply 'margin' to an empty 'div' #} +} + {# Cards ------------------------------------------------------------------------- #} .card { From c3dacbb9a1418e3e7c433152439f7e6ae390706f Mon Sep 17 00:00:00 2001 From: Jan Emrich Date: Fri, 4 Nov 2016 18:49:05 +0100 Subject: [PATCH 31/66] Remove double use Statement Syntax Error in Helper/QuestionHelper.php --- src/Symfony/Component/Console/Helper/QuestionHelper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 5244bb5fb842c..4b4e1a63f9fa0 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -19,7 +19,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Exception\RuntimeException; /** * The QuestionHelper class provides helpers to interact with the user. From 35642288faebec8b5d8ec9028494b43b78348a69 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Tue, 1 Nov 2016 16:33:50 -0400 Subject: [PATCH 32/66] [Form] Fix show float values as choices values in ChoiceType --- .../Component/Form/ChoiceList/ArrayChoiceList.php | 6 +++++- .../Form/Tests/ChoiceList/ArrayChoiceListTest.php | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php b/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php index 7f2824fab216a..4a2588ef1d475 100644 --- a/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php +++ b/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php @@ -236,7 +236,11 @@ private function castableToString(array $choices, array &$cache = array()) continue; } elseif (!is_scalar($choice)) { return false; - } elseif (isset($cache[$choice])) { + } + + $choice = false === $choice ? '0' : (string) $choice; + + if (isset($cache[$choice])) { return false; } diff --git a/src/Symfony/Component/Form/Tests/ChoiceList/ArrayChoiceListTest.php b/src/Symfony/Component/Form/Tests/ChoiceList/ArrayChoiceListTest.php index 09bcc9c4c2aa1..3b041eab293d1 100644 --- a/src/Symfony/Component/Form/Tests/ChoiceList/ArrayChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/ChoiceList/ArrayChoiceListTest.php @@ -34,12 +34,12 @@ protected function createChoiceList() protected function getChoices() { - return array(0, 1, '1', 'a', false, true, $this->object, null); + return array(0, 1, 1.5, '1', 'a', false, true, $this->object, null); } protected function getValues() { - return array('0', '1', '2', '3', '4', '5', '6', '7'); + return array('0', '1', '2', '3', '4', '5', '6', '7', '8'); } /** @@ -162,4 +162,13 @@ public function testGetChoicesForValuesWithContainingEmptyStringAndBooleans() $this->assertSame(array(0 => true), $choiceList->getChoicesForValues(array('1'))); $this->assertSame(array(0 => false), $choiceList->getChoicesForValues(array('0'))); } + + public function testGetChoicesForValuesWithContainingEmptyStringAndFloats() + { + $choiceList = new ArrayChoiceList(array('Empty String' => '', '1/3' => 0.3, '1/2' => 0.5)); + + $this->assertSame(array(0 => ''), $choiceList->getChoicesForValues(array(''))); + $this->assertSame(array(0 => 0.3), $choiceList->getChoicesForValues(array('0.3'))); + $this->assertSame(array(0 => 0.5), $choiceList->getChoicesForValues(array('0.5'))); + } } From eb0d6c94ca51aef6701dff88fbea2e8616e0e72d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 5 Nov 2016 23:09:07 -0700 Subject: [PATCH 33/66] removed a deprecation notice --- .../NodeVisitor/TranslationDefaultDomainNodeVisitor.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index b226d91adfe48..e64d6eae2347d 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -49,7 +49,7 @@ protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env) return $node; } else { - $var = $env->getParser()->getVarName(); + $var = $this->getVarName(); $name = new \Twig_Node_Expression_AssignName($var, $node->getTemplateLine()); $this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getTemplateLine())); @@ -123,4 +123,9 @@ private function isNamedArguments($arguments) return false; } + + private function getVarName() + { + return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false)); + } } From 27c91e514e563e090d9f8122235cf61951cde5bd Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Sun, 6 Nov 2016 08:05:17 +0000 Subject: [PATCH 34/66] [Translation][fallback] add missing resources in parent catalogues. --- .../Component/Translation/MessageCatalogue.php | 4 ++++ .../Translation/Tests/MessageCatalogueTest.php | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Translation/MessageCatalogue.php b/src/Symfony/Component/Translation/MessageCatalogue.php index dd354a85aae37..73649fb6ddcaa 100644 --- a/src/Symfony/Component/Translation/MessageCatalogue.php +++ b/src/Symfony/Component/Translation/MessageCatalogue.php @@ -178,6 +178,10 @@ public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) if ($c->getLocale() === $catalogue->getLocale()) { throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); } + + foreach ($catalogue->getResources() as $resource) { + $c->addResource($resource); + } } while ($c = $c->parent); $catalogue->parent = $this; diff --git a/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php b/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php index 6f55b8cc5e8fb..e5bb9810045f0 100644 --- a/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php +++ b/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php @@ -110,18 +110,25 @@ public function testAddFallbackCatalogue() $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); - $catalogue = new MessageCatalogue('en_US', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $r2 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r2->expects($this->any())->method('__toString')->will($this->returnValue('r2')); + + $catalogue = new MessageCatalogue('fr_FR', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); $catalogue->addResource($r); - $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo' => 'bar', 'foo1' => 'foo1'))); + $catalogue1 = new MessageCatalogue('fr', array('domain1' => array('foo' => 'bar', 'foo1' => 'foo1'))); $catalogue1->addResource($r1); + $catalogue2 = new MessageCatalogue('en'); + $catalogue2->addResource($r2); + $catalogue->addFallbackCatalogue($catalogue1); + $catalogue1->addFallbackCatalogue($catalogue2); $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); - $this->assertEquals(array($r, $r1), $catalogue->getResources()); + $this->assertEquals(array($r, $r1, $r2), $catalogue->getResources()); } /** From 9043a551b2f2ebacc00564a249234f2d32df7469 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 24 Oct 2016 11:16:47 +0200 Subject: [PATCH 35/66] Properly format value in UniqueEntityValidator --- .../Doctrine/Test/DoctrineTestHelper.php | 34 ++++++-- .../Doctrine/Test/TestRepositoryFactory.php | 85 +++++++++++++++++++ .../Tests/Fixtures/SingleIntIdEntity.php | 3 + .../Constraints/UniqueEntityValidatorTest.php | 58 +++++++++++-- .../Constraints/UniqueEntityValidator.php | 2 +- 5 files changed, 166 insertions(+), 16 deletions(-) create mode 100644 src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php diff --git a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php index 962099e36a7bc..e7f4555d07d2e 100644 --- a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php +++ b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php @@ -12,6 +12,8 @@ namespace Symfony\Bridge\Doctrine\Test; use Doctrine\Common\Annotations\AnnotationReader; +use Doctrine\Common\Cache\ArrayCache; +use Doctrine\ORM\Configuration; use Doctrine\ORM\Mapping\Driver\AnnotationDriver; use Doctrine\ORM\EntityManager; @@ -25,22 +27,19 @@ class DoctrineTestHelper /** * Returns an entity manager for testing. * + * @param Configuration|null $config + * * @return EntityManager */ - public static function createTestEntityManager() + public static function createTestEntityManager(Configuration $config = null) { if (!extension_loaded('pdo_sqlite')) { \PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.'); } - $config = new \Doctrine\ORM\Configuration(); - $config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures')); - $config->setAutoGenerateProxyClasses(true); - $config->setProxyDir(\sys_get_temp_dir()); - $config->setProxyNamespace('SymfonyTests\Doctrine'); - $config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader())); - $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); - $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); + if (null === $config) { + $config = self::createTestConfiguration(); + } $params = array( 'driver' => 'pdo_sqlite', @@ -50,6 +49,23 @@ public static function createTestEntityManager() return EntityManager::create($params, $config); } + /** + * @return Configuration + */ + public static function createTestConfiguration() + { + $config = new Configuration(); + $config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures')); + $config->setAutoGenerateProxyClasses(true); + $config->setProxyDir(\sys_get_temp_dir()); + $config->setProxyNamespace('SymfonyTests\Doctrine'); + $config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader())); + $config->setQueryCacheImpl(new ArrayCache()); + $config->setMetadataCacheImpl(new ArrayCache()); + + return $config; + } + /** * This class cannot be instantiated. */ diff --git a/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php new file mode 100644 index 0000000000000..b94a095f35418 --- /dev/null +++ b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Doctrine\Test; + +use Doctrine\Common\Persistence\ObjectRepository; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\ORM\Repository\RepositoryFactory; + +/** + * @author Andreas Braun + */ +final class TestRepositoryFactory implements RepositoryFactory +{ + /** + * The list of EntityRepository instances. + * + * @var ObjectRepository[] + */ + private $repositoryList = array(); + + /** + * {@inheritdoc} + */ + public function getRepository(EntityManagerInterface $entityManager, $entityName) + { + $repositoryHash = $this->getRepositoryHash($entityManager, $entityName); + + if (isset($this->repositoryList[$repositoryHash])) { + return $this->repositoryList[$repositoryHash]; + } + + return $this->repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName); + } + + /** + * @param EntityManagerInterface $entityManager + * @param string $entityName + * @param ObjectRepository $repository + */ + public function setRepository(EntityManagerInterface $entityManager, $entityName, ObjectRepository $repository) + { + $repositoryHash = $this->getRepositoryHash($entityManager, $entityName); + + $this->repositoryList[$repositoryHash] = $repository; + } + + /** + * Create a new repository instance for an entity class. + * + * @param EntityManagerInterface $entityManager The EntityManager instance. + * @param string $entityName The name of the entity. + * + * @return ObjectRepository + */ + private function createRepository(EntityManagerInterface $entityManager, $entityName) + { + /* @var $metadata ClassMetadata */ + $metadata = $entityManager->getClassMetadata($entityName); + $repositoryClassName = $metadata->customRepositoryClassName + ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName(); + + return new $repositoryClassName($entityManager, $metadata); + } + + /** + * @param EntityManagerInterface $entityManager + * @param string $entityName + * + * @return string + */ + private function getRepositoryHash(EntityManagerInterface $entityManager, $entityName) + { + return $entityManager->getClassMetadata($entityName)->getName().spl_object_hash($entityManager); + } +} diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php index 44630a1fc51f1..6ee360e6a10aa 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php @@ -24,6 +24,9 @@ class SingleIntIdEntity /** @Column(type="string", nullable=true) */ public $name; + /** @Column(type="array", nullable=true) */ + public $phoneNumbers = array(); + public function __construct($id, $name) { $this->id = $id; diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php index 7299f106b8967..2e2f2952e004e 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php @@ -16,6 +16,7 @@ use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\Persistence\ObjectRepository; use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; +use Symfony\Bridge\Doctrine\Test\TestRepositoryFactory; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleNameEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity; @@ -48,9 +49,16 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest */ protected $repository; + protected $repositoryFactory; + protected function setUp() { - $this->em = DoctrineTestHelper::createTestEntityManager(); + $this->repositoryFactory = new TestRepositoryFactory(); + + $config = DoctrineTestHelper::createTestConfiguration(); + $config->setRepositoryFactory($this->repositoryFactory); + + $this->em = DoctrineTestHelper::createTestEntityManager($config); $this->registry = $this->createRegistryMock($this->em); $this->createSchema($this->em); @@ -164,7 +172,7 @@ public function testValidateUniqueness() $this->buildViolation('myMessage') ->atPath('property.path.name') - ->setParameter('{{ value }}', 'Foo') + ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue('Foo') ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); @@ -189,7 +197,7 @@ public function testValidateCustomErrorPath() $this->buildViolation('myMessage') ->atPath('property.path.bar') - ->setParameter('{{ value }}', 'Foo') + ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue('Foo') ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); @@ -242,7 +250,7 @@ public function testValidateUniquenessWithIgnoreNull() $this->buildViolation('myMessage') ->atPath('property.path.name') - ->setParameter('{{ value }}', 'Foo') + ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue('Foo') ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); @@ -275,7 +283,7 @@ public function testValidateUniquenessWithValidCustomErrorPath() $this->buildViolation('myMessage') ->atPath('property.path.name2') - ->setParameter('{{ value }}', 'Bar') + ->setParameter('{{ value }}', '"Bar"') ->setInvalidValue('Bar') ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); @@ -446,7 +454,7 @@ public function testValidateUniquenessNotToStringEntityWithAssociatedEntity() $this->buildViolation('myMessage') ->atPath('property.path.single') - ->setParameter('{{ value }}', $expectedValue) + ->setParameter('{{ value }}', '"'.$expectedValue.'"') ->setInvalidValue($expectedValue) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); @@ -472,6 +480,44 @@ public function testAssociatedEntityWithNull() $this->assertNoViolation(); } + public function testValidateUniquenessWithArrayValue() + { + $repository = $this->createRepositoryMock(); + $this->repositoryFactory->setRepository($this->em, 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity', $repository); + + $constraint = new UniqueEntity(array( + 'message' => 'myMessage', + 'fields' => array('phoneNumbers'), + 'em' => self::EM_NAME, + 'repositoryMethod' => 'findByCustom', + )); + + $entity1 = new SingleIntIdEntity(1, 'foo'); + $entity1->phoneNumbers[] = 123; + + $repository->expects($this->once()) + ->method('findByCustom') + ->will($this->returnValue(array($entity1))) + ; + + $this->em->persist($entity1); + $this->em->flush(); + + $entity2 = new SingleIntIdEntity(2, 'bar'); + $entity2->phoneNumbers[] = 123; + $this->em->persist($entity2); + $this->em->flush(); + + $this->validator->validate($entity2, $constraint); + + $this->buildViolation('myMessage') + ->atPath('property.path.phoneNumbers') + ->setParameter('{{ value }}', 'array') + ->setInvalidValue(array(123)) + ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) + ->assertRaised(); + } + /** * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException * @expectedExceptionMessage Object manager "foo" does not exist. diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index 4fd8afff171b3..eb90b78af2f7d 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -133,7 +133,7 @@ public function validate($entity, Constraint $constraint) $this->context->buildViolation($constraint->message) ->atPath($errorPath) - ->setParameter('{{ value }}', $invalidValue) + ->setParameter('{{ value }}', $this->formatValue($invalidValue, static::OBJECT_TO_STRING | static::PRETTY_DATE)) ->setInvalidValue($invalidValue) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->addViolation(); From ba8a12a89867e127829b774744aa95ad3fb64fdd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 6 Nov 2016 08:20:57 -0800 Subject: [PATCH 36/66] fixed CS --- .../Doctrine/Test/TestRepositoryFactory.php | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php index b94a095f35418..b7cbafa947aef 100644 --- a/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php +++ b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php @@ -22,8 +22,6 @@ final class TestRepositoryFactory implements RepositoryFactory { /** - * The list of EntityRepository instances. - * * @var ObjectRepository[] */ private $repositoryList = array(); @@ -42,11 +40,6 @@ public function getRepository(EntityManagerInterface $entityManager, $entityName return $this->repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName); } - /** - * @param EntityManagerInterface $entityManager - * @param string $entityName - * @param ObjectRepository $repository - */ public function setRepository(EntityManagerInterface $entityManager, $entityName, ObjectRepository $repository) { $repositoryHash = $this->getRepositoryHash($entityManager, $entityName); @@ -55,29 +48,17 @@ public function setRepository(EntityManagerInterface $entityManager, $entityName } /** - * Create a new repository instance for an entity class. - * - * @param EntityManagerInterface $entityManager The EntityManager instance. - * @param string $entityName The name of the entity. - * * @return ObjectRepository */ private function createRepository(EntityManagerInterface $entityManager, $entityName) { /* @var $metadata ClassMetadata */ $metadata = $entityManager->getClassMetadata($entityName); - $repositoryClassName = $metadata->customRepositoryClassName - ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName(); + $repositoryClassName = $metadata->customRepositoryClassName ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName(); return new $repositoryClassName($entityManager, $metadata); } - /** - * @param EntityManagerInterface $entityManager - * @param string $entityName - * - * @return string - */ private function getRepositoryHash(EntityManagerInterface $entityManager, $entityName) { return $entityManager->getClassMetadata($entityName)->getName().spl_object_hash($entityManager); From 1c0f572d2e97195e55ab2a1db4dcb543e56f19f3 Mon Sep 17 00:00:00 2001 From: Lesnykh Ilia Date: Mon, 7 Nov 2016 10:23:54 +0300 Subject: [PATCH 37/66] Update UPGRADE-2.7.md --- UPGRADE-2.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md index 5de67ebede36c..1cf3d3df7f4dc 100644 --- a/UPGRADE-2.7.md +++ b/UPGRADE-2.7.md @@ -40,7 +40,7 @@ Form ---- * In form types and extension overriding the "setDefaultOptions" of the - AbstractType or AbstractExtensionType has been deprecated in favor of + AbstractType or AbstractTypeExtension has been deprecated in favor of overriding the new "configureOptions" method. The method "setDefaultOptions(OptionsResolverInterface $resolver)" will From b2fa7c4f0772b0729892055fdbfaaff51e78bf6e Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Mon, 7 Nov 2016 13:32:19 +0100 Subject: [PATCH 38/66] Revert "bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr)" This reverts commit 3f650f864cdd041d668336d917c6cfb2bbe4f156, reversing changes made to 962248dbd949421c9a6f66b43827395adaea4180. --- .../FrameworkBundle/Command/TranslationUpdateCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index 920c50c1d793f..f310613d10315 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -118,9 +118,8 @@ protected function execute(InputInterface $input, OutputInterface $output) // load any messages from templates $extractedCatalogue = new MessageCatalogue($input->getArgument('locale')); $output->text('Parsing templates'); - $prefix = $input->getOption('prefix'); $extractor = $this->getContainer()->get('translation.extractor'); - $extractor->setPrefix(null === $prefix ? '' : $prefix); + $extractor->setPrefix($input->getOption('prefix')); foreach ($transPaths as $path) { $path .= 'views'; if (is_dir($path)) { From a2c0a785c2eaf4425c1b79d6cd080404d34c28b1 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Sat, 22 Oct 2016 10:49:12 +0000 Subject: [PATCH 39/66] [HttpFoundation] Avoid implicit null to array conversion in request matcher --- .../HttpFoundation/RequestMatcher.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/RequestMatcher.php b/src/Symfony/Component/HttpFoundation/RequestMatcher.php index ca094ca16293a..aa4f67b58bb43 100644 --- a/src/Symfony/Component/HttpFoundation/RequestMatcher.php +++ b/src/Symfony/Component/HttpFoundation/RequestMatcher.php @@ -19,22 +19,22 @@ class RequestMatcher implements RequestMatcherInterface { /** - * @var string + * @var string|null */ private $path; /** - * @var string + * @var string|null */ private $host; /** - * @var array + * @var string[] */ private $methods = array(); /** - * @var string + * @var string[] */ private $ips = array(); @@ -76,13 +76,13 @@ public function __construct($path = null, $host = null, $methods = null, $ips = */ public function matchScheme($scheme) { - $this->schemes = array_map('strtolower', (array) $scheme); + $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : array(); } /** * Adds a check for the URL host name. * - * @param string $regexp A Regexp + * @param string|null $regexp A Regexp */ public function matchHost($regexp) { @@ -92,7 +92,7 @@ public function matchHost($regexp) /** * Adds a check for the URL path info. * - * @param string $regexp A Regexp + * @param string|null $regexp A Regexp */ public function matchPath($regexp) { @@ -112,21 +112,21 @@ public function matchIp($ip) /** * Adds a check for the client IP. * - * @param string|string[] $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 + * @param string|string[]|null $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 */ public function matchIps($ips) { - $this->ips = (array) $ips; + $this->ips = null !== $ips ? (array) $ips : array(); } /** * Adds a check for the HTTP method. * - * @param string|string[] $method An HTTP method or an array of HTTP methods + * @param string|string[]|null $method An HTTP method or an array of HTTP methods */ public function matchMethod($method) { - $this->methods = array_map('strtoupper', (array) $method); + $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : array(); } /** @@ -145,11 +145,11 @@ public function matchAttribute($key, $regexp) */ public function matches(Request $request) { - if ($this->schemes && !in_array($request->getScheme(), $this->schemes)) { + if ($this->schemes && !in_array($request->getScheme(), $this->schemes, true)) { return false; } - if ($this->methods && !in_array($request->getMethod(), $this->methods)) { + if ($this->methods && !in_array($request->getMethod(), $this->methods, true)) { return false; } From adbc529b7b355e93b00c2f8db0a1c843c5c646c5 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 7 Nov 2016 19:42:43 +0100 Subject: [PATCH 40/66] prefer getSourceContext() over getSource() --- .../Twig/Tests/Extension/TranslationExtensionTest.php | 2 +- src/Symfony/Bridge/Twig/TwigEngine.php | 4 ++-- .../Bundle/TwigBundle/Controller/ExceptionController.php | 4 ++-- .../HttpKernel/Fragment/HIncludeFragmentRenderer.php | 8 ++++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php index 0235c4da327a0..e96bd4f9a3bef 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php @@ -36,7 +36,7 @@ public function testTrans($template, $expected, array $variables = array()) $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); $twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector()))); - echo $twig->compile($twig->parse($twig->tokenize(new \Twig_Source($twig->getLoader()->getSource('index'), 'index'))))."\n\n"; + echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSourceContext('index'))))."\n\n"; $this->assertEquals($expected, $this->getTemplate($template)->render($variables)); } diff --git a/src/Symfony/Bridge/Twig/TwigEngine.php b/src/Symfony/Bridge/Twig/TwigEngine.php index 3e3257e7fa0f5..1ac9d0102e63b 100644 --- a/src/Symfony/Bridge/Twig/TwigEngine.php +++ b/src/Symfony/Bridge/Twig/TwigEngine.php @@ -75,14 +75,14 @@ public function exists($name) $loader = $this->environment->getLoader(); - if ($loader instanceof \Twig_ExistsLoaderInterface) { + if ($loader instanceof \Twig_ExistsLoaderInterface || method_exists($loader, 'exists')) { return $loader->exists((string) $name); } try { // cast possible TemplateReferenceInterface to string because the // EngineInterface supports them but Twig_LoaderInterface does not - $loader->getSource((string) $name); + $loader->getSourceContext((string) $name)->getCode(); } catch (\Twig_Error_Loader $e) { return false; } diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index 3eec8d6be92ec..b6972fc6354cd 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -131,12 +131,12 @@ protected function templateExists($template) $template = (string) $template; $loader = $this->twig->getLoader(); - if ($loader instanceof \Twig_ExistsLoaderInterface) { + if ($loader instanceof \Twig_ExistsLoaderInterface || method_exists($loader, 'exists')) { return $loader->exists($template); } try { - $loader->getSource($template); + $loader->getSourceContext($template)->getCode(); return true; } catch (\Twig_Error_Loader $e) { diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index 56c96b3ceda3f..27051cfb772ee 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -140,12 +140,16 @@ private function templateExists($template) } $loader = $this->templating->getLoader(); - if ($loader instanceof \Twig_ExistsLoaderInterface) { + if ($loader instanceof \Twig_ExistsLoaderInterface || method_exists($loader, 'exists')) { return $loader->exists($template); } try { - $loader->getSource($template); + if (method_exists($loader, 'getSourceContext')) { + $loader->getSourceContext($template); + } else { + $loader->getSource($template); + } return true; } catch (\Twig_Error_Loader $e) { From 201603137c761579eeb5b2f5e3c76608285308c3 Mon Sep 17 00:00:00 2001 From: Lesnykh Ilia Date: Tue, 8 Nov 2016 16:51:01 +0300 Subject: [PATCH 41/66] Added single quotes for upgrade guides. --- UPGRADE-2.8.md | 4 ++-- UPGRADE-3.0.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADE-2.8.md b/UPGRADE-2.8.md index 957f35b505cff..ae87a131a9d17 100644 --- a/UPGRADE-2.8.md +++ b/UPGRADE-2.8.md @@ -628,7 +628,7 @@ HttpFoundation After: ```php - $request->query->get('foo')[bar]; + $request->query->get('foo')['bar']; ``` Routing @@ -657,4 +657,4 @@ Routing // url generated in @router service $router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL); - ``` \ No newline at end of file + ``` diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 68e3780d8ab36..f6bd000ad129d 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -1750,5 +1750,5 @@ UPGRADE FROM 2.x to 3.0 After: ```php - $request->query->get('foo')[bar]; + $request->query->get('foo')['bar']; ``` From 6d4a658ab7a6860f1106565aa1d97f004d37dd56 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 9 Nov 2016 12:04:28 +0100 Subject: [PATCH 42/66] [Cache] Make directory hashing case insensitive --- .../DependencyInjection/Compiler/CachePoolPass.php | 2 +- .../DependencyInjection/FrameworkExtension.php | 2 +- .../DependencyInjection/Compiler/CachePoolPassTest.php | 4 ++-- src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php index 49e97b73c6402..1748862219ddf 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php @@ -84,7 +84,7 @@ public function process(ContainerBuilder $container) private function getNamespace($namespaceSuffix, $id) { - return substr(str_replace('/', '-', base64_encode(md5($id.$namespaceSuffix, true))), 0, 10); + return substr(str_replace('/', '-', base64_encode(hash('sha256', $id.$namespaceSuffix, true))), 0, 10); } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 3a2e40dcf60c3..9e9d797191a4e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1037,7 +1037,7 @@ private function registerPropertyInfoConfiguration(array $config, ContainerBuild private function registerCacheConfiguration(array $config, ContainerBuilder $container) { - $version = substr(str_replace('/', '-', base64_encode(md5(uniqid(mt_rand(), true), true))), 0, -2); + $version = substr(str_replace('/', '-', base64_encode(hash('sha256', uniqid(mt_rand(), true), true))), 0, 22); $container->getDefinition('cache.adapter.apcu')->replaceArgument(2, $version); $container->getDefinition('cache.adapter.system')->replaceArgument(2, $version); $container->getDefinition('cache.adapter.filesystem')->replaceArgument(2, $config['directory']); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php index 1f77cdd0fe60b..53cb95837f7e8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php @@ -41,7 +41,7 @@ public function testNamespaceArgumentIsReplaced() $this->cachePoolPass->process($container); - $this->assertSame('VcRIZlUhEv', $cachePool->getArgument(0)); + $this->assertSame('kRFqMp5odS', $cachePool->getArgument(0)); } public function testArgsAreReplaced() @@ -61,7 +61,7 @@ public function testArgsAreReplaced() $this->assertInstanceOf(Reference::class, $cachePool->getArgument(0)); $this->assertSame('foobar', (string) $cachePool->getArgument(0)); - $this->assertSame('VcRIZlUhEv', $cachePool->getArgument(1)); + $this->assertSame('kRFqMp5odS', $cachePool->getArgument(1)); $this->assertSame(3, $cachePool->getArgument(2)); } diff --git a/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php b/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php index 4734f71ee2a1f..81886b4d11a54 100644 --- a/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php @@ -146,13 +146,13 @@ protected function doSave(array $values, $lifetime) private function getFile($id, $mkdir = false) { - $hash = str_replace('/', '-', base64_encode(md5($id, true))); - $dir = $this->directory.$hash[0].DIRECTORY_SEPARATOR.$hash[1].DIRECTORY_SEPARATOR; + $hash = str_replace('/', '-', base64_encode(hash('sha256', $id, true))); + $dir = $this->directory.strtoupper($hash[0].DIRECTORY_SEPARATOR.$hash[1].DIRECTORY_SEPARATOR); if ($mkdir && !file_exists($dir)) { @mkdir($dir, 0777, true); } - return $dir.substr($hash, 2, -2); + return $dir.substr($hash, 2, 20); } } From 5a1bf6aa6e4eff880c376fe32f425942da357af8 Mon Sep 17 00:00:00 2001 From: Karim Miladi Date: Mon, 7 Nov 2016 18:16:01 +0100 Subject: [PATCH 43/66] [Command] Fixed method comments as phpDoc syntax --- src/Symfony/Component/Console/Command/Command.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php index dcda54b637953..0948d42b5755d 100644 --- a/src/Symfony/Component/Console/Command/Command.php +++ b/src/Symfony/Component/Console/Command/Command.php @@ -202,8 +202,6 @@ protected function initialize(InputInterface $input, OutputInterface $output) * * @return int The command exit code * - * @throws \Exception - * * @see setCode() * @see execute() */ From dd47295c15b5644dadad5d8cb6c81eea37a8ec62 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Mon, 7 Nov 2016 22:01:27 +0100 Subject: [PATCH 44/66] fixed phpdoc --- src/Symfony/Component/Yaml/Inline.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 7f2a75b8c70b5..624088fbba767 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -28,7 +28,7 @@ class Inline private static $objectForMap = false; /** - * Converts a YAML string to a PHP array. + * Converts a YAML string to a PHP value. * * @param string $value A YAML string * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise @@ -36,7 +36,7 @@ class Inline * @param bool $objectForMap true if maps should return a stdClass instead of array() * @param array $references Mapping of variable names to values * - * @return array A PHP array representing the YAML string + * @return mixed A PHP value * * @throws ParseException */ @@ -90,7 +90,7 @@ public static function parse($value, $exceptionOnInvalidType = false, $objectSup * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * - * @return string The YAML string representing the PHP array + * @return string The YAML string representing the PHP value * * @throws DumpException When trying to dump PHP resource */ @@ -210,7 +210,7 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor } /** - * Parses a scalar to a YAML string. + * Parses a YAML scalar. * * @param string $scalar * @param string $delimiters @@ -219,7 +219,7 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor * @param bool $evaluate * @param array $references * - * @return string A YAML string + * @return string * * @throws ParseException When malformed inline YAML string is parsed */ @@ -261,12 +261,12 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter } /** - * Parses a quoted scalar to YAML. + * Parses a YAML quoted scalar. * * @param string $scalar * @param int &$i * - * @return string A YAML string + * @return string * * @throws ParseException When malformed inline YAML string is parsed */ @@ -291,13 +291,13 @@ private static function parseQuotedScalar($scalar, &$i) } /** - * Parses a sequence to a YAML string. + * Parses a YAML sequence. * * @param string $sequence * @param int &$i * @param array $references * - * @return string A YAML string + * @return array * * @throws ParseException When malformed inline YAML string is parsed */ @@ -350,13 +350,13 @@ private static function parseSequence($sequence, &$i = 0, $references = array()) } /** - * Parses a mapping to a YAML string. + * Parses a YAML mapping. * * @param string $mapping * @param int &$i * @param array $references * - * @return string A YAML string + * @return array|\stdClass * * @throws ParseException When malformed inline YAML string is parsed */ From bac217dd833a60269e5a49f6a4c0be433aa389ae Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Wed, 9 Nov 2016 19:27:17 +0000 Subject: [PATCH 45/66] [Translation] fixed nested fallback catalogue using multiple locales. --- .../Component/Translation/Tests/TranslatorTest.php | 10 ++++++++++ src/Symfony/Component/Translation/Translator.php | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index ac5aaf9ec12a2..8756844b467c7 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorTest.php @@ -273,6 +273,16 @@ public function testWhenAResourceHasNoRegisteredLoader() $translator->trans('foo'); } + public function testNestedFallbackCatalogueWhenUsingMultipleLocales() + { + $translator = new Translator('fr'); + $translator->setFallbackLocales(array('ru', 'en')); + + $translator->getCatalogue('fr'); + + $this->assertNotNull($translator->getCatalogue('ru')->getFallbackCatalogue()); + } + public function testFallbackCatalogueResources() { $translator = new Translator('en_GB', new MessageSelector()); diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 48a801d375446..ed80a5e49f0fd 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -159,7 +159,7 @@ public function getLocale() * * @throws \InvalidArgumentException If a locale contains invalid characters * - * @deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead. + * @deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead */ public function setFallbackLocale($locales) { @@ -420,7 +420,7 @@ private function loadFallbackCatalogues($locale) foreach ($this->computeFallbackLocales($locale) as $fallback) { if (!isset($this->catalogues[$fallback])) { - $this->doLoadCatalogue($fallback); + $this->loadCatalogue($fallback); } $fallbackCatalogue = new MessageCatalogue($fallback, $this->catalogues[$fallback]->all()); From 31deea1d3dff2dd3b4ea8786776ea90288d832e0 Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Wed, 9 Nov 2016 20:23:10 +0000 Subject: [PATCH 46/66] [TranslationDebug] workaround for getFallbackLocales. --- .../Command/TranslationDebugCommand.php | 4 +++- .../Translation/DataCollectorTranslator.php | 14 ++++++++++++++ .../Component/Translation/LoggingTranslator.php | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index 64beda52656b3..be4696adfd806 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -19,6 +19,8 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\DataCollectorTranslator; +use Symfony\Component\Translation\LoggingTranslator; /** * Helps finding unused or missing translation messages in a given locale @@ -157,7 +159,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // Load the fallback catalogues $fallbackCatalogues = array(); $translator = $this->getContainer()->get('translator'); - if ($translator instanceof Translator) { + if ($translator instanceof Translator || $translator instanceof DataCollectorTranslator || $translator instanceof LoggingTranslator) { foreach ($translator->getFallbackLocales() as $fallbackLocale) { if ($fallbackLocale === $locale) { continue; diff --git a/src/Symfony/Component/Translation/DataCollectorTranslator.php b/src/Symfony/Component/Translation/DataCollectorTranslator.php index f88a467a1d12c..b2049d47511ce 100644 --- a/src/Symfony/Component/Translation/DataCollectorTranslator.php +++ b/src/Symfony/Component/Translation/DataCollectorTranslator.php @@ -88,6 +88,20 @@ public function getCatalogue($locale = null) return $this->translator->getCatalogue($locale); } + /** + * Gets the fallback locales. + * + * @return array $locales The fallback locales + */ + public function getFallbackLocales() + { + if ($this->translator instanceof Translator) { + return $this->translator->getFallbackLocales(); + } + + return array(); + } + /** * Passes through all unknown calls onto the translator object. */ diff --git a/src/Symfony/Component/Translation/LoggingTranslator.php b/src/Symfony/Component/Translation/LoggingTranslator.php index fa5c5cc5b5ffd..b259df5e0aa49 100644 --- a/src/Symfony/Component/Translation/LoggingTranslator.php +++ b/src/Symfony/Component/Translation/LoggingTranslator.php @@ -88,6 +88,20 @@ public function getCatalogue($locale = null) return $this->translator->getCatalogue($locale); } + /** + * Gets the fallback locales. + * + * @return array $locales The fallback locales + */ + public function getFallbackLocales() + { + if ($this->translator instanceof Translator) { + return $this->translator->getFallbackLocales(); + } + + return array(); + } + /** * Passes through all unknown calls onto the translator object. */ From f3fede2e833c1f42ee378ff542fb6cc0ceebcaad Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 10 Nov 2016 16:29:44 +0100 Subject: [PATCH 47/66] [Validator] Added missing swedish translation --- .../Validator/Resources/translations/validators.sv.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index 693f12b5b1998..879c0a5c559d0 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -310,6 +310,10 @@ This value does not match the expected {{ charset }} charset. Detta värde har inte den förväntade teckenkodningen {{ charset }}. + + This is not a valid Business Identifier Code (BIC). + Detta är inte en giltig BIC-kod. + From 5dc5dc84750f192b5867cc624461e4d22b085f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 24 Oct 2016 11:05:30 +0200 Subject: [PATCH 48/66] [Serializer] Fix DataUriNormalizer's regex --- .../Component/Serializer/Normalizer/DataUriNormalizer.php | 2 +- .../Serializer/Tests/Normalizer/DataUriNormalizerTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php index 9cf3c38b64ce9..988a491b7c800 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php @@ -85,7 +85,7 @@ public function supportsNormalization($data, $format = null) */ public function denormalize($data, $class, $format = null, array $context = array()) { - if (!preg_match('/^data:([a-z0-9]+\/[a-z0-9]+(;[a-z0-9\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\\\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i', $data)) { + if (!preg_match('/^data:([a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}\/[a-z0-9][a-z0-9\!\#\$\&\-\^\_\+\.]{0,126}(;[a-z0-9\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\\\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i', $data)) { throw new UnexpectedValueException('The provided "data:" URI is not valid.'); } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php index f8cfe6944807b..79fafcb26a41f 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/DataUriNormalizerTest.php @@ -163,6 +163,9 @@ public function validUriProvider() array('data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E'), array('data:,A%20brief%20note'), array('data:text/html;charset=US-ASCII,%3Ch1%3EHello!%3C%2Fh1%3E'), + array('data:application/ld+json;base64,eyJAaWQiOiAiL2ZvbyJ9'), + array('data:application/vnd.ms-word.document.macroenabled.12;base64,UEsDBBQABgAIAAAAIQBnzQ+udAEAADoFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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/9b+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1/7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/Q/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9H+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0v7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/T/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9T+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1f7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/W/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9f+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0P7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/R/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9L+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0/7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/U/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9X+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1v7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/X/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9D+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0f7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/S/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9P+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1P7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/V/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9b+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1/7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/Q/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9H+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0v7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/T/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9T+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1f7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/W/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9f+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0P7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/R/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9L+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0/7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/U/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9X+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1v7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/X/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9D+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/0f7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/S/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9P+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1P7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAfzL0Af/V/ur+Cn/JGvhJ/wBky8B/+orpVAHptABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQB/MvQB/9b+6v4Kf8ka+En/AGTLwH/6iulUAem0AFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH8y9AH/1/7q/gp/yRr4Sf8AZMvAf/qK6VQB6bQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAU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VnUEsBAi0AFAAGAAgAAAAhANJeFd+BAwAATAkAABEAAAAAAAAAAAAAAAAAyzcAAHdvcmQvc2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhAPC8NQHcAQAA8QUAABIAAAAAAAAAAAAAAAAAezsAAHdvcmQvZm9udFRhYmxlLnhtbFBLAQItABQABgAIAAAAIQDgi8pVHwEAABECAAAUAAAAAAAAAAAAAAAAAIc9AAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQCf6lVfewEAABUDAAARAAAAAAAAAAAAAAAAANg+AABkb2NQcm9wcy9jb3JlLnhtbFBLAQItABQABgAIAAAAIQCBlv05MgsAAGRyAAAPAAAAAAAAAAAAAAAAAIpBAAB3b3JkL3N0eWxlcy54bWxQSwECLQAUAAYACAAAACEA7SfiumUBAAC1AgAAEAAAAAAAAAAAAAAAAADpTAAAZG9jUHJvcHMvYXBwLnhtbFBLBQYAAAAADAAMAAYDAACETwAAAAA='), + array('data:a!b#c&d-e^f_g+h.i/a!b#c&d-e^f_g+h.i;base64,foobar'), ); if (!defined('HHVM_VERSION')) { From 2eedafc2313c6cb1d9fe9f3717efb8281b89b3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 10 Nov 2016 11:06:30 +0100 Subject: [PATCH 49/66] [FrameworkBundle] Register the ArrayDenormalizer --- .../Resources/config/serializer.xml | 7 ++- .../Tests/Functional/SerializerTest.php | 58 +++++++++++++++++++ .../Functional/app/Serializer/bundles.php | 16 +++++ .../Functional/app/Serializer/config.yml | 6 ++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/config.yml diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml index 370b364cd9e78..c96e42c6084cb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml @@ -23,10 +23,15 @@ - + + + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php new file mode 100644 index 0000000000000..ee79850c47dfb --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; + +use Symfony\Component\Serializer\Normalizer\DataUriNormalizer; + +/** + * @author Kévin Dunglas + */ +class SerializerTest extends WebTestCase +{ + public function testDeserializeArrayOfObject() + { + if (!class_exists(DataUriNormalizer::class)) { + $this->markTestSkipped('This test is only applicable when using the Symfony Serializer Component version 3.1 or superior.'); + } + + static::bootKernel(array('test_case' => 'Serializer')); + $container = static::$kernel->getContainer(); + + $result = $container->get('serializer')->deserialize('{"bars": [{"id": 1}, {"id": 2}]}', Foo::class, 'json'); + + $bar1 = new Bar(); + $bar1->id = 1; + $bar2 = new Bar(); + $bar2->id = 2; + + $expected = new Foo(); + $expected->bars = array($bar1, $bar2); + + $this->assertEquals($expected, $result); + } +} + +class Foo +{ + /** + * @var Bar[] + */ + public $bars; +} + +class Bar +{ + /** + * @var int + */ + public $id; +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php new file mode 100644 index 0000000000000..144db90236034 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Bundle\FrameworkBundle\FrameworkBundle; + +return array( + new FrameworkBundle(), +); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/config.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/config.yml new file mode 100644 index 0000000000000..cac135c315d00 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/config.yml @@ -0,0 +1,6 @@ +imports: + - { resource: ../config/default.yml } + +framework: + serializer: { enabled: true } + property_info: { enabled: true } From bcb03e0a395f8e862fc5ac6be87e7d920cc2da8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Ram=C3=ADrez=20+Deimos+?= Date: Wed, 26 Oct 2016 03:27:22 -0500 Subject: [PATCH 50/66] [Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds --- .../Form/Extension/Core/Type/TimeType.php | 13 +++++++++++++ .../Tests/Extension/Core/Type/TimeTypeTest.php | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index 8232170278502..b482f079ebfbc 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -12,6 +12,8 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\ReversedTransformer; @@ -49,6 +51,17 @@ public function buildForm(FormBuilderInterface $builder, array $options) if ('single_text' === $options['widget']) { $builder->addViewTransformer(new DateTimeToStringTransformer($options['model_timezone'], $options['view_timezone'], $format)); + + // handle seconds ignored by user's browser when with_seconds enabled + // https://codereview.chromium.org/450533009/ + if ($options['with_seconds']) { + $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $e) { + $data = $e->getData(); + if ($data && preg_match('/^\d{2}:\d{2}$/', $data)) { + $e->setData($data.':00'); + } + }); + } } else { $hourOptions = $minuteOptions = $secondOptions = array( 'error_bubbling' => true, diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php index e8b95312b4a80..3a60d079887d3 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php @@ -221,6 +221,22 @@ public function testSubmitStringSingleTextWithoutMinutes() $this->assertEquals('03', $form->getViewData()); } + public function testSubmitWithSecondsAndBrowserOmissionSeconds() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + 'widget' => 'single_text', + 'with_seconds' => true, + )); + + $form->submit('03:04'); + + $this->assertEquals('03:04:00', $form->getData()); + $this->assertEquals('03:04:00', $form->getViewData()); + } + public function testSetDataWithoutMinutes() { $form = $this->factory->create('time', null, array( From 0801f9723bb84b8f2fb9fec0c50f4605dda34cc6 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 12 Nov 2016 16:48:22 +0100 Subject: [PATCH 51/66] Tag the FormFieldRegistry as being internal --- src/Symfony/Component/DomCrawler/FormFieldRegistry.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php index dbd08ff720765..7dd3d3e7a3229 100644 --- a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php +++ b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php @@ -15,6 +15,8 @@ /** * This is an internal class that must not be used directly. + * + * @internal */ class FormFieldRegistry { From b8f7614388ad567b647f64650271bc51e7a9c624 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 10 Nov 2016 14:30:48 -0800 Subject: [PATCH 52/66] bumped min version of Twig to 1.28 --- composer.json | 2 +- src/Symfony/Bridge/Twig/composer.json | 2 +- src/Symfony/Bundle/SecurityBundle/composer.json | 2 +- src/Symfony/Bundle/TwigBundle/composer.json | 2 +- .../WebProfilerBundle/Controller/ProfilerController.php | 4 ++-- .../Bundle/WebProfilerBundle/Profiler/TemplateManager.php | 6 ++++-- .../Resources/views/Profiler/layout.html.twig | 6 +++++- .../Resources/views/Profiler/toolbar.html.twig | 7 ++++--- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 1a2e8c26b586f..34dfa896e3b45 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "paragonie/random_compat": "~1.0", "symfony/polyfill-apcu": "~1.1", "symfony/polyfill-mbstring": "~1.1", - "twig/twig": "~1.27|~2.0", + "twig/twig": "~1.28|~2.0", "psr/log": "~1.0" }, "replace": { diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index b83dc34c7fb8f..74c98e93a50e8 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=5.3.9", - "twig/twig": "~1.27|~2.0" + "twig/twig": "~1.28|~2.0" }, "require-dev": { "symfony/asset": "~2.7", diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index ee1faf659a260..64dfae228be08 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -37,7 +37,7 @@ "symfony/yaml": "~2.0,>=2.0.5", "symfony/expression-language": "~2.6", "doctrine/doctrine-bundle": "~1.2", - "twig/twig": "~1.27|~2.0", + "twig/twig": "~1.28|~2.0", "ircmaxell/password-compat": "~1.0" }, "autoload": { diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 4714ddb2e06fc..8c4947db65f27 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -19,7 +19,7 @@ "php": ">=5.3.9", "symfony/asset": "~2.7", "symfony/twig-bridge": "~2.7", - "twig/twig": "~1.27|~2.0", + "twig/twig": "~1.28|~2.0", "symfony/http-foundation": "~2.5", "symfony/http-kernel": "~2.7" }, diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 2748910a19ae8..24c83d5e1d8c6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -106,7 +106,7 @@ public function panelAction(Request $request, $token) 'panel' => $panel, 'page' => $page, 'request' => $request, - 'templates' => $this->getTemplateManager()->getTemplates($profile), + 'templates' => $this->getTemplateManager()->getNames($profile), 'is_ajax' => $request->isXmlHttpRequest(), )), 200, array('Content-Type' => 'text/html')); } @@ -200,7 +200,7 @@ public function toolbarAction(Request $request, $token) return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( 'position' => $position, 'profile' => $profile, - 'templates' => $this->getTemplateManager()->getTemplates($profile), + 'templates' => $this->getTemplateManager()->getNames($profile), 'profiler_url' => $url, 'token' => $token, )), 200, array('Content-Type' => 'text/html')); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php index 415034a9f80c6..91938e9be5395 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php @@ -67,7 +67,9 @@ public function getName(Profile $profile, $panel) * * @param Profile $profile * - * @return array + * @return Twig_Template[] + * + * @deprecated not used anymore internally */ public function getTemplates(Profile $profile) { @@ -88,7 +90,7 @@ public function getTemplates(Profile $profile) * * @throws \UnexpectedValueException */ - protected function getNames(Profile $profile) + public function getNames(Profile $profile) { $templates = array(); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig index 6be34406e6196..bcf97ddcbfb46 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig @@ -36,7 +36,11 @@ {% if templates is defined %}