diff -Nru symfony-3.4.21+dfsg/CHANGELOG-3.4.md symfony-3.4.22+dfsg/CHANGELOG-3.4.md --- symfony-3.4.21+dfsg/CHANGELOG-3.4.md 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/CHANGELOG-3.4.md 2019-02-03 12:23:08.000000000 +0000 @@ -7,6 +7,31 @@ To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.4.0...v3.4.1 +* 3.4.22 (2019-02-03) + + * bug #30046 [DI] Fix dumping Doctrine-like service graphs (nicolas-grekas) + * bug #30028 [Form] fix some docblocks and type checks (xabbuh) + * bug #30037 Disable Twig in the profiler menu when Twig is not used (javiereguiluz) + * bug #30026 [VarDumper] dont implement Serializable in Stub (nicolas-grekas) + * bug #30034 [Config] ensure moving away from Serializable wont break cache:clear (nicolas-grekas) + * bug #30006 [Security] don't do nested calls to serialize() (nicolas-grekas, Renan) + * bug #30007 [FrameworkBundle] Support use of hyphen in asset package name (damaya, XuruDragon) + * bug #29764 [HttpFoundation] Check file exists before unlink (adam-mospan) + * bug #29783 [HttpFoundation] MemcachedSessionHandler::close() must close connection (grachevko) + * bug #29844 [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0' (mrthehud) + * bug #29869 [Debug][ErrorHandler] Preserve our error handler when a logger sets another one (fancyweb) + * bug #29926 [Form] Changed UrlType input type to text when default_protocol is not null (MatTheCat) + * bug #29961 [Translation] Concatenated translation messages (Stadly) + * bug #29920 [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends (fancyweb) + * bug #29863 [Security] Do not mix password_*() API with libsodium one (chalasr) + * bug #29894 [DependencyInjection] the string "0" is a valid service identifier (xabbuh) + * bug #29885 Update MimeType extensions (fabpot) + * bug #29875 [TwigBridge] fix compatibility with Twig >= 2.6.1 (xabbuh) + * bug #29873 [Debug] remove return type hint for PHP 5 compatibility (xabbuh) + * bug #29837 Fix SwiftMailerHandler to support Monolog's latest reset functionality (Seldaek) + * bug #29853 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused" (mmarynich) + * bug #29833 [DebugClassLoader] expose proxyfied findFile() method (fancyweb) + * 3.4.21 (2019-01-06) * bug #29494 [HttpFoundation] Fix request uri when it starts with double slashes (alquerci) diff -Nru symfony-3.4.21+dfsg/CONTRIBUTORS.md symfony-3.4.22+dfsg/CONTRIBUTORS.md --- symfony-3.4.21+dfsg/CONTRIBUTORS.md 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/CONTRIBUTORS.md 2019-02-03 12:23:08.000000000 +0000 @@ -10,15 +10,15 @@ - Christian Flothmann (xabbuh) - Tobias Schultze (tobion) - Christophe Coevoet (stof) + - Robin Chalas (chalas_r) - Jordi Boggiano (seldaek) - Victor Berchet (victor) - - Robin Chalas (chalas_r) - Kévin Dunglas (dunglas) - Maxime Steinhausser (ogizanagi) - Jakub Zalas (jakubzalas) - Johannes S (johannes) - - Kris Wallsmith (kriswallsmith) - Ryan Weaver (weaverryan) + - Kris Wallsmith (kriswallsmith) - Javier Eguiluz (javier.eguiluz) - Roland Franssen (ro0) - Grégoire Pineau (lyrixx) @@ -61,14 +61,14 @@ - Kevin Bond (kbond) - Pierre du Plessis (pierredup) - Henrik Bjørnskov (henrikbjorn) + - Alexander M. Turek (derrabus) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) - - Alexander M. Turek (derrabus) - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) + - Mathieu Piot (mpiot) - Florin Patan (florinpatan) - Gábor Egyed (1ed) - - Mathieu Piot (mpiot) - Titouan Galopin (tgalopin) - Vladimir Reznichenko (kalessil) - Michel Weimerskirch (mweimerskirch) @@ -82,11 +82,11 @@ - Issei Murasawa (issei_m) - Arnout Boks (aboks) - Deni + - Grégoire Paris (greg0ire) - Henrik Westphal (snc) - Dariusz Górecki (canni) - - Douglas Greenshields (shieldo) - - Grégoire Paris (greg0ire) - Valentin Udaltsov (vudaltsov) + - Douglas Greenshields (shieldo) - Dariusz Ruminski - Lee McDermott - Brandon Turner @@ -109,12 +109,13 @@ - Brice BERNARD (brikou) - Baptiste Clavié (talus) - marc.weistroff + - Tomáš Votruba (tomas_votruba) - David Buchmann (dbu) - lenar - Alexander Schwenn (xelaris) - Włodzimierz Gajda (gajdaw) - Chris Wilkinson (thewilkybarkid) - - Tomáš Votruba (tomas_votruba) + - Jérôme Vasseur (jvasseur) - Peter Kokot (maastermedia) - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) @@ -124,7 +125,6 @@ - Daniel Wehner (dawehner) - excelwebzone - Gordon Franke (gimler) - - Jérôme Vasseur (jvasseur) - Javier Spagnoletti (phansys) - Fabien Pennequin (fabienpennequin) - Eric GELOEN (gelo) @@ -144,6 +144,7 @@ - Daniel Gomes (danielcsgomes) - Gabriel Caruso - Hidenori Goto (hidenorigoto) + - Thomas Calvet (fancyweb) - Arnaud Kleinpeter (nanocom) - Jannik Zschiesche (apfelbox) - Guilherme Blanco (guilhermeblanco) @@ -175,6 +176,7 @@ - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba + - Tyson Andre - GDIBass - SpacePossum - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) @@ -182,7 +184,6 @@ - Matthieu Napoli (mnapoli) - Florent Mata (fmata) - Warnar Boekkooi (boekkooi) - - Thomas Calvet (fancyweb) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - Daniel Espendiller @@ -198,6 +199,7 @@ - Mathieu Lemoine (lemoinem) - Christian Schmidt - Andreas Hucks (meandmymonkey) + - Tom Van Looy (tvlooy) - Noel Guilbert (noel) - Yanick Witschi (toflar) - Marek Štípek (maryo) @@ -205,6 +207,7 @@ - bronze1man - sun (sun) - Larry Garfield (crell) + - George Mponos (gmponos) - Michaël Perrin (michael.perrin) - Nikolay Labinskiy (e-moe) - Martin Schuhfuß (usefulthink) @@ -227,17 +230,16 @@ - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) - Michele Orselli (orso) - - Tom Van Looy (tvlooy) - Sven Paulus (subsven) - Rui Marinho (ruimarinho) - Eugene Wissner - Pascal Montoya - - George Mponos (gmponos) - Julien Brochet (mewt) - Leo Feyer - Tristan Darricau (nicofuma) - Marcel Beerta (mazen) - Pavel Batanov (scaytrase) + - Samuel NELA (snela) - Loïc Faugeron - Hidde Wieringa (hiddewie) - Marco Pivetta (ocramius) @@ -282,7 +284,6 @@ - GordonsLondon - Jan Sorgalla (jsor) - Ray - - Tyson Andre - Chekote - Thomas Adam - Viktor Bocharskyi (bocharsky_bw) @@ -290,7 +291,6 @@ - Diego Agulló (aeoris) - Andreas Schempp (aschempp) - jdhoek - - Samuel NELA (snela) - Massimiliano Arione (garak) - Bob den Otter (bopp) - Frank de Jonge (frenkynet) @@ -301,6 +301,7 @@ - Colin O'Dell (colinodell) - Giorgio Premi - Jan Schädlich (jschaedl) + - Ben Davies (bendavies) - Beau Simensen (simensen) - Michael Hirschler (mvhirsch) - Robert Kiss (kepten) @@ -313,6 +314,7 @@ - Peter Kruithof (pkruithof) - Michael Holm (hollo) - Remon van de Kamp (rpkamp) + - Mathieu Lechat - Marc Weistroff (futurecat) - Christian Schmidt - MatTheCat @@ -356,7 +358,6 @@ - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) - Gennady Telegin (gtelegin) - - Ben Davies (bendavies) - Erin Millard - Artur Melo (restless) - Matthew Lewinski (lewinski) @@ -379,11 +380,11 @@ - Felix Labrecque - Yaroslav Kiliba - Terje Bråten - - Mathieu Lechat - Robbert Klarenbeek (robbertkl) - JhonnyL - David Badura (davidbadura) - hossein zolfi (ocean) + - Alexander Schranz (alexander-schranz) - Clément Gautier (clementgautier) - Sanpi - Eduardo Gulias (egulias) @@ -483,7 +484,6 @@ - Marek Pietrzak - Luc Vieillescazes (iamluc) - franek (franek) - - Alexander Schranz (alexander-schranz) - Christian Wahler - Gintautas Miselis - Rob Bast @@ -606,6 +606,7 @@ - Sebastian Blum - aubx - Marvin Butkereit + - Renan - Ricky Su (ricky) - Gildas Quéméner (gquemener) - Charles-Henri Bruyand @@ -675,6 +676,7 @@ - Michael Devery (mickadoo) - Antoine Corcy - Sascha Grossenbacher + - Emanuele Panzeri (thepanz) - Szijarto Tamas - Robin Lehrmann (robinlehrmann) - Catalin Dan @@ -713,6 +715,7 @@ - Mark Sonnabaum - Massimiliano Braglia (massimilianobraglia) - Richard Quadling + - Raphaëll Roussel - jochenvdv - Arturas Smorgun (asarturas) - Alexander Volochnev (exelenz) @@ -731,6 +734,7 @@ - Pascal Helfenstein - Anthony GRASSIOT (antograssiot) - Baldur Rensch (brensch) + - Anthony MARTIN (xurudragon) - Pierre Rineau - Vladyslav Petrovych - Alex Xandra Albert Sim @@ -738,6 +742,7 @@ - Sergey Yastrebov - Trent Steel (trsteel88) - Yuen-Chi Lian + - Tarjei Huse (tarjei) - Besnik Br - Jose Gonzalez - Oleksii Zhurbytskyi @@ -764,6 +769,7 @@ - John Bohn (jbohn) - Marc Morera (mmoreram) - Saif Eddin Gmati (azjezz) + - Stadly - Andrew Hilobok (hilobok) - Noah Heck (myesain) - Christian Soronellas (theunic) @@ -853,6 +859,7 @@ - Jelle Kapitein - Benoît Bourgeois - mantulo + - Stefan Kruppa - corphi - grizlik - Derek ROTH @@ -885,6 +892,7 @@ - Forfarle (forfarle) - Harry Walter (haswalt) - Johnson Page (jwpage) + - Michael Käfer (michael_kaefer) - Ruben Gonzalez (rubenruateltek) - Michael Roterman (wtfzdotnet) - Arno Geurts @@ -950,6 +958,7 @@ - Franz Wilding (killerpoke) - ProgMiner - Oleg Golovakhin (doc_tr) + - Joost van Driel - Icode4Food (icode4food) - Radosław Benkel - kevin.nadin @@ -996,6 +1005,7 @@ - Wojciech Sznapka - Gavin Staniforth - Ariel J. Birnbaum + - Pablo Borowicz - Mathieu Santostefano - Arjan Keeman - Máximo Cuadros (mcuadros) @@ -1031,6 +1041,7 @@ - Sergey Novikov (s12v) - Marcos Quesada (marcos_quesada) - Matthew Vickery (mattvick) + - MARYNICH Mikhail (mmarynich-ext) - Viktor Novikov (panzer_commander) - Paul Mitchum (paul-m) - Angel Koilov (po_taka) @@ -1085,6 +1096,7 @@ - Andrew Tch - Alexander Cheprasov - Rodrigo Díez Villamuera (rodrigodiez) + - James Hudson - e-ivanov - Einenlum - Jochen Bayer (jocl) @@ -1095,6 +1107,7 @@ - wizhippo - Mathias STRASSER (roukmoute) - Thomason, James + - Gordienko Vladislav - Viacheslav Sychov - Alexandre Quercia (alquerci) - Helmut Hummel (helhum) @@ -1157,7 +1170,6 @@ - Vacheslav Silyutin - Juan Traverso - Alain Flaus (halundra) - - Tarjei Huse (tarjei) - tsufeki - Philipp Strube - Clement Herreman (clemherreman) @@ -1240,6 +1252,7 @@ - Berat Doğan - Guillaume LECERF - Juanmi Rodriguez Cerón + - renanbr - Andy Raines - Anthony Ferrara - Geoffrey Pécro (gpekz) @@ -1290,7 +1303,6 @@ - WedgeSama - Felds Liscia - Chihiro Adachi (chihiro-adachi) - - Emanuele Panzeri (thepanz) - Raphaëll Roussel - Tadcka - Beth Binkovitz @@ -1404,6 +1416,7 @@ - Gavin Staniforth - Alessandro Tagliapietra (alex88) - Biji (biji) + - Alex Teterin (errogaht) - Gunnar Lium (gunnarlium) - Tiago Garcia (tiagojsag) - Artiom @@ -1446,6 +1459,7 @@ - Paul Seiffert (seiffert) - Vasily Khayrulin (sirian) - Stefan Koopmanschap (skoop) + - Stas Soroka (stasyan) - Stefan Hüsges (tronsha) - Jake Bishop (yakobeyak) - Dan Blows @@ -1546,6 +1560,7 @@ - Muhammed Akbulut - Aaron Somi - Michał Dąbrowski (defrag) + - Konstantin Grachev (grachevko) - Simone Fumagalli (hpatoio) - Brian Graham (incognito) - Kevin Vergauwen (innocenzo) @@ -1635,6 +1650,7 @@ - Darryl Hein (xmmedia) - Sadicov Vladimir (xtech) - Kevin EMO (zarcox) + - Andrzej - Alexander Zogheb - Rémi Blaise - Nicolas Séverin @@ -1869,6 +1885,7 @@ - Şəhriyar İmanov - Alexis BOYER - Kaipi Yann + - adam-mospan - Sam Williams - Guillaume Aveline - Adrian Philipp @@ -1906,7 +1923,6 @@ - Shude - Ondřej Führer - Sema - - Michael Käfer - Elan Ruusamäe - Thorsten Hallwas - Michael Squires @@ -2074,9 +2090,9 @@ - drublic - Andreas Streichardt - Pascal Hofmann - - Stefan Kruppa - smokeybear87 - Gustavo Adrian + - damaya - Kevin Weber - Ben Scott - Dionysis Arvanitis diff -Nru symfony-3.4.21+dfsg/debian/changelog symfony-3.4.22+dfsg/debian/changelog --- symfony-3.4.21+dfsg/debian/changelog 2019-01-08 08:11:22.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/changelog 2019-02-11 12:19:49.000000000 +0000 @@ -1,3 +1,21 @@ +symfony (3.4.22+dfsg-1ubuntu1) disco; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Do not fail testsuite on s390x + + -- Gianfranco Costamagna Mon, 11 Feb 2019 13:19:49 +0100 + +symfony (3.4.22+dfsg-1) unstable; urgency=medium + + [ Fabien Potencier ] + * switched array() to [] (Closes: #919816) + * updated VERSION for 3.4.22 + + [ David Prévot ] + * Update dependency override + + -- David Prévot Fri, 08 Feb 2019 17:20:53 -1000 + symfony (3.4.21+dfsg-1ubuntu2) disco; urgency=low * Merge from Debian unstable. Remaining changes: @@ -757,4 +775,3 @@ * Initial release. (Closes: #513646) -- Daniel Beyer Sun, 07 Sep 2014 18:34:19 +0200 - diff -Nru symfony-3.4.21+dfsg/debian/control symfony-3.4.22+dfsg/debian/control --- symfony-3.4.21+dfsg/debian/control 2019-01-07 21:59:06.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/control 2019-02-09 09:49:34.000000000 +0000 @@ -367,6 +367,7 @@ Package: php-symfony-http-kernel Architecture: all Depends: php-symfony-http-foundation (>> 3.4.12), + php-symfony-debug (>> 3.3.3), ${misc:Depends}, ${phpcomposer:Debian-require} Suggests: ${phpcomposer:Debian-suggest} diff -Nru symfony-3.4.21+dfsg/debian/patches/Add-more-tests-to-group-tty.patch symfony-3.4.22+dfsg/debian/patches/Add-more-tests-to-group-tty.patch --- symfony-3.4.21+dfsg/debian/patches/Add-more-tests-to-group-tty.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Add-more-tests-to-group-tty.patch 2019-02-09 09:49:35.000000000 +0000 @@ -13,7 +13,7 @@ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Component/Process/Tests/ProcessTest.php b/src/Symfony/Component/Process/Tests/ProcessTest.php -index da74a3d..8cc5a62 100644 +index a9ecbe8..1972868 100644 --- a/src/Symfony/Component/Process/Tests/ProcessTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessTest.php @@ -447,6 +447,9 @@ class ProcessTest extends TestCase diff -Nru symfony-3.4.21+dfsg/debian/patches/Change-expected-format-for-some-numbers.patch symfony-3.4.22+dfsg/debian/patches/Change-expected-format-for-some-numbers.patch --- symfony-3.4.21+dfsg/debian/patches/Change-expected-format-for-some-numbers.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Change-expected-format-for-some-numbers.patch 2019-02-09 09:49:35.000000000 +0000 @@ -10,64 +10,64 @@ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php -index 169d18b..cad46b9 100644 +index 247a5d4..3ba58ad 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php @@ -496,8 +496,8 @@ class DateTypeTest extends BaseTypeTest $view = $form->createView(); - $this->assertEquals(array( + $this->assertEquals([ - new ChoiceView(6, '6', '06'), - new ChoiceView(7, '7', '07'), + new ChoiceView(6, '6', '6'), + new ChoiceView(7, '7', '7'), - ), $view['month']->vars['choices']); + ], $view['month']->vars['choices']); } @@ -567,8 +567,8 @@ class DateTypeTest extends BaseTypeTest ->createView(); - $this->assertEquals(array( + $this->assertEquals([ - new ChoiceView(6, '6', '06'), - new ChoiceView(7, '7', '07'), + new ChoiceView(6, '6', '6'), + new ChoiceView(7, '7', '7'), - ), $view['day']->vars['choices']); + ], $view['day']->vars['choices']); } diff --git a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php -index 89be795..0cd3c68 100644 +index a81d30c..18100ba 100644 --- a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php @@ -35,7 +35,7 @@ abstract class AbstractNumberFormatterTest extends TestCase { - return array( - array(100, 'ALL', '100'), -- array(100, 'BRL', '100.00'), -+ array(100, 'BRL', '100'), - array(100, 'CRC', '100'), - array(100, 'JPY', '100'), - array(100, 'CHF', '100'), + return [ + [100, 'ALL', '100'], +- [100, 'BRL', '100.00'], ++ [100, 'BRL', '100'], + [100, 'CRC', '100'], + [100, 'JPY', '100'], + [100, 'CHF', '100'], diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php -index 7eb931e..8a213dd 100644 +index 661161d..de171bc 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -50,7 +50,7 @@ class RangeValidatorTest extends ConstraintValidatorTestCase - array(9.99999, '9.99999'), - array('9.99999', '"9.99999"'), - array(5, '5'), -- array(1.0, '1.0'), -+ array(1.0, '1'), - ); + [9.99999, '9.99999'], + ['9.99999', '"9.99999"'], + [5, '5'], +- [1.0, '1.0'], ++ [1.0, '1'], + ]; } @@ -60,7 +60,7 @@ class RangeValidatorTest extends ConstraintValidatorTestCase - array(20.000001, '20.000001'), - array('20.000001', '"20.000001"'), - array(21, '21'), -- array(30.0, '30.0'), -+ array(30.0, '30'), - ); + [20.000001, '20.000001'], + ['20.000001', '"20.000001"'], + [21, '21'], +- [30.0, '30.0'], ++ [30.0, '30'], + ]; } @@ -151,7 +151,7 @@ class RangeValidatorTest extends ConstraintValidatorTestCase diff -Nru symfony-3.4.21+dfsg/debian/patches/Change-some-types-for-recent-PHPUnit-version.patch symfony-3.4.22+dfsg/debian/patches/Change-some-types-for-recent-PHPUnit-version.patch --- symfony-3.4.21+dfsg/debian/patches/Change-some-types-for-recent-PHPUnit-version.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Change-some-types-for-recent-PHPUnit-version.patch 2019-02-09 09:49:35.000000000 +0000 @@ -13,7 +13,7 @@ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformerTest.php -index 6046022..16e7baa 100644 +index e66331a..1dd6869 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformerTest.php @@ -16,7 +16,7 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToHtml5LocalDa @@ -26,7 +26,7 @@ if ($expected instanceof \DateTime && $actual instanceof \DateTime) { $expected = $expected->format('c'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php -index 8e7ad39..866ce1f 100644 +index 8cf5986..8bdcf81 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php @@ -39,7 +39,7 @@ class DateTimeToLocalizedStringTransformerTest extends TestCase @@ -39,7 +39,7 @@ if ($expected instanceof \DateTime && $actual instanceof \DateTime) { $expected = $expected->format('c'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php -index 053cb62..9177955 100644 +index 2352ea6..b7656f4 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php @@ -33,7 +33,7 @@ class DateTimeToRfc3339TransformerTest extends TestCase @@ -52,7 +52,7 @@ if ($expected instanceof \DateTime && $actual instanceof \DateTime) { $expected = $expected->format('c'); diff --git a/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php b/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php -index b28650c..5048fbf 100644 +index f32acf2..1f443d4 100644 --- a/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php +++ b/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php @@ -12,6 +12,7 @@ @@ -73,7 +73,7 @@ return $this->getMockBuilder($classname)->disableOriginalConstructor()->getMock(); } diff --git a/src/Symfony/Component/Validator/Tests/Validator/TraceableValidatorTest.php b/src/Symfony/Component/Validator/Tests/Validator/TraceableValidatorTest.php -index b2eef76..6edae16 100644 +index b80efed..682accf 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/TraceableValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/TraceableValidatorTest.php @@ -12,6 +12,7 @@ @@ -84,7 +84,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; -@@ -97,7 +98,7 @@ class TraceableValidatorTest extends TestCase +@@ -96,7 +97,7 @@ class TraceableValidatorTest extends TestCase $this->assertSame($expected, $validator->validatePropertyValue(new \stdClass(), 'property', 'value'), 'returns original validator validatePropertyValue() result'); } diff -Nru symfony-3.4.21+dfsg/debian/patches/Declare-composer-group-for-tests-failing-outside-a-Compos.patch symfony-3.4.22+dfsg/debian/patches/Declare-composer-group-for-tests-failing-outside-a-Compos.patch --- symfony-3.4.21+dfsg/debian/patches/Declare-composer-group-for-tests-failing-outside-a-Compos.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Declare-composer-group-for-tests-failing-outside-a-Compos.patch 2019-02-09 09:49:35.000000000 +0000 @@ -23,7 +23,7 @@ { $res = new ComposerResource(); diff --git a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php -index 5af2730..d9a0c9e 100644 +index ac1c55a..e94d81d 100644 --- a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php @@ -43,6 +43,9 @@ class ClientTest extends TestCase diff -Nru symfony-3.4.21+dfsg/debian/patches/DEP-8/Form-drop-test-failing-on-CI.patch symfony-3.4.22+dfsg/debian/patches/DEP-8/Form-drop-test-failing-on-CI.patch --- symfony-3.4.21+dfsg/debian/patches/DEP-8/Form-drop-test-failing-on-CI.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/DEP-8/Form-drop-test-failing-on-CI.patch 2019-02-09 09:49:35.000000000 +0000 @@ -8,16 +8,16 @@ 1 file changed, 3 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Component/Form/Tests/Console/Descriptor/AbstractDescriptorTest.php -index c29e3fe..7f59c07 100644 +index 23be3ab..b41accf 100644 --- a/src/Symfony/Component/Form/Tests/Console/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Component/Form/Tests/Console/Descriptor/AbstractDescriptorTest.php @@ -101,9 +101,6 @@ abstract class AbstractDescriptorTest extends TestCase $options['type'] = $resolvedType->getInnerType(); $options['option'] = 'foo'; - yield array($resolvedType->getOptionsResolver(), $options, 'required_option_with_allowed_values'); + yield [$resolvedType->getOptionsResolver(), $options, 'required_option_with_allowed_values']; - - $options['option'] = 'empty_data'; -- yield array($resolvedType->getOptionsResolver(), $options, 'overridden_option_with_default_closures'); +- yield [$resolvedType->getOptionsResolver(), $options, 'overridden_option_with_default_closures']; } abstract protected function getDescriptor(); diff -Nru symfony-3.4.21+dfsg/debian/patches/Drop-Debug-tests-currently-failing.patch symfony-3.4.22+dfsg/debian/patches/Drop-Debug-tests-currently-failing.patch --- symfony-3.4.21+dfsg/debian/patches/Drop-Debug-tests-currently-failing.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Drop-Debug-tests-currently-failing.patch 2019-02-09 09:49:35.000000000 +0000 @@ -9,7 +9,7 @@ 2 files changed, 23 deletions(-) diff --git a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php -index e9ce535..f33a620 100644 +index 73fee9a..9f566b4 100644 --- a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php +++ b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php @@ -59,23 +59,6 @@ class DebugClassLoaderTest extends TestCase @@ -49,7 +49,7 @@ * @dataProvider provideDeprecatedSuper */ diff --git a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php -index 5cdac2f..e113741 100644 +index 8e615ac..5fea722 100644 --- a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php @@ -61,7 +61,6 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase diff -Nru symfony-3.4.21+dfsg/debian/patches/Drop-HttpFoundation-tests-currently-failing.patch symfony-3.4.22+dfsg/debian/patches/Drop-HttpFoundation-tests-currently-failing.patch --- symfony-3.4.21+dfsg/debian/patches/Drop-HttpFoundation-tests-currently-failing.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Drop-HttpFoundation-tests-currently-failing.patch 2019-02-09 09:49:35.000000000 +0000 @@ -10,7 +10,7 @@ delete mode 100644 src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php -index 43fa9b7..bc9baaa 100644 +index 68634f6..44be75a 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -979,14 +979,6 @@ class ResponseTest extends ResponseTestCase @@ -30,7 +30,7 @@ class StringableObject diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php deleted file mode 100644 -index 3ac081e..0000000 +index 98bc67b..0000000 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php +++ /dev/null @@ -1,61 +0,0 @@ @@ -58,10 +58,10 @@ - - public static function setUpBeforeClass() - { -- $spec = array( -- 1 => array('file', '/dev/null', 'w'), -- 2 => array('file', '/dev/null', 'w'), -- ); +- $spec = [ +- 1 => ['file', '/dev/null', 'w'], +- 2 => ['file', '/dev/null', 'w'], +- ]; - if (!self::$server = @proc_open('exec php -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) { - self::markTestSkipped('PHP server unable to start.'); - } @@ -81,7 +81,7 @@ - */ - public function testSession($fixture) - { -- $context = array('http' => array('header' => "Cookie: sid=123abc\r\n")); +- $context = ['http' => ['header' => "Cookie: sid=123abc\r\n"]]; - $context = stream_context_create($context); - $result = file_get_contents(sprintf('http://localhost:8053/%s.php', $fixture), false, $context); - @@ -91,7 +91,7 @@ - public function provideSession() - { - foreach (glob(__DIR__.'/Fixtures/*.php') as $file) { -- yield array(pathinfo($file, PATHINFO_FILENAME)); +- yield [pathinfo($file, PATHINFO_FILENAME)]; - } - } -} diff -Nru symfony-3.4.21+dfsg/debian/patches/Drop-test-failing-outside-Composer-environment.patch symfony-3.4.22+dfsg/debian/patches/Drop-test-failing-outside-Composer-environment.patch --- symfony-3.4.21+dfsg/debian/patches/Drop-test-failing-outside-Composer-environment.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Drop-test-failing-outside-Composer-environment.patch 2019-02-09 09:49:35.000000000 +0000 @@ -9,7 +9,7 @@ diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt deleted file mode 100644 -index e20c7ad..0000000 +index b37b623..0000000 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt +++ /dev/null @@ -1,74 +0,0 @@ @@ -40,7 +40,7 @@ -{ - public static function getGroups() - { -- return array(); +- return []; - } -} -EOPHP diff -Nru symfony-3.4.21+dfsg/debian/patches/Drop-tests-data-throwing-a-RuntimeException-outside-a-Com.patch symfony-3.4.22+dfsg/debian/patches/Drop-tests-data-throwing-a-RuntimeException-outside-a-Com.patch --- symfony-3.4.21+dfsg/debian/patches/Drop-tests-data-throwing-a-RuntimeException-outside-a-Com.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Drop-tests-data-throwing-a-RuntimeException-outside-a-Com.patch 2019-02-09 09:49:35.000000000 +0000 @@ -10,38 +10,38 @@ 3 files changed, 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php -index dff65d6..7576785 100644 +index db550a2..b612442 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php @@ -32,7 +32,6 @@ class FragmentTest extends WebTestCase { - return array( - array(false), -- array(true), - ); + return [ + [false], +- [true], + ]; } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php -index 2d422b0..38fc810 100644 +index c5252c0..ec8820e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php @@ -40,7 +40,6 @@ class ProfilerTest extends WebTestCase { - return array( - array(false), -- array(true), - ); + return [ + [false], +- [true], + ]; } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php -index 2e16342..f2ea45d 100644 +index aad3d77..115a392 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php @@ -146,7 +146,6 @@ class SessionTest extends WebTestCase { - return array( + return [ // configfile, insulate -- array('config.yml', true), - array('config.yml', false), - ); +- ['config.yml', true], + ['config.yml', false], + ]; } diff -Nru symfony-3.4.21+dfsg/debian/patches/group-network-for-test-failing-without-network.patch symfony-3.4.22+dfsg/debian/patches/group-network-for-test-failing-without-network.patch --- symfony-3.4.21+dfsg/debian/patches/group-network-for-test-failing-without-network.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/group-network-for-test-failing-without-network.patch 2019-02-09 09:49:35.000000000 +0000 @@ -7,7 +7,7 @@ 1 file changed, 6 insertions(+) diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php -index f238361..134533a 100644 +index 18d1c02..dca860c 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php @@ -79,6 +79,9 @@ class AdapterTest extends LdapTestCase @@ -21,7 +21,7 @@ { $ldap = new Adapter($this->getLdapConfig()); @@ -95,6 +98,9 @@ class AdapterTest extends LdapTestCase - $this->assertEquals(array('Fabien Potencier'), $entry->getAttribute('cn')); + $this->assertEquals(['Fabien Potencier'], $entry->getAttribute('cn')); } + /** diff -Nru symfony-3.4.21+dfsg/debian/patches/HttpFoundation-Fix-incompatibility-with-php-memcache.patch symfony-3.4.22+dfsg/debian/patches/HttpFoundation-Fix-incompatibility-with-php-memcache.patch --- symfony-3.4.21+dfsg/debian/patches/HttpFoundation-Fix-incompatibility-with-php-memcache.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/HttpFoundation-Fix-incompatibility-with-php-memcache.patch 2019-02-09 09:49:35.000000000 +0000 @@ -12,7 +12,7 @@ 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php -index 1b12c92..c7f729c 100644 +index 3abc33c..b71f589 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -76,7 +76,10 @@ class MemcacheSessionHandler implements \SessionHandlerInterface diff -Nru symfony-3.4.21+dfsg/debian/patches/HttpFoundation-Workaround-some-currently-broken-tests.patch symfony-3.4.22+dfsg/debian/patches/HttpFoundation-Workaround-some-currently-broken-tests.patch --- symfony-3.4.21+dfsg/debian/patches/HttpFoundation-Workaround-some-currently-broken-tests.patch 2019-01-08 08:11:22.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/HttpFoundation-Workaround-some-currently-broken-tests.patch 2019-02-11 12:19:49.000000000 +0000 @@ -8,8 +8,7 @@ .../Tests/Fixtures/response-functional/cookie_samesite_lax.expected | 2 +- .../Tests/Fixtures/response-functional/cookie_samesite_strict.expected | 2 +- src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php | 1 + - .../HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php | 1 + - 5 files changed, 6 insertions(+), 3 deletions(-) + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_max_age.expected b/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_max_age.expected index bdb9d02..90e7be6 100644 @@ -54,7 +53,7 @@ ) shutdown diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php -index 22f25e9..10cc81f 100644 +index 3d3e696..f82954c 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php @@ -42,6 +42,7 @@ class ResponseFunctionalTest extends TestCase @@ -65,15 +64,3 @@ */ public function testCookie($fixture) { -#diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php -#index 52da294..6cf7571 100644 -#--- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php -#+++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php -#@@ -169,6 +169,7 @@ class NativeSessionStorageTest extends TestCase -# 'cookie_domain' => 'symfony.example.com', -# 'cookie_secure' => true, -# 'cookie_httponly' => false, -#+ 'cookie_samesite' => '' -# ); -# -# $this->getStorage($options); diff -Nru symfony-3.4.21+dfsg/debian/patches/Increasing-timeout-in-test-AbstractProcessTest-testS.patch symfony-3.4.22+dfsg/debian/patches/Increasing-timeout-in-test-AbstractProcessTest-testS.patch --- symfony-3.4.21+dfsg/debian/patches/Increasing-timeout-in-test-AbstractProcessTest-testS.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/Increasing-timeout-in-test-AbstractProcessTest-testS.patch 2019-02-09 09:49:35.000000000 +0000 @@ -12,7 +12,7 @@ 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Tests/ProcessTest.php b/src/Symfony/Component/Process/Tests/ProcessTest.php -index 8cc5a62..5bc35f4 100644 +index 1972868..8c385fa 100644 --- a/src/Symfony/Component/Process/Tests/ProcessTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessTest.php @@ -868,12 +868,12 @@ class ProcessTest extends TestCase diff -Nru symfony-3.4.21+dfsg/debian/patches/VarDumper-Workaround-some-currently-broken-tests.patch symfony-3.4.22+dfsg/debian/patches/VarDumper-Workaround-some-currently-broken-tests.patch --- symfony-3.4.21+dfsg/debian/patches/VarDumper-Workaround-some-currently-broken-tests.patch 2019-01-07 21:59:07.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/patches/VarDumper-Workaround-some-currently-broken-tests.patch 2019-02-09 09:49:35.000000000 +0000 @@ -8,7 +8,7 @@ 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php -index 4f9b538..902cc4e 100644 +index ea83e77..5061ebd 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ExceptionCasterTest.php @@ -52,10 +52,10 @@ Exception { @@ -21,7 +21,7 @@ + $this->assertDumpMatchesFormat($expectedDump, $e); - $this->assertSame(array('foo'), $ref); + $this->assertSame(['foo'], $ref); } @@ -72,10 +72,10 @@ EODUMP; › } diff -Nru symfony-3.4.21+dfsg/debian/tests/control symfony-3.4.22+dfsg/debian/tests/control --- symfony-3.4.21+dfsg/debian/tests/control 2019-01-07 21:59:06.000000000 +0000 +++ symfony-3.4.22+dfsg/debian/tests/control 2019-02-09 09:49:34.000000000 +0000 @@ -12,8 +12,6 @@ php-doctrine-orm (>= 2.5), php-email-validator, php-gd, - php-intl, - php-mbstring, php-memcache, php-memcached, php-nrk-predis, diff -Nru symfony-3.4.21+dfsg/.php_cs.dist symfony-3.4.22+dfsg/.php_cs.dist --- symfony-3.4.21+dfsg/.php_cs.dist 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/.php_cs.dist 2019-02-03 12:23:08.000000000 +0000 @@ -5,26 +5,26 @@ } return PhpCsFixer\Config::create() - ->setRules(array( + ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, '@PHPUnit48Migration:risky' => true, 'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice - 'array_syntax' => array('syntax' => 'long'), + 'array_syntax' => ['syntax' => 'short'], 'fopen_flags' => false, 'ordered_imports' => true, 'protected_to_private' => false, // Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading - 'native_function_invocation' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'), + 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'], // Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading - 'phpdoc_types_order' => array('null_adjustment' => 'always_last', 'sort_algorithm' => 'none'), - )) + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + ]) ->setRiskyAllowed(true) ->setFinder( PhpCsFixer\Finder::create() ->in(__DIR__.'/src') - ->append(array(__FILE__)) - ->exclude(array( + ->append([__FILE__]) + ->exclude([ // directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code 'Symfony/Component/DependencyInjection/Tests/Fixtures', 'Symfony/Component/Routing/Tests/Fixtures/dumper', @@ -38,7 +38,7 @@ 'Symfony/Bundle/FrameworkBundle/Resources/views/Form', // explicit trigger_error tests 'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/', - )) + ]) // Support for older PHPunit version ->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php') // file content autogenerated by `var_export` diff -Nru symfony-3.4.21+dfsg/phpunit symfony-3.4.22+dfsg/phpunit --- symfony-3.4.21+dfsg/phpunit 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/phpunit 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env php => */ - private $listeners = array(); - private $initialized = array(); + private $listeners = []; + private $initialized = []; private $container; public function __construct(ContainerInterface $container) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ /** * @var DebugStack[] */ - private $loggers = array(); + private $loggers = []; public function __construct(ManagerRegistry $registry) { @@ -58,24 +58,24 @@ */ public function collect(Request $request, Response $response, \Exception $exception = null) { - $queries = array(); + $queries = []; foreach ($this->loggers as $name => $logger) { $queries[$name] = $this->sanitizeQueries($name, $logger->queries); } - $this->data = array( + $this->data = [ 'queries' => $queries, 'connections' => $this->connections, 'managers' => $this->managers, - ); + ]; } public function reset() { - $this->data = array(); + $this->data = []; foreach ($this->loggers as $logger) { - $logger->queries = array(); + $logger->queries = []; $logger->currentQuery = 0; } } @@ -133,10 +133,10 @@ { $query['explainable'] = true; if (null === $query['params']) { - $query['params'] = array(); + $query['params'] = []; } if (!\is_array($query['params'])) { - $query['params'] = array($query['params']); + $query['params'] = [$query['params']]; } foreach ($query['params'] as $j => $param) { if (isset($query['types'][$j])) { @@ -184,12 +184,12 @@ $className = \get_class($var); return method_exists($var, '__toString') ? - array(sprintf('Object(%s): "%s"', $className, $var->__toString()), false) : - array(sprintf('Object(%s)', $className), false); + [sprintf('Object(%s): "%s"', $className, $var->__toString()), false] : + [sprintf('Object(%s)', $className), false]; } if (\is_array($var)) { - $a = array(); + $a = []; $original = true; foreach ($var as $k => $v) { list($value, $orig) = $this->sanitizeParam($v); @@ -197,13 +197,13 @@ $a[$k] = $value; } - return array($a, $original); + return [$a, $original]; } if (\is_resource($var)) { - return array(sprintf('Resource(%s)', get_resource_type($var)), false); + return [sprintf('Resource(%s)', get_resource_type($var)), false]; } - return array($var, true); + return [$var, true]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,12 +27,12 @@ /** * Used inside metadata driver method to simplify aggregation of data. */ - protected $aliasMap = array(); + protected $aliasMap = []; /** * Used inside metadata driver method to simplify aggregation of data. */ - protected $drivers = array(); + protected $drivers = []; /** * @param array $objectManager A configured object manager @@ -46,10 +46,10 @@ // automatically register bundle mappings foreach (array_keys($container->getParameter('kernel.bundles')) as $bundle) { if (!isset($objectManager['mappings'][$bundle])) { - $objectManager['mappings'][$bundle] = array( + $objectManager['mappings'][$bundle] = [ 'mapping' => true, 'is_bundle' => true, - ); + ]; } } } @@ -59,11 +59,11 @@ continue; } - $mappingConfig = array_replace(array( + $mappingConfig = array_replace([ 'dir' => false, 'type' => false, 'prefix' => false, - ), (array) $mappingConfig); + ], (array) $mappingConfig); $mappingConfig['dir'] = $container->getParameterBag()->resolveValue($mappingConfig['dir']); // a bundle configuration is detected by realizing that the specified dir is not absolute and existing @@ -153,7 +153,7 @@ } if (!$bundleConfig['dir']) { - if (\in_array($bundleConfig['type'], array('annotation', 'staticphp'))) { + if (\in_array($bundleConfig['type'], ['annotation', 'staticphp'])) { $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingObjectDefaultName(); } else { $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingResourceConfigDirectory(); @@ -197,25 +197,25 @@ } $mappingDriverDef->setArguments($args); } elseif ('annotation' == $driverType) { - $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( + $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), [ new Reference($this->getObjectManagerElementName('metadata.annotation_reader')), array_values($driverPaths), - )); + ]); } else { - $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( + $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), [ array_values($driverPaths), - )); + ]); } $mappingDriverDef->setPublic(false); if (false !== strpos($mappingDriverDef->getClass(), 'yml') || false !== strpos($mappingDriverDef->getClass(), 'xml')) { - $mappingDriverDef->setArguments(array(array_flip($driverPaths))); - $mappingDriverDef->addMethodCall('setGlobalBasename', array('mapping')); + $mappingDriverDef->setArguments([array_flip($driverPaths)]); + $mappingDriverDef->addMethodCall('setGlobalBasename', ['mapping']); } $container->setDefinition($mappingService, $mappingDriverDef); foreach ($driverPaths as $prefix => $driverPath) { - $chainDriverDef->addMethodCall('addDriver', array(new Reference($mappingService), $prefix)); + $chainDriverDef->addMethodCall('addDriver', [new Reference($mappingService), $prefix]); } } @@ -240,7 +240,7 @@ throw new \InvalidArgumentException(sprintf('Specified non-existing directory "%s" as Doctrine mapping source.', $mappingConfig['dir'])); } - if (!\in_array($mappingConfig['type'], array('xml', 'yml', 'annotation', 'php', 'staticphp'))) { + if (!\in_array($mappingConfig['type'], ['xml', 'yml', 'annotation', 'php', 'staticphp'])) { throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or '. '"staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. '. 'You can register them by adding a new driver to the '. @@ -326,11 +326,11 @@ $cacheDef = new Definition($memcacheClass); $memcacheInstance = new Definition($memcacheInstanceClass); $memcacheInstance->setPrivate(true); - $memcacheInstance->addMethodCall('connect', array( + $memcacheInstance->addMethodCall('connect', [ $memcacheHost, $memcachePort, - )); + ]); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManagerName)), $memcacheInstance); - $cacheDef->addMethodCall('setMemcache', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManagerName))))); + $cacheDef->addMethodCall('setMemcache', [new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManagerName)))]); break; case 'memcached': $memcachedClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.memcached.class').'%'; @@ -340,11 +340,11 @@ $cacheDef = new Definition($memcachedClass); $memcachedInstance = new Definition($memcachedInstanceClass); $memcachedInstance->setPrivate(true); - $memcachedInstance->addMethodCall('addServer', array( + $memcachedInstance->addMethodCall('addServer', [ $memcachedHost, $memcachedPort, - )); + ]); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName)), $memcachedInstance); - $cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName))))); + $cacheDef->addMethodCall('setMemcached', [new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName)))]); break; case 'redis': $redisClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.redis.class').'%'; @@ -354,11 +354,11 @@ $cacheDef = new Definition($redisClass); $redisInstance = new Definition($redisInstanceClass); $redisInstance->setPrivate(true); - $redisInstance->addMethodCall('connect', array( + $redisInstance->addMethodCall('connect', [ $redisHost, $redisPort, - )); + ]); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManagerName)), $redisInstance); - $cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManagerName))))); + $cacheDef->addMethodCall('setRedis', [new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManagerName)))]); break; case 'apc': case 'apcu': @@ -387,7 +387,7 @@ $cacheDriver['namespace'] = $namespace; } - $cacheDef->addMethodCall('setNamespace', array($cacheDriver['namespace'])); + $cacheDef->addMethodCall('setNamespace', [$cacheDriver['namespace']]); $container->setDefinition($cacheDriverServiceId, $cacheDef); @@ -410,10 +410,10 @@ continue 2; } } - $managerConfigs[$autoMappedManager]['mappings'][$bundle] = array( + $managerConfigs[$autoMappedManager]['mappings'][$bundle] = [ 'mapping' => true, 'is_bundle' => true, - ); + ]; } $managerConfigs[$autoMappedManager]['auto_mapping'] = false; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,13 +65,13 @@ foreach ($taggedSubscribers as $taggedSubscriber) { list($id, $tag) = $taggedSubscriber; - $connections = isset($tag['connection']) ? array($tag['connection']) : array_keys($this->connections); + $connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections); foreach ($connections as $con) { if (!isset($this->connections[$con])) { throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections)))); } - $this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', array(new Reference($id))); + $this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', [new Reference($id)]); } } } @@ -88,7 +88,7 @@ throw new InvalidArgumentException(sprintf('Doctrine event listener "%s" must specify the "event" attribute.', $id)); } - $connections = isset($tag['connection']) ? array($tag['connection']) : array_keys($this->connections); + $connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections); foreach ($connections as $con) { if (!isset($this->connections[$con])) { throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections)))); @@ -99,7 +99,7 @@ } // we add one call per event per service so we have the correct order - $this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', array(array($tag['event']), $lazy ? $id : new Reference($id))); + $this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', [[$tag['event']], $lazy ? $id : new Reference($id)]); } } } @@ -130,12 +130,12 @@ */ private function findAndSortTags($tagName, ContainerBuilder $container) { - $sortedTags = array(); + $sortedTags = []; foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $tags) { foreach ($tags as $attributes) { $priority = isset($attributes['priority']) ? $attributes['priority'] : 0; - $sortedTags[$priority][] = array($serviceId, $attributes); + $sortedTags[$priority][] = [$serviceId, $attributes]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -50,7 +50,7 @@ /** * List of potential container parameters that hold the object manager name * to register the mappings with the correct metadata driver, for example - * array('acme.manager', 'doctrine.default_entity_manager'). + * ['acme.manager', 'doctrine.default_entity_manager']. * * @var string[] */ @@ -117,7 +117,7 @@ * register alias * @param string[] $aliasMap Map of alias to namespace */ - public function __construct($driver, array $namespaces, array $managerParameters, $driverPattern, $enabledParameter = false, $configurationPattern = '', $registerAliasMethodName = '', array $aliasMap = array()) + public function __construct($driver, array $namespaces, array $managerParameters, $driverPattern, $enabledParameter = false, $configurationPattern = '', $registerAliasMethodName = '', array $aliasMap = []) { $this->driver = $driver; $this->namespaces = $namespaces; @@ -146,7 +146,7 @@ // Definition for a Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain $chainDriverDef = $container->getDefinition($chainDriverDefService); foreach ($this->namespaces as $namespace) { - $chainDriverDef->addMethodCall('addDriver', array($mappingDriverDef, $namespace)); + $chainDriverDef->addMethodCall('addDriver', [$mappingDriverDef, $namespace]); } if (!\count($this->aliasMap)) { @@ -157,7 +157,7 @@ // Definition of the Doctrine\...\Configuration class specific to the Doctrine flavour. $configurationServiceDefinition = $container->getDefinition($configurationServiceName); foreach ($this->aliasMap as $alias => $namespace) { - $configurationServiceDefinition->addMethodCall($this->registerAliasMethodName, array($alias, $namespace)); + $configurationServiceDefinition->addMethodCall($this->registerAliasMethodName, [$alias, $namespace]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -92,7 +92,7 @@ { // Performance optimization if (empty($choices)) { - return array(); + return []; } // Optimize performance for single-field identifiers. We already @@ -101,7 +101,7 @@ // Attention: This optimization does not check choices for existence if ($optimize && !$this->choiceList && $this->idReader->isSingleId()) { - $values = array(); + $values = []; // Maintain order and indices of the given objects foreach ($choices as $i => $object) { @@ -129,7 +129,7 @@ // statements, consequently no test fails when this code is removed. // https://github.com/symfony/symfony/pull/8981#issuecomment-24230557 if (empty($values)) { - return array(); + return []; } // Optimize performance in case we have an object loader and @@ -138,8 +138,8 @@ if ($optimize && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) { $unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values); - $objectsById = array(); - $objects = array(); + $objectsById = []; + $objects = []; // Maintain order and indices from the given $values // An alternative approach to the following loop is to add the diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,7 +43,7 @@ $this->om = $om; $this->classMetadata = $classMetadata; $this->singleId = 1 === \count($ids); - $this->intId = $this->singleId && \in_array($idType, array('integer', 'smallint', 'bigint')); + $this->intId = $this->singleId && \in_array($idType, ['integer', 'smallint', 'bigint']); $this->idField = current($ids); // single field association are resolved, since the schema column could be an int diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -64,7 +64,7 @@ // Guess type $entity = current($qb->getRootEntities()); $metadata = $qb->getEntityManager()->getClassMetadata($entity); - if (\in_array($metadata->getTypeOfField($identifier), array('integer', 'bigint', 'smallint'))) { + if (\in_array($metadata->getTypeOfField($identifier), ['integer', 'bigint', 'smallint'])) { $parameterType = Connection::PARAM_INT_ARRAY; // Filter out non-integer values (e.g. ""). If we don't, some @@ -72,7 +72,7 @@ $values = array_values(array_filter($values, function ($v) { return (string) $v === (string) (int) $v || ctype_digit($v); })); - } elseif (\in_array($metadata->getTypeOfField($identifier), array('uuid', 'guid'))) { + } elseif (\in_array($metadata->getTypeOfField($identifier), ['uuid', 'guid'])) { $parameterType = Connection::PARAM_STR_ARRAY; // Like above, but we just filter out empty strings. @@ -83,7 +83,7 @@ $parameterType = Connection::PARAM_STR_ARRAY; } if (!$values) { - return array(); + return []; } return $qb->andWhere($where) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ public function transform($collection) { if (null === $collection) { - return array(); + return []; } // For cases when the collection getter returns $collection->toArray() @@ -57,7 +57,7 @@ public function reverseTransform($array) { if ('' === $array || null === $array) { - $array = array(); + $array = []; } else { $array = (array) $array; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,9 +26,9 @@ protected function loadTypes() { - return array( + return [ new EntityType($this->registry), - ); + ]; } protected function loadTypeGuesser() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ { protected $registry; - private $cache = array(); + private $cache = []; public function __construct(ManagerRegistry $registry) { @@ -39,7 +39,7 @@ public function guessType($class, $property) { if (!$ret = $this->getMetadata($class)) { - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', array(), Guess::LOW_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', [], Guess::LOW_CONFIDENCE); } list($metadata, $name) = $ret; @@ -48,37 +48,37 @@ $multiple = $metadata->isCollectionValuedAssociation($property); $mapping = $metadata->getAssociationMapping($property); - return new TypeGuess('Symfony\Bridge\Doctrine\Form\Type\EntityType', array('em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Bridge\Doctrine\Form\Type\EntityType', ['em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple], Guess::HIGH_CONFIDENCE); } switch ($metadata->getTypeOfField($property)) { case Type::TARRAY: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CollectionType', array(), Guess::MEDIUM_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CollectionType', [], Guess::MEDIUM_CONFIDENCE); case Type::BOOLEAN: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', array(), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', [], Guess::HIGH_CONFIDENCE); case Type::DATETIME: case Type::DATETIMETZ: case 'vardatetime': - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', array(), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', [], Guess::HIGH_CONFIDENCE); case 'dateinterval': - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateIntervalType', array(), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateIntervalType', [], Guess::HIGH_CONFIDENCE); case Type::DATE: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateType', array(), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateType', [], Guess::HIGH_CONFIDENCE); case Type::TIME: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', array(), Guess::HIGH_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', [], Guess::HIGH_CONFIDENCE); case Type::DECIMAL: case Type::FLOAT: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', array(), Guess::MEDIUM_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', [], Guess::MEDIUM_CONFIDENCE); case Type::INTEGER: case Type::BIGINT: case Type::SMALLINT: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\IntegerType', array(), Guess::MEDIUM_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\IntegerType', [], Guess::MEDIUM_CONFIDENCE); case Type::STRING: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', array(), Guess::MEDIUM_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', [], Guess::MEDIUM_CONFIDENCE); case Type::TEXT: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextareaType', array(), Guess::MEDIUM_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextareaType', [], Guess::MEDIUM_CONFIDENCE); default: - return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', array(), Guess::LOW_CONFIDENCE); + return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', [], Guess::LOW_CONFIDENCE); } } @@ -133,7 +133,7 @@ return new ValueGuess($mapping['length'], Guess::HIGH_CONFIDENCE); } - if (\in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { + if (\in_array($ret[0]->getTypeOfField($property), [Type::DECIMAL, Type::FLOAT])) { return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); } } @@ -146,7 +146,7 @@ { $ret = $this->getMetadata($class); if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) { - if (\in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { + if (\in_array($ret[0]->getTypeOfField($property), [Type::DECIMAL, Type::FLOAT])) { return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); } } @@ -164,7 +164,7 @@ $this->cache[$class] = null; foreach ($this->registry->getManagers() as $name => $em) { try { - return $this->cache[$class] = array($em->getClassMetadata($class), $name); + return $this->cache[$class] = [$em->getClassMetadata($class), $name]; } catch (MappingException $e) { // not an entity or mapped super class } catch (LegacyMappingException $e) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,12 +35,12 @@ { // Higher priority than core MergeCollectionListener so that this one // is called before - return array( - FormEvents::SUBMIT => array( - array('onBind', 10), // deprecated - array('onSubmit', 5), - ), - ); + return [ + FormEvents::SUBMIT => [ + ['onBind', 10], // deprecated + ['onSubmit', 5], + ], + ]; } public function onSubmit(FormEvent $event) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,12 +35,12 @@ /** * @var IdReader[] */ - private $idReaders = array(); + private $idReaders = []; /** * @var DoctrineChoiceLoader[] */ - private $choiceLoaders = array(); + private $choiceLoaders = []; /** * Creates the label for a choice. @@ -126,11 +126,11 @@ // also if concrete Type can return important QueryBuilder parts to generate // hash key we go for it as well if (!$options['query_builder'] || false !== ($qbParts = $this->getQueryBuilderPartsForCachingHash($options['query_builder']))) { - $hash = CachingFactoryDecorator::generateHash(array( + $hash = CachingFactoryDecorator::generateHash([ $options['em'], $options['class'], $qbParts, - )); + ]); if (isset($this->choiceLoaders[$hash])) { return $this->choiceLoaders[$hash]; @@ -167,7 +167,7 @@ // field name. We can only use numeric IDs as names, as we cannot // guarantee that a non-numeric ID contains a valid form name if ($idReader->isIntId()) { - return array(__CLASS__, 'createChoiceName'); + return [__CLASS__, 'createChoiceName']; } // Otherwise, an incrementing integer is used as name automatically @@ -183,7 +183,7 @@ // If the entity has a single-column ID, use that ID as value if ($idReader->isSingleId()) { - return array($idReader, 'getIdValue'); + return [$idReader, 'getIdValue']; } // Otherwise, an incrementing integer is used as value automatically @@ -221,10 +221,10 @@ // Set the "id_reader" option via the normalizer. This option is not // supposed to be set by the user. $idReaderNormalizer = function (Options $options) { - $hash = CachingFactoryDecorator::generateHash(array( + $hash = CachingFactoryDecorator::generateHash([ $options['em'], $options['class'], - )); + ]); // The ID reader is a utility that is needed to read the object IDs // when generating the field values. The callback generating the @@ -240,25 +240,25 @@ return $this->idReaders[$hash]; }; - $resolver->setDefaults(array( + $resolver->setDefaults([ 'em' => null, 'query_builder' => null, 'choices' => null, 'choice_loader' => $choiceLoader, - 'choice_label' => array(__CLASS__, 'createChoiceLabel'), + 'choice_label' => [__CLASS__, 'createChoiceLabel'], 'choice_name' => $choiceName, 'choice_value' => $choiceValue, 'id_reader' => null, // internal 'choice_translation_domain' => false, - )); + ]); - $resolver->setRequired(array('class')); + $resolver->setRequired(['class']); $resolver->setNormalizer('em', $emNormalizer); $resolver->setNormalizer('query_builder', $queryBuilderNormalizer); $resolver->setNormalizer('id_reader', $idReaderNormalizer); - $resolver->setAllowedTypes('em', array('null', 'string', 'Doctrine\Common\Persistence\ObjectManager')); + $resolver->setAllowedTypes('em', ['null', 'string', 'Doctrine\Common\Persistence\ObjectManager']); } /** @@ -279,6 +279,6 @@ public function reset() { - $this->choiceLoaders = array(); + $this->choiceLoaders = []; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,7 +40,7 @@ }; $resolver->setNormalizer('query_builder', $queryBuilderNormalizer); - $resolver->setAllowedTypes('query_builder', array('null', 'callable', 'Doctrine\ORM\QueryBuilder')); + $resolver->setAllowedTypes('query_builder', ['null', 'callable', 'Doctrine\ORM\QueryBuilder']); } /** @@ -78,10 +78,10 @@ */ public function getQueryBuilderPartsForCachingHash($queryBuilder) { - return array( + return [ $queryBuilder->getQuery()->getSQL(), - array_map(array($this, 'parameterToArray'), $queryBuilder->getParameters()->toArray()), - ); + array_map([$this, 'parameterToArray'], $queryBuilder->getParameters()->toArray()), + ]; } /** @@ -91,6 +91,6 @@ */ private function parameterToArray(Parameter $parameter) { - return array($parameter->getName(), $parameter->getType(), $parameter->getValue()); + return [$parameter->getName(), $parameter->getType(), $parameter->getValue()]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php 2019-02-03 12:23:08.000000000 +0000 @@ -44,6 +44,6 @@ $table->addColumn('sess_id', 'string'); $table->addColumn('sess_data', 'text')->setNotNull(true); $table->addColumn('sess_time', 'integer')->setNotNull(true)->setUnsigned(true); - $table->setPrimaryKey(array('sess_id')); + $table->setPrimaryKey(['sess_id']); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,7 +42,7 @@ } if (null !== $this->logger) { - $this->log($sql, null === $params ? array() : $this->normalizeParams($params)); + $this->log($sql, null === $params ? [] : $this->normalizeParams($params)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ /** * {@inheritdoc} */ - public function getProperties($class, array $context = array()) + public function getProperties($class, array $context = []) { try { $metadata = $this->classMetadataFactory->getMetadataFor($class); @@ -63,7 +63,7 @@ /** * {@inheritdoc} */ - public function getTypes($class, $property, array $context = array()) + public function getTypes($class, $property, array $context = []) { try { $metadata = $this->classMetadataFactory->getMetadataFor($class); @@ -85,7 +85,7 @@ $nullable = false; } - return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $class)); + return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $class)]; } $collectionKeyType = Type::BUILTIN_TYPE_INT; @@ -112,18 +112,18 @@ } } - return array(new Type( + return [new Type( Type::BUILTIN_TYPE_OBJECT, false, 'Doctrine\Common\Collections\Collection', true, new Type($collectionKeyType), new Type(Type::BUILTIN_TYPE_OBJECT, false, $class) - )); + )]; } if ($metadata instanceof ClassMetadataInfo && class_exists('Doctrine\ORM\Mapping\Embedded') && isset($metadata->embeddedClasses[$property])) { - return array(new Type(Type::BUILTIN_TYPE_OBJECT, false, $metadata->embeddedClasses[$property]['class'])); + return [new Type(Type::BUILTIN_TYPE_OBJECT, false, $metadata->embeddedClasses[$property]['class'])]; } if ($metadata->hasField($property)) { @@ -136,30 +136,30 @@ case DBALType::DATETIMETZ: case 'vardatetime': case DBALType::TIME: - return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')); + return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')]; case 'date_immutable': case 'datetime_immutable': case 'datetimetz_immutable': case 'time_immutable': - return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTimeImmutable')); + return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTimeImmutable')]; case 'dateinterval': - return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateInterval')); + return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateInterval')]; case DBALType::TARRAY: - return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)); + return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)]; case DBALType::SIMPLE_ARRAY: - return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))); + return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))]; case DBALType::JSON_ARRAY: - return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)); + return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)]; default: $builtinType = $this->getPhpType($typeOfField); - return $builtinType ? array(new Type($builtinType, $nullable)) : null; + return $builtinType ? [new Type($builtinType, $nullable)] : null; } } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,8 +53,8 @@ // the alias for lastUsed works around case insensitivity in PostgreSQL $sql = 'SELECT class, username, value, lastUsed AS last_used' .' FROM rememberme_token WHERE series=:series'; - $paramValues = array('series' => $series); - $paramTypes = array('series' => \PDO::PARAM_STR); + $paramValues = ['series' => $series]; + $paramTypes = ['series' => \PDO::PARAM_STR]; $stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes); $row = $stmt->fetch(\PDO::FETCH_ASSOC); @@ -71,8 +71,8 @@ public function deleteTokenBySeries($series) { $sql = 'DELETE FROM rememberme_token WHERE series=:series'; - $paramValues = array('series' => $series); - $paramTypes = array('series' => \PDO::PARAM_STR); + $paramValues = ['series' => $series]; + $paramTypes = ['series' => \PDO::PARAM_STR]; $this->conn->executeUpdate($sql, $paramValues, $paramTypes); } @@ -83,16 +83,16 @@ { $sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed' .' WHERE series=:series'; - $paramValues = array( + $paramValues = [ 'value' => $tokenValue, 'lastUsed' => $lastUsed, 'series' => $series, - ); - $paramTypes = array( + ]; + $paramTypes = [ 'value' => \PDO::PARAM_STR, 'lastUsed' => DoctrineType::DATETIME, 'series' => \PDO::PARAM_STR, - ); + ]; $updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes); if ($updated < 1) { throw new TokenNotFoundException('No token found.'); @@ -107,20 +107,20 @@ $sql = 'INSERT INTO rememberme_token' .' (class, username, series, value, lastUsed)' .' VALUES (:class, :username, :series, :value, :lastUsed)'; - $paramValues = array( + $paramValues = [ 'class' => $token->getClass(), 'username' => $token->getUsername(), 'series' => $token->getSeries(), 'value' => $token->getTokenValue(), 'lastUsed' => $token->getLastUsed(), - ); - $paramTypes = array( + ]; + $paramTypes = [ 'class' => \PDO::PARAM_STR, 'username' => \PDO::PARAM_STR, 'series' => \PDO::PARAM_STR, 'value' => \PDO::PARAM_STR, 'lastUsed' => DoctrineType::DATETIME, - ); + ]; $this->conn->executeUpdate($sql, $paramValues, $paramTypes); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php 2019-02-03 12:23:08.000000000 +0000 @@ -48,7 +48,7 @@ { $repository = $this->getRepository(); if (null !== $this->property) { - $user = $repository->findOneBy(array($this->property => $username)); + $user = $repository->findOneBy([$this->property => $username]); } else { if (!$repository instanceof UserLoaderInterface) { throw new \InvalidArgumentException(sprintf('You must either make the "%s" entity Doctrine Repository ("%s") implement "Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface" or set the "property" option in the corresponding entity provider configuration.', $this->classOrAlias, \get_class($repository))); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,10 +42,10 @@ $config = self::createTestConfiguration(); } - $params = array( + $params = [ 'driver' => 'pdo_sqlite', 'memory' => true, - ); + ]; return EntityManager::create($params, $config); } @@ -56,7 +56,7 @@ public static function createTestConfiguration() { $config = new Configuration(); - $config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures')); + $config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']); $config->setAutoGenerateProxyClasses(true); $config->setProxyDir(\sys_get_temp_dir()); $config->setProxyNamespace('SymfonyTests\Doctrine'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ /** * @var ObjectRepository[] */ - private $repositoryList = array(); + private $repositoryList = []; /** * {@inheritdoc} diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,15 +43,15 @@ $this->evm->addEventListener('foo', 'bar'); $this->evm->addEventListener('foo', $listener = new MyListener()); - $listeners = array('foo' => array('_service_bar' => 'bar', spl_object_hash($listener) => $listener)); + $listeners = ['foo' => ['_service_bar' => 'bar', spl_object_hash($listener) => $listener]]; $this->assertSame($listeners, $this->evm->getListeners()); $this->assertSame($listeners['foo'], $this->evm->getListeners('foo')); $this->evm->removeEventListener('foo', $listener); - $this->assertSame(array('_service_bar' => 'bar'), $this->evm->getListeners('foo')); + $this->assertSame(['_service_bar' => 'bar'], $this->evm->getListeners('foo')); $this->evm->removeEventListener('foo', 'bar'); - $this->assertSame(array(), $this->evm->getListeners('foo')); + $this->assertSame([], $this->evm->getListeners('foo')); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,27 +22,27 @@ { public function testCollectConnections() { - $c = $this->createCollector(array()); + $c = $this->createCollector([]); $c->collect(new Request(), new Response()); - $this->assertEquals(array('default' => 'doctrine.dbal.default_connection'), $c->getConnections()); + $this->assertEquals(['default' => 'doctrine.dbal.default_connection'], $c->getConnections()); } public function testCollectManagers() { - $c = $this->createCollector(array()); + $c = $this->createCollector([]); $c->collect(new Request(), new Response()); - $this->assertEquals(array('default' => 'doctrine.orm.default_entity_manager'), $c->getManagers()); + $this->assertEquals(['default' => 'doctrine.orm.default_entity_manager'], $c->getManagers()); } public function testCollectQueryCount() { - $c = $this->createCollector(array()); + $c = $this->createCollector([]); $c->collect(new Request(), new Response()); $this->assertEquals(0, $c->getQueryCount()); - $queries = array( - array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 0), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1', 'params' => [], 'types' => [], 'executionMS' => 0], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $this->assertEquals(1, $c->getQueryCount()); @@ -50,21 +50,21 @@ public function testCollectTime() { - $c = $this->createCollector(array()); + $c = $this->createCollector([]); $c->collect(new Request(), new Response()); $this->assertEquals(0, $c->getTime()); - $queries = array( - array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1', 'params' => [], 'types' => [], 'executionMS' => 1], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $this->assertEquals(1, $c->getTime()); - $queries = array( - array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), - array('sql' => 'SELECT * FROM table2', 'params' => array(), 'types' => array(), 'executionMS' => 2), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1', 'params' => [], 'types' => [], 'executionMS' => 1], + ['sql' => 'SELECT * FROM table2', 'params' => [], 'types' => [], 'executionMS' => 2], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $this->assertEquals(3, $c->getTime()); @@ -75,9 +75,9 @@ */ public function testCollectQueries($param, $types, $expected, $explainable) { - $queries = array( - array('sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => array($param), 'types' => $types, 'executionMS' => 1), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => [$param], 'types' => $types, 'executionMS' => 1], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); @@ -88,32 +88,32 @@ public function testCollectQueryWithNoParams() { - $queries = array( - array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), - array('sql' => 'SELECT * FROM table1', 'params' => null, 'types' => null, 'executionMS' => 1), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1', 'params' => [], 'types' => [], 'executionMS' => 1], + ['sql' => 'SELECT * FROM table1', 'params' => null, 'types' => null, 'executionMS' => 1], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $collectedQueries = $c->getQueries(); - $this->assertEquals(array(), $collectedQueries['default'][0]['params']); + $this->assertEquals([], $collectedQueries['default'][0]['params']); $this->assertTrue($collectedQueries['default'][0]['explainable']); - $this->assertEquals(array(), $collectedQueries['default'][1]['params']); + $this->assertEquals([], $collectedQueries['default'][1]['params']); $this->assertTrue($collectedQueries['default'][1]['explainable']); } public function testReset() { - $queries = array( - array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1', 'params' => [], 'types' => [], 'executionMS' => 1], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $c->reset(); $c->collect(new Request(), new Response()); - $this->assertEquals(array('default' => array()), $c->getQueries()); + $this->assertEquals(['default' => []], $c->getQueries()); } /** @@ -121,9 +121,9 @@ */ public function testSerialization($param, $types, $expected, $explainable) { - $queries = array( - array('sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => array($param), 'types' => $types, 'executionMS' => 1), - ); + $queries = [ + ['sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => [$param], 'types' => $types, 'executionMS' => 1], + ]; $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $c = unserialize(serialize($c)); @@ -135,25 +135,25 @@ public function paramProvider() { - $tests = array( - array('some value', array(), 'some value', true), - array(1, array(), 1, true), - array(true, array(), true, true), - array(null, array(), null, true), - array(new \DateTime('2011-09-11'), array('date'), '2011-09-11', true), - array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false), - array(new \stdClass(), array(), 'Object(stdClass)', false), - array( + $tests = [ + ['some value', [], 'some value', true], + [1, [], 1, true], + [true, [], true, true], + [null, [], null, true], + [new \DateTime('2011-09-11'), ['date'], '2011-09-11', true], + [fopen(__FILE__, 'r'), [], 'Resource(stream)', false], + [new \stdClass(), [], 'Object(stdClass)', false], + [ new StringRepresentableClass(), - array(), + [], 'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "string representation"', false, - ), - ); + ], + ]; if (version_compare(Version::VERSION, '2.6', '>=')) { - $tests[] = array('this is not a date', array('date'), 'this is not a date', false); - $tests[] = array(new \stdClass(), array('date'), 'Object(stdClass)', false); + $tests[] = ['this is not a date', ['date'], 'this is not a date', false]; + $tests[] = [new \stdClass(), ['date'], 'Object(stdClass)', false]; } return $tests; @@ -172,11 +172,11 @@ $registry ->expects($this->any()) ->method('getConnectionNames') - ->will($this->returnValue(array('default' => 'doctrine.dbal.default_connection'))); + ->will($this->returnValue(['default' => 'doctrine.dbal.default_connection'])); $registry ->expects($this->any()) ->method('getManagerNames') - ->will($this->returnValue(array('default' => 'doctrine.orm.default_entity_manager'))); + ->will($this->returnValue(['default' => 'doctrine.orm.default_entity_manager'])); $registry->expects($this->any()) ->method('getConnection') ->will($this->returnValue($connection)); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -44,7 +44,7 @@ $abstractDefinition = new Definition('stdClass'); $abstractDefinition->setAbstract(true); - $abstractDefinition->addTag('doctrine.event_listener', array('event' => 'test')); + $abstractDefinition->addTag('doctrine.event_listener', ['event' => 'test']); $container->setDefinition('a', $abstractDefinition); @@ -58,44 +58,44 @@ $container ->register('a', 'stdClass') ->setPublic(false) - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'bar', - )) - ->addTag('doctrine.event_listener', array( + ]) + ->addTag('doctrine.event_listener', [ 'event' => 'foo', 'priority' => -5, - )) - ->addTag('doctrine.event_listener', array( + ]) + ->addTag('doctrine.event_listener', [ 'event' => 'foo_bar', 'priority' => 3, 'lazy' => true, - )) + ]) ; $container ->register('b', 'stdClass') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'foo', - )) + ]) ; $container ->register('c', 'stdClass') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'foo_bar', 'priority' => 4, - )) + ]) ; $this->process($container); $methodCalls = $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls(); $this->assertEquals( - array( - array('addEventListener', array(array('foo_bar'), new Reference('c'))), - array('addEventListener', array(array('foo_bar'), new Reference('a'))), - array('addEventListener', array(array('bar'), new Reference('a'))), - array('addEventListener', array(array('foo'), new Reference('b'))), - array('addEventListener', array(array('foo'), new Reference('a'))), - ), + [ + ['addEventListener', [['foo_bar'], new Reference('c')]], + ['addEventListener', [['foo_bar'], new Reference('a')]], + ['addEventListener', [['bar'], new Reference('a')]], + ['addEventListener', [['foo'], new Reference('b')]], + ['addEventListener', [['foo'], new Reference('a')]], + ], $methodCalls ); @@ -113,42 +113,42 @@ $container ->register('a', 'stdClass') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'onFlush', - )) + ]) ; $container ->register('b', 'stdClass') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'onFlush', 'connection' => 'default', - )) + ]) ; $container ->register('c', 'stdClass') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'event' => 'onFlush', 'connection' => 'second', - )) + ]) ; $this->process($container); $this->assertEquals( - array( - array('addEventListener', array(array('onFlush'), new Reference('a'))), - array('addEventListener', array(array('onFlush'), new Reference('b'))), - ), + [ + ['addEventListener', [['onFlush'], new Reference('a')]], + ['addEventListener', [['onFlush'], new Reference('b')]], + ], $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls() ); $this->assertEquals( - array( - array('addEventListener', array(array('onFlush'), new Reference('a'))), - array('addEventListener', array(array('onFlush'), new Reference('c'))), - ), + [ + ['addEventListener', [['onFlush'], new Reference('a')]], + ['addEventListener', [['onFlush'], new Reference('c')]], + ], $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls() ); } @@ -159,42 +159,42 @@ $container ->register('a', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'event' => 'onFlush', - )) + ]) ; $container ->register('b', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'event' => 'onFlush', 'connection' => 'default', - )) + ]) ; $container ->register('c', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'event' => 'onFlush', 'connection' => 'second', - )) + ]) ; $this->process($container); $this->assertEquals( - array( - array('addEventSubscriber', array(new Reference('a'))), - array('addEventSubscriber', array(new Reference('b'))), - ), + [ + ['addEventSubscriber', [new Reference('a')]], + ['addEventSubscriber', [new Reference('b')]], + ], $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls() ); $this->assertEquals( - array( - array('addEventSubscriber', array(new Reference('a'))), - array('addEventSubscriber', array(new Reference('c'))), - ), + [ + ['addEventSubscriber', [new Reference('a')]], + ['addEventSubscriber', [new Reference('c')]], + ], $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls() ); } @@ -209,39 +209,39 @@ ; $container ->register('b', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'priority' => 5, - )) + ]) ; $container ->register('c', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'priority' => 10, - )) + ]) ; $container ->register('d', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'priority' => 10, - )) + ]) ; $container ->register('e', 'stdClass') - ->addTag('doctrine.event_subscriber', array( + ->addTag('doctrine.event_subscriber', [ 'priority' => 10, - )) + ]) ; $this->process($container); $this->assertEquals( - array( - array('addEventSubscriber', array(new Reference('c'))), - array('addEventSubscriber', array(new Reference('d'))), - array('addEventSubscriber', array(new Reference('e'))), - array('addEventSubscriber', array(new Reference('b'))), - array('addEventSubscriber', array(new Reference('a'))), - ), + [ + ['addEventSubscriber', [new Reference('c')]], + ['addEventSubscriber', [new Reference('d')]], + ['addEventSubscriber', [new Reference('e')]], + ['addEventSubscriber', [new Reference('b')]], + ['addEventSubscriber', [new Reference('a')]], + ], $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls() ); } @@ -252,9 +252,9 @@ $this->process($container); - $this->assertEquals(array(), $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()); + $this->assertEquals([], $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()); - $this->assertEquals(array(), $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()); + $this->assertEquals([], $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()); } private function process(ContainerBuilder $container) @@ -267,7 +267,7 @@ { $container = new ContainerBuilder(); - $connections = array('default' => 'doctrine.dbal.default_connection'); + $connections = ['default' => 'doctrine.dbal.default_connection']; $container->register('doctrine.dbal.default_connection.event_manager', 'stdClass'); $container->register('doctrine.dbal.default_connection', 'stdClass'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,17 +16,17 @@ public function testNoDriverParmeterException() { $container = $this->createBuilder(); - $this->process($container, array( + $this->process($container, [ 'manager.param.one', 'manager.param.two', - )); + ]); } private function process(ContainerBuilder $container, array $managerParamNames) { $pass = new ConcreteMappingsPass( new Definition('\stdClass'), - array(), + [], $managerParamNames, 'some.%s.metadata_driver' ); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,13 +32,13 @@ $this->extension = $this ->getMockBuilder('Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension') - ->setMethods(array( + ->setMethods([ 'getMappingResourceConfigDirectory', 'getObjectManagerElementName', 'getMappingObjectDefaultName', 'getMappingResourceExtension', 'load', - )) + ]) ->getMock() ; @@ -54,19 +54,19 @@ */ public function testFixManagersAutoMappingsWithTwoAutomappings() { - $emConfigs = array( - 'em1' => array( + $emConfigs = [ + 'em1' => [ 'auto_mapping' => true, - ), - 'em2' => array( + ], + 'em2' => [ 'auto_mapping' => true, - ), - ); + ], + ]; - $bundles = array( + $bundles = [ 'FirstBundle' => 'My\FirstBundle', 'SecondBundle' => 'My\SecondBundle', - ); + ]; $reflection = new \ReflectionClass(\get_class($this->extension)); $method = $reflection->getMethod('fixManagersAutoMappings'); @@ -77,69 +77,69 @@ public function getAutomappingData() { - return array( - array( - array( // no auto mapping on em1 + return [ + [ + [ // no auto mapping on em1 'auto_mapping' => false, - ), - array( // no auto mapping on em2 + ], + [ // no auto mapping on em2 'auto_mapping' => false, - ), - array(), - array(), - ), - array( - array( // no auto mapping on em1 + ], + [], + [], + ], + [ + [ // no auto mapping on em1 'auto_mapping' => false, - ), - array( // auto mapping enabled on em2 + ], + [ // auto mapping enabled on em2 'auto_mapping' => true, - ), - array(), - array( - 'mappings' => array( - 'FirstBundle' => array( + ], + [], + [ + 'mappings' => [ + 'FirstBundle' => [ 'mapping' => true, 'is_bundle' => true, - ), - 'SecondBundle' => array( + ], + 'SecondBundle' => [ 'mapping' => true, 'is_bundle' => true, - ), - ), - ), - ), - array( - array( // no auto mapping on em1, but it defines SecondBundle as own + ], + ], + ], + ], + [ + [ // no auto mapping on em1, but it defines SecondBundle as own 'auto_mapping' => false, - 'mappings' => array( - 'SecondBundle' => array( + 'mappings' => [ + 'SecondBundle' => [ 'mapping' => true, 'is_bundle' => true, - ), - ), - ), - array( // auto mapping enabled on em2 + ], + ], + ], + [ // auto mapping enabled on em2 'auto_mapping' => true, - ), - array( - 'mappings' => array( - 'SecondBundle' => array( + ], + [ + 'mappings' => [ + 'SecondBundle' => [ 'mapping' => true, 'is_bundle' => true, - ), - ), - ), - array( - 'mappings' => array( - 'FirstBundle' => array( + ], + ], + ], + [ + 'mappings' => [ + 'FirstBundle' => [ 'mapping' => true, 'is_bundle' => true, - ), - ), - ), - ), - ); + ], + ], + ], + ], + ]; } /** @@ -147,15 +147,15 @@ */ public function testFixManagersAutoMappings(array $originalEm1, array $originalEm2, array $expectedEm1, array $expectedEm2) { - $emConfigs = array( + $emConfigs = [ 'em1' => $originalEm1, 'em2' => $originalEm2, - ); + ]; - $bundles = array( + $bundles = [ 'FirstBundle' => 'My\FirstBundle', 'SecondBundle' => 'My\SecondBundle', - ); + ]; $reflection = new \ReflectionClass(\get_class($this->extension)); $method = $reflection->getMethod('fixManagersAutoMappings'); @@ -163,27 +163,27 @@ $newEmConfigs = $method->invoke($this->extension, $emConfigs, $bundles); - $this->assertEquals($newEmConfigs['em1'], array_merge(array( + $this->assertEquals($newEmConfigs['em1'], array_merge([ 'auto_mapping' => false, - ), $expectedEm1)); - $this->assertEquals($newEmConfigs['em2'], array_merge(array( + ], $expectedEm1)); + $this->assertEquals($newEmConfigs['em2'], array_merge([ 'auto_mapping' => false, - ), $expectedEm2)); + ], $expectedEm2)); } public function providerBasicDrivers() { - return array( - array('doctrine.orm.cache.apc.class', array('type' => 'apc')), - array('doctrine.orm.cache.apcu.class', array('type' => 'apcu')), - array('doctrine.orm.cache.array.class', array('type' => 'array')), - array('doctrine.orm.cache.xcache.class', array('type' => 'xcache')), - array('doctrine.orm.cache.wincache.class', array('type' => 'wincache')), - array('doctrine.orm.cache.zenddata.class', array('type' => 'zenddata')), - array('doctrine.orm.cache.redis.class', array('type' => 'redis'), array('setRedis')), - array('doctrine.orm.cache.memcache.class', array('type' => 'memcache'), array('setMemcache')), - array('doctrine.orm.cache.memcached.class', array('type' => 'memcached'), array('setMemcached')), - ); + return [ + ['doctrine.orm.cache.apc.class', ['type' => 'apc']], + ['doctrine.orm.cache.apcu.class', ['type' => 'apcu']], + ['doctrine.orm.cache.array.class', ['type' => 'array']], + ['doctrine.orm.cache.xcache.class', ['type' => 'xcache']], + ['doctrine.orm.cache.wincache.class', ['type' => 'wincache']], + ['doctrine.orm.cache.zenddata.class', ['type' => 'zenddata']], + ['doctrine.orm.cache.redis.class', ['type' => 'redis'], ['setRedis']], + ['doctrine.orm.cache.memcache.class', ['type' => 'memcache'], ['setMemcache']], + ['doctrine.orm.cache.memcached.class', ['type' => 'memcached'], ['setMemcached']], + ]; } /** @@ -192,14 +192,14 @@ * * @dataProvider providerBasicDrivers */ - public function testLoadBasicCacheDriver($class, array $config, array $expectedCalls = array()) + public function testLoadBasicCacheDriver($class, array $config, array $expectedCalls = []) { $container = $this->createContainer(); $cacheName = 'metadata_cache'; - $objectManager = array( + $objectManager = [ 'name' => 'default', 'metadata_cache_driver' => $config, - ); + ]; $this->invokeLoadCacheDriver($objectManager, $container, $cacheName); @@ -223,13 +223,13 @@ $cacheName = 'metadata_cache'; $container = $this->createContainer(); $definition = new Definition('%doctrine.orm.cache.apc.class%'); - $objectManager = array( + $objectManager = [ 'name' => 'default', - 'metadata_cache_driver' => array( + 'metadata_cache_driver' => [ 'type' => 'service', 'id' => 'service_driver', - ), - ); + ], + ]; $container->setDefinition('service_driver', $definition); @@ -246,12 +246,12 @@ { $cacheName = 'metadata_cache'; $container = $this->createContainer(); - $objectManager = array( + $objectManager = [ 'name' => 'default', - 'metadata_cache_driver' => array( + 'metadata_cache_driver' => [ 'type' => 'unrecognized_type', - ), - ); + ], + ]; $this->invokeLoadCacheDriver($objectManager, $container, $cacheName); } @@ -262,21 +262,21 @@ $method->setAccessible(true); - $method->invokeArgs($this->extension, array($objectManager, $container, $cacheName)); + $method->invokeArgs($this->extension, [$objectManager, $container, $cacheName]); } /** * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ - protected function createContainer(array $data = array()) + protected function createContainer(array $data = []) { - return new ContainerBuilder(new ParameterBag(array_merge(array( - 'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'), + return new ContainerBuilder(new ParameterBag(array_merge([ + 'kernel.bundles' => ['FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'], 'kernel.cache_dir' => __DIR__, 'kernel.debug' => false, 'kernel.environment' => 'test', 'kernel.name' => 'kernel', 'kernel.root_dir' => __DIR__, - ), $data))); + ], $data))); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ public $name; /** @Column(type="array", nullable=true) */ - public $phoneNumbers = array(); + public $phoneNumbers = []; public function __construct($id, $name) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,9 +81,9 @@ ->disableOriginalConstructor() ->getMock(); $this->objectLoader = $this->getMockBuilder('Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface')->getMock(); - $this->obj1 = (object) array('name' => 'A'); - $this->obj2 = (object) array('name' => 'B'); - $this->obj3 = (object) array('name' => 'C'); + $this->obj1 = (object) ['name' => 'A']; + $this->obj2 = (object) ['name' => 'B']; + $this->obj3 = (object) ['name' => 'C']; $this->om->expects($this->any()) ->method('getRepository') @@ -104,7 +104,7 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $value = function () {}; $choiceList = new ArrayChoiceList($choices, $value); @@ -132,7 +132,7 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $value = function () {}; $choiceList = new ArrayChoiceList($choices, $value); @@ -159,7 +159,7 @@ $this->objectLoader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $choiceList = new ArrayChoiceList($choices); $this->repository->expects($this->never()) @@ -184,17 +184,17 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $this->repository->expects($this->once()) ->method('findAll') ->willReturn($choices); - $this->assertSame(array('1', '2'), $loader->loadValuesForChoices(array($this->obj2, $this->obj3))); + $this->assertSame(['1', '2'], $loader->loadValuesForChoices([$this->obj2, $this->obj3])); // no further loads on subsequent calls - $this->assertSame(array('1', '2'), $loader->loadValuesForChoices(array($this->obj2, $this->obj3))); + $this->assertSame(['1', '2'], $loader->loadValuesForChoices([$this->obj2, $this->obj3])); } public function testLoadValuesForChoicesDoesNotLoadIfEmptyChoices() @@ -208,7 +208,7 @@ $this->repository->expects($this->never()) ->method('findAll'); - $this->assertSame(array(), $loader->loadValuesForChoices(array())); + $this->assertSame([], $loader->loadValuesForChoices([])); } public function testLoadValuesForChoicesDoesNotLoadIfSingleIntId() @@ -231,7 +231,7 @@ ->with($this->obj2) ->willReturn('2'); - $this->assertSame(array('2'), $loader->loadValuesForChoices(array($this->obj2))); + $this->assertSame(['2'], $loader->loadValuesForChoices([$this->obj2])); } public function testLoadValuesForChoicesLoadsIfSingleIntIdAndValueGiven() @@ -242,7 +242,7 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $value = function (\stdClass $object) { return $object->name; }; $this->idReader->expects($this->any()) @@ -253,8 +253,8 @@ ->method('findAll') ->willReturn($choices); - $this->assertSame(array('B'), $loader->loadValuesForChoices( - array($this->obj2), + $this->assertSame(['B'], $loader->loadValuesForChoices( + [$this->obj2], $value )); } @@ -267,7 +267,7 @@ $this->idReader ); - $value = array($this->idReader, 'getIdValue'); + $value = [$this->idReader, 'getIdValue']; $this->idReader->expects($this->any()) ->method('isSingleId') @@ -281,8 +281,8 @@ ->with($this->obj2) ->willReturn('2'); - $this->assertSame(array('2'), $loader->loadValuesForChoices( - array($this->obj2), + $this->assertSame(['2'], $loader->loadValuesForChoices( + [$this->obj2], $value )); } @@ -295,17 +295,17 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $this->repository->expects($this->once()) ->method('findAll') ->willReturn($choices); - $this->assertSame(array($this->obj2, $this->obj3), $loader->loadChoicesForValues(array('1', '2'))); + $this->assertSame([$this->obj2, $this->obj3], $loader->loadChoicesForValues(['1', '2'])); // no further loads on subsequent calls - $this->assertSame(array($this->obj2, $this->obj3), $loader->loadChoicesForValues(array('1', '2'))); + $this->assertSame([$this->obj2, $this->obj3], $loader->loadChoicesForValues(['1', '2'])); } public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues() @@ -319,7 +319,7 @@ $this->repository->expects($this->never()) ->method('findAll'); - $this->assertSame(array(), $loader->loadChoicesForValues(array())); + $this->assertSame([], $loader->loadChoicesForValues([])); } public function testLoadChoicesForValuesLoadsOnlyChoicesIfSingleIntId() @@ -331,7 +331,7 @@ $this->objectLoader ); - $choices = array($this->obj2, $this->obj3); + $choices = [$this->obj2, $this->obj3]; $this->idReader->expects($this->any()) ->method('isSingleId') @@ -346,19 +346,19 @@ $this->objectLoader->expects($this->once()) ->method('getEntitiesByIds') - ->with('idField', array(4 => '3', 7 => '2')) + ->with('idField', [4 => '3', 7 => '2']) ->willReturn($choices); $this->idReader->expects($this->any()) ->method('getIdValue') - ->willReturnMap(array( - array($this->obj2, '2'), - array($this->obj3, '3'), - )); + ->willReturnMap([ + [$this->obj2, '2'], + [$this->obj3, '3'], + ]); $this->assertSame( - array(4 => $this->obj3, 7 => $this->obj2), - $loader->loadChoicesForValues(array(4 => '3', 7 => '2') + [4 => $this->obj3, 7 => $this->obj2], + $loader->loadChoicesForValues([4 => '3', 7 => '2'] )); } @@ -370,7 +370,7 @@ $this->idReader ); - $choices = array($this->obj1, $this->obj2, $this->obj3); + $choices = [$this->obj1, $this->obj2, $this->obj3]; $value = function (\stdClass $object) { return $object->name; }; $this->idReader->expects($this->any()) @@ -381,8 +381,8 @@ ->method('findAll') ->willReturn($choices); - $this->assertSame(array($this->obj2), $loader->loadChoicesForValues( - array('B'), + $this->assertSame([$this->obj2], $loader->loadChoicesForValues( + ['B'], $value )); } @@ -396,8 +396,8 @@ $this->objectLoader ); - $choices = array($this->obj2, $this->obj3); - $value = array($this->idReader, 'getIdValue'); + $choices = [$this->obj2, $this->obj3]; + $value = [$this->idReader, 'getIdValue']; $this->idReader->expects($this->any()) ->method('isSingleId') @@ -412,16 +412,16 @@ $this->objectLoader->expects($this->once()) ->method('getEntitiesByIds') - ->with('idField', array('2')) + ->with('idField', ['2']) ->willReturn($choices); $this->idReader->expects($this->any()) ->method('getIdValue') - ->willReturnMap(array( - array($this->obj2, '2'), - array($this->obj3, '3'), - )); + ->willReturnMap([ + [$this->obj2, '2'], + [$this->obj3, '3'], + ]); - $this->assertSame(array($this->obj2), $loader->loadChoicesForValues(array('2'), $value)); + $this->assertSame([$this->obj2], $loader->loadChoicesForValues(['2'], $value)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,17 +34,17 @@ $em = DoctrineTestHelper::createTestEntityManager(); $query = $this->getMockBuilder('QueryMock') - ->setMethods(array('setParameter', 'getResult', 'getSql', '_doExecute')) + ->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute']) ->getMock(); $query->expects($this->once()) ->method('setParameter') - ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2), $expectedType) + ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', [1, 2], $expectedType) ->willReturn($query); $qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder') - ->setConstructorArgs(array($em)) - ->setMethods(array('getQuery')) + ->setConstructorArgs([$em]) + ->setMethods(['getQuery']) ->getMock(); $qb->expects($this->once()) @@ -55,7 +55,7 @@ ->from($classname, 'e'); $loader = new ORMQueryBuilderLoader($qb); - $loader->getEntitiesByIds('id', array(1, 2)); + $loader->getEntitiesByIds('id', [1, 2]); } public function testFilterNonIntegerValues() @@ -63,17 +63,17 @@ $em = DoctrineTestHelper::createTestEntityManager(); $query = $this->getMockBuilder('QueryMock') - ->setMethods(array('setParameter', 'getResult', 'getSql', '_doExecute')) + ->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute']) ->getMock(); $query->expects($this->once()) ->method('setParameter') - ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2, 3, '9223372036854775808'), Connection::PARAM_INT_ARRAY) + ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', [1, 2, 3, '9223372036854775808'], Connection::PARAM_INT_ARRAY) ->willReturn($query); $qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder') - ->setConstructorArgs(array($em)) - ->setMethods(array('getQuery')) + ->setConstructorArgs([$em]) + ->setMethods(['getQuery']) ->getMock(); $qb->expects($this->once()) @@ -84,7 +84,7 @@ ->from('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity', 'e'); $loader = new ORMQueryBuilderLoader($qb); - $loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo', '9223372036854775808')); + $loader->getEntitiesByIds('id', [1, '', 2, 3, 'foo', '9223372036854775808']); } /** @@ -95,17 +95,17 @@ $em = DoctrineTestHelper::createTestEntityManager(); $query = $this->getMockBuilder('QueryMock') - ->setMethods(array('setParameter', 'getResult', 'getSql', '_doExecute')) + ->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute']) ->getMock(); $query->expects($this->once()) ->method('setParameter') - ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array('71c5fd46-3f16-4abb-bad7-90ac1e654a2d', 'b98e8e11-2897-44df-ad24-d2627eb7f499'), Connection::PARAM_STR_ARRAY) + ->with('ORMQueryBuilderLoader_getEntitiesByIds_id', ['71c5fd46-3f16-4abb-bad7-90ac1e654a2d', 'b98e8e11-2897-44df-ad24-d2627eb7f499'], Connection::PARAM_STR_ARRAY) ->willReturn($query); $qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder') - ->setConstructorArgs(array($em)) - ->setMethods(array('getQuery')) + ->setConstructorArgs([$em]) + ->setMethods(['getQuery']) ->getMock(); $qb->expects($this->once()) @@ -116,7 +116,7 @@ ->from($entityClass, 'e'); $loader = new ORMQueryBuilderLoader($qb); - $loader->getEntitiesByIds('id', array('71c5fd46-3f16-4abb-bad7-90ac1e654a2d', '', 'b98e8e11-2897-44df-ad24-d2627eb7f499')); + $loader->getEntitiesByIds('id', ['71c5fd46-3f16-4abb-bad7-90ac1e654a2d', '', 'b98e8e11-2897-44df-ad24-d2627eb7f499']); } public function testEmbeddedIdentifierName() @@ -130,17 +130,17 @@ $em = DoctrineTestHelper::createTestEntityManager(); $query = $this->getMockBuilder('QueryMock') - ->setMethods(array('setParameter', 'getResult', 'getSql', '_doExecute')) + ->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute']) ->getMock(); $query->expects($this->once()) ->method('setParameter') - ->with('ORMQueryBuilderLoader_getEntitiesByIds_id_value', array(1, 2, 3), Connection::PARAM_INT_ARRAY) + ->with('ORMQueryBuilderLoader_getEntitiesByIds_id_value', [1, 2, 3], Connection::PARAM_INT_ARRAY) ->willReturn($query); $qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder') - ->setConstructorArgs(array($em)) - ->setMethods(array('getQuery')) + ->setConstructorArgs([$em]) + ->setMethods(['getQuery']) ->getMock(); $qb->expects($this->once()) ->method('getQuery') @@ -150,14 +150,14 @@ ->from('Symfony\Bridge\Doctrine\Tests\Fixtures\EmbeddedIdentifierEntity', 'e'); $loader = new ORMQueryBuilderLoader($qb); - $loader->getEntitiesByIds('id.value', array(1, '', 2, 3, 'foo')); + $loader->getEntitiesByIds('id.value', [1, '', 2, 3, 'foo']); } public function provideGuidEntityClasses() { - return array( - array('Symfony\Bridge\Doctrine\Tests\Fixtures\GuidIdEntity'), - array('Symfony\Bridge\Doctrine\Tests\Fixtures\UuidIdEntity'), - ); + return [ + ['Symfony\Bridge\Doctrine\Tests\Fixtures\GuidIdEntity'], + ['Symfony\Bridge\Doctrine\Tests\Fixtures\UuidIdEntity'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,10 +32,10 @@ public function testTransform() { - $array = array( + $array = [ 2 => 'foo', 3 => 'bar', - ); + ]; $this->assertSame($array, $this->transformer->transform(new ArrayCollection($array))); } @@ -49,17 +49,17 @@ */ public function testTransformArray() { - $array = array( + $array = [ 2 => 'foo', 3 => 'bar', - ); + ]; $this->assertSame($array, $this->transformer->transform($array)); } public function testTransformNull() { - $this->assertSame(array(), $this->transformer->transform(null)); + $this->assertSame([], $this->transformer->transform(null)); } /** @@ -72,10 +72,10 @@ public function testReverseTransform() { - $array = array( + $array = [ 2 => 'foo', 3 => 'bar', - ); + ]; $this->assertEquals(new ArrayCollection($array), $this->transformer->reverseTransform($array)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,54 +29,54 @@ public function requiredProvider() { - $return = array(); + $return = []; // Simple field, not nullable $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->fieldMappings['field'] = true; $classMetadata->expects($this->once())->method('isNullable')->with('field')->will($this->returnValue(false)); - $return[] = array($classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE)); + $return[] = [$classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE)]; // Simple field, nullable $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->fieldMappings['field'] = true; $classMetadata->expects($this->once())->method('isNullable')->with('field')->will($this->returnValue(true)); - $return[] = array($classMetadata, new ValueGuess(false, Guess::MEDIUM_CONFIDENCE)); + $return[] = [$classMetadata, new ValueGuess(false, Guess::MEDIUM_CONFIDENCE)]; // One-to-one, nullable (by default) $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true)); - $mapping = array('joinColumns' => array(array())); + $mapping = ['joinColumns' => [[]]]; $classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping)); - $return[] = array($classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE)); + $return[] = [$classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE)]; // One-to-one, nullable (explicit) $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true)); - $mapping = array('joinColumns' => array(array('nullable' => true))); + $mapping = ['joinColumns' => [['nullable' => true]]]; $classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping)); - $return[] = array($classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE)); + $return[] = [$classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE)]; // One-to-one, not nullable $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true)); - $mapping = array('joinColumns' => array(array('nullable' => false))); + $mapping = ['joinColumns' => [['nullable' => false]]]; $classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping)); - $return[] = array($classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE)); + $return[] = [$classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE)]; // One-to-many, no clue $classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(false)); - $return[] = array($classMetadata, null); + $return[] = [$classMetadata, null]; return $return; } @@ -87,7 +87,7 @@ $em->expects($this->once())->method('getClassMetaData')->with('TestEntity')->will($this->returnValue($classMetadata)); $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock(); - $registry->expects($this->once())->method('getManagers')->will($this->returnValue(array($em))); + $registry->expects($this->once())->method('getManagers')->will($this->returnValue([$em])); return new DoctrineOrmTypeGuesser($registry); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ protected function setUp() { - $this->collection = new ArrayCollection(array('test')); + $this->collection = new ArrayCollection(['test']); $this->dispatcher = new EventDispatcher(); $this->factory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock(); $this->form = $this->getBuilder() @@ -45,14 +45,14 @@ $this->form = null; } - protected function getBuilder($name = 'name') + protected function getBuilder() { - return new FormBuilder($name, null, $this->dispatcher, $this->factory); + return new FormBuilder('name', null, $this->dispatcher, $this->factory); } - protected function getForm($name = 'name') + protected function getForm() { - return $this->getBuilder($name) + return $this->getBuilder() ->setData($this->collection) ->addEventSubscriber(new MergeDoctrineCollectionListener()) ->getForm(); @@ -60,7 +60,7 @@ public function testOnSubmitDoNothing() { - $submittedData = array('test'); + $submittedData = ['test']; $event = new FormEvent($this->getForm(), $submittedData); $this->dispatcher->dispatch(FormEvents::SUBMIT, $event); @@ -71,7 +71,7 @@ public function testOnSubmitNullClearCollection() { - $submittedData = array(); + $submittedData = []; $event = new FormEvent($this->getForm(), $submittedData); $this->dispatcher->dispatch(FormEvents::SUBMIT, $event); @@ -84,11 +84,11 @@ */ public function testLegacyChildClassOnSubmitCallParent() { - $form = $this->getBuilder('name') + $form = $this->getBuilder() ->setData($this->collection) ->addEventSubscriber(new TestClassExtendingMergeDoctrineCollectionListener()) ->getForm(); - $submittedData = array(); + $submittedData = []; $event = new FormEvent($form, $submittedData); $this->dispatcher->dispatch(FormEvents::SUBMIT, $event); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,10 +42,10 @@ ->method('getManagerForClass') ->will($this->returnValue($this->em)); - return array( + return [ new CoreExtension(), new DoctrineOrmExtension($manager), - ); + ]; } protected function setUp() @@ -55,9 +55,9 @@ parent::setUp(); $schemaTool = new SchemaTool($this->em); - $classes = array( + $classes = [ $this->em->getClassMetadata(self::ENTITY_CLASS), - ); + ]; try { $schemaTool->dropSchema($classes); @@ -90,9 +90,9 @@ $this->setMaxRunningTime(1); for ($i = 0; $i < 40; ++$i) { - $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( + $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, [ 'class' => self::ENTITY_CLASS, - )); + ]); // force loading of the choice list $form->createView(); @@ -108,10 +108,10 @@ $this->setMaxRunningTime(1); for ($i = 0; $i < 40; ++$i) { - $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( + $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, [ 'class' => self::ENTITY_CLASS, 'choices' => $choices, - )); + ]); // force loading of the choice list $form->createView(); @@ -127,10 +127,10 @@ $this->setMaxRunningTime(1); for ($i = 0; $i < 40; ++$i) { - $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( + $form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, [ 'class' => self::ENTITY_CLASS, 'preferred_choices' => $choices, - )); + ]); // force loading of the choice list $form->createView(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,7 +65,7 @@ parent::setUp(); $schemaTool = new SchemaTool($this->em); - $classes = array( + $classes = [ $this->em->getClassMetadata(self::ITEM_GROUP_CLASS), $this->em->getClassMetadata(self::SINGLE_IDENT_CLASS), $this->em->getClassMetadata(self::SINGLE_IDENT_NO_TO_STRING_CLASS), @@ -74,7 +74,7 @@ $this->em->getClassMetadata(self::SINGLE_STRING_CASTABLE_IDENT_CLASS), $this->em->getClassMetadata(self::COMPOSITE_IDENT_CLASS), $this->em->getClassMetadata(self::COMPOSITE_STRING_IDENT_CLASS), - ); + ]; try { $schemaTool->dropSchema($classes); @@ -97,9 +97,9 @@ protected function getExtensions() { - return array_merge(parent::getExtensions(), array( + return array_merge(parent::getExtensions(), [ new DoctrineOrmExtension($this->emRegistry), - )); + ]); } protected function persist(array $entities) @@ -126,9 +126,9 @@ */ public function testInvalidClassOption() { - $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'class' => 'foo', - )); + ]); } public function testSetDataToUninitializedEntityWithNonRequired() @@ -136,16 +136,16 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, 'choice_label' => 'name', - )); + ]); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']); } public function testSetDataToUninitializedEntityWithNonRequiredToString() @@ -153,16 +153,16 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, - )) + ]) ->createView(); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $view->vars['choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')], $view->vars['choices']); } public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder() @@ -170,19 +170,19 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); $qb = $this->em->createQueryBuilder()->select('e')->from(self::SINGLE_IDENT_CLASS, 'e'); - $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, 'choice_label' => 'name', 'query_builder' => $qb, - )) + ]) ->createView(); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $view->vars['choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')], $view->vars['choices']); } /** @@ -190,11 +190,11 @@ */ public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure() { - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => new \stdClass(), - )); + ]); } /** @@ -202,13 +202,13 @@ */ public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder() { - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function () { return new \stdClass(); }, - )); + ]); $field->submit('2'); } @@ -218,26 +218,26 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function () { return; }, - )); + ]); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']); } public function testSetDataSingleNull() { - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $field->setData(null); $this->assertNull($field->getData()); @@ -246,30 +246,30 @@ public function testSetDataMultipleExpandedNull() { - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $field->setData(null); $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getViewData()); + $this->assertSame([], $field->getViewData()); } public function testSetDataMultipleNonExpandedNull() { - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $field->setData(null); $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getViewData()); + $this->assertSame([], $field->getViewData()); } public function testSubmitSingleNonExpandedSingleIdentifier() @@ -277,15 +277,15 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -302,15 +302,15 @@ $entity1 = new SingleAssociationToIntIdEntity($innerEntity1, 'Foo'); $entity2 = new SingleAssociationToIntIdEntity($innerEntity2, 'Bar'); - $this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); + $this->persist([$innerEntity1, $innerEntity2, $entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -324,15 +324,15 @@ $entity1 = new CompositeIntIdEntity(10, 20, 'Foo'); $entity2 = new CompositeIntIdEntity(30, 40, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::COMPOSITE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); // the collection key is used here $field->submit('1'); @@ -348,23 +348,23 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('1', '3'), $field->getViewData()); + $this->assertSame(['1', '3'], $field->getViewData()); } public function testSubmitMultipleNonExpandedSingleAssocIdentifier() @@ -377,23 +377,23 @@ $entity2 = new SingleAssociationToIntIdEntity($innerEntity2, 'Bar'); $entity3 = new SingleAssociationToIntIdEntity($innerEntity3, 'Baz'); - $this->persist(array($innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3)); + $this->persist([$innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('1', '3'), $field->getViewData()); + $this->assertSame(['1', '3'], $field->getViewData()); } public function testSubmitMultipleNonExpandedSingleIdentifierForExistingData() @@ -402,29 +402,29 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $existing = new ArrayCollection(array(0 => $entity2)); + $existing = new ArrayCollection([0 => $entity2]); $field->setData($existing); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); // entry with index 0 ($entity2) was replaced - $expected = new ArrayCollection(array(0 => $entity1, 1 => $entity3)); + $expected = new ArrayCollection([0 => $entity1, 1 => $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); // same object still, useful if it is a PersistentCollection $this->assertSame($existing, $field->getData()); - $this->assertSame(array('1', '3'), $field->getViewData()); + $this->assertSame(['1', '3'], $field->getViewData()); } public function testSubmitMultipleNonExpandedCompositeIdentifier() @@ -433,24 +433,24 @@ $entity2 = new CompositeIntIdEntity(30, 40, 'Bar'); $entity3 = new CompositeIntIdEntity(50, 60, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::COMPOSITE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); // because of the composite key collection keys are used - $field->submit(array('0', '2')); + $field->submit(['0', '2']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('0', '2'), $field->getViewData()); + $this->assertSame(['0', '2'], $field->getViewData()); } public function testSubmitMultipleNonExpandedCompositeIdentifierExistingData() @@ -459,29 +459,29 @@ $entity2 = new CompositeIntIdEntity(30, 40, 'Bar'); $entity3 = new CompositeIntIdEntity(50, 60, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::COMPOSITE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $existing = new ArrayCollection(array(0 => $entity2)); + $existing = new ArrayCollection([0 => $entity2]); $field->setData($existing); - $field->submit(array('0', '2')); + $field->submit(['0', '2']); // entry with index 0 ($entity2) was replaced - $expected = new ArrayCollection(array(0 => $entity1, 1 => $entity3)); + $expected = new ArrayCollection([0 => $entity1, 1 => $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); // same object still, useful if it is a PersistentCollection $this->assertSame($existing, $field->getData()); - $this->assertSame(array('0', '2'), $field->getViewData()); + $this->assertSame(['0', '2'], $field->getViewData()); } public function testSubmitSingleExpanded() @@ -489,15 +489,15 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -515,19 +515,19 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Bar'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); @@ -544,19 +544,19 @@ $entity1 = new SingleIntIdEntity(-1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('-1')); + $field->submit(['-1']); - $expected = new ArrayCollection(array($entity1)); + $expected = new ArrayCollection([$entity1]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); @@ -569,15 +569,15 @@ $entity1 = new SingleStringCastableIdEntity(1, 'Foo'); $entity2 = new SingleStringCastableIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_STRING_CASTABLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -591,15 +591,15 @@ $entity1 = new SingleStringCastableIdEntity(1, 'Foo'); $entity2 = new SingleStringCastableIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_STRING_CASTABLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -617,29 +617,29 @@ $entity2 = new SingleStringCastableIdEntity(2, 'Bar'); $entity3 = new SingleStringCastableIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_STRING_CASTABLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $existing = new ArrayCollection(array(0 => $entity2)); + $existing = new ArrayCollection([0 => $entity2]); $field->setData($existing); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); // entry with index 0 ($entity2) was replaced - $expected = new ArrayCollection(array(0 => $entity1, 1 => $entity3)); + $expected = new ArrayCollection([0 => $entity1, 1 => $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); // same object still, useful if it is a PersistentCollection $this->assertSame($existing, $field->getData()); - $this->assertSame(array('1', '3'), $field->getViewData()); + $this->assertSame(['1', '3'], $field->getViewData()); } public function testSubmitMultipleNonExpandedStringCastableIdentifier() @@ -648,23 +648,23 @@ $entity2 = new SingleStringCastableIdEntity(2, 'Bar'); $entity3 = new SingleStringCastableIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_STRING_CASTABLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('1', '3'), $field->getViewData()); + $this->assertSame(['1', '3'], $field->getViewData()); } public function testSubmitMultipleStringCastableIdentifierExpanded() @@ -673,19 +673,19 @@ $entity2 = new SingleStringCastableIdEntity(2, 'Bar'); $entity3 = new SingleStringCastableIdEntity(3, 'Bar'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => true, 'expanded' => true, 'em' => 'default', 'class' => self::SINGLE_STRING_CASTABLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); - $field->submit(array('1', '3')); + $field->submit(['1', '3']); - $expected = new ArrayCollection(array($entity1, $entity3)); + $expected = new ArrayCollection([$entity1, $entity3]); $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); @@ -703,19 +703,19 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, // not all persisted entities should be displayed - 'choices' => array($entity1, $entity2), + 'choices' => [$entity1, $entity2], 'choice_label' => 'name', - )); + ]); $field->submit('2'); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']); $this->assertTrue($field->isSynchronized()); $this->assertSame($entity2, $field->getData()); $this->assertSame('2', $field->getViewData()); @@ -726,18 +726,18 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', 'choice_value' => 'name', - )); + ]); $field->submit('Bar'); - $this->assertEquals(array('Foo' => new ChoiceView($entity1, 'Foo', 'Foo'), 'Bar' => new ChoiceView($entity2, 'Bar', 'Bar')), $field->createView()->vars['choices']); + $this->assertEquals(['Foo' => new ChoiceView($entity1, 'Foo', 'Foo'), 'Bar' => new ChoiceView($entity2, 'Bar', 'Bar')], $field->createView()->vars['choices']); $this->assertTrue($field->isSynchronized(), 'Field should be synchronized.'); $this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.'); $this->assertSame('Bar', $field->getViewData()); @@ -748,9 +748,9 @@ $entity1 = new GroupableEntity(1, 'Foo', 'BazGroup'); $entity2 = new GroupableEntity(2, 'Bar', 'BooGroup'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::ITEM_GROUP_CLASS, 'choice_label' => 'name', @@ -761,14 +761,14 @@ return $entity->groupName.'/'.$entity->name; }, - )); + ]); $field->submit('BooGroup/Bar'); - $this->assertEquals(array( + $this->assertEquals([ 'BazGroup/Foo' => new ChoiceView($entity1, 'BazGroup/Foo', 'Foo'), 'BooGroup/Bar' => new ChoiceView($entity2, 'BooGroup/Bar', 'Bar'), - ), $field->createView()->vars['choices']); + ], $field->createView()->vars['choices']); $this->assertTrue($field->isSynchronized(), 'Field should be synchronized.'); $this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.'); $this->assertSame('BooGroup/Bar', $field->getViewData()); @@ -779,13 +779,13 @@ $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Bar'); - $this->persist(array($entity1, $entity2)); + $this->persist([$entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $this->em->clear(); @@ -805,29 +805,29 @@ $item3 = new GroupableEntity(3, 'Baz', 'Group2'); $item4 = new GroupableEntity(4, 'Boo!', null); - $this->persist(array($item1, $item2, $item3, $item4)); + $this->persist([$item1, $item2, $item3, $item4]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::ITEM_GROUP_CLASS, - 'choices' => array($item1, $item2, $item3, $item4), + 'choices' => [$item1, $item2, $item3, $item4], 'choice_label' => 'name', 'group_by' => 'groupName', - )); + ]); $field->submit('2'); $this->assertSame('2', $field->getViewData()); - $this->assertEquals(array( - 'Group1' => new ChoiceGroupView('Group1', array( + $this->assertEquals([ + 'Group1' => new ChoiceGroupView('Group1', [ 1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar'), - )), - 'Group2' => new ChoiceGroupView('Group2', array( + ]), + 'Group2' => new ChoiceGroupView('Group2', [ 3 => new ChoiceView($item3, '3', 'Baz'), - )), + ]), 4 => new ChoiceView($item4, '4', 'Boo!'), - ), $field->createView()->vars['choices']); + ], $field->createView()->vars['choices']); } public function testPreferredChoices() @@ -836,17 +836,17 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - 'preferred_choices' => array($entity3, $entity2), + 'preferred_choices' => [$entity3, $entity2], 'choice_label' => 'name', - )); + ]); - $this->assertEquals(array(3 => new ChoiceView($entity3, '3', 'Baz'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['preferred_choices']); - $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo')), $field->createView()->vars['choices']); + $this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['preferred_choices']); + $this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo')], $field->createView()->vars['choices']); } public function testOverrideChoicesWithPreferredChoices() @@ -855,18 +855,18 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - 'choices' => array($entity2, $entity3), - 'preferred_choices' => array($entity3), + 'choices' => [$entity2, $entity3], + 'preferred_choices' => [$entity3], 'choice_label' => 'name', - )); + ]); - $this->assertEquals(array(3 => new ChoiceView($entity3, '3', 'Baz')), $field->createView()->vars['preferred_choices']); - $this->assertEquals(array(2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); + $this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz')], $field->createView()->vars['preferred_choices']); + $this->assertEquals([2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']); } public function testDisallowChoicesThatAreNotIncludedChoicesSingleIdentifier() @@ -875,14 +875,14 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - 'choices' => array($entity1, $entity2), + 'choices' => [$entity1, $entity2], 'choice_label' => 'name', - )); + ]); $field->submit('3'); @@ -898,14 +898,14 @@ $entity1 = new SingleAssociationToIntIdEntity($innerEntity1, 'Foo'); $entity2 = new SingleAssociationToIntIdEntity($innerEntity2, 'Bar'); - $this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); + $this->persist([$innerEntity1, $innerEntity2, $entity1, $entity2]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, - 'choices' => array($entity1, $entity2), + 'choices' => [$entity1, $entity2], 'choice_label' => 'name', - )); + ]); $field->submit('3'); @@ -919,14 +919,14 @@ $entity2 = new CompositeIntIdEntity(30, 40, 'Bar'); $entity3 = new CompositeIntIdEntity(50, 60, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::COMPOSITE_IDENT_CLASS, - 'choices' => array($entity1, $entity2), + 'choices' => [$entity1, $entity2], 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -940,17 +940,17 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); $repository = $this->em->getRepository(self::SINGLE_IDENT_CLASS); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => $repository->createQueryBuilder('e') ->where('e.id IN (1, 2)'), 'choice_label' => 'name', - )); + ]); $field->submit('3'); @@ -968,17 +968,17 @@ $entity2 = new SingleAssociationToIntIdEntity($innerEntity2, 'Bar'); $entity3 = new SingleAssociationToIntIdEntity($innerEntity3, 'Baz'); - $this->persist(array($innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3)); + $this->persist([$innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3]); $repository = $this->em->getRepository(self::SINGLE_ASSOC_IDENT_CLASS); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'query_builder' => $repository->createQueryBuilder('e') ->where('e.entity IN (1, 2)'), 'choice_label' => 'name', - )); + ]); $field->submit('3'); @@ -992,9 +992,9 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repository) { @@ -1002,7 +1002,7 @@ ->where('e.id IN (1, 2)'); }, 'choice_label' => 'name', - )); + ]); $field->submit('3'); @@ -1016,9 +1016,9 @@ $entity2 = new CompositeIntIdEntity(30, 40, 'Bar'); $entity3 = new CompositeIntIdEntity(50, 60, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::COMPOSITE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repository) { @@ -1026,7 +1026,7 @@ ->where('e.id1 IN (10, 50)'); }, 'choice_label' => 'name', - )); + ]); $field->submit('2'); @@ -1038,15 +1038,15 @@ { $entity1 = new SingleStringIdEntity('foo', 'Foo'); - $this->persist(array($entity1)); + $this->persist([$entity1]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::SINGLE_STRING_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); $field->submit('foo'); @@ -1059,15 +1059,15 @@ { $entity1 = new CompositeStringIdEntity('foo1', 'foo2', 'Foo'); - $this->persist(array($entity1)); + $this->persist([$entity1]); - $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'multiple' => false, 'expanded' => false, 'em' => 'default', 'class' => self::COMPOSITE_STRING_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); // the collection key is used here $field->submit('0'); @@ -1087,11 +1087,11 @@ ->with(self::SINGLE_IDENT_CLASS) ->will($this->returnValue($this->em)); - $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, 'choice_label' => 'name', - )); + ]); } public function testExplicitEm() @@ -1102,11 +1102,11 @@ $this->emRegistry->expects($this->never()) ->method('getManagerForClass'); - $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => $this->em, 'class' => self::SINGLE_IDENT_CLASS, 'choice_label' => 'name', - )); + ]); } public function testLoaderCaching() @@ -1115,7 +1115,7 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); $repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS); @@ -1130,35 +1130,35 @@ $formBuilder = $factory->createNamedBuilder('form', FormTypeTest::TESTED_TYPE); - $formBuilder->add('property1', static::TESTED_TYPE, array( + $formBuilder->add('property1', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => $repo->createQueryBuilder('e')->where('e.id IN (1, 2)'), - )); + ]); - $formBuilder->add('property2', static::TESTED_TYPE, array( + $formBuilder->add('property2', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repo) { return $repo->createQueryBuilder('e')->where('e.id IN (1, 2)'); }, - )); + ]); - $formBuilder->add('property3', static::TESTED_TYPE, array( + $formBuilder->add('property3', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repo) { return $repo->createQueryBuilder('e')->where('e.id IN (1, 2)'); }, - )); + ]); $form = $formBuilder->getForm(); - $form->submit(array( + $form->submit([ 'property1' => 1, 'property2' => 1, 'property3' => 2, - )); + ]); $choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader'); $choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader'); @@ -1175,7 +1175,7 @@ $entity2 = new SingleIntIdEntity(2, 'Bar'); $entity3 = new SingleIntIdEntity(3, 'Baz'); - $this->persist(array($entity1, $entity2, $entity3)); + $this->persist([$entity1, $entity2, $entity3]); $repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS); @@ -1190,35 +1190,35 @@ $formBuilder = $factory->createNamedBuilder('form', FormTypeTest::TESTED_TYPE); - $formBuilder->add('property1', static::TESTED_TYPE, array( + $formBuilder->add('property1', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => $repo->createQueryBuilder('e')->where('e.id = :id')->setParameter('id', 1), - )); + ]); - $formBuilder->add('property2', static::TESTED_TYPE, array( + $formBuilder->add('property2', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repo) { return $repo->createQueryBuilder('e')->where('e.id = :id')->setParameter('id', 1); }, - )); + ]); - $formBuilder->add('property3', static::TESTED_TYPE, array( + $formBuilder->add('property3', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'query_builder' => function (EntityRepository $repo) { return $repo->createQueryBuilder('e')->where('e.id = :id')->setParameter('id', 1); }, - )); + ]); $form = $formBuilder->getForm(); - $form->submit(array( + $form->submit([ 'property1' => 1, 'property2' => 1, 'property3' => 2, - )); + ]); $choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader'); $choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader'); @@ -1242,21 +1242,21 @@ public function testPassDisabledAsOption() { - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'disabled' => true, 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $this->assertTrue($form->isDisabled()); } public function testPassIdAndNameToView() { - $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, array( + $view = $this->factory->createNamed('name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->createView(); $this->assertEquals('name', $view->vars['id']); @@ -1266,10 +1266,10 @@ public function testStripLeadingUnderscoresAndDigitsFromId() { - $view = $this->factory->createNamed('_09name', static::TESTED_TYPE, null, array( + $view = $this->factory->createNamed('_09name', static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->createView(); $this->assertEquals('name', $view->vars['id']); @@ -1280,10 +1280,10 @@ public function testPassIdAndNameToViewWithParent() { $view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE) - ->add('child', static::TESTED_TYPE, array( + ->add('child', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->getForm() ->createView(); @@ -1296,10 +1296,10 @@ { $builder = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE) ->add('child', FormTypeTest::TESTED_TYPE); - $builder->get('child')->add('grand_child', static::TESTED_TYPE, array( + $builder->get('child')->add('grand_child', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $view = $builder->getForm()->createView(); $this->assertEquals('parent_child_grand_child', $view['child']['grand_child']->vars['id']); @@ -1309,11 +1309,11 @@ public function testPassTranslationDomainToView() { - $view = $this->factory->create(static::TESTED_TYPE, null, array( + $view = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'translation_domain' => 'domain', - )) + ]) ->createView(); $this->assertSame('domain', $view->vars['translation_domain']); @@ -1322,13 +1322,13 @@ public function testInheritTranslationDomainFromParent() { $view = $this->factory - ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, array( + ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'translation_domain' => 'domain', - )) - ->add('child', static::TESTED_TYPE, array( + ]) + ->add('child', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->getForm() ->createView(); @@ -1338,14 +1338,14 @@ public function testPreferOwnTranslationDomain() { $view = $this->factory - ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, array( + ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'translation_domain' => 'parent_domain', - )) - ->add('child', static::TESTED_TYPE, array( + ]) + ->add('child', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'translation_domain' => 'domain', - )) + ]) ->getForm() ->createView(); @@ -1356,10 +1356,10 @@ { $view = $this->factory ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE) - ->add('child', static::TESTED_TYPE, array( + ->add('child', static::TESTED_TYPE, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->getForm() ->createView(); @@ -1368,11 +1368,11 @@ public function testPassLabelToView() { - $view = $this->factory->createNamed('__test___field', static::TESTED_TYPE, null, array( + $view = $this->factory->createNamed('__test___field', static::TESTED_TYPE, null, [ 'label' => 'My label', 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->createView(); $this->assertSame('My label', $view->vars['label']); @@ -1380,10 +1380,10 @@ public function testPassMultipartFalseToView() { - $view = $this->factory->create(static::TESTED_TYPE, null, array( + $view = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )) + ]) ->createView(); $this->assertFalse($view->vars['multipart']); @@ -1391,10 +1391,10 @@ public function testSubmitNull($expected = null, $norm = null, $view = null) { - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, - )); + ]); $form->submit(null); $this->assertNull($form->getData()); @@ -1404,11 +1404,11 @@ public function testSubmitNullExpanded() { - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'expanded' => true, - )); + ]); $form->submit(null); $this->assertNull($form->getData()); @@ -1418,82 +1418,82 @@ public function testSubmitNullMultiple() { - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'multiple' => true, - )); + ]); $form->submit(null); $collection = new ArrayCollection(); $this->assertEquals($collection, $form->getData()); $this->assertEquals($collection, $form->getNormData()); - $this->assertSame(array(), $form->getViewData(), 'View data is always an array'); + $this->assertSame([], $form->getViewData(), 'View data is always an array'); } public function testSubmitNullExpandedMultiple() { - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'expanded' => true, 'multiple' => true, - )); + ]); $form->submit(null); $collection = new ArrayCollection(); $this->assertEquals($collection, $form->getData()); $this->assertEquals($collection, $form->getNormData()); - $this->assertSame(array(), $form->getViewData(), 'View data is always an array'); + $this->assertSame([], $form->getViewData(), 'View data is always an array'); } public function testSetDataEmptyArraySubmitNullMultiple() { - $emptyArray = array(); - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $emptyArray = []; + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'multiple' => true, - )); + ]); $form->setData($emptyArray); $form->submit(null); $this->assertInternalType('array', $form->getData()); - $this->assertEquals(array(), $form->getData()); - $this->assertEquals(array(), $form->getNormData()); - $this->assertSame(array(), $form->getViewData(), 'View data is always an array'); + $this->assertEquals([], $form->getData()); + $this->assertEquals([], $form->getNormData()); + $this->assertSame([], $form->getViewData(), 'View data is always an array'); } public function testSetDataNonEmptyArraySubmitNullMultiple() { $entity1 = new SingleIntIdEntity(1, 'Foo'); - $this->persist(array($entity1)); - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $this->persist([$entity1]); + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'multiple' => true, - )); - $existing = array(0 => $entity1); + ]); + $existing = [0 => $entity1]; $form->setData($existing); $form->submit(null); $this->assertInternalType('array', $form->getData()); - $this->assertEquals(array(), $form->getData()); - $this->assertEquals(array(), $form->getNormData()); - $this->assertSame(array(), $form->getViewData(), 'View data is always an array'); + $this->assertEquals([], $form->getData()); + $this->assertEquals([], $form->getNormData()); + $this->assertSame([], $form->getViewData(), 'View data is always an array'); } public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null) { $emptyData = '1'; $entity1 = new SingleIntIdEntity(1, 'Foo'); - $this->persist(array($entity1)); + $this->persist([$entity1]); - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'empty_data' => $emptyData, - )); + ]); $form->submit(null); $this->assertSame($emptyData, $form->getViewData()); @@ -1503,19 +1503,19 @@ public function testSubmitNullMultipleUsesDefaultEmptyData() { - $emptyData = array('1'); + $emptyData = ['1']; $entity1 = new SingleIntIdEntity(1, 'Foo'); - $this->persist(array($entity1)); + $this->persist([$entity1]); - $form = $this->factory->create(static::TESTED_TYPE, null, array( + $form = $this->factory->create(static::TESTED_TYPE, null, [ 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'multiple' => true, 'empty_data' => $emptyData, - )); + ]); $form->submit(null); - $collection = new ArrayCollection(array($entity1)); + $collection = new ArrayCollection([$entity1]); $this->assertSame($emptyData, $form->getViewData()); $this->assertEquals($collection, $form->getNormData()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,8 +25,8 @@ $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') - ->setConstructorArgs(array($logger, null)) - ->setMethods(array('log')) + ->setConstructorArgs([$logger, null]) + ->setMethods(['log']) ->getMock() ; @@ -41,14 +41,14 @@ public function getLogFixtures() { - return array( - array('SQL', null, array()), - array('SQL', array(), array()), - array('SQL', array('foo' => 'bar'), array('foo' => 'bar')), - array('SQL', array('foo' => "\x7F\xFF"), array('foo' => DbalLogger::BINARY_DATA_VALUE)), - array('SQL', array('foo' => "bar\x7F\xFF"), array('foo' => DbalLogger::BINARY_DATA_VALUE)), - array('SQL', array('foo' => ''), array('foo' => '')), - ); + return [ + ['SQL', null, []], + ['SQL', [], []], + ['SQL', ['foo' => 'bar'], ['foo' => 'bar']], + ['SQL', ['foo' => "\x7F\xFF"], ['foo' => DbalLogger::BINARY_DATA_VALUE]], + ['SQL', ['foo' => "bar\x7F\xFF"], ['foo' => DbalLogger::BINARY_DATA_VALUE]], + ['SQL', ['foo' => ''], ['foo' => '']], + ]; } public function testLogNonUtf8() @@ -57,21 +57,21 @@ $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') - ->setConstructorArgs(array($logger, null)) - ->setMethods(array('log')) + ->setConstructorArgs([$logger, null]) + ->setMethods(['log']) ->getMock() ; $dbalLogger ->expects($this->once()) ->method('log') - ->with('SQL', array('utf8' => 'foo', 'nonutf8' => DbalLogger::BINARY_DATA_VALUE)) + ->with('SQL', ['utf8' => 'foo', 'nonutf8' => DbalLogger::BINARY_DATA_VALUE]) ; - $dbalLogger->startQuery('SQL', array( + $dbalLogger->startQuery('SQL', [ 'utf8' => 'foo', 'nonutf8' => "\x7F\xFF", - )); + ]); } public function testLogNonUtf8Array() @@ -80,29 +80,29 @@ $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') - ->setConstructorArgs(array($logger, null)) - ->setMethods(array('log')) + ->setConstructorArgs([$logger, null]) + ->setMethods(['log']) ->getMock() ; $dbalLogger ->expects($this->once()) ->method('log') - ->with('SQL', array( + ->with('SQL', [ 'utf8' => 'foo', - array( + [ 'nonutf8' => DbalLogger::BINARY_DATA_VALUE, - ), - ) + ], + ] ) ; - $dbalLogger->startQuery('SQL', array( + $dbalLogger->startQuery('SQL', [ 'utf8' => 'foo', - array( + [ 'nonutf8' => "\x7F\xFF", - ), - )); + ], + ]); } public function testLogLongString() @@ -111,8 +111,8 @@ $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') - ->setConstructorArgs(array($logger, null)) - ->setMethods(array('log')) + ->setConstructorArgs([$logger, null]) + ->setMethods(['log']) ->getMock() ; @@ -124,13 +124,13 @@ $dbalLogger ->expects($this->once()) ->method('log') - ->with('SQL', array('short' => $shortString, 'long' => substr($longString, 0, DbalLogger::MAX_STRING_LENGTH - 6).' [...]')) + ->with('SQL', ['short' => $shortString, 'long' => substr($longString, 0, DbalLogger::MAX_STRING_LENGTH - 6).' [...]']) ; - $dbalLogger->startQuery('SQL', array( + $dbalLogger->startQuery('SQL', [ 'short' => $shortString, 'long' => $longString, - )); + ]); } public function testLogUTF8LongString() @@ -139,12 +139,12 @@ $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') - ->setConstructorArgs(array($logger, null)) - ->setMethods(array('log')) + ->setConstructorArgs([$logger, null]) + ->setMethods(['log']) ->getMock() ; - $testStringArray = array('é', 'á', 'ű', 'ő', 'ú', 'ö', 'ü', 'ó', 'í'); + $testStringArray = ['é', 'á', 'ű', 'ő', 'ú', 'ö', 'ü', 'ó', 'í']; $testStringCount = \count($testStringArray); $shortString = ''; @@ -158,12 +158,12 @@ $dbalLogger ->expects($this->once()) ->method('log') - ->with('SQL', array('short' => $shortString, 'long' => mb_substr($longString, 0, DbalLogger::MAX_STRING_LENGTH - 6, 'UTF-8').' [...]')) + ->with('SQL', ['short' => $shortString, 'long' => mb_substr($longString, 0, DbalLogger::MAX_STRING_LENGTH - 6, 'UTF-8').' [...]']) ; - $dbalLogger->startQuery('SQL', array( + $dbalLogger->startQuery('SQL', [ 'short' => $shortString, 'long' => $longString, - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ { $container = new \LazyServiceProjectServiceContainer(); - $registry = new TestManagerRegistry('name', array(), array('defaultManager' => 'foo'), 'defaultConnection', 'defaultManager', 'proxyInterfaceName'); + $registry = new TestManagerRegistry('name', [], ['defaultManager' => 'foo'], 'defaultConnection', 'defaultManager', 'proxyInterfaceName'); $registry->setTestContainer($container); $foo = $container->get('foo'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,8 +30,8 @@ protected function setUp() { - $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'), true); - $entityManager = EntityManager::create(array('driver' => 'pdo_sqlite'), $config); + $config = Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true); + $entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config); if (!DBALType::hasType('foo')) { DBALType::addType('foo', 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineFooType'); @@ -44,7 +44,7 @@ public function testGetProperties() { $this->assertEquals( - array( + [ 'id', 'guid', 'time', @@ -62,7 +62,7 @@ 'bar', 'indexedBar', 'indexedFoo', - ), + ], $this->extractor->getProperties('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy') ); } @@ -74,10 +74,10 @@ } $this->assertEquals( - array( + [ 'id', 'embedded', - ), + ], $this->extractor->getProperties('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineWithEmbedded') ); } @@ -87,7 +87,7 @@ */ public function testExtract($property, array $type = null) { - $this->assertEquals($type, $this->extractor->getTypes('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy', $property, array())); + $this->assertEquals($type, $this->extractor->getTypes('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy', $property, [])); } public function testExtractWithEmbedded() @@ -96,16 +96,16 @@ $this->markTestSkipped('@Embedded is not available in Doctrine ORM lower than 2.5.'); } - $expectedTypes = array(new Type( + $expectedTypes = [new Type( Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineEmbeddable' - )); + )]; $actualTypes = $this->extractor->getTypes( 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineWithEmbedded', 'embedded', - array() + [] ); $this->assertEquals($expectedTypes, $actualTypes); @@ -113,47 +113,47 @@ public function typesProvider() { - return array( - array('id', array(new Type(Type::BUILTIN_TYPE_INT))), - array('guid', array(new Type(Type::BUILTIN_TYPE_STRING))), - array('bigint', array(new Type(Type::BUILTIN_TYPE_STRING))), - array('time', array(new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))), - array('timeImmutable', array(new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTimeImmutable'))), - array('dateInterval', array(new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateInterval'))), - array('float', array(new Type(Type::BUILTIN_TYPE_FLOAT))), - array('decimal', array(new Type(Type::BUILTIN_TYPE_STRING))), - array('bool', array(new Type(Type::BUILTIN_TYPE_BOOL))), - array('binary', array(new Type(Type::BUILTIN_TYPE_RESOURCE))), - array('json', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true))), - array('foo', array(new Type(Type::BUILTIN_TYPE_OBJECT, true, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation'))), - array('bar', array(new Type( + return [ + ['id', [new Type(Type::BUILTIN_TYPE_INT)]], + ['guid', [new Type(Type::BUILTIN_TYPE_STRING)]], + ['bigint', [new Type(Type::BUILTIN_TYPE_STRING)]], + ['time', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime')]], + ['timeImmutable', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTimeImmutable')]], + ['dateInterval', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateInterval')]], + ['float', [new Type(Type::BUILTIN_TYPE_FLOAT)]], + ['decimal', [new Type(Type::BUILTIN_TYPE_STRING)]], + ['bool', [new Type(Type::BUILTIN_TYPE_BOOL)]], + ['binary', [new Type(Type::BUILTIN_TYPE_RESOURCE)]], + ['json', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)]], + ['foo', [new Type(Type::BUILTIN_TYPE_OBJECT, true, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation')]], + ['bar', [new Type( Type::BUILTIN_TYPE_OBJECT, false, 'Doctrine\Common\Collections\Collection', true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation') - ))), - array('indexedBar', array(new Type( + )]], + ['indexedBar', [new Type( Type::BUILTIN_TYPE_OBJECT, false, 'Doctrine\Common\Collections\Collection', true, new Type(Type::BUILTIN_TYPE_STRING), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation') - ))), - array('indexedFoo', array(new Type( + )]], + ['indexedFoo', [new Type( Type::BUILTIN_TYPE_OBJECT, false, 'Doctrine\Common\Collections\Collection', true, new Type(Type::BUILTIN_TYPE_STRING), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation') - ))), - array('simpleArray', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING)))), - array('customFoo', null), - array('notMapped', null), - ); + )]], + ['simpleArray', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))]], + ['customFoo', null], + ['notMapped', null], + ]; } public function testGetPropertiesCatchException() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,7 +38,7 @@ */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - return $platform->getClobTypeDeclarationSQL(array()); + return $platform->getClobTypeDeclarationSQL([]); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -145,7 +145,7 @@ $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User', 'name'); - $user2 = $em->getReference('Symfony\Bridge\Doctrine\Tests\Fixtures\User', array('id1' => 1, 'id2' => 1)); + $user2 = $em->getReference('Symfony\Bridge\Doctrine\Tests\Fixtures\User', ['id1' => 1, 'id2' => 1]); $this->assertTrue($provider->supportsClass(\get_class($user2))); } @@ -196,7 +196,7 @@ private function getObjectManager($repository) { $em = $this->getMockBuilder('\Doctrine\Common\Persistence\ObjectManager') - ->setMethods(array('getClassMetadata', 'getRepository')) + ->setMethods(['getClassMetadata', 'getRepository']) ->getMockForAbstractClass(); $em->expects($this->any()) ->method('getRepository') @@ -208,8 +208,8 @@ private function createSchema($em) { $schemaTool = new SchemaTool($em); - $schemaTool->createSchema(array( + $schemaTool->createSchema([ $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\User'), - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -90,7 +90,7 @@ protected function createRepositoryMock() { $repository = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectRepository') - ->setMethods(array('findByCustom', 'find', 'findAll', 'findOneBy', 'findBy', 'getClassName')) + ->setMethods(['findByCustom', 'find', 'findAll', 'findOneBy', 'findBy', 'getClassName']) ->getMock() ; @@ -118,8 +118,8 @@ ->getMock() ; $refl = $this->getMockBuilder('Doctrine\Common\Reflection\StaticReflectionProperty') - ->setConstructorArgs(array($reflParser, 'property-name')) - ->setMethods(array('getValue')) + ->setConstructorArgs([$reflParser, 'property-name']) + ->setMethods(['getValue']) ->getMock() ; $refl @@ -127,7 +127,7 @@ ->method('getValue') ->will($this->returnValue(true)) ; - $classMetadata->reflFields = array('name' => $refl); + $classMetadata->reflFields = ['name' => $refl]; $em->expects($this->any()) ->method('getClassMetadata') ->will($this->returnValue($classMetadata)) @@ -144,7 +144,7 @@ private function createSchema(ObjectManager $em) { $schemaTool = new SchemaTool($em); - $schemaTool->createSchema(array( + $schemaTool->createSchema([ $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity'), $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity'), $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleNameEntity'), @@ -156,7 +156,7 @@ $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\Employee'), $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeObjectNoToStringIdEntity'), $em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdStringWrapperNameEntity'), - )); + ]); } /** @@ -164,11 +164,11 @@ */ public function testValidateUniqueness() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Foo'); @@ -190,19 +190,19 @@ ->atPath('property.path.name') ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue($entity2) - ->setCause(array($entity1)) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } public function testValidateCustomErrorPath() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'errorPath' => 'bar', - )); + ]); $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Foo'); @@ -216,18 +216,18 @@ ->atPath('property.path.bar') ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue($entity2) - ->setCause(array($entity1)) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } public function testValidateUniquenessWithNull() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $entity1 = new SingleIntIdEntity(1, null); $entity2 = new SingleIntIdEntity(2, null); @@ -243,12 +243,12 @@ public function testValidateUniquenessWithIgnoreNullDisabled() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name', 'name2'), + 'fields' => ['name', 'name2'], 'em' => self::EM_NAME, 'ignoreNull' => false, - )); + ]); $entity1 = new DoubleNameEntity(1, 'Foo', null); $entity2 = new DoubleNameEntity(2, 'Foo', null); @@ -270,7 +270,7 @@ ->atPath('property.path.name') ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue('Foo') - ->setCause(array($entity1)) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } @@ -280,12 +280,12 @@ */ public function testAllConfiguredFieldsAreCheckedOfBeingMappedByDoctrineWithIgnoreNullEnabled() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name', 'name2'), + 'fields' => ['name', 'name2'], 'em' => self::EM_NAME, 'ignoreNull' => true, - )); + ]); $entity1 = new SingleIntIdEntity(1, null); @@ -294,12 +294,12 @@ public function testNoValidationIfFirstFieldIsNullAndNullValuesAreIgnored() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name', 'name2'), + 'fields' => ['name', 'name2'], 'em' => self::EM_NAME, 'ignoreNull' => true, - )); + ]); $entity1 = new DoubleNullableNameEntity(1, null, 'Foo'); $entity2 = new DoubleNullableNameEntity(2, null, 'Foo'); @@ -322,12 +322,12 @@ public function testValidateUniquenessWithValidCustomErrorPath() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name', 'name2'), + 'fields' => ['name', 'name2'], 'em' => self::EM_NAME, 'errorPath' => 'name2', - )); + ]); $entity1 = new DoubleNameEntity(1, 'Foo', 'Bar'); $entity2 = new DoubleNameEntity(2, 'Foo', 'Bar'); @@ -349,24 +349,24 @@ ->atPath('property.path.name2') ->setParameter('{{ value }}', '"Bar"') ->setInvalidValue('Bar') - ->setCause(array($entity1)) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } public function testValidateUniquenessUsingCustomRepositoryMethod() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'repositoryMethod' => 'findByCustom', - )); + ]); $repository = $this->createRepositoryMock(); $repository->expects($this->once()) ->method('findByCustom') - ->will($this->returnValue(array())) + ->will($this->returnValue([])) ; $this->em = $this->createEntityManagerMock($repository); $this->registry = $this->createRegistryMock($this->em); @@ -382,12 +382,12 @@ public function testValidateUniquenessWithUnrewoundArray() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'repositoryMethod' => 'findByCustom', - )); + ]); $entity = new SingleIntIdEntity(1, 'foo'); @@ -396,9 +396,9 @@ ->method('findByCustom') ->will( $this->returnCallback(function () use ($entity) { - $returnValue = array( + $returnValue = [ $entity, - ); + ]; next($returnValue); return $returnValue; @@ -420,12 +420,12 @@ */ public function testValidateResultTypes($entity1, $result) { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'repositoryMethod' => 'findByCustom', - )); + ]); $repository = $this->createRepositoryMock(); $repository->expects($this->once()) @@ -446,20 +446,20 @@ { $entity = new SingleIntIdEntity(1, 'foo'); - return array( - array($entity, array($entity)), - array($entity, new \ArrayIterator(array($entity))), - array($entity, new ArrayCollection(array($entity))), - ); + return [ + [$entity, [$entity]], + [$entity, new \ArrayIterator([$entity])], + [$entity, new ArrayCollection([$entity])], + ]; } public function testAssociatedEntity() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('single'), + 'fields' => ['single'], 'em' => self::EM_NAME, - )); + ]); $entity1 = new SingleIntIdEntity(1, 'foo'); $associated = new AssociationEntity(); @@ -485,17 +485,17 @@ ->setParameter('{{ value }}', 'foo') ->setInvalidValue($entity1) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) - ->setCause(array($associated, $associated2)) + ->setCause([$associated, $associated2]) ->assertRaised(); } public function testValidateUniquenessNotToStringEntityWithAssociatedEntity() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('single'), + 'fields' => ['single'], 'em' => self::EM_NAME, - )); + ]); $entity1 = new SingleIntIdNoToStringEntity(1, 'foo'); $associated = new AssociationEntity2(); @@ -522,19 +522,19 @@ ->atPath('property.path.single') ->setParameter('{{ value }}', $expectedValue) ->setInvalidValue($entity1) - ->setCause(array($associated, $associated2)) + ->setCause([$associated, $associated2]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } public function testAssociatedEntityWithNull() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('single'), + 'fields' => ['single'], 'em' => self::EM_NAME, 'ignoreNull' => false, - )); + ]); $associated = new AssociationEntity(); $associated->single = null; @@ -552,19 +552,19 @@ $repository = $this->createRepositoryMock(); $this->repositoryFactory->setRepository($this->em, 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity', $repository); - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('phoneNumbers'), + 'fields' => ['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))) + ->will($this->returnValue([$entity1])) ; $this->em->persist($entity1); @@ -580,8 +580,8 @@ $this->buildViolation('myMessage') ->atPath('property.path.phoneNumbers') ->setParameter('{{ value }}', 'array') - ->setInvalidValue(array(123)) - ->setCause(array($entity1)) + ->setInvalidValue([123]) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } @@ -592,11 +592,11 @@ */ public function testDedicatedEntityManagerNullObject() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $this->em = null; $this->registry = $this->createRegistryMock($this->em); @@ -614,11 +614,11 @@ */ public function testEntityManagerNullObject() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], // no "em" option set - )); + ]); $this->em = null; $this->registry = $this->createRegistryMock($this->em); @@ -643,11 +643,11 @@ $this->validator = $this->createValidator(); $this->validator->initialize($this->context); - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $entity = new SingleIntIdEntity(1, null); @@ -660,12 +660,12 @@ public function testValidateInheritanceUniqueness() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'entityClass' => 'Symfony\Bridge\Doctrine\Tests\Fixtures\Person', - )); + ]); $entity1 = new Person(1, 'Foo'); $entity2 = new Employee(2, 'Foo'); @@ -687,8 +687,8 @@ ->atPath('property.path.name') ->setInvalidValue('Foo') ->setCode('23bd9dbf-6b9b-41cd-a99e-4844bcf3077f') - ->setCause(array($entity1)) - ->setParameters(array('{{ value }}' => '"Foo"')) + ->setCause([$entity1]) + ->setParameters(['{{ value }}' => '"Foo"']) ->assertRaised(); } @@ -698,12 +698,12 @@ */ public function testInvalidateRepositoryForInheritance() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, 'entityClass' => 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity', - )); + ]); $entity = new Person(1, 'Foo'); $this->validator->validate($entity, $constraint); @@ -711,11 +711,11 @@ public function testValidateUniquenessWithCompositeObjectNoToStringIdEntity() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('objectOne', 'objectTwo'), + 'fields' => ['objectOne', 'objectTwo'], 'em' => self::EM_NAME, - )); + ]); $objectOne = new SingleIntIdNoToStringEntity(1, 'foo'); $objectTwo = new SingleIntIdNoToStringEntity(2, 'bar'); @@ -739,18 +739,18 @@ ->atPath('property.path.objectOne') ->setParameter('{{ value }}', $expectedValue) ->setInvalidValue($objectOne) - ->setCause(array($entity)) + ->setCause([$entity]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } public function testValidateUniquenessWithCustomDoctrineTypeValue() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $existingEntity = new SingleIntIdStringWrapperNameEntity(1, new StringWrapper('foo')); @@ -767,7 +767,7 @@ ->atPath('property.path.name') ->setParameter('{{ value }}', $expectedValue) ->setInvalidValue($existingEntity->name) - ->setCause(array($existingEntity)) + ->setCause([$existingEntity]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } @@ -777,11 +777,11 @@ */ public function testValidateUniquenessCause() { - $constraint = new UniqueEntity(array( + $constraint = new UniqueEntity([ 'message' => 'myMessage', - 'fields' => array('name'), + 'fields' => ['name'], 'em' => self::EM_NAME, - )); + ]); $entity1 = new SingleIntIdEntity(1, 'Foo'); $entity2 = new SingleIntIdEntity(2, 'Foo'); @@ -803,7 +803,7 @@ ->atPath('property.path.name') ->setParameter('{{ value }}', '"Foo"') ->setInvalidValue($entity2) - ->setCause(array($entity1)) + ->setCause([$entity1]) ->setCode(UniqueEntity::NOT_UNIQUE_ERROR) ->assertRaised(); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,17 +30,17 @@ public $em = null; public $entityClass = null; public $repositoryMethod = 'findBy'; - public $fields = array(); + public $fields = []; public $errorPath = null; public $ignoreNull = true; - protected static $errorNames = array( + protected static $errorNames = [ self::NOT_UNIQUE_ERROR => 'NOT_UNIQUE_ERROR', - ); + ]; public function getRequiredOptions() { - return array('fields'); + return ['fields']; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,7 +81,7 @@ $class = $em->getClassMetadata(\get_class($entity)); /* @var $class \Doctrine\Common\Persistence\Mapping\ClassMetadata */ - $criteria = array(); + $criteria = []; $hasNullValue = false; foreach ($fields as $fieldName) { @@ -149,15 +149,15 @@ if ($result instanceof \Iterator) { $result->rewind(); if ($result instanceof \Countable && 1 < \count($result)) { - $result = array($result->current(), $result->current()); + $result = [$result->current(), $result->current()]; } else { $result = $result->current(); - $result = null === $result ? array() : array($result); + $result = null === $result ? [] : [$result]; } } elseif (\is_array($result)) { reset($result); } else { - $result = null === $result ? array() : array($result); + $result = null === $result ? [] : [$result]; } /* If no entity matched the query criteria or a single entity matched, @@ -197,7 +197,7 @@ } else { // this case might happen if the non unique column has a custom doctrine type and its value is an object // in which case we cannot get any identifiers for it - $identifiers = array(); + $identifiers = []; } } else { $identifiers = $class->getIdentifierValues($value); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% [%channel%] %message%%context%%extra%\n"; const SIMPLE_DATE = 'H:i:s'; - private static $levelColorMap = array( + private static $levelColorMap = [ Logger::DEBUG => 'fg=white', Logger::INFO => 'fg=green', Logger::NOTICE => 'fg=blue', @@ -39,7 +39,7 @@ Logger::CRITICAL => 'fg=red', Logger::ALERT => 'fg=red', Logger::EMERGENCY => 'fg=white;bg=red', - ); + ]; private $options; private $cloner; @@ -53,13 +53,13 @@ * * colors: If true, the log string contains ANSI code to add color; * * multiline: If false, "context" and "extra" are dumped on one line. */ - public function __construct($options = array()) + public function __construct($options = []) { // BC Layer if (!\is_array($options)) { @trigger_error(sprintf('The constructor arguments $format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra of "%s" are deprecated since Symfony 3.3 and will be removed in 4.0. Use $options instead.', self::class), E_USER_DEPRECATED); $args = \func_get_args(); - $options = array(); + $options = []; if (isset($args[0])) { $options['format'] = $args[0]; } @@ -74,25 +74,25 @@ } } - $this->options = array_replace(array( + $this->options = array_replace([ 'format' => self::SIMPLE_FORMAT, 'date_format' => self::SIMPLE_DATE, 'colors' => true, 'multiline' => false, 'ignore_empty_context_and_extra' => true, - ), $options); + ], $options); if (class_exists(VarCloner::class)) { $this->cloner = new VarCloner(); - $this->cloner->addCasters(array( - '*' => array($this, 'castObject'), - )); + $this->cloner->addCasters([ + '*' => [$this, 'castObject'], + ]); $this->outputBuffer = fopen('php://memory', 'r+b'); if ($this->options['multiline']) { $output = $this->outputBuffer; } else { - $output = array($this, 'echoLine'); + $output = [$this, 'echoLine']; } $this->dumper = new CliDumper($output, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); @@ -132,7 +132,7 @@ $extra = ''; } - $formatted = strtr($this->options['format'], array( + $formatted = strtr($this->options['format'], [ '%datetime%' => $record['datetime']->format($this->options['date_format']), '%start_tag%' => sprintf('<%s>', $levelColor), '%level_name%' => sprintf('%-9s', $record['level_name']), @@ -141,7 +141,7 @@ '%message%' => $this->replacePlaceHolder($record)['message'], '%context%' => $context, '%extra%' => $extra, - )); + ]); return $formatted; } @@ -167,7 +167,7 @@ if ($isNested && !$v instanceof \DateTimeInterface) { $s->cut = -1; - $a = array(); + $a = []; } return $a; @@ -183,7 +183,7 @@ $context = $record['context']; - $replacements = array(); + $replacements = []; foreach ($context as $k => $v) { // Remove quotes added by the dumper around string. $v = trim($this->dumpData($v, false), '"'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ */ class ChromePhpHandler extends BaseChromePhpHandler { - private $headers = array(); + private $headers = []; /** * @var Response @@ -40,7 +40,7 @@ if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) { $this->sendHeaders = false; - $this->headers = array(); + $this->headers = []; return; } @@ -49,7 +49,7 @@ foreach ($this->headers as $header => $content) { $this->response->headers->set($header, $content); } - $this->headers = array(); + $this->headers = []; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,13 +43,13 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscriberInterface { private $output; - private $verbosityLevelMap = array( + private $verbosityLevelMap = [ OutputInterface::VERBOSITY_QUIET => Logger::ERROR, OutputInterface::VERBOSITY_NORMAL => Logger::WARNING, OutputInterface::VERBOSITY_VERBOSE => Logger::NOTICE, OutputInterface::VERBOSITY_VERY_VERBOSE => Logger::INFO, OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG, - ); + ]; /** * @param OutputInterface|null $output The console output to use (the handler remains disabled when passing null @@ -58,7 +58,7 @@ * @param array $verbosityLevelMap Array that maps the OutputInterface verbosity to a minimum logging * level (leave empty to use the default mapping) */ - public function __construct(OutputInterface $output = null, $bubble = true, array $verbosityLevelMap = array()) + public function __construct(OutputInterface $output = null, $bubble = true, array $verbosityLevelMap = []) { parent::__construct(Logger::DEBUG, $bubble); $this->output = $output; @@ -131,10 +131,10 @@ */ public static function getSubscribedEvents() { - return array( - ConsoleEvents::COMMAND => array('onCommand', 255), - ConsoleEvents::TERMINATE => array('onTerminate', -255), - ); + return [ + ConsoleEvents::COMMAND => ['onCommand', 255], + ConsoleEvents::TERMINATE => ['onTerminate', -255], + ]; } /** @@ -158,10 +158,10 @@ return new ConsoleFormatter(); } - return new ConsoleFormatter(array( + return new ConsoleFormatter([ 'colors' => $this->output->isDecorated(), 'multiline' => OutputInterface::VERBOSITY_DEBUG <= $this->output->getVerbosity(), - )); + ]); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,16 +31,16 @@ */ public function getLogs() { - $records = array(); + $records = []; foreach ($this->records as $record) { - $records[] = array( + $records[] = [ 'timestamp' => $record['datetime']->getTimestamp(), 'message' => $record['message'], 'priority' => $record['level'], 'priorityName' => $record['level_name'], 'context' => $record['context'], 'channel' => isset($record['channel']) ? $record['channel'] : '', - ); + ]; } return $records; @@ -52,7 +52,7 @@ public function countErrors() { $cnt = 0; - $levels = array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY); + $levels = [Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY]; foreach ($levels as $level) { if (isset($this->recordsByLevel[$level])) { $cnt += \count($this->recordsByLevel[$level]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ */ class FirePHPHandler extends BaseFirePHPHandler { - private $headers = array(); + private $headers = []; /** * @var Response @@ -42,7 +42,7 @@ if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $request->headers->get('User-Agent')) && !$request->headers->has('X-FirePHP-Version')) { self::$sendHeaders = false; - $this->headers = array(); + $this->headers = []; return; } @@ -51,7 +51,7 @@ foreach ($this->headers as $header => $content) { $this->response->headers->set($header, $content); } - $this->headers = array(); + $this->headers = []; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ private $context; private $socket; - public function __construct($host, $level = Logger::DEBUG, $bubble = true, $context = array()) + public function __construct($host, $level = Logger::DEBUG, $bubble = true, $context = []) { parent::__construct($level, $bubble); @@ -108,7 +108,7 @@ $recordFormatted = $this->getFormatter()->format($record); - foreach (array('log_uuid', 'uuid', 'uid') as $key) { + foreach (['log_uuid', 'uuid', 'uid'] as $key) { if (isset($record['extra'][$key])) { $recordFormatted['log_id'] = $record['extra'][$key]; break; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,6 +60,14 @@ } /** + * {@inheritdoc} + */ + public function reset() + { + $this->flushMemorySpool(); + } + + /** * Flushes the mail queue if a memory spool is used. */ private function flushMemorySpool() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Logger.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Logger.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Logger.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Logger.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ return $logger->getLogs(); } - return array(); + return []; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,19 +16,19 @@ class DebugProcessor implements DebugLoggerInterface { - private $records = array(); + private $records = []; private $errorCount = 0; public function __invoke(array $record) { - $this->records[] = array( + $this->records[] = [ 'timestamp' => $record['datetime']->getTimestamp(), 'message' => $record['message'], 'priority' => $record['level'], 'priorityName' => $record['level_name'], 'context' => $record['context'], 'channel' => isset($record['channel']) ? $record['channel'] : '', - ); + ]; switch ($record['level']) { case Logger::ERROR: case Logger::CRITICAL: @@ -61,7 +61,7 @@ */ public function clear() { - $this->records = array(); + $this->records = []; $this->errorCount = 0; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,11 +31,11 @@ { $records['extra']['token'] = null; if (null !== $token = $this->tokenStorage->getToken()) { - $records['extra']['token'] = array( + $records['extra']['token'] = [ 'username' => $token->getUsername(), 'authenticated' => $token->isAuthenticated(), 'roles' => array_map(function ($role) { return $role->getRole(); }, $token->getRoles()), - ); + ]; } return $records; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ public function __construct(array $extraFields = null) { // Pass an empty array as the default null value would access $_SERVER - parent::__construct(array(), $extraFields); + parent::__construct([], $extraFields); } public function onKernelRequest(GetResponseEvent $event) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,13 +38,13 @@ public function testIsHandling() { $handler = new ConsoleHandler(); - $this->assertFalse($handler->isHandling(array()), '->isHandling returns false when no output is set'); + $this->assertFalse($handler->isHandling([]), '->isHandling returns false when no output is set'); } /** * @dataProvider provideVerbosityMappingTests */ - public function testVerbosityMapping($verbosity, $level, $isHandling, array $map = array()) + public function testVerbosityMapping($verbosity, $level, $isHandling, array $map = []) { $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock(); $output @@ -53,7 +53,7 @@ ->will($this->returnValue($verbosity)) ; $handler = new ConsoleHandler($output, true, $map); - $this->assertSame($isHandling, $handler->isHandling(array('level' => $level)), + $this->assertSame($isHandling, $handler->isHandling(['level' => $level]), '->isHandling returns correct value depending on console verbosity and log level' ); @@ -61,7 +61,7 @@ $levelName = Logger::getLevelName($level); $levelName = sprintf('%-9s', $levelName); - $realOutput = $this->getMockBuilder('Symfony\Component\Console\Output\Output')->setMethods(array('doWrite'))->getMock(); + $realOutput = $this->getMockBuilder('Symfony\Component\Console\Output\Output')->setMethods(['doWrite'])->getMock(); $realOutput->setVerbosity($verbosity); if ($realOutput->isDebug()) { $log = "16:21:54 $levelName [app] My info message\n"; @@ -74,38 +74,38 @@ ->with($log, false); $handler = new ConsoleHandler($realOutput, true, $map); - $infoRecord = array( + $infoRecord = [ 'message' => 'My info message', - 'context' => array(), + 'context' => [], 'level' => $level, 'level_name' => Logger::getLevelName($level), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), - 'extra' => array(), - ); + 'extra' => [], + ]; $this->assertFalse($handler->handle($infoRecord), 'The handler finished handling the log.'); } public function provideVerbosityMappingTests() { - return array( - array(OutputInterface::VERBOSITY_QUIET, Logger::ERROR, true), - array(OutputInterface::VERBOSITY_QUIET, Logger::WARNING, false), - array(OutputInterface::VERBOSITY_NORMAL, Logger::WARNING, true), - array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, false), - array(OutputInterface::VERBOSITY_VERBOSE, Logger::NOTICE, true), - array(OutputInterface::VERBOSITY_VERBOSE, Logger::INFO, false), - array(OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::INFO, true), - array(OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::DEBUG, false), - array(OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true), - array(OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true), - array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, array( + return [ + [OutputInterface::VERBOSITY_QUIET, Logger::ERROR, true], + [OutputInterface::VERBOSITY_QUIET, Logger::WARNING, false], + [OutputInterface::VERBOSITY_NORMAL, Logger::WARNING, true], + [OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, false], + [OutputInterface::VERBOSITY_VERBOSE, Logger::NOTICE, true], + [OutputInterface::VERBOSITY_VERBOSE, Logger::INFO, false], + [OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::INFO, true], + [OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::DEBUG, false], + [OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true], + [OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true], + [OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, [ OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE, - )), - array(OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, array( + ]], + [OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, [ OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE, - )), - ); + ]], + ]; } public function testVerbosityChanged() @@ -122,10 +122,10 @@ ->will($this->returnValue(OutputInterface::VERBOSITY_DEBUG)) ; $handler = new ConsoleHandler($output); - $this->assertFalse($handler->isHandling(array('level' => Logger::NOTICE)), + $this->assertFalse($handler->isHandling(['level' => Logger::NOTICE]), 'when verbosity is set to quiet, the handler does not handle the log' ); - $this->assertTrue($handler->isHandling(array('level' => Logger::NOTICE)), + $this->assertTrue($handler->isHandling(['level' => Logger::NOTICE]), 'since the verbosity of the output increased externally, the handler is now handling the log' ); } @@ -155,15 +155,15 @@ $handler = new ConsoleHandler(null, false); $handler->setOutput($output); - $infoRecord = array( + $infoRecord = [ 'message' => 'My info message', - 'context' => array(), + 'context' => [], 'level' => Logger::INFO, 'level_name' => Logger::getLevelName(Logger::INFO), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), - 'extra' => array(), - ); + 'extra' => [], + ]; $this->assertTrue($handler->handle($infoRecord), 'The handler finished handling the log as bubble is false.'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,28 +28,28 @@ $requestStack = new RequestStack(); $requestStack->push(Request::create($url)); - $strategy = new NotFoundActivationStrategy($requestStack, array('^/foo', 'bar'), Logger::WARNING); + $strategy = new NotFoundActivationStrategy($requestStack, ['^/foo', 'bar'], Logger::WARNING); $this->assertEquals($expected, $strategy->isHandlerActivated($record)); } public function isActivatedProvider() { - return array( - array('/test', array('level' => Logger::DEBUG), false), - array('/foo', array('level' => Logger::DEBUG, 'context' => $this->getContextException(404)), false), - array('/baz/bar', array('level' => Logger::ERROR, 'context' => $this->getContextException(404)), false), - array('/foo', array('level' => Logger::ERROR, 'context' => $this->getContextException(404)), false), - array('/foo', array('level' => Logger::ERROR, 'context' => $this->getContextException(500)), true), + return [ + ['/test', ['level' => Logger::DEBUG], false], + ['/foo', ['level' => Logger::DEBUG, 'context' => $this->getContextException(404)], false], + ['/baz/bar', ['level' => Logger::ERROR, 'context' => $this->getContextException(404)], false], + ['/foo', ['level' => Logger::ERROR, 'context' => $this->getContextException(404)], false], + ['/foo', ['level' => Logger::ERROR, 'context' => $this->getContextException(500)], true], - array('/test', array('level' => Logger::ERROR), true), - array('/baz', array('level' => Logger::ERROR, 'context' => $this->getContextException(404)), true), - array('/baz', array('level' => Logger::ERROR, 'context' => $this->getContextException(500)), true), - ); + ['/test', ['level' => Logger::ERROR], true], + ['/baz', ['level' => Logger::ERROR, 'context' => $this->getContextException(404)], true], + ['/baz', ['level' => Logger::ERROR, 'context' => $this->getContextException(500)], true], + ]; } protected function getContextException($code) { - return array('exception' => new HttpException($code)); + return ['exception' => new HttpException($code)]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/LoggerTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/LoggerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/LoggerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/LoggerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ public function testGetLogsWithDebugHandler() { $handler = new DebugHandler(); - $logger = new Logger(__METHOD__, array($handler)); + $logger = new Logger(__METHOD__, [$handler]); $this->assertTrue($logger->error('error message')); $this->assertCount(1, $logger->getLogs()); @@ -34,10 +34,10 @@ public function testGetLogsWithoutDebugProcessor() { $handler = new TestHandler(); - $logger = new Logger(__METHOD__, array($handler)); + $logger = new Logger(__METHOD__, [$handler]); $this->assertTrue($logger->error('error message')); - $this->assertSame(array(), $logger->getLogs()); + $this->assertSame([], $logger->getLogs()); } /** @@ -46,7 +46,7 @@ public function testCountErrorsWithDebugHandler() { $handler = new DebugHandler(); - $logger = new Logger(__METHOD__, array($handler)); + $logger = new Logger(__METHOD__, [$handler]); $this->assertTrue($logger->debug('test message')); $this->assertTrue($logger->info('test message')); @@ -80,7 +80,7 @@ public function testCountErrorsWithoutDebugProcessor() { $handler = new TestHandler(); - $logger = new Logger(__METHOD__, array($handler)); + $logger = new Logger(__METHOD__, [$handler]); $this->assertTrue($logger->error('error message')); $this->assertSame(0, $logger->countErrors()); @@ -90,7 +90,7 @@ { $handler = new TestHandler(); $processor = new DebugProcessor(); - $logger = new Logger(__METHOD__, array($handler), array($processor)); + $logger = new Logger(__METHOD__, [$handler], [$processor]); $this->assertTrue($logger->error('error message')); $this->assertCount(1, $logger->getLogs()); @@ -100,7 +100,7 @@ { $handler = new TestHandler(); $processor = new DebugProcessor(); - $logger = new Logger(__METHOD__, array($handler), array($processor)); + $logger = new Logger(__METHOD__, [$handler], [$processor]); $this->assertTrue($logger->debug('test message')); $this->assertTrue($logger->info('test message')); @@ -118,7 +118,7 @@ public function testGetLogsWithDebugProcessor2() { $handler = new TestHandler(); - $logger = new Logger('test', array($handler)); + $logger = new Logger('test', [$handler]); $logger->pushProcessor(new DebugProcessor()); $logger->addInfo('test'); @@ -132,7 +132,7 @@ public function testClear() { $handler = new TestHandler(); - $logger = new Logger('test', array($handler)); + $logger = new Logger('test', [$handler]); $logger->pushProcessor(new DebugProcessor()); $logger->addInfo('test'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/TokenProcessorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/TokenProcessorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/TokenProcessorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/TokenProcessorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,12 +25,12 @@ { public function testProcessor() { - $token = new UsernamePasswordToken('user', 'password', 'provider', array('ROLE_USER')); + $token = new UsernamePasswordToken('user', 'password', 'provider', ['ROLE_USER']); $tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock(); $tokenStorage->method('getToken')->willReturn($token); $processor = new TokenProcessor($tokenStorage); - $record = array('extra' => array()); + $record = ['extra' => []]; $record = $processor($record); $this->assertArrayHasKey('token', $record['extra']); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,8 +36,8 @@ public function testUseRequestClientIp() { - Request::setTrustedProxies(array('192.168.0.1'), Request::HEADER_X_FORWARDED_ALL); - list($event, $server) = $this->createRequestEvent(array('X_FORWARDED_FOR' => '192.168.0.2')); + Request::setTrustedProxies(['192.168.0.1'], Request::HEADER_X_FORWARDED_ALL); + list($event, $server) = $this->createRequestEvent(['X_FORWARDED_FOR' => '192.168.0.2']); $processor = new WebProcessor(); $processor->onKernelRequest($event); @@ -50,7 +50,7 @@ $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']); $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']); - Request::setTrustedProxies(array(), -1); + Request::setTrustedProxies([], -1); } public function testCanBeConstructedWithExtraFields() @@ -61,7 +61,7 @@ list($event, $server) = $this->createRequestEvent(); - $processor = new WebProcessor(array('url', 'referrer')); + $processor = new WebProcessor(['url', 'referrer']); $processor->onKernelRequest($event); $record = $processor($this->getRecord()); @@ -73,16 +73,16 @@ /** * @return array */ - private function createRequestEvent($additionalServerParameters = array()) + private function createRequestEvent($additionalServerParameters = []) { $server = array_merge( - array( + [ 'REQUEST_URI' => 'A', 'REMOTE_ADDR' => '192.168.0.1', 'REQUEST_METHOD' => 'C', 'SERVER_NAME' => 'D', 'HTTP_REFERER' => 'E', - ), + ], $additionalServerParameters ); @@ -100,7 +100,7 @@ ->method('getRequest') ->will($this->returnValue($request)); - return array($event, $server); + return [$event, $server]; } /** @@ -111,15 +111,15 @@ */ private function getRecord($level = Logger::WARNING, $message = 'test') { - return array( + return [ 'message' => $message, - 'context' => array(), + 'context' => [], 'level' => $level, 'level_name' => Logger::getLevelName($level), 'channel' => 'test', 'datetime' => new \DateTime(), - 'extra' => array(), - ); + 'extra' => [], + ]; } private function isExtraFieldsSupported() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit 2019-02-03 12:23:08.000000000 +0000 @@ -61,7 +61,9 @@ @mkdir($PHPUNIT_DIR, 0777, true); chdir($PHPUNIT_DIR); if (file_exists("phpunit-$PHPUNIT_VERSION")) { - passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION")); + passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s > NUL': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION.old")); + rename("phpunit-$PHPUNIT_VERSION", "phpunit-$PHPUNIT_VERSION.old"); + passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION.old")); } passthru("$COMPOSER create-project --no-install --prefer-dist --no-scripts --no-plugins --no-progress --ansi phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\""); chdir("phpunit-$PHPUNIT_VERSION"); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,9 +54,9 @@ if (false === $mode) { $mode = getenv('SYMFONY_DEPRECATIONS_HELPER'); } - if (DeprecationErrorHandler::MODE_DISABLED !== $mode - && DeprecationErrorHandler::MODE_WEAK !== $mode - && DeprecationErrorHandler::MODE_WEAK_VENDORS !== $mode + if (self::MODE_DISABLED !== $mode + && self::MODE_WEAK !== $mode + && self::MODE_WEAK_VENDORS !== $mode && (!isset($mode[0]) || '/' !== $mode[0]) ) { $mode = preg_match('/^[1-9][0-9]*$/', $mode) ? (int) $mode : 0; @@ -106,7 +106,7 @@ ); $deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) { $mode = $getMode(); - if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) { + if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || self::MODE_DISABLED === $mode) { $ErrorHandler = $UtilPrefix.'ErrorHandler'; return $ErrorHandler::handleError($type, $msg, $file, $line, $context); @@ -114,7 +114,7 @@ $trace = debug_backtrace(); $group = 'other'; - $isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $inVendors($file); + $isVendor = self::MODE_WEAK_VENDORS === $mode && $inVendors($file); $i = \count($trace); while (1 < $i && (!isset($trace[--$i]['class']) || ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_') || 0 === strpos($trace[$i]['class'], 'PHPUnit\\')))) { @@ -131,7 +131,7 @@ // \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest() // then we need to use the serialized information to determine // if the error has been triggered from vendor code. - $isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && isset($parsedMsg['triggering_file']) && $inVendors($parsedMsg['triggering_file']); + $isVendor = self::MODE_WEAK_VENDORS === $mode && isset($parsedMsg['triggering_file']) && $inVendors($parsedMsg['triggering_file']); } else { $class = isset($trace[$i]['object']) ? \get_class($trace[$i]['object']) : $trace[$i]['class']; $method = $trace[$i]['function']; @@ -168,13 +168,13 @@ exit(1); } - if ('legacy' !== $group && DeprecationErrorHandler::MODE_WEAK !== $mode) { + if ('legacy' !== $group && self::MODE_WEAK !== $mode) { $ref = &$deprecations[$group][$msg]['count']; ++$ref; $ref = &$deprecations[$group][$msg][$class.'::'.$method]; ++$ref; } - } elseif (DeprecationErrorHandler::MODE_WEAK !== $mode) { + } elseif (self::MODE_WEAK !== $mode) { $ref = &$deprecations[$group][$msg]['count']; ++$ref; } @@ -207,7 +207,7 @@ $currErrorHandler = set_error_handler('var_dump'); restore_error_handler(); - if (DeprecationErrorHandler::MODE_WEAK === $mode) { + if (self::MODE_WEAK === $mode) { $colorize = function ($str) { return $str; }; } if ($currErrorHandler !== $deprecationHandler) { @@ -219,7 +219,7 @@ }; $groups = array('unsilenced', 'remaining'); - if (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode) { + if (self::MODE_WEAK_VENDORS === $mode) { $groups[] = 'remaining vendor'; } array_push($groups, 'legacy', 'other'); @@ -255,7 +255,7 @@ $displayDeprecations($deprecations); // store failing status - $isFailing = DeprecationErrorHandler::MODE_WEAK !== $mode && $mode < $deprecations['unsilencedCount'] + $deprecations['remainingCount'] + $deprecations['otherCount']; + $isFailing = self::MODE_WEAK !== $mode && $mode < $deprecations['unsilencedCount'] + $deprecations['remainingCount'] + $deprecations['otherCount']; // reset deprecations array foreach ($deprecations as $group => $arrayOrInt) { @@ -270,7 +270,7 @@ } } $displayDeprecations($deprecations); - if ($isFailing || DeprecationErrorHandler::MODE_WEAK !== $mode && $mode < $deprecations['unsilencedCount'] + $deprecations['remainingCount'] + $deprecations['otherCount']) { + if ($isFailing || self::MODE_WEAK !== $mode && $mode < $deprecations['unsilencedCount'] + $deprecations['remainingCount'] + $deprecations['otherCount']) { exit(1); } }); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ { public static function getGroups() { - return array(); + return []; } } EOPHP diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php 2019-02-03 12:23:08.000000000 +0000 @@ -7,7 +7,7 @@ { public static function getGroups() { - return array(); + return []; } } EOPHP diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ { public static function getGroups() { - return array(); + return []; } } EOPHP diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt --- symfony-3.4.21+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ { public static function getGroups() { - return array(); + return []; } } EOPHP diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -69,6 +69,6 @@ $dumper->setProxyDumper(new ProxyDumper()); - return $dumper->dump(array('class' => 'LazyServiceProjectServiceContainer')); + return $dumper->dump(['class' => 'LazyServiceProjectServiceContainer']); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/includes/foo.php 2019-02-03 12:23:08.000000000 +0000 @@ -11,14 +11,14 @@ public $initialized = false; public $configured = false; public $called = false; - public $arguments = array(); + public $arguments = []; - public function __construct($arguments = array()) + public function __construct($arguments = []) { $this->arguments = $arguments; } - public static function getInstance($arguments = array()) + public static function getInstance($arguments = []) { $obj = new self($arguments); $obj->called = true; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -98,18 +98,18 @@ public function getPrivatePublicDefinitions() { - return array( - array( + return [ + [ (new Definition(__CLASS__)) ->setPublic(false), \method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates', - ), - array( + ], + [ (new Definition(__CLASS__)) ->setPublic(true), 'services', - ), - ); + ], + ]; } /** @@ -134,12 +134,12 @@ */ public function getProxyCandidates() { - $definitions = array( - array(new Definition(__CLASS__), true), - array(new Definition('stdClass'), true), - array(new Definition(uniqid('foo', true)), false), - array(new Definition(), false), - ); + $definitions = [ + [new Definition(__CLASS__), true], + [new Definition('stdClass'), true], + [new Definition(uniqid('foo', true)), false], + [new Definition(), false], + ]; array_map( function ($definition) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/AppVariable.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/AppVariable.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/AppVariable.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/AppVariable.php 2019-02-03 12:23:08.000000000 +0000 @@ -150,7 +150,7 @@ * Returns some or all the existing flash messages: * * getFlashes() returns all the flash messages * * getFlashes('notice') returns a simple array with flash messages of that type - * * getFlashes(array('notice', 'error')) returns a nested array of type => messages. + * * getFlashes(['notice', 'error']) returns a nested array of type => messages. * * @return array */ @@ -159,13 +159,13 @@ try { $session = $this->getSession(); if (null === $session) { - return array(); + return []; } } catch (\RuntimeException $e) { - return array(); + return []; } - if (null === $types || '' === $types || array() === $types) { + if (null === $types || '' === $types || [] === $types) { return $session->getFlashBag()->all(); } @@ -173,7 +173,7 @@ return $session->getFlashBag()->get($types); } - $result = array(); + $result = []; foreach ($types as $type) { $result[$type] = $session->getFlashBag()->get($type); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/CHANGELOG.md symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/CHANGELOG.md --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/CHANGELOG.md 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/CHANGELOG.md 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ use Symfony\Bridge\Twig\Form\TwigRendererEngine; // ... - $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig')); + $rendererEngine = new TwigRendererEngine(['form_div_layout.html.twig']); $rendererEngine->setEnvironment($twig); $twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager))); ``` @@ -42,13 +42,13 @@ ```php // ... - $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); + $rendererEngine = new TwigRendererEngine(['form_div_layout.html.twig'], $twig); // require Twig 1.30+ - $twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryRuntimeLoader(array( + $twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryRuntimeLoader([ TwigRenderer::class => function () use ($rendererEngine, $csrfTokenManager) { return new TwigRenderer($rendererEngine, $csrfTokenManager); }, - ))); + ])); $twig->addExtension(new FormExtension()); ``` * Deprecated the `TwigRendererEngineInterface` interface. diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Command/DebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Command/DebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Command/DebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Command/DebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -72,10 +72,10 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('filter', InputArgument::OPTIONAL, 'Show details for all entries matching this filter'), 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(<<<'EOF' The %command.name% command outputs a list of twig functions, @@ -114,10 +114,10 @@ throw new \RuntimeException('The Twig environment needs to be set.'); } - $types = array('functions', 'filters', 'tests', 'globals'); + $types = ['functions', 'filters', 'tests', 'globals']; if ('json' === $input->getOption('format')) { - $data = array(); + $data = []; foreach ($types as $type) { foreach ($this->twig->{'get'.ucfirst($type)}() as $name => $entity) { $data[$type][$name] = $this->getMetadata($type, $entity); @@ -133,7 +133,7 @@ $filter = $input->getArgument('filter'); foreach ($types as $index => $type) { - $items = array(); + $items = []; foreach ($this->twig->{'get'.ucfirst($type)}() as $name => $entity) { if (!$filter || false !== strpos($name, $filter)) { $items[$name] = $name.$this->getPrettyMetadata($type, $entity); @@ -150,20 +150,20 @@ $io->listing($items); } - $rows = array(); + $rows = []; $firstNamespace = true; $prevHasSeparator = false; foreach ($this->getLoaderPaths() as $namespace => $paths) { if (!$firstNamespace && !$prevHasSeparator && \count($paths) > 1) { - $rows[] = array('', ''); + $rows[] = ['', '']; } $firstNamespace = false; foreach ($paths as $path) { - $rows[] = array($namespace, $path.\DIRECTORY_SEPARATOR); + $rows[] = [$namespace, $path.\DIRECTORY_SEPARATOR]; $namespace = ''; } if (\count($paths) > 1) { - $rows[] = array('', ''); + $rows[] = ['', '']; $prevHasSeparator = true; } else { $prevHasSeparator = false; @@ -173,7 +173,7 @@ array_pop($rows); } $io->section('Loader Paths'); - $io->table(array('Namespace', 'Paths'), $rows); + $io->table(['Namespace', 'Paths'], $rows); return 0; } @@ -181,10 +181,10 @@ private function getLoaderPaths() { if (!($loader = $this->twig->getLoader()) instanceof FilesystemLoader) { - return array(); + return []; } - $loaderPaths = array(); + $loaderPaths = []; foreach ($loader->getNamespaces() as $namespace) { $paths = array_map(function ($path) { if (null !== $this->projectDir && 0 === strpos($path, $this->projectDir)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Command/LintCommand.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Command/LintCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Command/LintCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Command/LintCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -129,7 +129,7 @@ $template .= fread(STDIN, 1024); } - return $this->display($input, $output, $io, array($this->validate($template, uniqid('sf_', true)))); + return $this->display($input, $output, $io, [$this->validate($template, uniqid('sf_', true))]); } $filesInfo = $this->getFilesInfo($filenames); @@ -139,7 +139,7 @@ private function getFilesInfo(array $filenames) { - $filesInfo = array(); + $filesInfo = []; foreach ($filenames as $filename) { foreach ($this->findFiles($filename) as $file) { $filesInfo[] = $this->validate(file_get_contents($file), $file); @@ -152,7 +152,7 @@ protected function findFiles($filename) { if (is_file($filename)) { - return array($filename); + return [$filename]; } elseif (is_dir($filename)) { return Finder::create()->files()->in($filename)->name('*.twig'); } @@ -164,7 +164,7 @@ { $realLoader = $this->twig->getLoader(); try { - $temporaryLoader = new ArrayLoader(array((string) $file => $template)); + $temporaryLoader = new ArrayLoader([(string) $file => $template]); $this->twig->setLoader($temporaryLoader); $nodeTree = $this->twig->parse($this->twig->tokenize(new Source($template, (string) $file))); $this->twig->compile($nodeTree); @@ -172,10 +172,10 @@ } catch (Error $e) { $this->twig->setLoader($realLoader); - return array('template' => $template, 'file' => $file, 'line' => $e->getTemplateLine(), 'valid' => false, 'exception' => $e); + return ['template' => $template, 'file' => $file, 'line' => $e->getTemplateLine(), 'valid' => false, 'exception' => $e]; } - return array('template' => $template, 'file' => $file, 'valid' => true); + return ['template' => $template, 'file' => $file, 'valid' => true]; } private function display(InputInterface $input, OutputInterface $output, SymfonyStyle $io, $files) @@ -261,7 +261,7 @@ $position = max(0, $line - $context); $max = min(\count($lines), $line - 1 + $context); - $result = array(); + $result = []; while ($position < $max) { $result[$position + 1] = $lines[$position]; ++$position; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/composer.json symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/composer.json --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/composer.json 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/composer.json 2019-02-03 12:23:08.000000000 +0000 @@ -17,13 +17,13 @@ ], "require": { "php": "^5.5.9|>=7.0.8", - "twig/twig": "^1.35|^2.4.4" + "twig/twig": "^1.37.1|^2.6.2" }, "require-dev": { "symfony/asset": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~2.8|~3.0|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/form": "^3.4.16|^4.1.5", + "symfony/form": "^3.4.22|~4.1.11|^4.2.3", "symfony/http-foundation": "^3.3.11|~4.0", "symfony/http-kernel": "~3.2|~4.0", "symfony/polyfill-intl-icu": "~1.0", diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php 2019-02-03 12:23:08.000000000 +0000 @@ -51,7 +51,7 @@ { $this->profile->reset(); $this->computed = null; - $this->data = array(); + $this->data = []; } /** @@ -60,7 +60,7 @@ public function lateCollect() { $this->data['profile'] = serialize($this->profile); - $this->data['template_paths'] = array(); + $this->data['template_paths'] = []; if (null === $this->twig) { return; @@ -122,15 +122,15 @@ $dump = $dumper->dump($this->getProfile()); // needed to remove the hardcoded CSS styles - $dump = str_replace(array( + $dump = str_replace([ '', '', '', - ), array( + ], [ '', '', '', - ), $dump); + ], $dump); return new Markup($dump, 'UTF-8'); } @@ -139,7 +139,7 @@ { if (null === $this->profile) { if (\PHP_VERSION_ID >= 70000) { - $this->profile = unserialize($this->data['profile'], array('allowed_classes' => array('Twig_Profiler_Profile', 'Twig\Profiler\Profile'))); + $this->profile = unserialize($this->data['profile'], ['allowed_classes' => ['Twig_Profiler_Profile', 'Twig\Profiler\Profile']]); } else { $this->profile = unserialize($this->data['profile']); } @@ -159,13 +159,13 @@ private function computeData(Profile $profile) { - $data = array( + $data = [ 'template_count' => 0, 'block_count' => 0, 'macro_count' => 0, - ); + ]; - $templates = array(); + $templates = []; foreach ($profile as $p) { $d = $this->computeData($p); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/AssetExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/AssetExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/AssetExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/AssetExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,10 +34,10 @@ */ public function getFunctions() { - return array( - new TwigFunction('asset', array($this, 'getAssetUrl')), - new TwigFunction('asset_version', array($this, 'getAssetVersion')), - ); + return [ + new TwigFunction('asset', [$this, 'getAssetUrl']), + new TwigFunction('asset_version', [$this, 'getAssetVersion']), + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/CodeExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/CodeExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/CodeExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/CodeExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,17 +43,17 @@ */ public function getFilters() { - return array( - new TwigFilter('abbr_class', array($this, 'abbrClass'), array('is_safe' => array('html'))), - new TwigFilter('abbr_method', array($this, 'abbrMethod'), array('is_safe' => array('html'))), - new TwigFilter('format_args', array($this, 'formatArgs'), array('is_safe' => array('html'))), - new TwigFilter('format_args_as_text', array($this, 'formatArgsAsText')), - new TwigFilter('file_excerpt', array($this, 'fileExcerpt'), array('is_safe' => array('html'))), - new TwigFilter('format_file', array($this, 'formatFile'), array('is_safe' => array('html'))), - new TwigFilter('format_file_from_text', array($this, 'formatFileFromText'), array('is_safe' => array('html'))), - new TwigFilter('format_log_message', array($this, 'formatLogMessage'), array('is_safe' => array('html'))), - new TwigFilter('file_link', array($this, 'getFileLink')), - ); + return [ + new TwigFilter('abbr_class', [$this, 'abbrClass'], ['is_safe' => ['html']]), + new TwigFilter('abbr_method', [$this, 'abbrMethod'], ['is_safe' => ['html']]), + new TwigFilter('format_args', [$this, 'formatArgs'], ['is_safe' => ['html']]), + new TwigFilter('format_args_as_text', [$this, 'formatArgsAsText']), + new TwigFilter('file_excerpt', [$this, 'fileExcerpt'], ['is_safe' => ['html']]), + new TwigFilter('format_file', [$this, 'formatFile'], ['is_safe' => ['html']]), + new TwigFilter('format_file_from_text', [$this, 'formatFileFromText'], ['is_safe' => ['html']]), + new TwigFilter('format_log_message', [$this, 'formatLogMessage'], ['is_safe' => ['html']]), + new TwigFilter('file_link', [$this, 'getFileLink']), + ]; } public function abbrClass($class) @@ -87,7 +87,7 @@ */ public function formatArgs($args) { - $result = array(); + $result = []; foreach ($args as $key => $item) { if ('object' === $item[0]) { $parts = explode('\\', $item[1]); @@ -146,7 +146,7 @@ }, $code); $content = explode('
', $code); - $lines = array(); + $lines = []; if (0 > $srcContext) { $srcContext = \count($content); } @@ -205,7 +205,7 @@ public function getFileLink($file, $line) { if ($fmt = $this->fileLinkFormat) { - return \is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line); + return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line); } return false; @@ -224,7 +224,7 @@ public function formatLogMessage($message, array $context) { if ($context && false !== strpos($message, '{')) { - $replacements = array(); + $replacements = []; foreach ($context as $key => $val) { if (is_scalar($val)) { $replacements['{'.$key.'}'] = $val; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/DumpExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/DumpExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/DumpExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/DumpExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,14 +37,14 @@ public function getFunctions() { - return array( - new TwigFunction('dump', array($this, 'dump'), array('is_safe' => array('html'), 'needs_context' => true, 'needs_environment' => true)), - ); + return [ + new TwigFunction('dump', [$this, 'dump'], ['is_safe' => ['html'], 'needs_context' => true, 'needs_environment' => true]), + ]; } public function getTokenParsers() { - return array(new DumpTokenParser()); + return [new DumpTokenParser()]; } public function getName() @@ -59,14 +59,14 @@ } if (2 === \func_num_args()) { - $vars = array(); + $vars = []; foreach ($context as $key => $value) { if (!$value instanceof Template) { $vars[$key] = $value; } } - $vars = array($vars); + $vars = [$vars]; } else { $vars = \func_get_args(); unset($vars[0], $vars[1]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/ExpressionExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/ExpressionExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/ExpressionExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/ExpressionExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,9 +27,9 @@ */ public function getFunctions() { - return array( - new TwigFunction('expression', array($this, 'createExpression')), - ); + return [ + new TwigFunction('expression', [$this, 'createExpression']), + ]; } public function createExpression($expression) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/FormExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/FormExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/FormExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/FormExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,10 +65,10 @@ */ public function getTokenParsers() { - return array( + return [ // {% form_theme form "SomeBundle::widgets.twig" %} new FormThemeTokenParser(), - ); + ]; } /** @@ -76,17 +76,17 @@ */ public function getFunctions() { - return array( - new TwigFunction('form_widget', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_errors', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_label', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_row', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_rest', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form', null, array('node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_start', null, array('node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('form_end', null, array('node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => array('html'))), - new TwigFunction('csrf_token', array('Symfony\Component\Form\FormRenderer', 'renderCsrfToken')), - ); + return [ + new TwigFunction('form_widget', null, ['node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_errors', null, ['node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_label', null, ['node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_row', null, ['node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_rest', null, ['node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_start', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('form_end', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]), + new TwigFunction('csrf_token', ['Symfony\Component\Form\FormRenderer', 'renderCsrfToken']), + ]; } /** @@ -94,10 +94,10 @@ */ public function getFilters() { - return array( - new TwigFilter('humanize', array('Symfony\Component\Form\FormRenderer', 'humanize')), - new TwigFilter('form_encode_currency', array('Symfony\Component\Form\FormRenderer', 'encodeCurrency'), array('is_safe' => array('html'), 'needs_environment' => true)), - ); + return [ + new TwigFilter('humanize', ['Symfony\Component\Form\FormRenderer', 'humanize']), + new TwigFilter('form_encode_currency', ['Symfony\Component\Form\FormRenderer', 'encodeCurrency'], ['is_safe' => ['html'], 'needs_environment' => true]), + ]; } /** @@ -105,10 +105,10 @@ */ public function getTests() { - return array( + return [ new TwigTest('selectedchoice', 'Symfony\Bridge\Twig\Extension\twig_is_selected_choice'), new TwigTest('rootform', 'Symfony\Bridge\Twig\Extension\twig_is_root_form'), - ); + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,10 +38,10 @@ */ public function getFunctions() { - return array( - new TwigFunction('absolute_url', array($this, 'generateAbsoluteUrl')), - new TwigFunction('relative_path', array($this, 'generateRelativePath')), - ); + return [ + new TwigFunction('absolute_url', [$this, 'generateAbsoluteUrl']), + new TwigFunction('relative_path', [$this, 'generateRelativePath']), + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,14 +24,14 @@ { public function getFunctions() { - return array( - new TwigFunction('render', array(HttpKernelRuntime::class, 'renderFragment'), array('is_safe' => array('html'))), - new TwigFunction('render_*', array(HttpKernelRuntime::class, 'renderFragmentStrategy'), array('is_safe' => array('html'))), + return [ + new TwigFunction('render', [HttpKernelRuntime::class, 'renderFragment'], ['is_safe' => ['html']]), + new TwigFunction('render_*', [HttpKernelRuntime::class, 'renderFragmentStrategy'], ['is_safe' => ['html']]), new TwigFunction('controller', static::class.'::controller'), - ); + ]; } - public static function controller($controller, $attributes = array(), $query = array()) + public static function controller($controller, $attributes = [], $query = []) { return new ControllerReference($controller, $attributes, $query); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,7 +38,7 @@ * * @see FragmentHandler::render() */ - public function renderFragment($uri, $options = array()) + public function renderFragment($uri, $options = []) { $strategy = isset($options['strategy']) ? $options['strategy'] : 'inline'; unset($options['strategy']); @@ -57,7 +57,7 @@ * * @see FragmentHandler::render() */ - public function renderFragmentStrategy($strategy, $uri, $options = array()) + public function renderFragmentStrategy($strategy, $uri, $options = []) { return $this->handler->render($uri, $strategy, $options); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/LogoutUrlExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/LogoutUrlExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/LogoutUrlExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/LogoutUrlExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,10 +34,10 @@ */ public function getFunctions() { - return array( - new TwigFunction('logout_url', array($this, 'getLogoutUrl')), - new TwigFunction('logout_path', array($this, 'getLogoutPath')), - ); + return [ + new TwigFunction('logout_url', [$this, 'getLogoutUrl']), + new TwigFunction('logout_path', [$this, 'getLogoutPath']), + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,10 +39,10 @@ */ public function getFunctions() { - return array( - new TwigFunction('url', array($this, 'getUrl'), array('is_safe_callback' => array($this, 'isUrlGenerationSafe'))), - new TwigFunction('path', array($this, 'getPath'), array('is_safe_callback' => array($this, 'isUrlGenerationSafe'))), - ); + return [ + new TwigFunction('url', [$this, 'getUrl'], ['is_safe_callback' => [$this, 'isUrlGenerationSafe']]), + new TwigFunction('path', [$this, 'getPath'], ['is_safe_callback' => [$this, 'isUrlGenerationSafe']]), + ]; } /** @@ -52,7 +52,7 @@ * * @return string */ - public function getPath($name, $parameters = array(), $relative = false) + public function getPath($name, $parameters = [], $relative = false) { return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH); } @@ -64,7 +64,7 @@ * * @return string */ - public function getUrl($name, $parameters = array(), $schemeRelative = false) + public function getUrl($name, $parameters = [], $schemeRelative = false) { return $this->generator->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL); } @@ -103,10 +103,10 @@ if (null === $paramsNode || $paramsNode instanceof ArrayExpression && \count($paramsNode) <= 2 && (!$paramsNode->hasNode(1) || $paramsNode->getNode(1) instanceof ConstantExpression) ) { - return array('html'); + return ['html']; } - return array(); + return []; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/SecurityExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,9 +53,9 @@ */ public function getFunctions() { - return array( - new TwigFunction('is_granted', array($this, 'isGranted')), - ); + return [ + new TwigFunction('is_granted', [$this, 'isGranted']), + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,14 +38,14 @@ public function getTokenParsers() { - return array( + return [ /* * {% stopwatch foo %} * Some stuff which will be recorded on the timeline * {% endstopwatch %} */ new StopwatchTokenParser(null !== $this->stopwatch && $this->enabled), - ); + ]; } public function getName() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -48,10 +48,10 @@ */ public function getFilters() { - return array( - new TwigFilter('trans', array($this, 'trans')), - new TwigFilter('transchoice', array($this, 'transchoice')), - ); + return [ + new TwigFilter('trans', [$this, 'trans']), + new TwigFilter('transchoice', [$this, 'transchoice']), + ]; } /** @@ -61,7 +61,7 @@ */ public function getTokenParsers() { - return array( + return [ // {% trans %}Symfony is great!{% endtrans %} new TransTokenParser(), @@ -72,7 +72,7 @@ // {% trans_default_domain "foobar" %} new TransDefaultDomainTokenParser(), - ); + ]; } /** @@ -80,7 +80,7 @@ */ public function getNodeVisitors() { - return array($this->getTranslationNodeVisitor(), new TranslationDefaultDomainNodeVisitor()); + return [$this->getTranslationNodeVisitor(), new TranslationDefaultDomainNodeVisitor()]; } public function getTranslationNodeVisitor() @@ -88,7 +88,7 @@ return $this->translationNodeVisitor ?: $this->translationNodeVisitor = new TranslationNodeVisitor(); } - public function trans($message, array $arguments = array(), $domain = null, $locale = null) + public function trans($message, array $arguments = [], $domain = null, $locale = null) { if (null === $this->translator) { return strtr($message, $arguments); @@ -97,13 +97,13 @@ return $this->translator->trans($message, $arguments, $domain, $locale); } - public function transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null) + public function transchoice($message, $count, array $arguments = [], $domain = null, $locale = null) { if (null === $this->translator) { return strtr($message, $arguments); } - return $this->translator->transChoice($message, $count, array_merge(array('%count%' => $count), $arguments), $domain, $locale); + return $this->translator->transChoice($message, $count, array_merge(['%count%' => $count], $arguments), $domain, $locale); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,14 +36,14 @@ */ public function getFunctions() { - return array( - new TwigFunction('link', array($this, 'link')), - new TwigFunction('preload', array($this, 'preload')), - new TwigFunction('dns_prefetch', array($this, 'dnsPrefetch')), - new TwigFunction('preconnect', array($this, 'preconnect')), - new TwigFunction('prefetch', array($this, 'prefetch')), - new TwigFunction('prerender', array($this, 'prerender')), - ); + return [ + new TwigFunction('link', [$this, 'link']), + new TwigFunction('preload', [$this, 'preload']), + new TwigFunction('dns_prefetch', [$this, 'dnsPrefetch']), + new TwigFunction('preconnect', [$this, 'preconnect']), + new TwigFunction('prefetch', [$this, 'prefetch']), + new TwigFunction('prerender', [$this, 'prerender']), + ]; } /** @@ -51,11 +51,11 @@ * * @param string $uri The relation URI * @param string $rel The relation type (e.g. "preload", "prefetch", "prerender" or "dns-prefetch") - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]") * * @return string The relation URI */ - public function link($uri, $rel, array $attributes = array()) + public function link($uri, $rel, array $attributes = []) { if (!$request = $this->requestStack->getMasterRequest()) { return $uri; @@ -76,11 +76,11 @@ * Preloads a resource. * * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('crossorigin' => 'use-credentials')") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['crossorigin' => 'use-credentials']") * * @return string The path of the asset */ - public function preload($uri, array $attributes = array()) + public function preload($uri, array $attributes = []) { return $this->link($uri, 'preload', $attributes); } @@ -89,11 +89,11 @@ * Resolves a resource origin as early as possible. * * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]") * * @return string The path of the asset */ - public function dnsPrefetch($uri, array $attributes = array()) + public function dnsPrefetch($uri, array $attributes = []) { return $this->link($uri, 'dns-prefetch', $attributes); } @@ -102,11 +102,11 @@ * Initiates a early connection to a resource (DNS resolution, TCP handshake, TLS negotiation). * * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]") * * @return string The path of the asset */ - public function preconnect($uri, array $attributes = array()) + public function preconnect($uri, array $attributes = []) { return $this->link($uri, 'preconnect', $attributes); } @@ -115,11 +115,11 @@ * Indicates to the client that it should prefetch this resource. * * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]") * * @return string The path of the asset */ - public function prefetch($uri, array $attributes = array()) + public function prefetch($uri, array $attributes = []) { return $this->link($uri, 'prefetch', $attributes); } @@ -128,11 +128,11 @@ * Indicates to the client that it should prerender this resource . * * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]") * * @return string The path of the asset */ - public function prerender($uri, array $attributes = array()) + public function prerender($uri, array $attributes = []) { return $this->link($uri, 'prerender', $attributes); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,12 +32,12 @@ public function getFunctions() { - return array( - new TwigFunction('workflow_can', array($this, 'canTransition')), - new TwigFunction('workflow_transitions', array($this, 'getEnabledTransitions')), - new TwigFunction('workflow_has_marked_place', array($this, 'hasMarkedPlace')), - new TwigFunction('workflow_marked_places', array($this, 'getMarkedPlaces')), - ); + return [ + new TwigFunction('workflow_can', [$this, 'canTransition']), + new TwigFunction('workflow_transitions', [$this, 'getEnabledTransitions']), + new TwigFunction('workflow_has_marked_place', [$this, 'hasMarkedPlace']), + new TwigFunction('workflow_marked_places', [$this, 'getMarkedPlaces']), + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/YamlExtension.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/YamlExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Extension/YamlExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Extension/YamlExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,10 +28,10 @@ */ public function getFilters() { - return array( - new TwigFilter('yaml_encode', array($this, 'encode')), - new TwigFilter('yaml_dump', array($this, 'dump')), - ); + return [ + new TwigFilter('yaml_encode', [$this, 'encode']), + new TwigFilter('yaml_dump', [$this, 'dump']), + ]; } public function encode($input, $inline = 0, $dumpObjects = 0) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ */ private $template; - public function __construct(array $defaultThemes = array(), Environment $environment = null) + public function __construct(array $defaultThemes = [], Environment $environment = null) { if (null === $environment) { @trigger_error(sprintf('Not passing a Twig Environment as the second argument for "%s" constructor is deprecated since Symfony 3.2 and won\'t be possible in 4.0.', static::class), E_USER_DEPRECATED); @@ -58,7 +58,7 @@ /** * {@inheritdoc} */ - public function renderBlock(FormView $view, $resource, $blockName, array $variables = array()) + public function renderBlock(FormView $view, $resource, $blockName, array $variables = []) { $cacheKey = $view->vars[self::CACHE_KEY_VAR]; @@ -187,7 +187,7 @@ // theme is a reference and we don't want to change it. $currentTheme = $theme; - $context = $this->environment->mergeGlobals(array()); + $context = $this->environment->mergeGlobals([]); // The do loop takes care of template inheritance. // Add blocks from all templates in the inheritance tree, but avoid diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/DumpNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/DumpNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/DumpNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/DumpNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,12 +23,12 @@ public function __construct($varPrefix, Node $values = null, $lineno, $tag = null) { - $nodes = array(); + $nodes = []; if (null !== $values) { $nodes['values'] = $values; } - parent::__construct($nodes, array(), $lineno, $tag); + parent::__construct($nodes, [], $lineno, $tag); $this->varPrefix = $varPrefix; } @@ -44,7 +44,7 @@ if (!$this->hasNode('values')) { // remove embedded templates (macros) from the context $compiler - ->write(sprintf('$%svars = array();'."\n", $this->varPrefix)) + ->write(sprintf('$%svars = [];'."\n", $this->varPrefix)) ->write(sprintf('foreach ($context as $%1$skey => $%1$sval) {'."\n", $this->varPrefix)) ->indent() ->write(sprintf('if (!$%sval instanceof \Twig\Template) {'."\n", $this->varPrefix)) @@ -65,7 +65,7 @@ } else { $compiler ->addDebugInfo($this) - ->write('\Symfony\Component\VarDumper\VarDumper::dump(array('."\n") + ->write('\Symfony\Component\VarDumper\VarDumper::dump(['."\n") ->indent(); foreach ($values as $node) { $compiler->write(''); @@ -80,7 +80,7 @@ } $compiler ->outdent() - ->write("));\n"); + ->write("]);\n"); } $compiler diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/FormThemeNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/FormThemeNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/FormThemeNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/FormThemeNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { public function __construct(Node $form, Node $resources, $lineno, $tag = null, $only = false) { - parent::__construct(array('form' => $form, 'resources' => $resources), array('only' => (bool) $only), $lineno, $tag); + parent::__construct(['form' => $form, 'resources' => $resources], ['only' => (bool) $only], $lineno, $tag); } public function compile(Compiler $compiler) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,7 +53,7 @@ // Only insert the label into the array if it is not empty if (!twig_test_empty($label->getAttribute('value'))) { $originalVariables = $variables; - $variables = new ArrayExpression(array(), $lineno); + $variables = new ArrayExpression([], $lineno); $labelKey = new ConstantExpression('label', $lineno); if (null !== $originalVariables) { @@ -100,7 +100,7 @@ // If not, add it to the array at runtime. $compiler->raw('(twig_test_empty($_label_ = '); $compiler->subcompile($label); - $compiler->raw(') ? array() : array("label" => $_label_))'); + $compiler->raw(') ? [] : ["label" => $_label_])'); } } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/StopwatchNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/StopwatchNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/StopwatchNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/StopwatchNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { public function __construct(Node $name, Node $body, AssignNameExpression $var, $lineno = 0, $tag = null) { - parent::__construct(array('body' => $body, 'name' => $name, 'var' => $var), array(), $lineno, $tag); + parent::__construct(['body' => $body, 'name' => $name, 'var' => $var], [], $lineno, $tag); } public function compile(Compiler $compiler) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { public function __construct(AbstractExpression $expr, $lineno = 0, $tag = null) { - parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + parent::__construct(['expr' => $expr], [], $lineno, $tag); } public function compile(Compiler $compiler) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/TransNode.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/TransNode.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Node/TransNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Node/TransNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ { public function __construct(Node $body, Node $domain = null, AbstractExpression $count = null, AbstractExpression $vars = null, AbstractExpression $locale = null, $lineno = 0, $tag = null) { - $nodes = array('body' => $body); + $nodes = ['body' => $body]; if (null !== $domain) { $nodes['domain'] = $domain; } @@ -43,14 +43,14 @@ $nodes['locale'] = $locale; } - parent::__construct($nodes, array(), $lineno, $tag); + parent::__construct($nodes, [], $lineno, $tag); } public function compile(Compiler $compiler) { $compiler->addDebugInfo($this); - $defaults = new ArrayExpression(array(), -1); + $defaults = new ArrayExpression([], -1); if ($this->hasNode('vars') && ($vars = $this->getNode('vars')) instanceof ArrayExpression) { $defaults = $this->getNode('vars'); $vars = null; @@ -109,7 +109,7 @@ } elseif ($body instanceof TextNode) { $msg = $body->getAttribute('data'); } else { - return array($body, $vars); + return [$body, $vars]; } preg_match_all('/(?getTemplateLine()), $vars); + return [new ConstantExpression(str_replace('%%', '%', trim($msg)), $body->getTemplateLine()), $vars]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php 2019-02-03 12:23:08.000000000 +0000 @@ -17,7 +17,7 @@ class Scope { private $parent; - private $data = array(); + private $data = []; private $left = false; public function __construct(self $parent = null) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php 2019-02-03 12:23:08.000000000 +0000 @@ -56,7 +56,7 @@ $name = new AssignNameExpression($var, $node->getTemplateLine()); $this->scope->set('domain', new NameExpression($var, $node->getTemplateLine())); - return new SetNode(false, new Node(array($name)), new Node(array($node->getNode('expr'))), $node->getTemplateLine()); + return new SetNode(false, new Node([$name]), new Node([$node->getNode('expr')]), $node->getTemplateLine()); } } @@ -64,7 +64,7 @@ return $node; } - if ($node instanceof FilterExpression && \in_array($node->getNode('filter')->getAttribute('value'), array('trans', 'transchoice'))) { + if ($node instanceof FilterExpression && \in_array($node->getNode('filter')->getAttribute('value'), ['trans', 'transchoice'])) { $arguments = $node->getNode('arguments'); $ind = 'trans' === $node->getNode('filter')->getAttribute('value') ? 1 : 2; if ($this->isNamedArguments($arguments)) { @@ -74,7 +74,7 @@ } else { if (!$arguments->hasNode($ind)) { if (!$arguments->hasNode($ind - 1)) { - $arguments->setNode($ind - 1, new ArrayExpression(array(), $node->getTemplateLine())); + $arguments->setNode($ind - 1, new ArrayExpression([], $node->getTemplateLine())); } $arguments->setNode($ind, $this->scope->get('domain')); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,18 +28,18 @@ const UNDEFINED_DOMAIN = '_undefined'; private $enabled = false; - private $messages = array(); + private $messages = []; public function enable() { $this->enabled = true; - $this->messages = array(); + $this->messages = []; } public function disable() { $this->enabled = false; - $this->messages = array(); + $this->messages = []; } public function getMessages() @@ -62,26 +62,26 @@ $node->getNode('node') instanceof ConstantExpression ) { // extract constant nodes with a trans filter - $this->messages[] = array( + $this->messages[] = [ $node->getNode('node')->getAttribute('value'), $this->getReadDomainFromArguments($node->getNode('arguments'), 1), - ); + ]; } elseif ( $node instanceof FilterExpression && 'transchoice' === $node->getNode('filter')->getAttribute('value') && $node->getNode('node') instanceof ConstantExpression ) { // extract constant nodes with a trans filter - $this->messages[] = array( + $this->messages[] = [ $node->getNode('node')->getAttribute('value'), $this->getReadDomainFromArguments($node->getNode('arguments'), 2), - ); + ]; } elseif ($node instanceof TransNode) { // extract trans nodes - $this->messages[] = array( + $this->messages[] = [ $node->getNode('body')->getAttribute('data'), $node->hasNode('domain') ? $this->getReadDomainFromNode($node->getNode('domain')) : null, - ); + ]; } return $node; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,10 +32,10 @@ public function debugDataProvider() { - return array( - 'debug on' => array(true), - 'debug off' => array(false), - ); + return [ + 'debug on' => [true], + 'debug off' => [false], + ]; } public function testEnvironment() @@ -166,7 +166,7 @@ { $this->setRequestStack(null); - $this->assertEquals(array(), $this->appVariable->getFlashes()); + $this->assertEquals([], $this->appVariable->getFlashes()); } /** @@ -190,15 +190,15 @@ $this->assertEquals($flashMessages, $this->appVariable->getFlashes('')); $flashMessages = $this->setFlashMessages(); - $this->assertEquals($flashMessages, $this->appVariable->getFlashes(array())); + $this->assertEquals($flashMessages, $this->appVariable->getFlashes([])); $flashMessages = $this->setFlashMessages(); - $this->assertEquals(array(), $this->appVariable->getFlashes('this-does-not-exist')); + $this->assertEquals([], $this->appVariable->getFlashes('this-does-not-exist')); $flashMessages = $this->setFlashMessages(); $this->assertEquals( - array('this-does-not-exist' => array()), - $this->appVariable->getFlashes(array('this-does-not-exist')) + ['this-does-not-exist' => []], + $this->appVariable->getFlashes(['this-does-not-exist']) ); $flashMessages = $this->setFlashMessages(); @@ -206,31 +206,31 @@ $flashMessages = $this->setFlashMessages(); $this->assertEquals( - array('notice' => $flashMessages['notice']), - $this->appVariable->getFlashes(array('notice')) + ['notice' => $flashMessages['notice']], + $this->appVariable->getFlashes(['notice']) ); $flashMessages = $this->setFlashMessages(); $this->assertEquals( - array('notice' => $flashMessages['notice'], 'this-does-not-exist' => array()), - $this->appVariable->getFlashes(array('notice', 'this-does-not-exist')) + ['notice' => $flashMessages['notice'], 'this-does-not-exist' => []], + $this->appVariable->getFlashes(['notice', 'this-does-not-exist']) ); $flashMessages = $this->setFlashMessages(); $this->assertEquals( - array('notice' => $flashMessages['notice'], 'error' => $flashMessages['error']), - $this->appVariable->getFlashes(array('notice', 'error')) + ['notice' => $flashMessages['notice'], 'error' => $flashMessages['error']], + $this->appVariable->getFlashes(['notice', 'error']) ); $this->assertEquals( - array('warning' => $flashMessages['warning']), - $this->appVariable->getFlashes(array('warning')), + ['warning' => $flashMessages['warning']], + $this->appVariable->getFlashes(['warning']), 'After getting some flash types (e.g. "notice" and "error"), the rest of flash messages must remain (e.g. "warning").' ); $this->assertEquals( - array('this-does-not-exist' => array()), - $this->appVariable->getFlashes(array('this-does-not-exist')) + ['this-does-not-exist' => []], + $this->appVariable->getFlashes(['this-does-not-exist']) ); } @@ -255,11 +255,11 @@ private function setFlashMessages($sessionHasStarted = true) { - $flashMessages = array( - 'notice' => array('Notice #1 message'), - 'warning' => array('Warning #1 message'), - 'error' => array('Error #1 message', 'Error #2 message'), - ); + $flashMessages = [ + 'notice' => ['Notice #1 message'], + 'warning' => ['Warning #1 message'], + 'error' => ['Error #1 message', 'Error #2 message'], + ]; $flashBag = new FlashBag(); $flashBag->initialize($flashMessages); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,7 +23,7 @@ public function testDebugCommand() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array(), array('decorated' => false)); + $ret = $tester->execute([], ['decorated' => false]); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); $this->assertContains('Functions', trim($tester->getDisplay())); @@ -33,12 +33,12 @@ { // these paths aren't realistic, // they're configured to force the line separator - $tester = $this->createCommandTester(array( - 'Acme' => array('extractor', 'extractor'), - '!Acme' => array('extractor', 'extractor'), - FilesystemLoader::MAIN_NAMESPACE => array('extractor', 'extractor'), - )); - $ret = $tester->execute(array(), array('decorated' => false)); + $tester = $this->createCommandTester([ + 'Acme' => ['extractor', 'extractor'], + '!Acme' => ['extractor', 'extractor'], + FilesystemLoader::MAIN_NAMESPACE => ['extractor', 'extractor'], + ]); + $ret = $tester->execute([], ['decorated' => false]); $ds = \DIRECTORY_SEPARATOR; $loaderPaths = <<assertContains($loaderPaths, trim($tester->getDisplay(true))); } - private function createCommandTester(array $paths = array()) + private function createCommandTester(array $paths = []) { - $filesystemLoader = new FilesystemLoader(array(), \dirname(__DIR__).'/Fixtures'); + $filesystemLoader = new FilesystemLoader([], \dirname(__DIR__).'/Fixtures'); foreach ($paths as $namespace => $relDirs) { foreach ($relDirs as $relDir) { $filesystemLoader->addPath($relDir, $namespace); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ $tester = $this->createCommandTester(); $filename = $this->createFile('{{ foo }}'); - $ret = $tester->execute(array('filename' => array($filename)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)); + $ret = $tester->execute(['filename' => [$filename]], ['verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false]); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); $this->assertContains('OK in', trim($tester->getDisplay())); @@ -39,7 +39,7 @@ $tester = $this->createCommandTester(); $filename = $this->createFile('{{ foo'); - $ret = $tester->execute(array('filename' => array($filename)), array('decorated' => false)); + $ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]); $this->assertEquals(1, $ret, 'Returns 1 in case of error'); $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay())); @@ -54,7 +54,7 @@ $filename = $this->createFile(''); unlink($filename); - $ret = $tester->execute(array('filename' => array($filename)), array('decorated' => false)); + $ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]); } public function testLintFileCompileTimeException() @@ -62,7 +62,7 @@ $tester = $this->createCommandTester(); $filename = $this->createFile("{{ 2|number_format(2, decimal_point='.', ',') }}"); - $ret = $tester->execute(array('filename' => array($filename)), array('decorated' => false)); + $ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]); $this->assertEquals(1, $ret, 'Returns 1 in case of error'); $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay())); @@ -83,7 +83,7 @@ $command = $application->find('lint:twig'); $tester = new CommandTester($command); - $tester->execute(array()); + $tester->execute([]); } /** @@ -115,7 +115,7 @@ protected function setUp() { - $this->files = array(); + $this->files = []; } protected function tearDown() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -17,7 +17,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType'); $view = $form->createView(); - $this->renderWidget($view, array('label' => 'foo')); + $this->renderWidget($view, ['label' => 'foo']); $html = $this->renderLabel($view); $this->assertMatchesXpath($html, @@ -31,11 +31,11 @@ public function testLabelDoesNotRenderFieldAttributes() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -48,11 +48,11 @@ public function testLabelWithCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -65,11 +65,11 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), 'Custom label', array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), 'Custom label', [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -82,14 +82,14 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'label' => 'Custom label', - )); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + ]); + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -102,10 +102,10 @@ public function testStartTag() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )); + ]); $html = $this->renderStart($form->createView()); @@ -114,25 +114,25 @@ public function testStartTagWithOverriddenVars() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'put', 'action' => 'http://example.com/directory', - )); + ]); - $html = $this->renderStart($form->createView(), array( + $html = $this->renderStart($form->createView(), [ 'method' => 'post', 'action' => 'http://foo.com/directory', - )); + ]); $this->assertSame('
', $html); } public function testStartTagForMultipartForm() { - $form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )) + ]) ->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType') ->getForm(); @@ -143,14 +143,14 @@ public function testStartTagWithExtraAttributes() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )); + ]); - $html = $this->renderStart($form->createView(), array( - 'attr' => array('class' => 'foobar'), - )); + $html = $this->renderStart($form->createView(), [ + 'attr' => ['class' => 'foobar'], + ]); $this->assertSame('', $html); } @@ -159,7 +159,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'); $view = $form->createView(); - $html = $this->renderRow($view, array('label' => 'foo')); + $html = $this->renderRow($view, ['label' => 'foo']); $this->assertMatchesXpath($html, '/div[@class="form-group"]/div[@class="col-sm-2" or @class="col-sm-10"]', 2); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType'); $view = $form->createView(); - $this->renderWidget($view, array('label' => 'foo')); + $this->renderWidget($view, ['label' => 'foo']); $html = $this->renderLabel($view); $this->assertMatchesXpath($html, @@ -34,11 +34,11 @@ public function testLabelDoesNotRenderFieldAttributes() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -51,11 +51,11 @@ public function testLabelWithCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -68,11 +68,11 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), 'Custom label', array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), 'Custom label', [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -85,14 +85,14 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'label' => 'Custom label', - )); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + ]); + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -158,7 +158,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', true); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="checkbox"] [ @@ -176,7 +176,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', false); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="checkbox"] [ @@ -192,11 +192,11 @@ public function testCheckboxWithValue() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', false, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', false, [ 'value' => 'foo&bar', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="checkbox"] [ @@ -212,13 +212,13 @@ public function testSingleChoice() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -234,14 +234,14 @@ public function testSingleChoiceAttributesWithMainAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, - 'attr' => array('class' => 'bar&baz'), - )); + 'attr' => ['class' => 'bar&baz'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'bar&baz')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'bar&baz']], '/select [@name="name"] [@class="bar&baz form-control"] @@ -257,14 +257,14 @@ public function testSingleExpandedChoiceAttributesWithMainAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, - 'attr' => array('class' => 'bar&baz'), - )); + 'attr' => ['class' => 'bar&baz'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'bar&baz')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'bar&baz']], '/div [@class="bar&baz"] [ @@ -294,14 +294,14 @@ public function testSelectWithSizeBiggerThanOneCanBeRequired() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, array( - 'choices' => array('a', 'b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, [ + 'choices' => ['a', 'b'], 'multiple' => false, 'expanded' => false, - 'attr' => array('size' => 2), - )); + 'attr' => ['size' => 2], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => '')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => '']], '/select [@name="name"] [@required="required"] @@ -313,14 +313,14 @@ public function testSingleChoiceWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, 'choice_translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -336,16 +336,16 @@ public function testSingleChoiceWithPlaceholderWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, 'required' => false, 'translation_domain' => false, 'placeholder' => 'Placeholder&Not&Translated', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -362,14 +362,14 @@ public function testSingleChoiceAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -385,14 +385,14 @@ public function testSingleChoiceWithPreferred() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'preferred_choices' => array('&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'preferred_choices' => ['&b'], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('separator' => '-- sep --', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['separator' => '-- sep --', 'attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -409,14 +409,14 @@ public function testSingleChoiceWithPreferredAndNoSeparator() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'preferred_choices' => array('&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'preferred_choices' => ['&b'], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('separator' => null, 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['separator' => null, 'attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -432,14 +432,14 @@ public function testSingleChoiceWithPreferredAndBlankSeparator() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'preferred_choices' => array('&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'preferred_choices' => ['&b'], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('separator' => '', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['separator' => '', 'attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -456,14 +456,14 @@ public function testChoiceWithOnlyPreferred() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'preferred_choices' => array('&a', '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'preferred_choices' => ['&a', '&b'], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@class="my&class form-control"] [count(./option)=2] @@ -473,14 +473,14 @@ public function testSingleChoiceNonRequired() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => false, 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -497,14 +497,14 @@ public function testSingleChoiceNonRequiredNoneSelected() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => false, 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -521,15 +521,15 @@ public function testSingleChoiceNonRequiredWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'Select&Anything&Not&Me', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -546,15 +546,15 @@ public function testSingleChoiceRequiredWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => true, 'multiple' => false, 'expanded' => false, 'placeholder' => 'Test&Me', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -571,14 +571,14 @@ public function testSingleChoiceRequiredWithPlaceholderViaView() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => true, 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('placeholder' => '', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['placeholder' => '', 'attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -595,16 +595,16 @@ public function testSingleChoiceGrouped() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array( - 'Group&1' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'Group&2' => array('Choice&C' => '&c'), - ), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => [ + 'Group&1' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'Group&2' => ['Choice&C' => '&c'], + ], 'multiple' => false, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -626,14 +626,14 @@ public function testMultipleChoice() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => true, 'multiple' => true, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name[]"] [@class="my&class form-control"] @@ -650,15 +650,15 @@ public function testMultipleChoiceAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'required' => true, 'multiple' => true, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name[]"] [@class="my&class form-control"] @@ -675,14 +675,14 @@ public function testMultipleChoiceSkipsPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => true, 'expanded' => false, 'placeholder' => 'Test&Me', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name[]"] [@class="my&class form-control"] @@ -698,14 +698,14 @@ public function testMultipleChoiceNonRequired() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'required' => false, 'multiple' => true, 'expanded' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name[]"] [@class="my&class form-control"] @@ -721,13 +721,13 @@ public function testSingleChoiceExpanded() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -756,14 +756,14 @@ public function testSingleChoiceExpandedWithLabelsAsFalse() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => false, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -790,8 +790,8 @@ public function testSingleChoiceExpandedWithLabelsSetByCallable() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'choice_label' => function ($choice, $label, $value) { if ('&b' === $choice) { return false; @@ -801,9 +801,9 @@ }, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -840,16 +840,16 @@ public function testSingleChoiceExpandedWithLabelsSetFalseByCallable() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => function () { return false; }, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -876,14 +876,14 @@ public function testSingleChoiceExpandedWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'choice_translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -912,14 +912,14 @@ public function testSingleChoiceExpandedAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -948,15 +948,15 @@ public function testSingleChoiceExpandedWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'placeholder' => 'Test&Me', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -994,16 +994,16 @@ public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'required' => false, 'choice_translation_domain' => false, 'placeholder' => 'Placeholder&Not&Translated', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1041,13 +1041,13 @@ public function testSingleChoiceExpandedWithBooleanValue() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', true, array( - 'choices' => array('Choice&A' => '1', 'Choice&B' => '0'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', true, [ + 'choices' => ['Choice&A' => '1', 'Choice&B' => '0'], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1076,14 +1076,14 @@ public function testMultipleChoiceExpanded() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'multiple' => true, 'expanded' => true, 'required' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1121,14 +1121,14 @@ public function testMultipleChoiceExpandedWithLabelsAsFalse() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => false, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1155,8 +1155,8 @@ public function testMultipleChoiceExpandedWithLabelsSetByCallable() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'choice_label' => function ($choice, $label, $value) { if ('&b' === $choice) { return false; @@ -1166,9 +1166,9 @@ }, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1205,16 +1205,16 @@ public function testMultipleChoiceExpandedWithLabelsSetFalseByCallable() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => function () { return false; }, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1241,15 +1241,15 @@ public function testMultipleChoiceExpandedWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'multiple' => true, 'expanded' => true, 'required' => true, 'choice_translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1287,15 +1287,15 @@ public function testMultipleChoiceExpandedAttributes() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'multiple' => true, 'expanded' => true, 'required' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -1335,7 +1335,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CountryType', 'AT'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -1347,12 +1347,12 @@ public function testCountryWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CountryType', 'AT', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CountryType', 'AT', [ 'placeholder' => 'Select&Country', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -1365,12 +1365,12 @@ public function testDateTime() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', [ 'input' => 'string', 'with_seconds' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [ ./select @@ -1401,13 +1401,13 @@ public function testDateTimeWithPlaceholderGlobal() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', null, [ 'input' => 'string', 'placeholder' => 'Change&Me', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1439,14 +1439,14 @@ public function testDateTimeWithHourAndMinute() { - $data = array('year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5'); + $data = ['year' => date('Y'), 'month' => '2', 'day' => '3', 'hour' => '4', 'minute' => '5']; - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', $data, [ 'input' => 'array', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1478,12 +1478,12 @@ public function testDateTimeWithSeconds() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', date('Y').'-02-03 04:05:06', [ 'input' => 'string', 'with_seconds' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1519,13 +1519,13 @@ public function testDateTimeSingleText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', [ 'input' => 'string', 'date_widget' => 'single_text', 'time_widget' => 'single_text', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1548,14 +1548,14 @@ public function testDateTimeWithWidgetSingleText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', [ 'input' => 'string', 'widget' => 'single_text', 'model_timezone' => 'UTC', 'view_timezone' => 'UTC', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="datetime-local"] [@name="name"] @@ -1567,16 +1567,16 @@ public function testDateTimeWithWidgetSingleTextIgnoreDateAndTimeWidgets() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', [ 'input' => 'string', 'date_widget' => 'choice', 'time_widget' => 'choice', 'widget' => 'single_text', 'model_timezone' => 'UTC', 'view_timezone' => 'UTC', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="datetime-local"] [@name="name"] @@ -1588,12 +1588,12 @@ public function testDateChoice() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', [ 'input' => 'string', 'widget' => 'choice', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1617,14 +1617,14 @@ public function testDateChoiceWithPlaceholderGlobal() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, [ 'input' => 'string', 'widget' => 'choice', 'placeholder' => 'Change&Me', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1648,14 +1648,14 @@ public function testDateChoiceWithPlaceholderOnYear() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, [ 'input' => 'string', 'widget' => 'choice', 'required' => false, - 'placeholder' => array('year' => 'Change&Me'), - )); + 'placeholder' => ['year' => 'Change&Me'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1679,12 +1679,12 @@ public function testDateText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', [ 'input' => 'string', 'widget' => 'text', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1711,12 +1711,12 @@ public function testDateSingleText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', '2011-02-03', [ 'input' => 'string', 'widget' => 'single_text', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="date"] [@name="name"] @@ -1728,11 +1728,11 @@ public function testBirthDay() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\BirthdayType', '2000-02-03', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\BirthdayType', '2000-02-03', [ 'input' => 'string', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1756,13 +1756,13 @@ public function testBirthDayWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\BirthdayType', '1950-01-01', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\BirthdayType', '1950-01-01', [ 'input' => 'string', 'placeholder' => '', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -1791,7 +1791,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\EmailType', 'foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="email"] [@name="name"] @@ -1804,11 +1804,11 @@ public function testEmailWithMaxLength() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\EmailType', 'foo&bar', array( - 'attr' => array('maxlength' => 123), - )); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\EmailType', 'foo&bar', [ + 'attr' => ['maxlength' => 123], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="email"] [@name="name"] @@ -1823,7 +1823,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\HiddenType', 'foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="hidden"] [@name="name"] @@ -1835,11 +1835,11 @@ public function testDisabled() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'disabled' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="text"] [@name="name"] @@ -1853,7 +1853,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\IntegerType', 123); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="number"] [@name="name"] @@ -1867,7 +1867,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\LanguageType', 'de'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -1881,7 +1881,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\LocaleType', 'de_AT'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -1893,11 +1893,11 @@ public function testMoney() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, [ 'currency' => 'EUR', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="input-group"] [ @@ -1917,11 +1917,11 @@ public function testMoneyWithoutCurrency() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, [ 'currency' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/input [@id="my&id"] [@type="text"] @@ -1938,7 +1938,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="text"] [@name="name"] @@ -1952,7 +1952,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PasswordType', 'foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="password"] [@name="name"] @@ -1963,12 +1963,12 @@ public function testPasswordSubmittedWithNotAlwaysEmpty() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PasswordType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PasswordType', null, [ 'always_empty' => false, - )); + ]); $form->submit('foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="password"] [@name="name"] @@ -1980,11 +1980,11 @@ public function testPasswordWithMaxLength() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PasswordType', 'foo&bar', array( - 'attr' => array('maxlength' => 123), - )); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PasswordType', 'foo&bar', [ + 'attr' => ['maxlength' => 123], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="password"] [@name="name"] @@ -1998,7 +1998,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PercentType', 0.1); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="input-group"] [ @@ -2020,7 +2020,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', true); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="radio"] [ @@ -2044,7 +2044,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', false); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="radio"] [ @@ -2065,11 +2065,11 @@ public function testRadioWithValue() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', false, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', false, [ 'value' => 'foo&bar', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="radio"] [ @@ -2090,9 +2090,9 @@ public function testRange() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RangeType', 42, array('attr' => array('min' => 5))); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RangeType', 42, ['attr' => ['min' => 5]]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="range"] [@name="name"] @@ -2105,9 +2105,9 @@ public function testRangeWithMinMaxValues() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RangeType', 42, array('attr' => array('min' => 5, 'max' => 57))); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RangeType', 42, ['attr' => ['min' => 5, 'max' => 57]]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="range"] [@name="name"] @@ -2121,11 +2121,11 @@ public function testTextarea() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextareaType', 'foo&bar', array( - 'attr' => array('pattern' => 'foo'), - )); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextareaType', 'foo&bar', [ + 'attr' => ['pattern' => 'foo'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/textarea [@name="name"] [@pattern="foo"] @@ -2139,7 +2139,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="text"] [@name="name"] @@ -2152,11 +2152,11 @@ public function testTextWithMaxLength() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'foo&bar', array( - 'attr' => array('maxlength' => 123), - )); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'foo&bar', [ + 'attr' => ['maxlength' => 123], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="text"] [@name="name"] @@ -2171,7 +2171,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\SearchType', 'foo&bar'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="search"] [@name="name"] @@ -2184,12 +2184,12 @@ public function testTime() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', [ 'input' => 'string', 'with_seconds' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -2211,12 +2211,12 @@ public function testTimeWithSeconds() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', [ 'input' => 'string', 'with_seconds' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -2246,12 +2246,12 @@ public function testTimeText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', [ 'input' => 'string', 'widget' => 'text', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -2279,12 +2279,12 @@ public function testTimeSingleText() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', '04:05:06', [ 'input' => 'string', 'widget' => 'single_text', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="time"] [@name="name"] @@ -2297,13 +2297,13 @@ public function testTimeWithPlaceholderGlobal() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', null, [ 'input' => 'string', 'placeholder' => 'Change&Me', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -2324,13 +2324,13 @@ public function testTimeWithPlaceholderOnYear() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimeType', null, [ 'input' => 'string', 'required' => false, - 'placeholder' => array('hour' => 'Change&Me'), - )); + 'placeholder' => ['hour' => 'Change&Me'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/div [@class="my&class form-inline"] [ @@ -2353,7 +2353,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimezoneType', 'Europe/Vienna'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@name="name"] [@class="my&class form-control"] @@ -2370,12 +2370,12 @@ public function testTimezoneWithPlaceholder() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimezoneType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TimezoneType', null, [ 'placeholder' => 'Select&Timezone', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/select [@class="my&class form-control"] [./option[@value=""][not(@selected)][not(@disabled)][.="[trans]Select&Timezone[/trans]"]] @@ -2385,13 +2385,29 @@ ); } - public function testUrl() + public function testUrlWithDefaultProtocol() { $url = 'http://www.google.com?foo1=bar1&foo2=bar2'; - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url); + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url, ['default_protocol' => 'http']); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input + [@type="text"] + [@name="name"] + [@class="my&class form-control"] + [@value="http://www.google.com?foo1=bar1&foo2=bar2"] + [@inputmode="url"] +' + ); + } + + public function testUrlWithoutDefaultProtocol() + { + $url = 'http://www.google.com?foo1=bar1&foo2=bar2'; + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url, ['default_protocol' => null]); + + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], + '/input [@type="url"] [@name="name"] [@class="my&class form-control"] @@ -2404,18 +2420,18 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ButtonType'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/button[@type="button"][@name="name"][.="[trans]Name[/trans]"][@class="my&class btn"]' ); } public function testButtonlabelWithoutTranslation() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, [ 'translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/button[@type="button"][@name="name"][.="Name"][@class="my&class btn"]' ); } @@ -2424,7 +2440,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\SubmitType'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/button[@type="submit"][@name="name"][@class="my&class btn"]' ); } @@ -2433,18 +2449,18 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ResetType'); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/button[@type="reset"][@name="name"][@class="my&class btn"]' ); } public function testWidgetAttributes() { - $form = $this->factory->createNamed('text', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'value', array( + $form = $this->factory->createNamed('text', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'value', [ 'required' => true, 'disabled' => true, - 'attr' => array('readonly' => true, 'maxlength' => 10, 'pattern' => '\d+', 'class' => 'foobar', 'data-foo' => 'bar'), - )); + 'attr' => ['readonly' => true, 'maxlength' => 10, 'pattern' => '\d+', 'class' => 'foobar', 'data-foo' => 'bar'], + ]); $html = $this->renderWidget($form->createView()); @@ -2454,9 +2470,9 @@ public function testWidgetAttributeNameRepeatedIfTrue() { - $form = $this->factory->createNamed('text', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'value', array( - 'attr' => array('foo' => true), - )); + $form = $this->factory->createNamed('text', 'Symfony\Component\Form\Extension\Core\Type\TextType', 'value', [ + 'attr' => ['foo' => true], + ]); $html = $this->renderWidget($form->createView()); @@ -2466,10 +2482,10 @@ public function testButtonAttributes() { - $form = $this->factory->createNamed('button', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, array( + $form = $this->factory->createNamed('button', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, [ 'disabled' => true, - 'attr' => array('class' => 'foobar', 'data-foo' => 'bar'), - )); + 'attr' => ['class' => 'foobar', 'data-foo' => 'bar'], + ]); $html = $this->renderWidget($form->createView()); @@ -2479,9 +2495,9 @@ public function testButtonAttributeNameRepeatedIfTrue() { - $form = $this->factory->createNamed('button', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, array( - 'attr' => array('foo' => true), - )); + $form = $this->factory->createNamed('button', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, [ + 'attr' => ['foo' => true], + ]); $html = $this->renderWidget($form->createView()); @@ -2494,7 +2510,7 @@ $tel = '0102030405'; $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TelType', $tel); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="tel"] [@name="name"] @@ -2509,7 +2525,7 @@ $color = '#0000ff'; $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ColorType', $color); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']], '/input [@type="color"] [@name="name"] diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType'); $view = $form->createView(); - $this->renderWidget($view, array('label' => 'foo')); + $this->renderWidget($view, ['label' => 'foo']); $html = $this->renderLabel($view); $this->assertMatchesXpath($html, @@ -63,11 +63,11 @@ public function testLabelDoesNotRenderFieldAttributes() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -80,11 +80,11 @@ public function testLabelWithCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -97,11 +97,11 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); - $html = $this->renderLabel($form->createView(), 'Custom label', array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), 'Custom label', [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -114,14 +114,14 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'label' => 'Custom label', - )); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + ]); + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -134,11 +134,11 @@ public function testLegendOnExpandedType() { - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, array( + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, [ 'label' => 'Custom label', 'expanded' => true, - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - )); + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + ]); $view = $form->createView(); $this->renderWidget($view); $html = $this->renderLabel($view); @@ -153,10 +153,10 @@ public function testStartTag() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )); + ]); $html = $this->renderStart($form->createView()); @@ -165,25 +165,25 @@ public function testStartTagWithOverriddenVars() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'put', 'action' => 'http://example.com/directory', - )); + ]); - $html = $this->renderStart($form->createView(), array( + $html = $this->renderStart($form->createView(), [ 'method' => 'post', 'action' => 'http://foo.com/directory', - )); + ]); $this->assertSame('', $html); } public function testStartTagForMultipartForm() { - $form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )) + ]) ->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType') ->getForm(); @@ -194,14 +194,14 @@ public function testStartTagWithExtraAttributes() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => 'http://example.com/directory', - )); + ]); - $html = $this->renderStart($form->createView(), array( - 'attr' => array('class' => 'foobar'), - )); + $html = $this->renderStart($form->createView(), [ + 'attr' => ['class' => 'foobar'], + ]); $this->assertSame('', $html); } @@ -210,7 +210,7 @@ { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'); $view = $form->createView(); - $html = $this->renderRow($view, array('label' => 'foo')); + $html = $this->renderRow($view, ['label' => 'foo']); $this->assertMatchesXpath($html, '/div[@class="form-group row"]/div[@class="col-sm-2" or @class="col-sm-10"]', 2); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -58,7 +58,7 @@ { $form = $this->factory->createNamed('name', DateType::class); $view = $form->createView(); - $this->renderWidget($view, array('label' => 'foo')); + $this->renderWidget($view, ['label' => 'foo']); $html = $this->renderLabel($view); $this->assertMatchesXpath($html, @@ -72,11 +72,11 @@ public function testLabelDoesNotRenderFieldAttributes() { $form = $this->factory->createNamed('name', TextType::class); - $html = $this->renderLabel($form->createView(), null, array( - 'attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -89,11 +89,11 @@ public function testLabelWithCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', TextType::class); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -106,11 +106,11 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', TextType::class); - $html = $this->renderLabel($form->createView(), 'Custom label', array( - 'label_attr' => array( + $html = $this->renderLabel($form->createView(), 'Custom label', [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -123,14 +123,14 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() { - $form = $this->factory->createNamed('name', TextType::class, null, array( + $form = $this->factory->createNamed('name', TextType::class, null, [ 'label' => 'Custom label', - )); - $html = $this->renderLabel($form->createView(), null, array( - 'label_attr' => array( + ]); + $html = $this->renderLabel($form->createView(), null, [ + 'label_attr' => [ 'class' => 'my&class', - ), - )); + ], + ]); $this->assertMatchesXpath($html, '/label @@ -143,11 +143,11 @@ public function testLegendOnExpandedType() { - $form = $this->factory->createNamed('name', ChoiceType::class, null, array( + $form = $this->factory->createNamed('name', ChoiceType::class, null, [ 'label' => 'Custom label', 'expanded' => true, - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - )); + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + ]); $view = $form->createView(); $this->renderWidget($view); $html = $this->renderLabel($view); @@ -187,7 +187,7 @@ public function testErrorWithNoLabel() { - $form = $this->factory->createNamed('name', TextType::class, array('label' => false)); + $form = $this->factory->createNamed('name', TextType::class, ['label' => false]); $form->addError(new FormError('[trans]Error 1[/trans]')); $view = $form->createView(); $html = $this->renderLabel($view); @@ -199,7 +199,7 @@ { $form = $this->factory->createNamed('name', CheckboxType::class, true); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -214,14 +214,14 @@ public function testSingleChoiceAttributesWithMainAttributes() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => false, - 'attr' => array('class' => 'bar&baz'), - )); + 'attr' => ['class' => 'bar&baz'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'bar&baz')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'bar&baz']], '/select [@name="name"] [@class="bar&baz form-control"] @@ -237,14 +237,14 @@ public function testSingleExpandedChoiceAttributesWithMainAttributes() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, - 'attr' => array('class' => 'bar&baz'), - )); + 'attr' => ['class' => 'bar&baz'], + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'bar&baz')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'bar&baz']], '/div [@class="bar&baz"] [ @@ -272,7 +272,7 @@ { $form = $this->factory->createNamed('name', CheckboxType::class, false); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -286,11 +286,11 @@ public function testCheckboxWithValue() { - $form = $this->factory->createNamed('name', CheckboxType::class, false, array( + $form = $this->factory->createNamed('name', CheckboxType::class, false, [ 'value' => 'foo&bar', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -304,13 +304,13 @@ public function testSingleChoiceExpanded() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -335,14 +335,14 @@ public function testSingleChoiceExpandedWithLabelsAsFalse() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => false, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -365,8 +365,8 @@ public function testSingleChoiceExpandedWithLabelsSetByCallable() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'choice_label' => function ($choice, $label, $value) { if ('&b' === $choice) { return false; @@ -376,9 +376,9 @@ }, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -409,16 +409,16 @@ public function testSingleChoiceExpandedWithLabelsSetFalseByCallable() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => function () { return false; }, 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -441,14 +441,14 @@ public function testSingleChoiceExpandedWithoutTranslation() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'choice_translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -473,14 +473,14 @@ public function testSingleChoiceExpandedAttributes() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -505,15 +505,15 @@ public function testSingleChoiceExpandedWithPlaceholder() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'placeholder' => 'Test&Me', 'required' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -545,16 +545,16 @@ public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation() { - $form = $this->factory->createNamed('name', ChoiceType::class, '&a', array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, '&a', [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'multiple' => false, 'expanded' => true, 'required' => false, 'choice_translation_domain' => false, 'placeholder' => 'Placeholder&Not&Translated', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -586,13 +586,13 @@ public function testSingleChoiceExpandedWithBooleanValue() { - $form = $this->factory->createNamed('name', ChoiceType::class, true, array( - 'choices' => array('Choice&A' => '1', 'Choice&B' => '0'), + $form = $this->factory->createNamed('name', ChoiceType::class, true, [ + 'choices' => ['Choice&A' => '1', 'Choice&B' => '0'], 'multiple' => false, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -617,14 +617,14 @@ public function testMultipleChoiceExpanded() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'multiple' => true, 'expanded' => true, 'required' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -656,14 +656,14 @@ public function testMultipleChoiceExpandedWithLabelsAsFalse() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => false, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -686,8 +686,8 @@ public function testMultipleChoiceExpandedWithLabelsSetByCallable() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'choice_label' => function ($choice, $label, $value) { if ('&b' === $choice) { return false; @@ -697,9 +697,9 @@ }, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -730,16 +730,16 @@ public function testMultipleChoiceExpandedWithLabelsSetFalseByCallable() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'choice_label' => function () { return false; }, 'multiple' => true, 'expanded' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -762,15 +762,15 @@ public function testMultipleChoiceExpandedWithoutTranslation() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], 'multiple' => true, 'expanded' => true, 'required' => true, 'choice_translation_domain' => false, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -802,15 +802,15 @@ public function testMultipleChoiceExpandedAttributes() { - $form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array( - 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), - 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), + $form = $this->factory->createNamed('name', ChoiceType::class, ['&a', '&c'], [ + 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'], + 'choice_attr' => ['Choice&B' => ['class' => 'foo&bar']], 'multiple' => true, 'expanded' => true, 'required' => true, - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array(), + $this->assertWidgetMatchesXpath($form->createView(), [], '/div [ ./div @@ -844,7 +844,7 @@ { $form = $this->factory->createNamed('name', RadioType::class, true); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -866,7 +866,7 @@ { $form = $this->factory->createNamed('name', RadioType::class, false); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -885,11 +885,11 @@ public function testRadioWithValue() { - $form = $this->factory->createNamed('name', RadioType::class, false, array( + $form = $this->factory->createNamed('name', RadioType::class, false, [ 'value' => 'foo&bar', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="form-check"] [ @@ -909,9 +909,9 @@ public function testButtonAttributeNameRepeatedIfTrue() { - $form = $this->factory->createNamed('button', ButtonType::class, null, array( - 'attr' => array('foo' => true), - )); + $form = $this->factory->createNamed('button', ButtonType::class, null, [ + 'attr' => ['foo' => true], + ]); $html = $this->renderWidget($form->createView()); @@ -923,7 +923,7 @@ { $form = $this->factory->createNamed('name', FileType::class); - $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class form-control-file')), + $this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class form-control-file']], '/input [@type="file"] ' @@ -932,11 +932,11 @@ public function testMoney() { - $form = $this->factory->createNamed('name', MoneyType::class, 1234.56, array( + $form = $this->factory->createNamed('name', MoneyType::class, 1234.56, [ 'currency' => 'EUR', - )); + ]); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="input-group"] [ @@ -962,7 +962,7 @@ { $form = $this->factory->createNamed('name', PercentType::class, 0.1); - $this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')), + $this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']], '/div [@class="input-group"] [ diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,20 +41,20 @@ public function getClassNameProvider() { - return array( - array('F\Q\N\Foo', 'Foo'), - array('Bare', 'Bare'), - ); + return [ + ['F\Q\N\Foo', 'Foo'], + ['Bare', 'Bare'], + ]; } public function getMethodNameProvider() { - return array( - array('F\Q\N\Foo::Method', 'Foo::Method()'), - array('Bare::Method', 'Bare::Method()'), - array('Closure', 'Closure'), - array('Method', 'Method()'), - ); + return [ + ['F\Q\N\Foo::Method', 'Foo::Method()'], + ['Bare::Method', 'Bare::Method()'], + ['Closure', 'Closure'], + ['Method', 'Method()'], + ]; } public function testGetName() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,11 +27,11 @@ public function testDumpTag($template, $debug, $expectedOutput, $expectedDumped) { $extension = new DumpExtension(new VarCloner()); - $twig = new Environment(new ArrayLoader(array('template' => $template)), array( + $twig = new Environment(new ArrayLoader(['template' => $template]), [ 'debug' => $debug, 'cache' => false, 'optimizations' => 0, - )); + ]); $twig->addExtension($extension); $dumped = null; @@ -54,11 +54,11 @@ public function getDumpTags() { - return array( - array('A{% dump %}B', true, 'AB', array()), - array('A{% set foo="bar"%}B{% dump %}C', true, 'ABC', array('foo' => 'bar')), - array('A{% dump %}B', false, 'AB', null), - ); + return [ + ['A{% dump %}B', true, 'AB', []], + ['A{% set foo="bar"%}B{% dump %}C', true, 'ABC', ['foo' => 'bar']], + ['A{% dump %}B', false, 'AB', null], + ]; } /** @@ -67,16 +67,16 @@ public function testDump($context, $args, $expectedOutput, $debug = true) { $extension = new DumpExtension(new VarCloner()); - $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array( + $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), [ 'debug' => $debug, 'cache' => false, 'optimizations' => 0, - )); + ]); array_unshift($args, $context); array_unshift($args, $twig); - $dump = \call_user_func_array(array($extension, 'dump'), $args); + $dump = \call_user_func_array([$extension, 'dump'], $args); if ($debug) { $this->assertStringStartsWith('\n"), - array( - array(), - array(123, 456), + return [ + [[], [], '', false], + [[], [], "
[]\n
\n"], + [ + [], + [123, 456], "
123\n
\n" ."
456\n
\n", - ), - array( - array('foo' => 'bar'), - array(), + ], + [ + ['foo' => 'bar'], + [], "
array:1 [\n"
                 ."  \"foo\" => \"bar\"\n"
                 ."]\n"
                 ."
\n", - ), - ); + ], + ]; } public function testCustomDumper() @@ -123,13 +123,13 @@ '' ); $extension = new DumpExtension(new VarCloner(), $dumper); - $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array( + $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), [ 'debug' => true, 'cache' => false, 'optimizations' => 0, - )); + ]); - $dump = $extension->dump($twig, array(), 'foo'); + $dump = $extension->dump($twig, [], 'foo'); $dump = preg_replace('/sf-dump-\d+/', 'sf-dump', $dump); $this->assertEquals( diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/ExpressionExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/ExpressionExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/ExpressionExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/ExpressionExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ public function testExpressionCreation() { $template = "{{ expression('1 == 1') }}"; - $twig = new Environment(new ArrayLoader(array('template' => $template)), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0)); + $twig = new Environment(new ArrayLoader(['template' => $template]), ['debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new ExpressionExtension()); $output = $twig->render('template'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,12 +15,12 @@ class StubTranslator implements TranslatorInterface { - public function trans($id, array $parameters = array(), $domain = null, $locale = null) + public function trans($id, array $parameters = [], $domain = null, $locale = null) { return '[trans]'.$id.'[/trans]'; } - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) { return '[trans]'.$id.'[/trans]'; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,9 +24,9 @@ { use RuntimeLoaderProvider; - protected $testableFeatures = array( + protected $testableFeatures = [ 'choice_attr', - ); + ]; /** * @var FormRenderer @@ -37,32 +37,32 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_3_horizontal_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -73,27 +73,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,29 +33,29 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_3_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -64,10 +64,10 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); @@ -76,18 +76,18 @@ public function testMoneyWidgetInIso() { - $environment = new Environment(new StubFilesystemLoader(array( + $environment = new Environment(new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )), array('strict_variables' => true)); + ]), ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); $environment->setCharset('ISO-8859-1'); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_3_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); @@ -104,15 +104,15 @@ , trim($this->renderWidget($view))); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -123,27 +123,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,9 +29,9 @@ { use RuntimeLoaderProvider; - protected $testableFeatures = array( + protected $testableFeatures = [ 'choice_attr', - ); + ]; private $renderer; @@ -39,32 +39,32 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_4_horizontal_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -75,27 +75,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,29 +37,29 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_4_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -68,10 +68,10 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); @@ -80,18 +80,18 @@ public function testMoneyWidgetInIso() { - $environment = new Environment(new StubFilesystemLoader(array( + $environment = new Environment(new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )), array('strict_variables' => true)); + ]), ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); $environment->setCharset('ISO-8859-1'); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'bootstrap_4_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); @@ -108,15 +108,15 @@ , trim($this->renderWidget($view))); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -127,27 +127,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,22 +35,22 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addGlobal('global', ''); // the value can be any template that exists $environment->addGlobal('dynamic_template_name', 'child_label'); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'form_div_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } @@ -62,7 +62,7 @@ ->createView() ; - $this->setTheme($view, array('theme_use.html.twig')); + $this->setTheme($view, ['theme_use.html.twig']); $this->assertMatchesXpath( $this->renderWidget($view), @@ -77,7 +77,7 @@ ->createView() ; - $this->setTheme($view, array('theme_extends.html.twig')); + $this->setTheme($view, ['theme_extends.html.twig']); $this->assertMatchesXpath( $this->renderWidget($view), @@ -92,7 +92,7 @@ ->createView() ; - $this->renderer->setTheme($view, array('page_dynamic_extends.html.twig')); + $this->renderer->setTheme($view, ['page_dynamic_extends.html.twig']); $this->assertMatchesXpath( $this->renderer->searchAndRenderBlock($view, 'row'), '/div/label[text()="child"]' @@ -101,18 +101,18 @@ public function isSelectedChoiceProvider() { - return array( - array(true, '0', '0'), - array(true, '1', '1'), - array(true, '', ''), - array(true, '1.23', '1.23'), - array(true, 'foo', 'foo'), - array(true, 'foo10', 'foo10'), - array(true, 'foo', array(1, 'foo', 'foo10')), - - array(false, 10, array(1, 'foo', 'foo10')), - array(false, 0, array(1, 'foo', 'foo10')), - ); + return [ + [true, '0', '0'], + [true, '1', '1'], + [true, '', ''], + [true, '1.23', '1.23'], + [true, 'foo', 'foo'], + [true, 'foo10', 'foo10'], + [true, 'foo', [1, 'foo', 'foo10']], + + [false, 10, [1, 'foo', 'foo10']], + [false, 0, [1, 'foo', 'foo10']], + ]; } /** @@ -127,10 +127,10 @@ public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -139,10 +139,10 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); @@ -151,10 +151,10 @@ public function isRootFormProvider() { - return array( - array(true, new FormView()), - array(false, new FormView(new FormView())), - ); + return [ + [true, new FormView()], + [false, new FormView(new FormView())], + ]; } /** @@ -167,18 +167,18 @@ public function testMoneyWidgetInIso() { - $environment = new Environment(new StubFilesystemLoader(array( + $environment = new Environment(new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )), array('strict_variables' => true)); + ]), ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new FormExtension()); $environment->setCharset('ISO-8859-1'); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'form_div_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); @@ -190,15 +190,15 @@ $this->assertSame('€ ', $this->renderWidget($view)); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -209,27 +209,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } @@ -241,15 +241,15 @@ public static function themeBlockInheritanceProvider() { - return array( - array(array('theme.html.twig')), - ); + return [ + [['theme.html.twig']], + ]; } public static function themeInheritanceProvider() { - return array( - array(array('parent_label.html.twig'), array('child_label.html.twig')), - ); + return [ + [['parent_label.html.twig'], ['child_label.html.twig']], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,30 +34,30 @@ { parent::setUp(); - $loader = new StubFilesystemLoader(array( + $loader = new StubFilesystemLoader([ __DIR__.'/../../Resources/views/Form', __DIR__.'/Fixtures/templates/form', - )); + ]); - $environment = new Environment($loader, array('strict_variables' => true)); + $environment = new Environment($loader, ['strict_variables' => true]); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addGlobal('global', ''); $environment->addExtension(new FormExtension()); - $rendererEngine = new TwigRendererEngine(array( + $rendererEngine = new TwigRendererEngine([ 'form_table_layout.html.twig', 'custom_widgets.html.twig', - ), $environment); + ], $environment); $this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock()); $this->registerTwigRuntimeLoader($environment, $this->renderer); } public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -66,25 +66,25 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); $this->assertSame('', $html); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form', $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { if (null !== $label) { - $vars += array('label' => $label); + $vars += ['label' => $label]; } return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars); @@ -95,27 +95,27 @@ return (string) $this->renderer->searchAndRenderBlock($view, 'errors'); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_start', $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->renderer->renderBlock($view, 'form_end', $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ $twigRenderer->expects($this->once()) ->method('setEnvironment'); - yield array($twigRenderer, $twigRenderer); + yield [$twigRenderer, $twigRenderer]; $twigRenderer = $this->getMockBuilder(TwigRendererInterface::class)->getMock(); $twigRenderer->expects($this->once()) @@ -61,7 +61,7 @@ ->with('service_id') ->willReturn($twigRenderer); - yield array(array($container, 'service_id'), $twigRenderer); + yield [[$container, 'service_id'], $twigRenderer]; $formRenderer = $this->getMockBuilder(FormRendererInterface::class)->getMock(); @@ -71,6 +71,6 @@ ->with('service_id') ->willReturn($formRenderer); - yield array(array($container, 'service_id'), $formRenderer); + yield [[$container, 'service_id'], $formRenderer]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,25 +33,25 @@ public function getGenerateAbsoluteUrlData() { - return array( - array('http://localhost/foo.png', '/foo.png', '/foo/bar.html'), - array('http://localhost/foo/foo.png', 'foo.png', '/foo/bar.html'), - array('http://localhost/foo/foo.png', 'foo.png', '/foo/bar'), - array('http://localhost/foo/bar/foo.png', 'foo.png', '/foo/bar/'), - - array('http://example.com/baz', 'http://example.com/baz', '/'), - array('https://example.com/baz', 'https://example.com/baz', '/'), - array('//example.com/baz', '//example.com/baz', '/'), - - array('http://localhost/foo/bar?baz', '?baz', '/foo/bar'), - array('http://localhost/foo/bar?baz=1', '?baz=1', '/foo/bar?foo=1'), - array('http://localhost/foo/baz?baz=1', 'baz?baz=1', '/foo/bar?foo=1'), - - array('http://localhost/foo/bar#baz', '#baz', '/foo/bar'), - array('http://localhost/foo/bar?0#baz', '#baz', '/foo/bar?0'), - array('http://localhost/foo/bar?baz=1#baz', '?baz=1#baz', '/foo/bar?foo=1'), - array('http://localhost/foo/baz?baz=1#baz', 'baz?baz=1#baz', '/foo/bar?foo=1'), - ); + return [ + ['http://localhost/foo.png', '/foo.png', '/foo/bar.html'], + ['http://localhost/foo/foo.png', 'foo.png', '/foo/bar.html'], + ['http://localhost/foo/foo.png', 'foo.png', '/foo/bar'], + ['http://localhost/foo/bar/foo.png', 'foo.png', '/foo/bar/'], + + ['http://example.com/baz', 'http://example.com/baz', '/'], + ['https://example.com/baz', 'https://example.com/baz', '/'], + ['//example.com/baz', '//example.com/baz', '/'], + + ['http://localhost/foo/bar?baz', '?baz', '/foo/bar'], + ['http://localhost/foo/bar?baz=1', '?baz=1', '/foo/bar?foo=1'], + ['http://localhost/foo/baz?baz=1', 'baz?baz=1', '/foo/bar?foo=1'], + + ['http://localhost/foo/bar#baz', '#baz', '/foo/bar'], + ['http://localhost/foo/bar?0#baz', '#baz', '/foo/bar?0'], + ['http://localhost/foo/bar?baz=1#baz', '?baz=1#baz', '/foo/bar?foo=1'], + ['http://localhost/foo/baz?baz=1#baz', 'baz?baz=1#baz', '/foo/bar?foo=1'], + ]; } /** @@ -85,16 +85,16 @@ public function getGenerateAbsoluteUrlRequestContextData() { - return array( - array('/foo.png', '/foo', 'localhost', 'http', 80, 443, 'http://localhost/foo.png'), - array('foo.png', '/foo', 'localhost', 'http', 80, 443, 'http://localhost/foo/foo.png'), - array('foo.png', '/foo/bar/', 'localhost', 'http', 80, 443, 'http://localhost/foo/bar/foo.png'), - array('/foo.png', '/foo', 'localhost', 'https', 80, 443, 'https://localhost/foo.png'), - array('foo.png', '/foo', 'localhost', 'https', 80, 443, 'https://localhost/foo/foo.png'), - array('foo.png', '/foo/bar/', 'localhost', 'https', 80, 443, 'https://localhost/foo/bar/foo.png'), - array('/foo.png', '/foo', 'localhost', 'http', 443, 80, 'http://localhost:443/foo.png'), - array('/foo.png', '/foo', 'localhost', 'https', 443, 80, 'https://localhost:80/foo.png'), - ); + return [ + ['/foo.png', '/foo', 'localhost', 'http', 80, 443, 'http://localhost/foo.png'], + ['foo.png', '/foo', 'localhost', 'http', 80, 443, 'http://localhost/foo/foo.png'], + ['foo.png', '/foo/bar/', 'localhost', 'http', 80, 443, 'http://localhost/foo/bar/foo.png'], + ['/foo.png', '/foo', 'localhost', 'https', 80, 443, 'https://localhost/foo.png'], + ['foo.png', '/foo', 'localhost', 'https', 80, 443, 'https://localhost/foo/foo.png'], + ['foo.png', '/foo/bar/', 'localhost', 'https', 80, 443, 'https://localhost/foo/bar/foo.png'], + ['/foo.png', '/foo', 'localhost', 'http', 443, 80, 'http://localhost:443/foo.png'], + ['/foo.png', '/foo', 'localhost', 'https', 443, 80, 'https://localhost:80/foo.png'], + ]; } public function testGenerateAbsoluteUrlWithScriptFileName() @@ -130,14 +130,14 @@ public function getGenerateRelativePathData() { - return array( - array('../foo.png', '/foo.png', '/foo/bar.html'), - array('../baz/foo.png', '/baz/foo.png', '/foo/bar.html'), - array('baz/foo.png', 'baz/foo.png', '/foo/bar.html'), - - array('http://example.com/baz', 'http://example.com/baz', '/'), - array('https://example.com/baz', 'https://example.com/baz', '/'), - array('//example.com/baz', '//example.com/baz', '/'), - ); + return [ + ['../foo.png', '/foo.png', '/foo/bar.html'], + ['../baz/foo.png', '/baz/foo.png', '/foo/bar.html'], + ['baz/foo.png', 'baz/foo.png', '/foo/bar.html'], + + ['http://example.com/baz', 'http://example.com/baz', '/'], + ['https://example.com/baz', 'https://example.com/baz', '/'], + ['//example.com/baz', '//example.com/baz', '/'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -72,19 +72,19 @@ $context->expects($this->any())->method('getCurrentRequest')->will($this->returnValue(Request::create('/'))); - return new FragmentHandler($context, array($strategy), false); + return new FragmentHandler($context, [$strategy], false); } protected function renderTemplate(FragmentHandler $renderer, $template = '{{ render("foo") }}') { - $loader = new ArrayLoader(array('index' => $template)); - $twig = new Environment($loader, array('debug' => true, 'cache' => false)); + $loader = new ArrayLoader(['index' => $template]); + $twig = new Environment($loader, ['debug' => true, 'cache' => false]); $twig->addExtension(new HttpKernelExtension()); $loader = $this->getMockBuilder('Twig\RuntimeLoader\RuntimeLoaderInterface')->getMock(); - $loader->expects($this->any())->method('load')->will($this->returnValueMap(array( - array('Symfony\Bridge\Twig\Extension\HttpKernelRuntime', new HttpKernelRuntime($renderer)), - ))); + $loader->expects($this->any())->method('load')->will($this->returnValueMap([ + ['Symfony\Bridge\Twig\Extension\HttpKernelRuntime', new HttpKernelRuntime($renderer)], + ])); $twig->addRuntimeLoader($loader); return $twig->render('index'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ */ public function testEscaping($template, $mustBeEscaped) { - $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0)); + $twig = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new RoutingExtension($this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock())); $nodes = $twig->parse($twig->tokenize(new Source($template, ''))); @@ -34,21 +34,21 @@ public function getEscapingTemplates() { - return array( - array('{{ path("foo") }}', false), - array('{{ path("foo", {}) }}', false), - array('{{ path("foo", { foo: "foo" }) }}', false), - array('{{ path("foo", foo) }}', true), - array('{{ path("foo", { foo: foo }) }}', true), - array('{{ path("foo", { foo: ["foo", "bar"] }) }}', true), - array('{{ path("foo", { foo: "foo", bar: "bar" }) }}', true), + return [ + ['{{ path("foo") }}', false], + ['{{ path("foo", {}) }}', false], + ['{{ path("foo", { foo: "foo" }) }}', false], + ['{{ path("foo", foo) }}', true], + ['{{ path("foo", { foo: foo }) }}', true], + ['{{ path("foo", { foo: ["foo", "bar"] }) }}', true], + ['{{ path("foo", { foo: "foo", bar: "bar" }) }}', true], - array('{{ path(name = "foo", parameters = {}) }}', false), - array('{{ path(name = "foo", parameters = { foo: "foo" }) }}', false), - array('{{ path(name = "foo", parameters = foo) }}', true), - array('{{ path(name = "foo", parameters = { foo: ["foo", "bar"] }) }}', true), - array('{{ path(name = "foo", parameters = { foo: foo }) }}', true), - array('{{ path(name = "foo", parameters = { foo: "foo", bar: "bar" }) }}', true), - ); + ['{{ path(name = "foo", parameters = {}) }}', false], + ['{{ path(name = "foo", parameters = { foo: "foo" }) }}', false], + ['{{ path(name = "foo", parameters = foo) }}', true], + ['{{ path(name = "foo", parameters = { foo: ["foo", "bar"] }) }}', true], + ['{{ path(name = "foo", parameters = { foo: foo }) }}', true], + ['{{ path(name = "foo", parameters = { foo: "foo", bar: "bar" }) }}', true], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RuntimeLoaderProvider.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RuntimeLoaderProvider.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RuntimeLoaderProvider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/RuntimeLoaderProvider.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ protected function registerTwigRuntimeLoader(Environment $environment, FormRenderer $renderer) { $loader = $this->getMockBuilder('Twig\RuntimeLoader\RuntimeLoaderInterface')->getMock(); - $loader->expects($this->any())->method('load')->will($this->returnValueMap(array( - array('Symfony\Component\Form\FormRenderer', $renderer), - ))); + $loader->expects($this->any())->method('load')->will($this->returnValueMap([ + ['Symfony\Component\Form\FormRenderer', $renderer], + ])); $environment->addRuntimeLoader($loader); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ */ public function testFailIfStoppingWrongEvent() { - $this->testTiming('{% stopwatch "foo" %}{% endstopwatch "bar" %}', array()); + $this->testTiming('{% stopwatch "foo" %}{% endstopwatch "bar" %}', []); } /** @@ -32,7 +32,7 @@ */ public function testTiming($template, $events) { - $twig = new Environment(new ArrayLoader(array('template' => $template)), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0)); + $twig = new Environment(new ArrayLoader(['template' => $template]), ['debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new StopwatchExtension($this->getStopwatch($events))); try { @@ -44,19 +44,19 @@ public function getTimingTemplates() { - return array( - array('{% stopwatch "foo" %}something{% endstopwatch %}', 'foo'), - array('{% stopwatch "foo" %}symfony is fun{% endstopwatch %}{% stopwatch "bar" %}something{% endstopwatch %}', array('foo', 'bar')), - array('{% set foo = "foo" %}{% stopwatch foo %}something{% endstopwatch %}', 'foo'), - array('{% set foo = "foo" %}{% stopwatch foo %}something {% set foo = "bar" %}{% endstopwatch %}', 'foo'), - array('{% stopwatch "foo.bar" %}something{% endstopwatch %}', 'foo.bar'), - array('{% stopwatch "foo" %}something{% endstopwatch %}{% stopwatch "foo" %}something else{% endstopwatch %}', array('foo', 'foo')), - ); + return [ + ['{% stopwatch "foo" %}something{% endstopwatch %}', 'foo'], + ['{% stopwatch "foo" %}symfony is fun{% endstopwatch %}{% stopwatch "bar" %}something{% endstopwatch %}', ['foo', 'bar']], + ['{% set foo = "foo" %}{% stopwatch foo %}something{% endstopwatch %}', 'foo'], + ['{% set foo = "foo" %}{% stopwatch foo %}something {% set foo = "bar" %}{% endstopwatch %}', 'foo'], + ['{% stopwatch "foo.bar" %}something{% endstopwatch %}', 'foo.bar'], + ['{% stopwatch "foo" %}something{% endstopwatch %}{% stopwatch "foo" %}something else{% endstopwatch %}', ['foo', 'foo']], + ]; } - protected function getStopwatch($events = array()) + protected function getStopwatch($events = []) { - $events = \is_array($events) ? $events : array($events); + $events = \is_array($events) ? $events : [$events]; $stopwatch = $this->getMockBuilder('Symfony\Component\Stopwatch\Stopwatch')->getMock(); $i = -1; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { public function testEscaping() { - $output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(array('value' => 12, 'msg' => 'approx.')); + $output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(['value' => 12, 'msg' => 'approx.']); $this->assertEquals('Percent: 12% (approx.)', $output); } @@ -30,12 +30,12 @@ /** * @dataProvider getTransTests */ - public function testTrans($template, $expected, array $variables = array()) + public function testTrans($template, $expected, array $variables = []) { if ($expected != $this->getTemplate($template)->render($variables)) { echo $template."\n"; - $loader = new TwigArrayLoader(array('index' => $template)); - $twig = new Environment($loader, array('debug' => true, 'cache' => false)); + $loader = new TwigArrayLoader(['index' => $template]); + $twig = new Environment($loader, ['debug' => true, 'cache' => false]); $twig->addExtension(new TranslationExtension(new Translator('en'))); echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSourceContext('index'))))."\n\n"; @@ -74,67 +74,67 @@ public function getTransTests() { - return array( + return [ // trans tag - array('{% trans %}Hello{% endtrans %}', 'Hello'), - array('{% trans %}%name%{% endtrans %}', 'Symfony', array('name' => 'Symfony')), + ['{% trans %}Hello{% endtrans %}', 'Hello'], + ['{% trans %}%name%{% endtrans %}', 'Symfony', ['name' => 'Symfony']], - array('{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'), + ['{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'], - array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', array('name' => 'Symfony')), - array('{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'), - array('{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'), + ['{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', ['name' => 'Symfony']], + ['{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'], + ['{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'], - array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'), + ['{% trans into "fr"%}Hello{% endtrans %}', 'Hello'], // transchoice - array( + [ '{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', 'There is no apples', - array('count' => 0), - ), - array( + ['count' => 0], + ], + [ '{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', 'There is 5 apples', - array('count' => 5), - ), - array( + ['count' => 5], + ], + [ '{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', 'There is 5 apples (Symfony)', - array('count' => 5, 'name' => 'Symfony'), - ), - array( + ['count' => 5, 'name' => 'Symfony'], + ], + [ '{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', 'There is 5 apples (Symfony)', - array('count' => 5), - ), - array( + ['count' => 5], + ], + [ '{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', 'There is no apples', - array('count' => 0), - ), - array( + ['count' => 0], + ], + [ '{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', 'There is 5 apples', - ), + ], // trans filter - array('{{ "Hello"|trans }}', 'Hello'), - array('{{ name|trans }}', 'Symfony', array('name' => 'Symfony')), - array('{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', array('hello' => 'Hello %name%')), - array('{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', array('hello' => 'Hello %name%')), - array('{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'), + ['{{ "Hello"|trans }}', 'Hello'], + ['{{ name|trans }}', 'Symfony', ['name' => 'Symfony']], + ['{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', ['hello' => 'Hello %name%']], + ['{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', ['hello' => 'Hello %name%']], + ['{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'], // transchoice filter - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count) }}', 'There is 5 apples', array('count' => 5)), - array('{{ text|transchoice(5, {\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')), - array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count, {}, "messages", "fr") }}', 'There is 5 apples', array('count' => 5)), - ); + ['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count) }}', 'There is 5 apples', ['count' => 5]], + ['{{ text|transchoice(5, {\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', ['text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)']], + ['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|transchoice(count, {}, "messages", "fr") }}', 'There is 5 apples', ['count' => 5]], + ]; } public function testDefaultTranslationDomain() { - $templates = array( + $templates = [ 'index' => ' {%- extends "base" %} @@ -153,22 +153,22 @@ 'base' => ' {%- block content "" %} ', - ); + ]; $translator = new Translator('en'); $translator->addLoader('array', new ArrayLoader()); - $translator->addResource('array', array('foo' => 'foo (messages)'), 'en'); - $translator->addResource('array', array('foo' => 'foo (custom)'), 'en', 'custom'); - $translator->addResource('array', array('foo' => 'foo (foo)'), 'en', 'foo'); + $translator->addResource('array', ['foo' => 'foo (messages)'], 'en'); + $translator->addResource('array', ['foo' => 'foo (custom)'], 'en', 'custom'); + $translator->addResource('array', ['foo' => 'foo (foo)'], 'en', 'foo'); $template = $this->getTemplate($templates, $translator); - $this->assertEquals('foo (foo)foo (custom)foo (foo)foo (custom)foo (foo)foo (custom)', trim($template->render(array()))); + $this->assertEquals('foo (foo)foo (custom)foo (foo)foo (custom)foo (foo)foo (custom)', trim($template->render([]))); } public function testDefaultTranslationDomainWithNamedArguments() { - $templates = array( + $templates = [ 'index' => ' {%- trans_default_domain "foo" %} @@ -186,18 +186,18 @@ 'base' => ' {%- block content "" %} ', - ); + ]; $translator = new Translator('en'); $translator->addLoader('array', new ArrayLoader()); - $translator->addResource('array', array('foo' => 'foo (messages)'), 'en'); - $translator->addResource('array', array('foo' => 'foo (custom)'), 'en', 'custom'); - $translator->addResource('array', array('foo' => 'foo (foo)'), 'en', 'foo'); - $translator->addResource('array', array('foo' => 'foo (fr)'), 'fr', 'custom'); + $translator->addResource('array', ['foo' => 'foo (messages)'], 'en'); + $translator->addResource('array', ['foo' => 'foo (custom)'], 'en', 'custom'); + $translator->addResource('array', ['foo' => 'foo (foo)'], 'en', 'foo'); + $translator->addResource('array', ['foo' => 'foo (fr)'], 'fr', 'custom'); $template = $this->getTemplate($templates, $translator); - $this->assertEquals('foo (custom)foo (foo)foo (custom)foo (custom)foo (fr)foo (custom)foo (fr)', trim($template->render(array()))); + $this->assertEquals('foo (custom)foo (foo)foo (custom)foo (custom)foo (fr)foo (custom)foo (fr)', trim($template->render([]))); } protected function getTemplate($template, $translator = null) @@ -209,9 +209,9 @@ if (\is_array($template)) { $loader = new TwigArrayLoader($template); } else { - $loader = new TwigArrayLoader(array('index' => $template)); + $loader = new TwigArrayLoader(['index' => $template]); } - $twig = new Environment($loader, array('debug' => true, 'cache' => false)); + $twig = new Environment($loader, ['debug' => true, 'cache' => false]); $twig->addExtension(new TranslationExtension($translator)); return $twig->loadTemplate('index'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WebLinkExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WebLinkExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WebLinkExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WebLinkExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -44,49 +44,49 @@ public function testLink() { - $this->assertEquals('/foo.css', $this->extension->link('/foo.css', 'preload', array('as' => 'style', 'nopush' => true))); + $this->assertEquals('/foo.css', $this->extension->link('/foo.css', 'preload', ['as' => 'style', 'nopush' => true])); $link = (new Link('preload', '/foo.css'))->withAttribute('as', 'style')->withAttribute('nopush', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } public function testPreload() { - $this->assertEquals('/foo.css', $this->extension->preload('/foo.css', array('as' => 'style', 'crossorigin' => true))); + $this->assertEquals('/foo.css', $this->extension->preload('/foo.css', ['as' => 'style', 'crossorigin' => true])); $link = (new Link('preload', '/foo.css'))->withAttribute('as', 'style')->withAttribute('crossorigin', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } public function testDnsPrefetch() { - $this->assertEquals('/foo.css', $this->extension->dnsPrefetch('/foo.css', array('as' => 'style', 'crossorigin' => true))); + $this->assertEquals('/foo.css', $this->extension->dnsPrefetch('/foo.css', ['as' => 'style', 'crossorigin' => true])); $link = (new Link('dns-prefetch', '/foo.css'))->withAttribute('as', 'style')->withAttribute('crossorigin', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } public function testPreconnect() { - $this->assertEquals('/foo.css', $this->extension->preconnect('/foo.css', array('as' => 'style', 'crossorigin' => true))); + $this->assertEquals('/foo.css', $this->extension->preconnect('/foo.css', ['as' => 'style', 'crossorigin' => true])); $link = (new Link('preconnect', '/foo.css'))->withAttribute('as', 'style')->withAttribute('crossorigin', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } public function testPrefetch() { - $this->assertEquals('/foo.css', $this->extension->prefetch('/foo.css', array('as' => 'style', 'crossorigin' => true))); + $this->assertEquals('/foo.css', $this->extension->prefetch('/foo.css', ['as' => 'style', 'crossorigin' => true])); $link = (new Link('prefetch', '/foo.css'))->withAttribute('as', 'style')->withAttribute('crossorigin', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } public function testPrerender() { - $this->assertEquals('/foo.css', $this->extension->prerender('/foo.css', array('as' => 'style', 'crossorigin' => true))); + $this->assertEquals('/foo.css', $this->extension->prerender('/foo.css', ['as' => 'style', 'crossorigin' => true])); $link = (new Link('prerender', '/foo.css'))->withAttribute('as', 'style')->withAttribute('crossorigin', true); - $this->assertEquals(array($link), array_values($this->request->attributes->get('_links')->getLinks())); + $this->assertEquals([$link], array_values($this->request->attributes->get('_links')->getLinks())); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,11 +25,11 @@ protected function setUp() { - $places = array('ordered', 'waiting_for_payment', 'processed'); - $transitions = array( + $places = ['ordered', 'waiting_for_payment', 'processed']; + $transitions = [ new Transition('t1', 'ordered', 'waiting_for_payment'), new Transition('t2', 'waiting_for_payment', 'processed'), - ); + ]; $definition = new Definition($places, $transitions); $workflow = new Workflow($definition); @@ -42,7 +42,7 @@ public function testCanTransition() { $subject = new \stdClass(); - $subject->marking = array(); + $subject->marking = []; $this->assertTrue($this->extension->canTransition($subject, 't1')); $this->assertFalse($this->extension->canTransition($subject, 't2')); @@ -51,7 +51,7 @@ public function testGetEnabledTransitions() { $subject = new \stdClass(); - $subject->marking = array(); + $subject->marking = []; $transitions = $this->extension->getEnabledTransitions($subject); @@ -63,8 +63,8 @@ public function testHasMarkedPlace() { $subject = new \stdClass(); - $subject->marking = array(); - $subject->marking = array('ordered' => 1, 'waiting_for_payment' => 1); + $subject->marking = []; + $subject->marking = ['ordered' => 1, 'waiting_for_payment' => 1]; $this->assertTrue($this->extension->hasMarkedPlace($subject, 'ordered')); $this->assertTrue($this->extension->hasMarkedPlace($subject, 'waiting_for_payment')); @@ -74,10 +74,10 @@ public function testGetMarkedPlaces() { $subject = new \stdClass(); - $subject->marking = array(); - $subject->marking = array('ordered' => 1, 'waiting_for_payment' => 1); + $subject->marking = []; + $subject->marking = ['ordered' => 1, 'waiting_for_payment' => 1]; - $this->assertSame(array('ordered', 'waiting_for_payment'), $this->extension->getMarkedPlaces($subject)); + $this->assertSame(['ordered', 'waiting_for_payment'], $this->extension->getMarkedPlaces($subject)); $this->assertSame($subject->marking, $this->extension->getMarkedPlaces($subject, false)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ $expected = <<<'EOTXT' if ($this->env->isDebug()) { - $barvars = array(); + $barvars = []; foreach ($context as $barkey => $barval) { if (!$barval instanceof \Twig\Template) { $barvars[$barkey] = $barval; @@ -53,7 +53,7 @@ $expected = <<<'EOTXT' if ($this->env->isDebug()) { - $barvars = array(); + $barvars = []; foreach ($context as $barkey => $barval) { if (!$barval instanceof \Twig\Template) { $barvars[$barkey] = $barval; @@ -70,9 +70,9 @@ public function testOneVar() { - $vars = new Node(array( + $vars = new Node([ new NameExpression('foo', 7), - )); + ]); $node = new DumpNode('bar', $vars, 7); $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock()); @@ -97,10 +97,10 @@ public function testMultiVars() { - $vars = new Node(array( + $vars = new Node([ new NameExpression('foo', 7), new NameExpression('bar', 7), - )); + ]); $node = new DumpNode('bar', $vars, 7); $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock()); @@ -109,10 +109,10 @@ $expected = <<<'EOTXT' if ($this->env->isDebug()) { // line 7 - \Symfony\Component\VarDumper\VarDumper::dump(array( + \Symfony\Component\VarDumper\VarDumper::dump([ "foo" => %foo%, "bar" => %bar%, - )); + ]); } EOTXT; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,10 +30,10 @@ public function testConstructor() { $form = new NameExpression('form', 0); - $resources = new Node(array( + $resources = new Node([ new ConstantExpression('tpl1', 0), new ConstantExpression('tpl2', 0), - )); + ]); $node = new FormThemeNode($form, $resources, 0); @@ -45,12 +45,12 @@ public function testCompile() { $form = new NameExpression('form', 0); - $resources = new ArrayExpression(array( + $resources = new ArrayExpression([ new ConstantExpression(0, 0), new ConstantExpression('tpl1', 0), new ConstantExpression(1, 0), new ConstantExpression('tpl2', 0), - ), 0); + ], 0); $node = new FormThemeNode($form, $resources, 0); @@ -61,7 +61,7 @@ $this->assertEquals( sprintf( - '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, array(0 => "tpl1", 1 => "tpl2"), true);', + '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [0 => "tpl1", 1 => "tpl2"], true);', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -71,7 +71,7 @@ $this->assertEquals( sprintf( - '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, array(0 => "tpl1", 1 => "tpl2"), false);', + '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [0 => "tpl1", 1 => "tpl2"], false);', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,9 +25,9 @@ { public function testCompileWidget() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), - )); + ]); $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0); @@ -44,13 +44,13 @@ public function testCompileWidgetWithVariables() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression('foo', 0), new ConstantExpression('bar', 0), - ), 0), - )); + ], 0), + ]); $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0); @@ -58,7 +58,7 @@ $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'widget\', array("foo" => "bar"))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'widget\', ["foo" => "bar"])', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -67,10 +67,10 @@ public function testCompileLabelWithLabel() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConstantExpression('my label', 0), - )); + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -78,7 +78,7 @@ $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', array("label" => "my label"))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["label" => "my label"])', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -87,10 +87,10 @@ public function testCompileLabelWithNullLabel() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConstantExpression(null, 0), - )); + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -109,10 +109,10 @@ public function testCompileLabelWithEmptyStringLabel() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConstantExpression('', 0), - )); + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -131,9 +131,9 @@ public function testCompileLabelWithDefaultLabel() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), - )); + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -150,14 +150,14 @@ public function testCompileLabelWithAttributes() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConstantExpression(null, 0), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression('foo', 0), new ConstantExpression('bar', 0), - ), 0), - )); + ], 0), + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -168,7 +168,7 @@ // https://github.com/symfony/symfony/issues/5029 $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', array("foo" => "bar"))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["foo" => "bar"])', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -177,16 +177,16 @@ public function testCompileLabelWithLabelAndAttributes() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConstantExpression('value in argument', 0), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression('foo', 0), new ConstantExpression('bar', 0), new ConstantExpression('label', 0), new ConstantExpression('value in attributes', 0), - ), 0), - )); + ], 0), + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -194,7 +194,7 @@ $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in argument"))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["foo" => "bar", "label" => "value in argument"])', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -203,7 +203,7 @@ public function testCompileLabelWithLabelThatEvaluatesToNull() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConditionalExpression( // if @@ -214,7 +214,7 @@ new ConstantExpression(null, 0), 0 ), - )); + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -225,7 +225,7 @@ // https://github.com/symfony/symfony/issues/5029 $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) @@ -234,7 +234,7 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes() { - $arguments = new Node(array( + $arguments = new Node([ new NameExpression('form', 0), new ConditionalExpression( // if @@ -245,13 +245,13 @@ new ConstantExpression(null, 0), 0 ), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression('foo', 0), new ConstantExpression('bar', 0), new ConstantExpression('label', 0), new ConstantExpression('value in attributes', 0), - ), 0), - )); + ], 0), + ]); $node = new SearchAndRenderBlockNode('form_label', $arguments, 0); @@ -262,7 +262,7 @@ // https://github.com/symfony/symfony/issues/5029 $this->assertEquals( sprintf( - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in attributes") + (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))', + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["foo" => "bar", "label" => "value in attributes"] + (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', $this->getVariableGetter('form') ), trim($compiler->compile($node)->getSource()) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,12 +29,12 @@ $vars = new NameExpression('foo', 0); $node = new TransNode($body, null, null, $vars); - $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('strict_variables' => true)); + $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => true]); $compiler = new Compiler($env); $this->assertEquals( sprintf( - 'echo $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->getTranslator()->trans("trans %%var%%", array_merge(array("%%var%%" => %s), %s), "messages");', + 'echo $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->getTranslator()->trans("trans %%var%%", array_merge(["%%var%%" => %s], %s), "messages");', $this->getVariableGetterWithoutStrictCheck('var'), $this->getVariableGetterWithStrictCheck('foo') ), @@ -53,12 +53,8 @@ protected function getVariableGetterWithStrictCheck($name) { - if (Environment::VERSION_ID > 20404) { - return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name); - } - if (Environment::MAJOR_VERSION >= 2) { - return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name); + return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name); } if (\PHP_VERSION_ID >= 70000) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ /** @dataProvider getDefaultDomainAssignmentTestData */ public function testDefaultDomainAssignment(Node $node) { - $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); $visitor = new TranslationDefaultDomainNodeVisitor(); // visit trans_default_domain tag @@ -46,13 +46,13 @@ $visitor->enterNode($node, $env); $visitor->leaveNode($node, $env); - $this->assertEquals(array(array(self::$message, self::$domain)), $visitor->getMessages()); + $this->assertEquals([[self::$message, self::$domain]], $visitor->getMessages()); } /** @dataProvider getDefaultDomainAssignmentTestData */ public function testNewModuleWithoutDefaultDomainTag(Node $node) { - $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); $visitor = new TranslationDefaultDomainNodeVisitor(); // visit trans_default_domain tag @@ -72,22 +72,22 @@ $visitor->enterNode($node, $env); $visitor->leaveNode($node, $env); - $this->assertEquals(array(array(self::$message, null)), $visitor->getMessages()); + $this->assertEquals([[self::$message, null]], $visitor->getMessages()); } public function getDefaultDomainAssignmentTestData() { - return array( - array(TwigNodeProvider::getTransFilter(self::$message)), - array(TwigNodeProvider::getTransChoiceFilter(self::$message)), - array(TwigNodeProvider::getTransTag(self::$message)), + return [ + [TwigNodeProvider::getTransFilter(self::$message)], + [TwigNodeProvider::getTransChoiceFilter(self::$message)], + [TwigNodeProvider::getTransTag(self::$message)], // with named arguments - array(TwigNodeProvider::getTransFilter(self::$message, null, array( - 'arguments' => new ArrayExpression(array(), 0), - ))), - array(TwigNodeProvider::getTransChoiceFilter(self::$message), null, array( - 'arguments' => new ArrayExpression(array(), 0), - )), - ); + [TwigNodeProvider::getTransFilter(self::$message, null, [ + 'arguments' => new ArrayExpression([], 0), + ])], + [TwigNodeProvider::getTransChoiceFilter(self::$message), null, [ + 'arguments' => new ArrayExpression([], 0), + ]], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ /** @dataProvider getMessagesExtractionTestData */ public function testMessagesExtraction(Node $node, array $expectedMessages) { - $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); $visitor = new TranslationNodeVisitor(); $visitor->enable(); $visitor->enterNode($node, $env); @@ -40,14 +40,14 @@ $node = new FilterExpression( new ConstantExpression($message, 0), new ConstantExpression('trans', 0), - new Node(array( - new ArrayExpression(array(), 0), + new Node([ + new ArrayExpression([], 0), new NameExpression('variable', 0), - )), + ]), 0 ); - $this->testMessagesExtraction($node, array(array($message, TranslationNodeVisitor::UNDEFINED_DOMAIN))); + $this->testMessagesExtraction($node, [[$message, TranslationNodeVisitor::UNDEFINED_DOMAIN]]); } public function getMessagesExtractionTestData() @@ -55,13 +55,13 @@ $message = 'new key'; $domain = 'domain'; - return array( - array(TwigNodeProvider::getTransFilter($message), array(array($message, null))), - array(TwigNodeProvider::getTransChoiceFilter($message), array(array($message, null))), - array(TwigNodeProvider::getTransTag($message), array(array($message, null))), - array(TwigNodeProvider::getTransFilter($message, $domain), array(array($message, $domain))), - array(TwigNodeProvider::getTransChoiceFilter($message, $domain), array(array($message, $domain))), - array(TwigNodeProvider::getTransTag($message, $domain), array(array($message, $domain))), - ); + return [ + [TwigNodeProvider::getTransFilter($message), [[$message, null]]], + [TwigNodeProvider::getTransChoiceFilter($message), [[$message, null]]], + [TwigNodeProvider::getTransTag($message), [[$message, null]]], + [TwigNodeProvider::getTransFilter($message, $domain), [[$message, $domain]]], + [TwigNodeProvider::getTransChoiceFilter($message, $domain), [[$message, $domain]]], + [TwigNodeProvider::getTransTag($message, $domain), [[$message, $domain]]], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TwigNodeProvider.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TwigNodeProvider.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TwigNodeProvider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TwigNodeProvider.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,9 +28,9 @@ return new ModuleNode( new ConstantExpression($content, 0), null, - new ArrayExpression(array(), 0), - new ArrayExpression(array(), 0), - new ArrayExpression(array(), 0), + new ArrayExpression([], 0), + new ArrayExpression([], 0), + new ArrayExpression([], 0), null, new Source('', '') ); @@ -39,10 +39,10 @@ public static function getTransFilter($message, $domain = null, $arguments = null) { if (!$arguments) { - $arguments = $domain ? array( - new ArrayExpression(array(), 0), + $arguments = $domain ? [ + new ArrayExpression([], 0), new ConstantExpression($domain, 0), - ) : array(); + ] : []; } return new FilterExpression( @@ -56,11 +56,11 @@ public static function getTransChoiceFilter($message, $domain = null, $arguments = null) { if (!$arguments) { - $arguments = $domain ? array( + $arguments = $domain ? [ new ConstantExpression(0, 0), - new ArrayExpression(array(), 0), + new ArrayExpression([], 0), new ConstantExpression($domain, 0), - ) : array(); + ] : []; } return new FilterExpression( @@ -74,7 +74,7 @@ public static function getTransTag($message, $domain = null) { return new TransNode( - new BodyNode(array(), array('data' => $message)), + new BodyNode([], ['data' => $message]), $domain ? new ConstantExpression($domain, 0) : null ); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ */ public function testCompile($source, $expected) { - $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); + $env = new Environment($this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); $env->addTokenParser(new FormThemeTokenParser()); $stream = $env->tokenize(new Source($source, '')); $parser = new Parser($env); @@ -38,34 +38,34 @@ public function getTestsForFormTheme() { - return array( - array( + return [ + [ '{% form_theme form "tpl1" %}', new FormThemeNode( new NameExpression('form', 1), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression(0, 1), new ConstantExpression('tpl1', 1), - ), 1), + ], 1), 1, 'form_theme' ), - ), - array( + ], + [ '{% form_theme form "tpl1" "tpl2" %}', new FormThemeNode( new NameExpression('form', 1), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression(0, 1), new ConstantExpression('tpl1', 1), new ConstantExpression(1, 1), new ConstantExpression('tpl2', 1), - ), 1), + ], 1), 1, 'form_theme' ), - ), - array( + ], + [ '{% form_theme form with "tpl1" %}', new FormThemeNode( new NameExpression('form', 1), @@ -73,48 +73,48 @@ 1, 'form_theme' ), - ), - array( + ], + [ '{% form_theme form with ["tpl1"] %}', new FormThemeNode( new NameExpression('form', 1), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression(0, 1), new ConstantExpression('tpl1', 1), - ), 1), + ], 1), 1, 'form_theme' ), - ), - array( + ], + [ '{% form_theme form with ["tpl1", "tpl2"] %}', new FormThemeNode( new NameExpression('form', 1), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression(0, 1), new ConstantExpression('tpl1', 1), new ConstantExpression(1, 1), new ConstantExpression('tpl2', 1), - ), 1), + ], 1), 1, 'form_theme' ), - ), - array( + ], + [ '{% form_theme form with ["tpl1", "tpl2"] only %}', new FormThemeNode( new NameExpression('form', 1), - new ArrayExpression(array( + new ArrayExpression([ new ConstantExpression(0, 1), new ConstantExpression('tpl1', 1), new ConstantExpression(1, 1), new ConstantExpression('tpl2', 1), - ), 1), + ], 1), 1, 'form_theme', true ), - ), - ); + ], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,12 +27,12 @@ public function testExtract($template, $messages) { $loader = $this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock(); - $twig = new Environment($loader, array( + $twig = new Environment($loader, [ 'strict_variables' => true, 'debug' => true, 'cache' => false, 'autoescape' => false, - )); + ]); $twig->addExtension(new TranslationExtension($this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock())); $extractor = new TwigExtractor($twig); @@ -51,28 +51,28 @@ public function getExtractData() { - return array( - array('{{ "new key" | trans() }}', array('new key' => 'messages')), - array('{{ "new key" | trans() | upper }}', array('new key' => 'messages')), - array('{{ "new key" | trans({}, "domain") }}', array('new key' => 'domain')), - array('{{ "new key" | transchoice(1) }}', array('new key' => 'messages')), - array('{{ "new key" | transchoice(1) | upper }}', array('new key' => 'messages')), - array('{{ "new key" | transchoice(1, {}, "domain") }}', array('new key' => 'domain')), - array('{% trans %}new key{% endtrans %}', array('new key' => 'messages')), - array('{% trans %} new key {% endtrans %}', array('new key' => 'messages')), - array('{% trans from "domain" %}new key{% endtrans %}', array('new key' => 'domain')), - array('{% set foo = "new key" | trans %}', array('new key' => 'messages')), - array('{{ 1 ? "new key" | trans : "another key" | trans }}', array('new key' => 'messages', 'another key' => 'messages')), + return [ + ['{{ "new key" | trans() }}', ['new key' => 'messages']], + ['{{ "new key" | trans() | upper }}', ['new key' => 'messages']], + ['{{ "new key" | trans({}, "domain") }}', ['new key' => 'domain']], + ['{{ "new key" | transchoice(1) }}', ['new key' => 'messages']], + ['{{ "new key" | transchoice(1) | upper }}', ['new key' => 'messages']], + ['{{ "new key" | transchoice(1, {}, "domain") }}', ['new key' => 'domain']], + ['{% trans %}new key{% endtrans %}', ['new key' => 'messages']], + ['{% trans %} new key {% endtrans %}', ['new key' => 'messages']], + ['{% trans from "domain" %}new key{% endtrans %}', ['new key' => 'domain']], + ['{% set foo = "new key" | trans %}', ['new key' => 'messages']], + ['{{ 1 ? "new key" | trans : "another key" | trans }}', ['new key' => 'messages', 'another key' => 'messages']], // make sure 'trans_default_domain' tag is supported - array('{% trans_default_domain "domain" %}{{ "new key"|trans }}', array('new key' => 'domain')), - array('{% trans_default_domain "domain" %}{{ "new key"|transchoice }}', array('new key' => 'domain')), - array('{% trans_default_domain "domain" %}{% trans %}new key{% endtrans %}', array('new key' => 'domain')), + ['{% trans_default_domain "domain" %}{{ "new key"|trans }}', ['new key' => 'domain']], + ['{% trans_default_domain "domain" %}{{ "new key"|transchoice }}', ['new key' => 'domain']], + ['{% trans_default_domain "domain" %}{% trans %}new key{% endtrans %}', ['new key' => 'domain']], // make sure this works with twig's named arguments - array('{{ "new key" | trans(domain="domain") }}', array('new key' => 'domain')), - array('{{ "new key" | transchoice(domain="domain", count=1) }}', array('new key' => 'domain')), - ); + ['{{ "new key" | trans(domain="domain") }}', ['new key' => 'domain']], + ['{{ "new key" | transchoice(domain="domain", count=1) }}', ['new key' => 'domain']], + ]; } /** @@ -105,11 +105,11 @@ */ public function resourcesWithSyntaxErrorsProvider() { - return array( - array(__DIR__.'/../Fixtures'), - array(__DIR__.'/../Fixtures/extractor/syntax_error.twig'), - array(new \SplFileInfo(__DIR__.'/../Fixtures/extractor/syntax_error.twig')), - ); + return [ + [__DIR__.'/../Fixtures'], + [__DIR__.'/../Fixtures/extractor/syntax_error.twig'], + [new \SplFileInfo(__DIR__.'/../Fixtures/extractor/syntax_error.twig')], + ]; } /** @@ -117,13 +117,13 @@ */ public function testExtractWithFiles($resource) { - $loader = new ArrayLoader(array()); - $twig = new Environment($loader, array( + $loader = new ArrayLoader([]); + $twig = new Environment($loader, [ 'strict_variables' => true, 'debug' => true, 'cache' => false, 'autoescape' => false, - )); + ]); $twig->addExtension(new TranslationExtension($this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock())); $extractor = new TwigExtractor($twig); @@ -141,12 +141,12 @@ { $directory = __DIR__.'/../Fixtures/extractor/'; - return array( - array($directory.'with_translations.html.twig'), - array(array($directory.'with_translations.html.twig')), - array(array(new \SplFileInfo($directory.'with_translations.html.twig'))), - array(new \ArrayObject(array($directory.'with_translations.html.twig'))), - array(new \ArrayObject(array(new \SplFileInfo($directory.'with_translations.html.twig')))), - ); + return [ + [$directory.'with_translations.html.twig'], + [[$directory.'with_translations.html.twig']], + [[new \SplFileInfo($directory.'with_translations.html.twig')]], + [new \ArrayObject([$directory.'with_translations.html.twig'])], + [new \ArrayObject([new \SplFileInfo($directory.'with_translations.html.twig')])], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,7 +23,7 @@ { $engine = $this->getTwig(); - $this->assertTrue($engine->exists($this->getMockForAbstractClass('Twig\Template', array(), '', false))); + $this->assertTrue($engine->exists($this->getMockForAbstractClass('Twig\Template', [], '', false))); } public function testExistsWithNonExistentTemplates() @@ -70,10 +70,10 @@ protected function getTwig() { - $twig = new Environment(new ArrayLoader(array( + $twig = new Environment(new ArrayLoader([ 'index' => 'foo', 'error' => '{{ foo }', - ))); + ])); $parser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock(); return new TwigEngine($twig, $parser); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,7 +45,7 @@ $only = true; } } else { - $resources = new ArrayExpression(array(), $stream->getCurrent()->getLine()); + $resources = new ArrayExpression([], $stream->getCurrent()->getLine()); do { $resources->addElement($this->parser->getExpressionParser()->parseExpression()); } while (!$stream->test(Token::BLOCK_END_TYPE)); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/StopwatchTokenParser.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/StopwatchTokenParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/StopwatchTokenParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/StopwatchTokenParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,7 +41,7 @@ $stream->expect(Token::BLOCK_END_TYPE); // {% endstopwatch %} - $body = $this->parser->subparse(array($this, 'decideStopwatchEnd'), true); + $body = $this->parser->subparse([$this, 'decideStopwatchEnd'], true); $stream->expect(Token::BLOCK_END_TYPE); if ($this->stopwatchIsAvailable) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,7 +38,7 @@ $lineno = $token->getLine(); $stream = $this->parser->getStream(); - $vars = new ArrayExpression(array(), $lineno); + $vars = new ArrayExpression([], $lineno); $count = $this->parser->getExpressionParser()->parseExpression(); @@ -65,10 +65,10 @@ $stream->expect(Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true); + $body = $this->parser->subparse([$this, 'decideTransChoiceFork'], true); if (!$body instanceof TextNode && !$body instanceof AbstractExpression) { - throw new SyntaxError('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName()); + throw new SyntaxError('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()); } $stream->expect(Token::BLOCK_END_TYPE); @@ -78,7 +78,7 @@ public function decideTransChoiceFork($token) { - return $token->test(array('endtranschoice')); + return $token->test(['endtranschoice']); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ $lineno = $token->getLine(); $stream = $this->parser->getStream(); - $vars = new ArrayExpression(array(), $lineno); + $vars = new ArrayExpression([], $lineno); $domain = null; $locale = null; if (!$stream->test(Token::BLOCK_END_TYPE)) { @@ -60,16 +60,16 @@ $stream->next(); $locale = $this->parser->getExpressionParser()->parseExpression(); } elseif (!$stream->test(Token::BLOCK_END_TYPE)) { - throw new SyntaxError('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName()); + throw new SyntaxError('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); } } // {% trans %}message{% endtrans %} $stream->expect(Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'decideTransFork'), true); + $body = $this->parser->subparse([$this, 'decideTransFork'], true); if (!$body instanceof TextNode && !$body instanceof AbstractExpression) { - throw new SyntaxError('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName()); + throw new SyntaxError('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()); } $stream->expect(Token::BLOCK_END_TYPE); @@ -79,7 +79,7 @@ public function decideTransFork($token) { - return $token->test(array('endtrans')); + return $token->test(['endtrans']); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TwigEngine.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TwigEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/TwigEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/TwigEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -44,7 +44,7 @@ * * @throws Error if something went wrong like a thrown exception while rendering the template */ - public function render($name, array $parameters = array()) + public function render($name, array $parameters = []) { return $this->load($name)->render($parameters); } @@ -56,7 +56,7 @@ * * @throws Error if something went wrong like a thrown exception while rendering the template */ - public function stream($name, array $parameters = array()) + public function stream($name, array $parameters = []) { $this->load($name)->display($parameters); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,15 +19,15 @@ */ class UndefinedCallableHandler { - private static $filterComponents = array( + private static $filterComponents = [ 'humanize' => 'form', 'trans' => 'translation', 'transchoice' => 'translation', 'yaml_encode' => 'yaml', 'yaml_dump' => 'yaml', - ); + ]; - private static $functionComponents = array( + private static $functionComponents = [ 'asset' => 'asset', 'asset_version' => 'asset', 'dump' => 'debug-bundle', @@ -54,15 +54,15 @@ 'workflow_transitions' => 'workflow', 'workflow_has_marked_place' => 'workflow', 'workflow_marked_places' => 'workflow', - ); + ]; - private static $fullStackEnable = array( + private static $fullStackEnable = [ 'form' => 'enable "framework.form"', 'security-core' => 'add the "SecurityBundle"', 'security-http' => 'add the "SecurityBundle"', 'web-link' => 'enable "framework.web_link"', 'workflow' => 'enable "framework.workflows"', - ); + ]; public static function onUndefinedFilter($name) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,9 +39,9 @@ $container->getDefinition('var_dumper.cli_dumper')->setPrivate(true); $container->getDefinition('var_dumper.cloner') - ->addMethodCall('setMaxItems', array($config['max_items'])) - ->addMethodCall('setMinDepth', array($config['min_depth'])) - ->addMethodCall('setMaxString', array($config['max_string_length'])); + ->addMethodCall('setMaxItems', [$config['max_items']]) + ->addMethodCall('setMinDepth', [$config['min_depth']]) + ->addMethodCall('setMaxString', [$config['max_string_length']]); if (null !== $config['dump_destination']) { $container->getDefinition('var_dumper.cli_dumper') diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/Compiler/DumpDataCollectorPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/Compiler/DumpDataCollectorPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/Compiler/DumpDataCollectorPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/Compiler/DumpDataCollectorPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ $container = new ContainerBuilder(); $container->addCompilerPass(new DumpDataCollectorPass()); - $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, null)); + $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', [null, null, null, null]); $container->setDefinition('data_collector.dump', $definition); $container->compile(); @@ -39,7 +39,7 @@ $container->addCompilerPass(new DumpDataCollectorPass()); $requestStack = new RequestStack(); - $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, $requestStack)); + $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', [null, null, null, $requestStack]); $container->setDefinition('data_collector.dump', $definition); $container->setParameter('web_profiler.debug_toolbar.mode', WebDebugToolbarListener::ENABLED); @@ -53,7 +53,7 @@ $container = new ContainerBuilder(); $container->addCompilerPass(new DumpDataCollectorPass()); - $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, new RequestStack())); + $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', [null, null, null, new RequestStack()]); $container->setDefinition('data_collector.dump', $definition); $container->setParameter('web_profiler.debug_toolbar.mode', WebDebugToolbarListener::DISABLED); @@ -67,7 +67,7 @@ $container = new ContainerBuilder(); $container->addCompilerPass(new DumpDataCollectorPass()); - $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', array(null, null, null, new RequestStack())); + $definition = new Definition('Symfony\Component\HttpKernel\DataCollector\DumpDataCollector', [null, null, null, new RequestStack()]); $container->setDefinition('data_collector.dump', $definition); $container->compile(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/DebugExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/DebugExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/DebugExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/DebugExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,36 +22,36 @@ { $container = $this->createContainer(); $container->registerExtension(new DebugExtension()); - $container->loadFromExtension('debug', array()); + $container->loadFromExtension('debug', []); $this->compileContainer($container); - $expectedTags = array( - array( + $expectedTags = [ + [ 'id' => 'dump', 'template' => '@Debug/Profiler/dump.html.twig', 'priority' => 240, - ), - ); + ], + ]; $this->assertSame($expectedTags, $container->getDefinition('data_collector.dump')->getTag('data_collector')); } private function createContainer() { - $container = new ContainerBuilder(new ParameterBag(array( + $container = new ContainerBuilder(new ParameterBag([ 'kernel.cache_dir' => __DIR__, 'kernel.charset' => 'UTF-8', 'kernel.debug' => true, - 'kernel.bundles' => array('DebugBundle' => 'Symfony\\Bundle\\DebugBundle\\DebugBundle'), - ))); + 'kernel.bundles' => ['DebugBundle' => 'Symfony\\Bundle\\DebugBundle\\DebugBundle'], + ])); return $container; } private function compileContainer(ContainerBuilder $container) { - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,13 +54,13 @@ { $arrayAdapter = new ArrayAdapter(); - spl_autoload_register(array(PhpArrayAdapter::class, 'throwOnRequiredClass')); + spl_autoload_register([PhpArrayAdapter::class, 'throwOnRequiredClass']); try { if (!$this->doWarmUp($cacheDir, $arrayAdapter)) { return; } } finally { - spl_autoload_unregister(array(PhpArrayAdapter::class, 'throwOnRequiredClass')); + spl_autoload_unregister([PhpArrayAdapter::class, 'throwOnRequiredClass']); } // the ArrayAdapter stores the values serialized diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -71,8 +71,8 @@ */ public static function getSubscribedServices() { - return array( + return [ 'router' => RouterInterface::class, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -74,7 +74,7 @@ */ private function extractSupportedLoaders(array $loaders) { - $supportedLoaders = array(); + $supportedLoaders = []; foreach ($loaders as $loader) { if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php 2019-02-03 12:23:08.000000000 +0000 @@ -52,7 +52,7 @@ return $this->templates; } - $templates = array(); + $templates = []; foreach ($this->kernel->getBundles() as $bundle) { $templates = array_merge($templates, $this->findTemplatesInBundle($bundle)); @@ -72,7 +72,7 @@ */ private function findTemplatesInFolder($dir) { - $templates = array(); + $templates = []; if (is_dir($dir)) { $finder = new Finder(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ public function warmUp($cacheDir) { $filesystem = new Filesystem(); - $templates = array(); + $templates = []; foreach ($this->finder->findAllTemplates() as $template) { $templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -72,8 +72,8 @@ */ public static function getSubscribedServices() { - return array( + return [ 'translator' => TranslatorInterface::class, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -85,7 +85,7 @@ */ private function extractSupportedLoaders(array $loaders) { - $supportedLoaders = array(); + $supportedLoaders = []; foreach ($loaders as $loader) { if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Client.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Client.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Client.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Client.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ /** * {@inheritdoc} */ - public function __construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null) + public function __construct(KernelInterface $kernel, array $server = [], History $history = null, CookieJar $cookieJar = null) { parent::__construct($kernel, $server, $history, $cookieJar); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,46 +60,46 @@ /** @var $kernel KernelInterface */ $kernel = $this->getApplication()->getKernel(); - $rows = array( - array('Symfony'), + $rows = [ + ['Symfony'], new TableSeparator(), - array('Version', Kernel::VERSION), - array('End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' Expired' : '')), - array('End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' Expired' : '')), + ['Version', Kernel::VERSION], + ['End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' Expired' : '')], + ['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' Expired' : '')], new TableSeparator(), - array('Kernel'), + ['Kernel'], new TableSeparator(), - array('Type', \get_class($kernel)), - array('Name', $kernel->getName()), - array('Environment', $kernel->getEnvironment()), - array('Debug', $kernel->isDebug() ? 'true' : 'false'), - array('Charset', $kernel->getCharset()), - array('Root directory', self::formatPath($kernel->getRootDir(), $kernel->getProjectDir())), - array('Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' ('.self::formatFileSize($kernel->getCacheDir()).')'), - array('Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' ('.self::formatFileSize($kernel->getLogDir()).')'), + ['Type', \get_class($kernel)], + ['Name', $kernel->getName()], + ['Environment', $kernel->getEnvironment()], + ['Debug', $kernel->isDebug() ? 'true' : 'false'], + ['Charset', $kernel->getCharset()], + ['Root directory', self::formatPath($kernel->getRootDir(), $kernel->getProjectDir())], + ['Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' ('.self::formatFileSize($kernel->getCacheDir()).')'], + ['Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' ('.self::formatFileSize($kernel->getLogDir()).')'], new TableSeparator(), - array('PHP'), + ['PHP'], new TableSeparator(), - array('Version', PHP_VERSION), - array('Architecture', (PHP_INT_SIZE * 8).' bits'), - array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'), - array('Timezone', date_default_timezone_get().' ('.(new \DateTime())->format(\DateTime::W3C).')'), - array('OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'), - array('APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'), - array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'), - ); + ['Version', PHP_VERSION], + ['Architecture', (PHP_INT_SIZE * 8).' bits'], + ['Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'], + ['Timezone', date_default_timezone_get().' ('.(new \DateTime())->format(\DateTime::W3C).')'], + ['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'], + ['APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'], + ['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'], + ]; if ($dotenv = self::getDotenvVars()) { - $rows = array_merge($rows, array( + $rows = array_merge($rows, [ new TableSeparator(), - array('Environment (.env)'), + ['Environment (.env)'], new TableSeparator(), - ), array_map(function ($value, $name) { - return array($name, $value); + ], array_map(function ($value, $name) { + return [$name, $value]; }, $dotenv, array_keys($dotenv))); } - $io->table(array(), $rows); + $io->table([], $rows); } private static function formatPath($path, $baseDir = null) @@ -130,7 +130,7 @@ private static function getDotenvVars() { - $vars = array(); + $vars = []; foreach (explode(',', getenv('SYMFONY_DOTENV_VARS')) as $name) { if ('' !== $name && false !== $value = getenv($name)) { $vars[$name] = $value; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,8 +29,8 @@ protected function listBundles($output) { $title = 'Available registered bundles with their extension alias if available'; - $headers = array('Bundle name', 'Extension alias'); - $rows = array(); + $headers = ['Bundle name', 'Extension alias']; + $rows = []; $bundles = $this->getApplication()->getKernel()->getBundles(); usort($bundles, function ($bundleA, $bundleB) { @@ -39,7 +39,7 @@ foreach ($bundles as $bundle) { $extension = $bundle->getContainerExtension(); - $rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : ''); + $rows[] = [$bundle->getName(), $extension ? $extension->getAlias() : '']; } if ($output instanceof StyleInterface) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,9 +65,9 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', null), - )) + ]) ->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it') ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks') ->setDescription('Installs bundles web assets under a public directory') @@ -144,10 +144,10 @@ $io->newLine(); - $rows = array(); + $rows = []; $copyUsed = false; $exitCode = 0; - $validAssetDirs = array(); + $validAssetDirs = []; /** @var BundleInterface $bundle */ foreach ($kernel->getBundles() as $bundle) { if (!is_dir($originDir = $bundle->getPath().'/Resources/public')) { @@ -180,13 +180,13 @@ } if ($method === $expectedMethod) { - $rows[] = array(sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method); + $rows[] = [sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method]; } else { - $rows[] = array(sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method); + $rows[] = [sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method]; } } catch (\Exception $e) { $exitCode = 1; - $rows[] = array(sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage()); + $rows[] = [sprintf('%s', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage()]; } } // remove the assets of the bundles that no longer exist @@ -196,7 +196,7 @@ } if ($rows) { - $io->table(array('', 'Bundle', 'Method / Error'), $rows); + $io->table(['', 'Bundle', 'Method / Error'], $rows); } if (0 !== $exitCode) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -66,10 +66,10 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'), new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), - )) + ]) ->setDescription('Clears the cache') ->setHelp(<<<'EOF' The %command.name% command clears the application cache for a given environment @@ -148,7 +148,7 @@ if ('/' === \DIRECTORY_SEPARATOR && $mounts = @file('/proc/mounts')) { foreach ($mounts as $mount) { $mount = \array_slice(explode(' ', $mount), 1, -3); - if (!\in_array(array_pop($mount), array('vboxsf', 'nfs'))) { + if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) { continue; } $mount = implode(' ', $mount).'/'; @@ -222,7 +222,7 @@ $warmer->warmUp($warmupDir); // fix references to cached files with the real cache directory name - $search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir)); + $search = [$warmupDir, str_replace('\\', '\\\\', $warmupDir)]; $replace = str_replace('\\', '/', $realCacheDir); foreach (Finder::create()->files()->in($warmupDir) as $file) { $content = str_replace($search, $replace, file_get_contents($file), $count); @@ -338,7 +338,7 @@ // filter container's resources, removing reference to temp kernel file \$resources = \$container->getResources(); - \$filteredResources = array(); + \$filteredResources = []; foreach (\$resources as \$resource) { if ((string) \$resource !== __FILE__) { \$filteredResources[] = \$resource; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,9 +54,9 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('pools', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'A list of cache pools or cache pool clearers'), - )) + ]) ->setDescription('Clears cache pools') ->setHelp(<<<'EOF' The %command.name% command clears the given cache pools or cache pool clearers. @@ -80,8 +80,8 @@ $io = new SymfonyStyle($input, $output); $kernel = $this->getApplication()->getKernel(); - $pools = array(); - $clearers = array(); + $pools = []; + $clearers = []; foreach ($input->getArgument('pools') as $id) { if ($this->poolClearer->hasPool($id)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,9 +54,9 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), - )) + ]) ->setDescription('Warms up an empty cache') ->setHelp(<<<'EOF' The %command.name% command warms up the cache. diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,10 +36,10 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'), new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'), - )) + ]) ->setDescription('Dumps the current configuration for an extension') ->setHelp(<<<'EOF' The %command.name% command dumps the current configuration for an @@ -94,7 +94,7 @@ sprintf('Current configuration for %s', ($name === $extensionAlias ? sprintf('extension with alias "%s"', $extensionAlias) : sprintf('"%s"', $name))) ); - $io->writeln(Yaml::dump(array($extensionAlias => $config), 10)); + $io->writeln(Yaml::dump([$extensionAlias => $config], 10)); return; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,11 +39,11 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'), new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (yaml or xml)', 'yaml'), - )) + ]) ->setDescription('Dumps the default configuration for an extension') ->setHelp(<<<'EOF' The %command.name% command dumps the default configuration for an @@ -81,17 +81,17 @@ if (null === $name = $input->getArgument('name')) { $this->listBundles($errorIo); - $errorIo->comment(array( + $errorIo->comment([ 'Provide the name of a bundle as the first argument of this command to dump its default configuration. (e.g. config:dump-reference FrameworkBundle)', 'For dumping a specific option, add its path as the second argument of this command. (e.g. config:dump-reference FrameworkBundle profiler.matcher to dump the framework.profiler.matcher configuration)', - )); + ]); return; } $extension = $this->findExtension($name); - $configuration = $extension->getConfiguration(array(), $this->getContainerBuilder()); + $configuration = $extension->getConfiguration([], $this->getContainerBuilder()); $this->validateConfiguration($extension, $configuration); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -46,7 +46,7 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'), new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services'), new InputOption('show-arguments', null, InputOption::VALUE_NONE, 'Used to show arguments in services'), @@ -57,7 +57,7 @@ new InputOption('types', null, InputOption::VALUE_NONE, 'Displays types (classes/interfaces) available in the container'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'), - )) + ]) ->setDescription('Displays current services for an application') ->setHelp(<<<'EOF' The %command.name% command displays all configured public services: @@ -110,26 +110,26 @@ $object = $this->getContainerBuilder(); if ($input->getOption('types')) { - $options = array('show_private' => true); - $options['filter'] = array($this, 'filterToServiceTypes'); + $options = ['show_private' => true]; + $options['filter'] = [$this, 'filterToServiceTypes']; } elseif ($input->getOption('parameters')) { - $parameters = array(); + $parameters = []; foreach ($object->getParameterBag()->all() as $k => $v) { $parameters[$k] = $object->resolveEnvPlaceholders($v); } $object = new ParameterBag($parameters); - $options = array(); + $options = []; } elseif ($parameter = $input->getOption('parameter')) { - $options = array('parameter' => $parameter); + $options = ['parameter' => $parameter]; } elseif ($input->getOption('tags')) { - $options = array('group_by' => 'tags', 'show_private' => $input->getOption('show-private')); + $options = ['group_by' => 'tags', 'show_private' => $input->getOption('show-private')]; } elseif ($tag = $input->getOption('tag')) { - $options = array('tag' => $tag, 'show_private' => $input->getOption('show-private')); + $options = ['tag' => $tag, 'show_private' => $input->getOption('show-private')]; } elseif ($name = $input->getArgument('name')) { $name = $this->findProperServiceName($input, $errorIo, $object, $name); - $options = array('id' => $name); + $options = ['id' => $name]; } else { - $options = array('show_private' => $input->getOption('show-private')); + $options = ['show_private' => $input->getOption('show-private')]; } $helper = new DescriptorHelper(); @@ -157,7 +157,7 @@ */ protected function validateInput(InputInterface $input) { - $options = array('tags', 'tag', 'parameters', 'parameter'); + $options = ['tags', 'tag', 'parameters', 'parameter']; $optionsCount = 0; foreach ($options as $option) { @@ -192,7 +192,7 @@ if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) { $buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel)); $container = $buildContainer(); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); } else { (new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump')); @@ -220,7 +220,7 @@ private function findServiceIdsContaining(ContainerBuilder $builder, $name) { $serviceIds = $builder->getServiceIds(); - $foundServiceIds = array(); + $foundServiceIds = []; foreach ($serviceIds as $serviceId) { if (false === stripos($serviceId, $name)) { continue; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,9 +33,9 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('search', InputArgument::OPTIONAL, 'A search filter'), - )) + ]) ->setDescription('Lists classes/interfaces you can use for autowiring') ->setHelp(<<<'EOF' The %command.name% command displays all classes and interfaces that @@ -62,7 +62,7 @@ $builder = $this->getContainerBuilder(); $serviceIds = $builder->getServiceIds(); - $serviceIds = array_filter($serviceIds, array($this, 'filterToServiceTypes')); + $serviceIds = array_filter($serviceIds, [$this, 'filterToServiceTypes']); if ($search = $input->getArgument('search')) { $serviceIds = array_filter($serviceIds, function ($serviceId) use ($search) { @@ -84,14 +84,14 @@ $io->text(sprintf('(only showing classes/interfaces matching %s)', $search)); } $io->newLine(); - $tableRows = array(); + $tableRows = []; foreach ($serviceIds as $serviceId) { - $tableRows[] = array(sprintf('%s', $serviceId)); + $tableRows[] = [sprintf('%s', $serviceId)]; if ($builder->hasAlias($serviceId)) { - $tableRows[] = array(sprintf(' alias to %s', $builder->getAlias($serviceId))); + $tableRows[] = [sprintf(' alias to %s', $builder->getAlias($serviceId))]; } } - $io->table(array(), $tableRows); + $io->table([], $tableRows); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -55,11 +55,11 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('event', InputArgument::OPTIONAL, 'An event name'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'), - )) + ]) ->setDescription('Displays configured listeners for an application') ->setHelp(<<<'EOF' The %command.name% command displays all configured listeners: @@ -88,7 +88,7 @@ $io = new SymfonyStyle($input, $output); - $options = array(); + $options = []; if ($event = $input->getArgument('event')) { if (!$this->dispatcher->hasListeners($event)) { $io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.', $event)); @@ -96,7 +96,7 @@ return; } - $options = array('event' => $event); + $options = ['event' => $event]; } $helper = new DescriptorHelper(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,12 +81,12 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('name', InputArgument::OPTIONAL, 'A route name'), new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw route(s)'), - )) + ]) ->setDescription('Displays current routes for an application') ->setHelp(<<<'EOF' The %command.name% displays the configured routes: @@ -122,24 +122,24 @@ $callable = $this->extractCallable($route); - $helper->describe($io, $route, array( + $helper->describe($io, $route, [ 'format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'name' => $name, 'output' => $io, 'callable' => $callable, - )); + ]); } else { foreach ($routes as $route) { $this->convertController($route); } - $helper->describe($io, $routes, array( + $helper->describe($io, $routes, [ 'format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'show_controllers' => $input->getOption('show-controllers'), 'output' => $io, - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -78,12 +78,12 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'), new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'), new InputOption('scheme', null, InputOption::VALUE_REQUIRED, 'Sets the URI scheme (usually http or https)'), new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the URI host'), - )) + ]) ->setDescription('Helps debug routes by simulating a path info match') ->setHelp(<<<'EOF' The %command.name% shows which routes match a given request and which don't and for what reason: @@ -136,7 +136,7 @@ $io->success(sprintf('Route "%s" matches', $trace['name'])); $routerDebugCommand = $this->getApplication()->find('debug:router'); - $routerDebugCommand->run(new ArrayInput(array('name' => $trace['name'])), $output); + $routerDebugCommand->run(new ArrayInput(['name' => $trace['name']]), $output); $matches = true; } elseif ($input->getOption('verbose')) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -74,14 +74,14 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'), new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'), new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'), new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'), new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'), - )) + ]) ->setDescription('Displays translation messages information') ->setHelp(<<<'EOF' The %command.name% command helps finding unused or missing translation @@ -156,11 +156,11 @@ $kernel = $this->getApplication()->getKernel(); // Define Root Paths - $transPaths = array($kernel->getRootDir().'/Resources/translations'); + $transPaths = [$kernel->getRootDir().'/Resources/translations']; if ($this->defaultTransPath) { $transPaths[] = $this->defaultTransPath; } - $viewsPaths = array($kernel->getRootDir().'/Resources/views'); + $viewsPaths = [$kernel->getRootDir().'/Resources/views']; if ($this->defaultViewsPath) { $viewsPaths[] = $this->defaultViewsPath; } @@ -169,20 +169,20 @@ if (null !== $input->getArgument('bundle')) { try { $bundle = $kernel->getBundle($input->getArgument('bundle')); - $transPaths = array($bundle->getPath().'/Resources/translations'); + $transPaths = [$bundle->getPath().'/Resources/translations']; if ($this->defaultTransPath) { $transPaths[] = $this->defaultTransPath.'/'.$bundle->getName(); } $transPaths[] = sprintf('%s/Resources/%s/translations', $kernel->getRootDir(), $bundle->getName()); - $viewsPaths = array($bundle->getPath().'/Resources/views'); + $viewsPaths = [$bundle->getPath().'/Resources/views']; if ($this->defaultViewsPath) { $viewsPaths[] = $this->defaultViewsPath.'/bundles/'.$bundle->getName(); } $viewsPaths[] = sprintf('%s/Resources/%s/views', $kernel->getRootDir(), $bundle->getName()); } catch (\InvalidArgumentException $e) { // such a bundle does not exist, so treat the argument as path - $transPaths = array($input->getArgument('bundle').'/Resources/translations'); - $viewsPaths = array($input->getArgument('bundle').'/Resources/views'); + $transPaths = [$input->getArgument('bundle').'/Resources/translations']; + $viewsPaths = [$input->getArgument('bundle').'/Resources/views']; if (!is_dir($transPaths[0])) { throw new InvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0])); @@ -213,7 +213,7 @@ $mergeOperation = new MergeOperation($extractedCatalogue, $currentCatalogue); $allMessages = $mergeOperation->getResult()->all($domain); if (null !== $domain) { - $allMessages = array($domain => $allMessages); + $allMessages = [$domain => $allMessages]; } // No defined or extracted messages @@ -233,16 +233,16 @@ $fallbackCatalogues = $this->loadFallbackCatalogues($locale, $transPaths); // Display header line - $headers = array('State', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale)); + $headers = ['State', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale)]; foreach ($fallbackCatalogues as $fallbackCatalogue) { $headers[] = sprintf('Fallback Message Preview (%s)', $fallbackCatalogue->getLocale()); } - $rows = array(); + $rows = []; // Iterate all message ids and determine their state foreach ($allMessages as $domain => $messages) { foreach (array_keys($messages) as $messageId) { $value = $currentCatalogue->get($messageId, $domain); - $states = array(); + $states = []; if ($extractedCatalogue->defines($messageId, $domain)) { if (!$currentCatalogue->defines($messageId, $domain)) { @@ -265,7 +265,7 @@ } } - $row = array($this->formatStates($states), $domain, $this->formatId($messageId), $this->sanitizeString($value)); + $row = [$this->formatStates($states), $domain, $this->formatId($messageId), $this->sanitizeString($value)]; foreach ($fallbackCatalogues as $fallbackCatalogue) { $row[] = $this->sanitizeString($fallbackCatalogue->get($messageId, $domain)); } @@ -296,7 +296,7 @@ private function formatStates(array $states) { - $result = array(); + $result = []; foreach ($states as $state) { $result[] = $this->formatState($state); } @@ -368,7 +368,7 @@ */ private function loadFallbackCatalogues($locale, $transPaths) { - $fallbackCatalogues = array(); + $fallbackCatalogues = []; if ($this->translator instanceof Translator || $this->translator instanceof DataCollectorTranslator || $this->translator instanceof LoggingTranslator) { foreach ($this->translator->getFallbackLocales() as $fallbackLocale) { if ($fallbackLocale === $locale) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -78,7 +78,7 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'), new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'), @@ -89,7 +89,7 @@ new InputOption('no-backup', null, InputOption::VALUE_NONE, 'Should backup be disabled'), new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'), new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'Specify the domain to update'), - )) + ]) ->setDescription('Updates the translation file') ->setHelp(<<<'EOF' The %command.name% command extracts translation strings from templates @@ -155,7 +155,7 @@ // check format $supportedFormats = $this->writer->getFormats(); if (!\in_array($input->getOption('output-format'), $supportedFormats)) { - $errorIo->error(array('Wrong output format', 'Supported formats are: '.implode(', ', $supportedFormats).'.')); + $errorIo->error(['Wrong output format', 'Supported formats are: '.implode(', ', $supportedFormats).'.']); return 1; } @@ -163,11 +163,11 @@ $kernel = $this->getApplication()->getKernel(); // Define Root Paths - $transPaths = array($kernel->getRootDir().'/Resources/translations'); + $transPaths = [$kernel->getRootDir().'/Resources/translations']; if ($this->defaultTransPath) { $transPaths[] = $this->defaultTransPath; } - $viewsPaths = array($kernel->getRootDir().'/Resources/views'); + $viewsPaths = [$kernel->getRootDir().'/Resources/views']; if ($this->defaultViewsPath) { $viewsPaths[] = $this->defaultViewsPath; } @@ -177,12 +177,12 @@ if (null !== $input->getArgument('bundle')) { try { $foundBundle = $kernel->getBundle($input->getArgument('bundle')); - $transPaths = array($foundBundle->getPath().'/Resources/translations'); + $transPaths = [$foundBundle->getPath().'/Resources/translations']; if ($this->defaultTransPath) { $transPaths[] = $this->defaultTransPath.'/'.$foundBundle->getName(); } $transPaths[] = sprintf('%s/Resources/%s/translations', $kernel->getRootDir(), $foundBundle->getName()); - $viewsPaths = array($foundBundle->getPath().'/Resources/views'); + $viewsPaths = [$foundBundle->getPath().'/Resources/views']; if ($this->defaultViewsPath) { $viewsPaths[] = $this->defaultViewsPath.'/bundles/'.$foundBundle->getName(); } @@ -190,8 +190,8 @@ $currentName = $foundBundle->getName(); } catch (\InvalidArgumentException $e) { // such a bundle does not exist, so treat the argument as path - $transPaths = array($input->getArgument('bundle').'/Resources/translations'); - $viewsPaths = array($input->getArgument('bundle').'/Resources/views'); + $transPaths = [$input->getArgument('bundle').'/Resources/translations']; + $viewsPaths = [$input->getArgument('bundle').'/Resources/views']; $currentName = $transPaths[0]; if (!is_dir($transPaths[0])) { @@ -299,7 +299,7 @@ $bundleTransPath = end($transPaths); } - $this->writer->write($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->defaultLocale)); + $this->writer->write($operation->getResult(), $input->getOption('output-format'), ['path' => $bundleTransPath, 'default_locale' => $this->defaultLocale]); if (true === $input->getOption('dump-messages')) { $resultMessage .= ' and translation files were updated'; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,10 +34,10 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'), new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'), - )) + ]) ->setDescription('Dump a workflow') ->setHelp(<<<'EOF' The %command.name% command dumps the graphical representation of a diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/composer.json symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/composer.json --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/composer.json 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/composer.json 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ "symfony/css-selector": "~2.8|~3.0|~4.0", "symfony/dom-crawler": "~2.8|~3.0|~4.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/form": "~3.4|~4.0", + "symfony/form": "^3.4.22|~4.1.11|^4.2.3", "symfony/expression-language": "~2.8|~3.0|~4.0", "symfony/process": "~2.8|~3.0|~4.0", "symfony/security-core": "~3.2|~4.0", diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Application.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Application.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Application.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Application.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ { private $kernel; private $commandsRegistered = false; - private $registrationErrors = array(); + private $registrationErrors = []; public function __construct(KernelInterface $kernel) { @@ -166,7 +166,7 @@ } if ($container->hasParameter('console.command.ids')) { - $lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : array(); + $lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : []; foreach ($container->getParameter('console.command.ids') as $id) { if (!isset($lazyCommandIds[$id])) { try { @@ -193,6 +193,6 @@ $this->doRenderException($error, $output); } - $this->registrationErrors = array(); + $this->registrationErrors = []; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,7 +36,7 @@ /** * {@inheritdoc} */ - public function describe(OutputInterface $output, $object, array $options = array()) + public function describe(OutputInterface $output, $object, array $options = []) { $this->output = $output; @@ -103,22 +103,22 @@ /** * Describes an InputArgument instance. */ - abstract protected function describeRouteCollection(RouteCollection $routes, array $options = array()); + abstract protected function describeRouteCollection(RouteCollection $routes, array $options = []); /** * Describes an InputOption instance. */ - abstract protected function describeRoute(Route $route, array $options = array()); + abstract protected function describeRoute(Route $route, array $options = []); /** * Describes container parameters. */ - abstract protected function describeContainerParameters(ParameterBag $parameters, array $options = array()); + abstract protected function describeContainerParameters(ParameterBag $parameters, array $options = []); /** * Describes container tags. */ - abstract protected function describeContainerTags(ContainerBuilder $builder, array $options = array()); + abstract protected function describeContainerTags(ContainerBuilder $builder, array $options = []); /** * Describes a container service by its name. @@ -130,7 +130,7 @@ * @param array $options * @param ContainerBuilder|null $builder */ - abstract protected function describeContainerService($service, array $options = array(), ContainerBuilder $builder = null); + abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null); /** * Describes container services. @@ -138,22 +138,22 @@ * Common options are: * * tag: filters described services by given tag */ - abstract protected function describeContainerServices(ContainerBuilder $builder, array $options = array()); + abstract protected function describeContainerServices(ContainerBuilder $builder, array $options = []); /** * Describes a service definition. */ - abstract protected function describeContainerDefinition(Definition $definition, array $options = array()); + abstract protected function describeContainerDefinition(Definition $definition, array $options = []); /** * Describes a service alias. */ - abstract protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null); + abstract protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null); /** * Describes a container parameter. */ - abstract protected function describeContainerParameter($parameter, array $options = array()); + abstract protected function describeContainerParameter($parameter, array $options = []); /** * Describes event dispatcher listeners. @@ -161,7 +161,7 @@ * Common options are: * * name: name of listened event */ - abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array()); + abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []); /** * Describes a callable. @@ -169,7 +169,7 @@ * @param callable $callable * @param array $options */ - abstract protected function describeCallable($callable, array $options = array()); + abstract protected function describeCallable($callable, array $options = []); /** * Formats a value as string. @@ -242,7 +242,7 @@ */ protected function findDefinitionsByTag(ContainerBuilder $builder, $showPrivate) { - $definitions = array(); + $definitions = []; $tags = $builder->findTags(); asort($tags); @@ -255,7 +255,7 @@ } if (!isset($definitions[$tag])) { - $definitions[$tag] = array(); + $definitions[$tag] = []; } $definitions[$tag][$serviceId] = $definition; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,9 +32,9 @@ /** * {@inheritdoc} */ - protected function describeRouteCollection(RouteCollection $routes, array $options = array()) + protected function describeRouteCollection(RouteCollection $routes, array $options = []) { - $data = array(); + $data = []; foreach ($routes->all() as $name => $route) { $data[$name] = $this->getRouteData($route); } @@ -45,7 +45,7 @@ /** * {@inheritdoc} */ - protected function describeRoute(Route $route, array $options = array()) + protected function describeRoute(Route $route, array $options = []) { $this->writeData($this->getRouteData($route), $options); } @@ -53,7 +53,7 @@ /** * {@inheritdoc} */ - protected function describeContainerParameters(ParameterBag $parameters, array $options = array()) + protected function describeContainerParameters(ParameterBag $parameters, array $options = []) { $this->writeData($this->sortParameters($parameters), $options); } @@ -61,13 +61,13 @@ /** * {@inheritdoc} */ - protected function describeContainerTags(ContainerBuilder $builder, array $options = array()) + protected function describeContainerTags(ContainerBuilder $builder, array $options = []) { $showPrivate = isset($options['show_private']) && $options['show_private']; - $data = array(); + $data = []; foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) { - $data[$tag] = array(); + $data[$tag] = []; foreach ($definitions as $definition) { $data[$tag][] = $this->getContainerDefinitionData($definition, true); } @@ -79,7 +79,7 @@ /** * {@inheritdoc} */ - protected function describeContainerService($service, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null) { if (!isset($options['id'])) { throw new \InvalidArgumentException('An "id" option must be provided.'); @@ -97,13 +97,13 @@ /** * {@inheritdoc} */ - protected function describeContainerServices(ContainerBuilder $builder, array $options = array()) + protected function describeContainerServices(ContainerBuilder $builder, array $options = []) { $serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds(); $showPrivate = isset($options['show_private']) && $options['show_private']; $omitTags = isset($options['omit_tags']) && $options['omit_tags']; $showArguments = isset($options['show_arguments']) && $options['show_arguments']; - $data = array('definitions' => array(), 'aliases' => array(), 'services' => array()); + $data = ['definitions' => [], 'aliases' => [], 'services' => []]; if (isset($options['filter'])) { $serviceIds = array_filter($serviceIds, $options['filter']); @@ -131,7 +131,7 @@ /** * {@inheritdoc} */ - protected function describeContainerDefinition(Definition $definition, array $options = array()) + protected function describeContainerDefinition(Definition $definition, array $options = []) { $this->writeData($this->getContainerDefinitionData($definition, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments']), $options); } @@ -139,22 +139,22 @@ /** * {@inheritdoc} */ - protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null) { if (!$builder) { return $this->writeData($this->getContainerAliasData($alias), $options); } $this->writeData( - array($this->getContainerAliasData($alias), $this->getContainerDefinitionData($builder->getDefinition((string) $alias), isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments'])), - array_merge($options, array('id' => (string) $alias)) + [$this->getContainerAliasData($alias), $this->getContainerDefinitionData($builder->getDefinition((string) $alias), isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments'])], + array_merge($options, ['id' => (string) $alias]) ); } /** * {@inheritdoc} */ - protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array()) + protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []) { $this->writeData($this->getEventDispatcherListenersData($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null), $options); } @@ -162,7 +162,7 @@ /** * {@inheritdoc} */ - protected function describeCallable($callable, array $options = array()) + protected function describeCallable($callable, array $options = []) { $this->writeData($this->getCallableData($callable, $options), $options); } @@ -170,11 +170,11 @@ /** * {@inheritdoc} */ - protected function describeContainerParameter($parameter, array $options = array()) + protected function describeContainerParameter($parameter, array $options = []) { $key = isset($options['parameter']) ? $options['parameter'] : ''; - $this->writeData(array($key => $parameter), $options); + $this->writeData([$key => $parameter], $options); } /** @@ -193,7 +193,7 @@ */ protected function getRouteData(Route $route) { - return array( + return [ 'path' => $route->getPath(), 'pathRegex' => $route->compile()->getRegex(), 'host' => '' !== $route->getHost() ? $route->getHost() : 'ANY', @@ -204,7 +204,7 @@ 'defaults' => $route->getDefaults(), 'requirements' => $route->getRequirements() ?: 'NO CUSTOM', 'options' => $route->getOptions(), - ); + ]; } /** @@ -215,7 +215,7 @@ */ private function getContainerDefinitionData(Definition $definition, $omitTags = false, $showArguments = false) { - $data = array( + $data = [ 'class' => (string) $definition->getClass(), 'public' => $definition->isPublic() && !$definition->isPrivate(), 'synthetic' => $definition->isSynthetic(), @@ -224,7 +224,7 @@ 'abstract' => $definition->isAbstract(), 'autowire' => $definition->isAutowired(), 'autoconfigure' => $definition->isAutoconfigured(), - ); + ]; // forward compatibility with DependencyInjection component in version 4.0 if (method_exists($definition, 'getAutowiringTypes')) { @@ -256,17 +256,17 @@ $calls = $definition->getMethodCalls(); if (\count($calls) > 0) { - $data['calls'] = array(); + $data['calls'] = []; foreach ($calls as $callData) { $data['calls'][] = $callData[0]; } } if (!$omitTags) { - $data['tags'] = array(); + $data['tags'] = []; foreach ($definition->getTags() as $tagName => $tagData) { foreach ($tagData as $parameters) { - $data['tags'][] = array('name' => $tagName, 'parameters' => $parameters); + $data['tags'][] = ['name' => $tagName, 'parameters' => $parameters]; } } } @@ -279,10 +279,10 @@ */ private function getContainerAliasData(Alias $alias) { - return array( + return [ 'service' => (string) $alias, 'public' => $alias->isPublic() && !$alias->isPrivate(), - ); + ]; } /** @@ -293,7 +293,7 @@ */ private function getEventDispatcherListenersData(EventDispatcherInterface $eventDispatcher, $event = null) { - $data = array(); + $data = []; $registeredListeners = $eventDispatcher->getListeners($event); if (null !== $event) { @@ -323,9 +323,9 @@ * * @return array */ - private function getCallableData($callable, array $options = array()) + private function getCallableData($callable, array $options = []) { - $data = array(); + $data = []; if (\is_array($callable)) { $data['type'] = 'function'; @@ -397,7 +397,7 @@ private function describeValue($value, $omitTags, $showArguments) { if (\is_array($value)) { - $data = array(); + $data = []; foreach ($value as $k => $v) { $data[$k] = $this->describeValue($v, $omitTags, $showArguments); } @@ -410,10 +410,10 @@ } if ($value instanceof Reference) { - return array( + return [ 'type' => 'service', 'id' => (string) $value, - ); + ]; } if ($value instanceof ArgumentInterface) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ /** * {@inheritdoc} */ - protected function describeRouteCollection(RouteCollection $routes, array $options = array()) + protected function describeRouteCollection(RouteCollection $routes, array $options = []) { $first = true; foreach ($routes->all() as $name => $route) { @@ -39,7 +39,7 @@ } else { $this->write("\n\n"); } - $this->describeRoute($route, array('name' => $name)); + $this->describeRoute($route, ['name' => $name]); } $this->write("\n"); } @@ -47,7 +47,7 @@ /** * {@inheritdoc} */ - protected function describeRoute(Route $route, array $options = array()) + protected function describeRoute(Route $route, array $options = []) { $output = '- Path: '.$route->getPath() ."\n".'- Path Regex: '.$route->compile()->getRegex() @@ -69,7 +69,7 @@ /** * {@inheritdoc} */ - protected function describeContainerParameters(ParameterBag $parameters, array $options = array()) + protected function describeContainerParameters(ParameterBag $parameters, array $options = []) { $this->write("Container parameters\n====================\n"); foreach ($this->sortParameters($parameters) as $key => $value) { @@ -80,7 +80,7 @@ /** * {@inheritdoc} */ - protected function describeContainerTags(ContainerBuilder $builder, array $options = array()) + protected function describeContainerTags(ContainerBuilder $builder, array $options = []) { $showPrivate = isset($options['show_private']) && $options['show_private']; $this->write("Container tags\n=============="); @@ -89,7 +89,7 @@ $this->write("\n\n".$tag."\n".str_repeat('-', \strlen($tag))); foreach ($definitions as $serviceId => $definition) { $this->write("\n\n"); - $this->describeContainerDefinition($definition, array('omit_tags' => true, 'id' => $serviceId)); + $this->describeContainerDefinition($definition, ['omit_tags' => true, 'id' => $serviceId]); } } } @@ -97,13 +97,13 @@ /** * {@inheritdoc} */ - protected function describeContainerService($service, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null) { if (!isset($options['id'])) { throw new \InvalidArgumentException('An "id" option must be provided.'); } - $childOptions = array_merge($options, array('id' => $options['id'], 'as_array' => true)); + $childOptions = array_merge($options, ['id' => $options['id'], 'as_array' => true]); if ($service instanceof Alias) { $this->describeContainerAlias($service, $childOptions, $builder); @@ -117,7 +117,7 @@ /** * {@inheritdoc} */ - protected function describeContainerServices(ContainerBuilder $builder, array $options = array()) + protected function describeContainerServices(ContainerBuilder $builder, array $options = []) { $showPrivate = isset($options['show_private']) && $options['show_private']; @@ -129,7 +129,7 @@ $serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds(); $showArguments = isset($options['show_arguments']) && $options['show_arguments']; - $services = array('definitions' => array(), 'aliases' => array(), 'services' => array()); + $services = ['definitions' => [], 'aliases' => [], 'services' => []]; if (isset($options['filter'])) { $serviceIds = array_filter($serviceIds, $options['filter']); @@ -155,7 +155,7 @@ $this->write("\n\nDefinitions\n-----------\n"); foreach ($services['definitions'] as $id => $service) { $this->write("\n"); - $this->describeContainerDefinition($service, array('id' => $id, 'show_arguments' => $showArguments)); + $this->describeContainerDefinition($service, ['id' => $id, 'show_arguments' => $showArguments]); } } @@ -163,7 +163,7 @@ $this->write("\n\nAliases\n-------\n"); foreach ($services['aliases'] as $id => $service) { $this->write("\n"); - $this->describeContainerAlias($service, array('id' => $id)); + $this->describeContainerAlias($service, ['id' => $id]); } } @@ -179,7 +179,7 @@ /** * {@inheritdoc} */ - protected function describeContainerDefinition(Definition $definition, array $options = array()) + protected function describeContainerDefinition(Definition $definition, array $options = []) { $output = '- Class: `'.$definition->getClass().'`' ."\n".'- Public: '.($definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no') @@ -243,7 +243,7 @@ /** * {@inheritdoc} */ - protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null) { $output = '- Service: `'.$alias.'`' ."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no'); @@ -259,13 +259,13 @@ } $this->write("\n"); - $this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, array('id' => (string) $alias))); + $this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias])); } /** * {@inheritdoc} */ - protected function describeContainerParameter($parameter, array $options = array()) + protected function describeContainerParameter($parameter, array $options = []) { $this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', \strlen($options['parameter'])), $this->formatParameter($parameter)) : $parameter); } @@ -273,7 +273,7 @@ /** * {@inheritdoc} */ - protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array()) + protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []) { $event = array_key_exists('event', $options) ? $options['event'] : null; @@ -309,7 +309,7 @@ /** * {@inheritdoc} */ - protected function describeCallable($callable, array $options = array()) + protected function describeCallable($callable, array $options = []) { $string = ''; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,24 +35,24 @@ /** * {@inheritdoc} */ - protected function describeRouteCollection(RouteCollection $routes, array $options = array()) + protected function describeRouteCollection(RouteCollection $routes, array $options = []) { $showControllers = isset($options['show_controllers']) && $options['show_controllers']; - $tableHeaders = array('Name', 'Method', 'Scheme', 'Host', 'Path'); + $tableHeaders = ['Name', 'Method', 'Scheme', 'Host', 'Path']; if ($showControllers) { $tableHeaders[] = 'Controller'; } - $tableRows = array(); + $tableRows = []; foreach ($routes->all() as $name => $route) { - $row = array( + $row = [ $name, $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY', $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY', '' !== $route->getHost() ? $route->getHost() : 'ANY', $route->getPath(), - ); + ]; if ($showControllers) { $controller = $route->getDefault('_controller'); @@ -74,24 +74,24 @@ /** * {@inheritdoc} */ - protected function describeRoute(Route $route, array $options = array()) + protected function describeRoute(Route $route, array $options = []) { - $tableHeaders = array('Property', 'Value'); - $tableRows = array( - array('Route Name', isset($options['name']) ? $options['name'] : ''), - array('Path', $route->getPath()), - array('Path Regex', $route->compile()->getRegex()), - array('Host', ('' !== $route->getHost() ? $route->getHost() : 'ANY')), - array('Host Regex', ('' !== $route->getHost() ? $route->compile()->getHostRegex() : '')), - array('Scheme', ($route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY')), - array('Method', ($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')), - array('Requirements', ($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM')), - array('Class', \get_class($route)), - array('Defaults', $this->formatRouterConfig($route->getDefaults())), - array('Options', $this->formatRouterConfig($route->getOptions())), - ); + $tableHeaders = ['Property', 'Value']; + $tableRows = [ + ['Route Name', isset($options['name']) ? $options['name'] : ''], + ['Path', $route->getPath()], + ['Path Regex', $route->compile()->getRegex()], + ['Host', ('' !== $route->getHost() ? $route->getHost() : 'ANY')], + ['Host Regex', ('' !== $route->getHost() ? $route->compile()->getHostRegex() : '')], + ['Scheme', ($route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY')], + ['Method', ($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')], + ['Requirements', ($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM')], + ['Class', \get_class($route)], + ['Defaults', $this->formatRouterConfig($route->getDefaults())], + ['Options', $this->formatRouterConfig($route->getOptions())], + ]; if (isset($options['callable'])) { - $tableRows[] = array('Callable', $options['callable']); + $tableRows[] = ['Callable', $options['callable']]; } $table = new Table($this->getOutput()); @@ -102,13 +102,13 @@ /** * {@inheritdoc} */ - protected function describeContainerParameters(ParameterBag $parameters, array $options = array()) + protected function describeContainerParameters(ParameterBag $parameters, array $options = []) { - $tableHeaders = array('Parameter', 'Value'); + $tableHeaders = ['Parameter', 'Value']; - $tableRows = array(); + $tableRows = []; foreach ($this->sortParameters($parameters) as $parameter => $value) { - $tableRows[] = array($parameter, $this->formatParameter($value)); + $tableRows[] = [$parameter, $this->formatParameter($value)]; } $options['output']->title('Symfony Container Parameters'); @@ -118,7 +118,7 @@ /** * {@inheritdoc} */ - protected function describeContainerTags(ContainerBuilder $builder, array $options = array()) + protected function describeContainerTags(ContainerBuilder $builder, array $options = []) { $showPrivate = isset($options['show_private']) && $options['show_private']; @@ -137,7 +137,7 @@ /** * {@inheritdoc} */ - protected function describeContainerService($service, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null) { if (!isset($options['id'])) { throw new \InvalidArgumentException('An "id" option must be provided.'); @@ -150,10 +150,10 @@ } else { $options['output']->title(sprintf('Information for Service "%s"', $options['id'])); $options['output']->table( - array('Service ID', 'Class'), - array( - array(isset($options['id']) ? $options['id'] : '-', \get_class($service)), - ) + ['Service ID', 'Class'], + [ + [isset($options['id']) ? $options['id'] : '-', \get_class($service)], + ] ); } } @@ -161,7 +161,7 @@ /** * {@inheritdoc} */ - protected function describeContainerServices(ContainerBuilder $builder, array $options = array()) + protected function describeContainerServices(ContainerBuilder $builder, array $options = []) { $showPrivate = isset($options['show_private']) && $options['show_private']; $showTag = isset($options['tag']) ? $options['tag'] : null; @@ -179,7 +179,7 @@ $options['output']->title($title); $serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds(); - $maxTags = array(); + $maxTags = []; if (isset($options['filter'])) { $serviceIds = array_filter($serviceIds, $options['filter']); @@ -217,8 +217,8 @@ $tagsCount = \count($maxTags); $tagsNames = array_keys($maxTags); - $tableHeaders = array_merge(array('Service ID'), $tagsNames, array('Class name')); - $tableRows = array(); + $tableHeaders = array_merge(['Service ID'], $tagsNames, ['Class name']); + $tableRows = []; $rawOutput = isset($options['raw_text']) && $options['raw_text']; foreach ($this->sortServiceIds($serviceIds) as $serviceId) { $definition = $this->resolveServiceDefinition($builder, $serviceId); @@ -227,24 +227,24 @@ if ($definition instanceof Definition) { if ($showTag) { foreach ($definition->getTag($showTag) as $key => $tag) { - $tagValues = array(); + $tagValues = []; foreach ($tagsNames as $tagName) { $tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : ''; } if (0 === $key) { - $tableRows[] = array_merge(array($serviceId), $tagValues, array($definition->getClass())); + $tableRows[] = array_merge([$serviceId], $tagValues, [$definition->getClass()]); } else { - $tableRows[] = array_merge(array(' "'), $tagValues, array('')); + $tableRows[] = array_merge([' "'], $tagValues, ['']); } } } else { - $tableRows[] = array($styledServiceId, $definition->getClass()); + $tableRows[] = [$styledServiceId, $definition->getClass()]; } } elseif ($definition instanceof Alias) { $alias = $definition; - $tableRows[] = array_merge(array($styledServiceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, '') : array()); + $tableRows[] = array_merge([$styledServiceId, sprintf('alias for "%s"', $alias)], $tagsCount ? array_fill(0, $tagsCount, '') : []); } else { - $tableRows[] = array_merge(array($styledServiceId, \get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, '') : array()); + $tableRows[] = array_merge([$styledServiceId, \get_class($definition)], $tagsCount ? array_fill(0, $tagsCount, '') : []); } } @@ -254,20 +254,20 @@ /** * {@inheritdoc} */ - protected function describeContainerDefinition(Definition $definition, array $options = array()) + protected function describeContainerDefinition(Definition $definition, array $options = []) { if (isset($options['id'])) { $options['output']->title(sprintf('Information for Service "%s"', $options['id'])); } - $tableHeaders = array('Option', 'Value'); + $tableHeaders = ['Option', 'Value']; - $tableRows[] = array('Service ID', isset($options['id']) ? $options['id'] : '-'); - $tableRows[] = array('Class', $definition->getClass() ?: '-'); + $tableRows[] = ['Service ID', isset($options['id']) ? $options['id'] : '-']; + $tableRows[] = ['Class', $definition->getClass() ?: '-']; $omitTags = isset($options['omit_tags']) && $options['omit_tags']; if (!$omitTags && ($tags = $definition->getTags())) { - $tagInformation = array(); + $tagInformation = []; foreach ($tags as $tagName => $tagData) { foreach ($tagData as $tagParameters) { $parameters = array_map(function ($key, $value) { @@ -286,51 +286,51 @@ } else { $tagInformation = '-'; } - $tableRows[] = array('Tags', $tagInformation); + $tableRows[] = ['Tags', $tagInformation]; $calls = $definition->getMethodCalls(); if (\count($calls) > 0) { - $callInformation = array(); + $callInformation = []; foreach ($calls as $call) { $callInformation[] = $call[0]; } - $tableRows[] = array('Calls', implode(', ', $callInformation)); + $tableRows[] = ['Calls', implode(', ', $callInformation)]; } - $tableRows[] = array('Public', $definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no'); - $tableRows[] = array('Synthetic', $definition->isSynthetic() ? 'yes' : 'no'); - $tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no'); - $tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no'); - $tableRows[] = array('Abstract', $definition->isAbstract() ? 'yes' : 'no'); - $tableRows[] = array('Autowired', $definition->isAutowired() ? 'yes' : 'no'); - $tableRows[] = array('Autoconfigured', $definition->isAutoconfigured() ? 'yes' : 'no'); + $tableRows[] = ['Public', $definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no']; + $tableRows[] = ['Synthetic', $definition->isSynthetic() ? 'yes' : 'no']; + $tableRows[] = ['Lazy', $definition->isLazy() ? 'yes' : 'no']; + $tableRows[] = ['Shared', $definition->isShared() ? 'yes' : 'no']; + $tableRows[] = ['Abstract', $definition->isAbstract() ? 'yes' : 'no']; + $tableRows[] = ['Autowired', $definition->isAutowired() ? 'yes' : 'no']; + $tableRows[] = ['Autoconfigured', $definition->isAutoconfigured() ? 'yes' : 'no']; // forward compatibility with DependencyInjection component in version 4.0 if (method_exists($definition, 'getAutowiringTypes') && $autowiringTypes = $definition->getAutowiringTypes(false)) { - $tableRows[] = array('Autowiring Types', implode(', ', $autowiringTypes)); + $tableRows[] = ['Autowiring Types', implode(', ', $autowiringTypes)]; } if ($definition->getFile()) { - $tableRows[] = array('Required File', $definition->getFile() ?: '-'); + $tableRows[] = ['Required File', $definition->getFile() ?: '-']; } if ($factory = $definition->getFactory()) { if (\is_array($factory)) { if ($factory[0] instanceof Reference) { - $tableRows[] = array('Factory Service', $factory[0]); + $tableRows[] = ['Factory Service', $factory[0]]; } elseif ($factory[0] instanceof Definition) { throw new \InvalidArgumentException('Factory is not describable.'); } else { - $tableRows[] = array('Factory Class', $factory[0]); + $tableRows[] = ['Factory Class', $factory[0]]; } - $tableRows[] = array('Factory Method', $factory[1]); + $tableRows[] = ['Factory Method', $factory[1]]; } else { - $tableRows[] = array('Factory Function', $factory); + $tableRows[] = ['Factory Function', $factory]; } } $showArguments = isset($options['show_arguments']) && $options['show_arguments']; - $argumentsInformation = array(); + $argumentsInformation = []; if ($showArguments && ($arguments = $definition->getArguments())) { foreach ($arguments as $argument) { if ($argument instanceof ServiceClosureArgument) { @@ -347,7 +347,7 @@ } } - $tableRows[] = array('Arguments', implode("\n", $argumentsInformation)); + $tableRows[] = ['Arguments', implode("\n", $argumentsInformation)]; } $options['output']->table($tableHeaders, $tableRows); @@ -356,7 +356,7 @@ /** * {@inheritdoc} */ - protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null) { $options['output']->comment(sprintf('This service is an alias for the service %s', (string) $alias)); @@ -364,26 +364,26 @@ return; } - return $this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, array('id' => (string) $alias))); + return $this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias])); } /** * {@inheritdoc} */ - protected function describeContainerParameter($parameter, array $options = array()) + protected function describeContainerParameter($parameter, array $options = []) { $options['output']->table( - array('Parameter', 'Value'), - array( - array($options['parameter'], $this->formatParameter($parameter), - ), - )); + ['Parameter', 'Value'], + [ + [$options['parameter'], $this->formatParameter($parameter), + ], + ]); } /** * {@inheritdoc} */ - protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array()) + protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []) { $event = array_key_exists('event', $options) ? $options['event'] : null; @@ -410,19 +410,19 @@ /** * {@inheritdoc} */ - protected function describeCallable($callable, array $options = array()) + protected function describeCallable($callable, array $options = []) { $this->writeText($this->formatCallable($callable), $options); } private function renderEventListenerTable(EventDispatcherInterface $eventDispatcher, $event, array $eventListeners, SymfonyStyle $io) { - $tableHeaders = array('Order', 'Callable', 'Priority'); - $tableRows = array(); + $tableHeaders = ['Order', 'Callable', 'Priority']; + $tableRows = []; $order = 1; foreach ($eventListeners as $order => $listener) { - $tableRows[] = array(sprintf('#%d', $order + 1), $this->formatCallable($listener), $eventDispatcher->getListenerPriority($event, $listener)); + $tableRows[] = [sprintf('#%d', $order + 1), $this->formatCallable($listener), $eventDispatcher->getListenerPriority($event, $listener)]; } $io->table($tableHeaders, $tableRows); @@ -491,7 +491,7 @@ * @param string $content * @param array $options */ - private function writeText($content, array $options = array()) + private function writeText($content, array $options = []) { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ /** * {@inheritdoc} */ - protected function describeRouteCollection(RouteCollection $routes, array $options = array()) + protected function describeRouteCollection(RouteCollection $routes, array $options = []) { $this->writeDocument($this->getRouteCollectionDocument($routes)); } @@ -40,7 +40,7 @@ /** * {@inheritdoc} */ - protected function describeRoute(Route $route, array $options = array()) + protected function describeRoute(Route $route, array $options = []) { $this->writeDocument($this->getRouteDocument($route, isset($options['name']) ? $options['name'] : null)); } @@ -48,7 +48,7 @@ /** * {@inheritdoc} */ - protected function describeContainerParameters(ParameterBag $parameters, array $options = array()) + protected function describeContainerParameters(ParameterBag $parameters, array $options = []) { $this->writeDocument($this->getContainerParametersDocument($parameters)); } @@ -56,7 +56,7 @@ /** * {@inheritdoc} */ - protected function describeContainerTags(ContainerBuilder $builder, array $options = array()) + protected function describeContainerTags(ContainerBuilder $builder, array $options = []) { $this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_private']) && $options['show_private'])); } @@ -64,7 +64,7 @@ /** * {@inheritdoc} */ - protected function describeContainerService($service, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null) { if (!isset($options['id'])) { throw new \InvalidArgumentException('An "id" option must be provided.'); @@ -76,7 +76,7 @@ /** * {@inheritdoc} */ - protected function describeContainerServices(ContainerBuilder $builder, array $options = array()) + protected function describeContainerServices(ContainerBuilder $builder, array $options = []) { $this->writeDocument($this->getContainerServicesDocument($builder, isset($options['tag']) ? $options['tag'] : null, isset($options['show_private']) && $options['show_private'], isset($options['show_arguments']) && $options['show_arguments'], isset($options['filter']) ? $options['filter'] : null)); } @@ -84,7 +84,7 @@ /** * {@inheritdoc} */ - protected function describeContainerDefinition(Definition $definition, array $options = array()) + protected function describeContainerDefinition(Definition $definition, array $options = []) { $this->writeDocument($this->getContainerDefinitionDocument($definition, isset($options['id']) ? $options['id'] : null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments'])); } @@ -92,7 +92,7 @@ /** * {@inheritdoc} */ - protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null) + protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, isset($options['id']) ? $options['id'] : null)->childNodes->item(0), true)); @@ -109,7 +109,7 @@ /** * {@inheritdoc} */ - protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array()) + protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []) { $this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null)); } @@ -117,7 +117,7 @@ /** * {@inheritdoc} */ - protected function describeCallable($callable, array $options = array()) + protected function describeCallable($callable, array $options = []) { $this->writeDocument($this->getCallableDocument($callable)); } @@ -125,7 +125,7 @@ /** * {@inheritdoc} */ - protected function describeContainerParameter($parameter, array $options = array()) + protected function describeContainerParameter($parameter, array $options = []) { $this->writeDocument($this->getContainerParameterDocument($parameter, $options)); } @@ -413,7 +413,7 @@ */ private function getArgumentNodes(array $arguments, \DOMDocument $dom) { - $nodes = array(); + $nodes = []; foreach ($arguments as $argumentKey => $argument) { $argumentXML = $dom->createElement('argument'); @@ -477,7 +477,7 @@ /** * @return \DOMDocument */ - private function getContainerParameterDocument($parameter, $options = array()) + private function getContainerParameterDocument($parameter, $options = []) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($parameterXML = $dom->createElement('parameter')); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,7 +54,7 @@ public static function getSubscribedServices() { - return array( + return [ 'router' => '?'.RouterInterface::class, 'request_stack' => '?'.RequestStack::class, 'http_kernel' => '?'.HttpKernelInterface::class, @@ -67,6 +67,6 @@ 'form.factory' => '?'.FormFactoryInterface::class, 'security.token_storage' => '?'.TokenStorageInterface::class, 'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ $originalController = $controller; list($bundle, $controller, $action) = $parts; $controller = str_replace('/', '\\', $controller); - $bundles = array(); + $bundles = []; try { // this throws an exception if there is no such bundle @@ -70,7 +70,7 @@ if (!\is_array($allBundles)) { // happens when HttpKernel is version 4+ - $allBundles = array($allBundles); + $allBundles = [$allBundles]; } foreach ($allBundles as $b) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -80,7 +80,7 @@ * * @final since version 3.4 */ - protected function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) + protected function generateUrl($route, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) { return $this->container->get('router')->generate($route, $parameters, $referenceType); } @@ -96,7 +96,7 @@ * * @final since version 3.4 */ - protected function forward($controller, array $path = array(), array $query = array()) + protected function forward($controller, array $path = [], array $query = []) { $request = $this->container->get('request_stack')->getCurrentRequest(); $path['_forwarded'] = $request->attributes; @@ -132,7 +132,7 @@ * * @final since version 3.4 */ - protected function redirectToRoute($route, array $parameters = array(), $status = 302) + protected function redirectToRoute($route, array $parameters = [], $status = 302) { return $this->redirect($this->generateUrl($route, $parameters), $status); } @@ -149,12 +149,12 @@ * * @final since version 3.4 */ - protected function json($data, $status = 200, $headers = array(), $context = array()) + protected function json($data, $status = 200, $headers = [], $context = []) { if ($this->container->has('serializer')) { - $json = $this->container->get('serializer')->serialize($data, 'json', array_merge(array( + $json = $this->container->get('serializer')->serialize($data, 'json', array_merge([ 'json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, - ), $context)); + ], $context)); return new JsonResponse($json, $status, $headers, true); } @@ -254,7 +254,7 @@ * * @final since version 3.4 */ - protected function renderView($view, array $parameters = array()) + protected function renderView($view, array $parameters = []) { if ($this->container->has('templating')) { return $this->container->get('templating')->render($view, $parameters); @@ -278,7 +278,7 @@ * * @final since version 3.4 */ - protected function render($view, array $parameters = array(), Response $response = null) + protected function render($view, array $parameters = [], Response $response = null) { if ($this->container->has('templating')) { $content = $this->container->get('templating')->render($view, $parameters); @@ -308,7 +308,7 @@ * * @final since version 3.4 */ - protected function stream($view, array $parameters = array(), StreamedResponse $response = null) + protected function stream($view, array $parameters = [], StreamedResponse $response = null) { if ($this->container->has('templating')) { $templating = $this->container->get('templating'); @@ -390,7 +390,7 @@ * * @final since version 3.4 */ - protected function createForm($type, $data = null, array $options = array()) + protected function createForm($type, $data = null, array $options = []) { return $this->container->get('form.factory')->create($type, $data, $options); } @@ -405,7 +405,7 @@ * * @final since version 3.4 */ - protected function createFormBuilder($data = null, array $options = array()) + protected function createFormBuilder($data = null, array $options = []) { return $this->container->get('form.factory')->createBuilder(FormType::class, $data, $options); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php 2019-02-03 12:23:08.000000000 +0000 @@ -79,7 +79,7 @@ throw new HttpException($permanent ? 410 : 404); } - $attributes = array(); + $attributes = []; if (false === $ignoreAttributes || \is_array($ignoreAttributes)) { $attributes = $request->attributes->get('_route_params'); unset($attributes['route'], $attributes['permanent'], $attributes['ignoreAttributes']); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,10 +38,10 @@ } } if ($request->attributes->has('_forward_controller')) { - $this->data['forward'] = array( + $this->data['forward'] = [ 'token' => $request->attributes->get('_forward_token'), 'controller' => $this->parseController($request->attributes->get('_forward_controller')), - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,7 +35,7 @@ return; } - $clearers = array(); + $clearers = []; foreach ($container->findTaggedServiceIds('kernel.cache_clearer', true) as $id => $attributes) { $clearers[] = new Reference($id); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,6 +30,6 @@ } $definition = $container->getDefinition('monolog.logger_prototype'); - $definition->addMethodCall('pushProcessor', array(new Reference('debug.log_processor'))); + $definition->addMethodCall('pushProcessor', [new Reference('debug.log_processor')]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ if ($container->has('router')) { $definition = $container->findDefinition('router'); foreach ($container->findTaggedServiceIds('routing.expression_language_provider', true) as $id => $attributes) { - $definition->addMethodCall('addExpressionLanguageProvider', array(new Reference($id))); + $definition->addMethodCall('addExpressionLanguageProvider', [new Reference($id)]); } } @@ -39,7 +39,7 @@ if ($container->has('security.expression_language')) { $definition = $container->findDefinition('security.expression_language'); foreach ($container->findTaggedServiceIds('security.expression_language_provider', true) as $id => $attributes) { - $definition->addMethodCall('registerProvider', array(new Reference($id))); + $definition->addMethodCall('registerProvider', [new Reference($id)]); } } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CacheCollectorPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CacheCollectorPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CacheCollectorPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CacheCollectorPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,21 +45,21 @@ $recorder = new Definition(is_subclass_of($definition->getClass(), TagAwareAdapterInterface::class) ? TraceableTagAwareAdapter::class : TraceableAdapter::class); $recorder->setTags($definition->getTags()); $recorder->setPublic($definition->isPublic()); - $recorder->setArguments(array(new Reference($innerId = $id.'.recorder_inner'))); + $recorder->setArguments([new Reference($innerId = $id.'.recorder_inner')]); - $definition->setTags(array()); + $definition->setTags([]); $definition->setPublic(false); if (method_exists($definition, 'getAutowiringTypes') && $types = $definition->getAutowiringTypes(false)) { $recorder->setAutowiringTypes($types); - $definition->setAutowiringTypes(array()); + $definition->setAutowiringTypes([]); } $container->setDefinition($innerId, $definition); $container->setDefinition($id, $recorder); // Tell the collector to add the new instance - $collectorDefinition->addMethodCall('addInstance', array($id, new Reference($id))); + $collectorDefinition->addMethodCall('addInstance', [$id, new Reference($id)]); $collectorDefinition->setPublic(false); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ foreach ($container->findTaggedServiceIds('cache.pool.clearer') as $id => $attr) { $clearer = $container->getDefinition($id); - $pools = array(); + $pools = []; foreach ($clearer->getArgument(0) as $id => $ref) { if ($container->hasDefinition($id)) { $pools[$id] = new Reference($id); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,14 +37,14 @@ } $seed .= '.'.$container->getParameter('kernel.name').'.'.$container->getParameter('kernel.environment'); - $pools = array(); - $clearers = array(); - $attributes = array( + $pools = []; + $clearers = []; + $attributes = [ 'provider', 'namespace', 'default_lifetime', 'reset', - ); + ]; foreach ($container->findTaggedServiceIds('cache.pool') as $id => $tags) { $adapter = $pool = $container->getDefinition($id); if ($pool->isAbstract()) { @@ -78,7 +78,7 @@ // no-op } elseif ('reset' === $attr) { if ($tags[0][$attr]) { - $pool->addTag('kernel.reset', array('method' => $tags[0][$attr])); + $pool->addTag('kernel.reset', ['method' => $tags[0][$attr]]); } } elseif ('namespace' !== $attr || ArrayAdapter::class !== $adapter->getClass()) { $pool->replaceArgument($i++, $tags[0][$attr]); @@ -137,8 +137,8 @@ if (!$container->hasDefinition($name = 'cache_connection.'.ContainerBuilder::hash($dsn))) { $definition = new Definition(AbstractAdapter::class); $definition->setPublic(false); - $definition->setFactory(array(AbstractAdapter::class, 'createConnection')); - $definition->setArguments(array($dsn, array('lazy' => true))); + $definition->setFactory([AbstractAdapter::class, 'createConnection']); + $definition->setArguments([$dsn, ['lazy' => true]]); $container->setDefinition($name, $definition); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,7 +41,7 @@ return; } - $services = array(); + $services = []; foreach ($container->findTaggedServiceIds($this->cachePoolTag) as $id => $tags) { $class = $container->getParameterBag()->resolveValue($container->getDefinition($id)->getClass()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ $definition = $container->getDefinition('form.extension'); // Builds an array with fully-qualified type class names as keys and service IDs as values - $types = array(); + $types = []; foreach ($container->findTaggedServiceIds('form.type') as $serviceId => $tag) { $serviceDefinition = $container->getDefinition($serviceId); @@ -53,7 +53,7 @@ $definition->replaceArgument(1, $types); - $typeExtensions = array(); + $typeExtensions = []; foreach ($this->findAndSortTaggedServices('form.type_extension', $container) as $reference) { $serviceId = (string) $reference; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/LoggingTranslatorPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/LoggingTranslatorPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/LoggingTranslatorPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/LoggingTranslatorPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -47,7 +47,7 @@ $warmer->addTag('container.service_subscriber', $v); } } - $warmer->addTag('container.service_subscriber', array('key' => 'translator', 'id' => 'translator.logging.inner')); + $warmer->addTag('container.service_subscriber', ['key' => 'translator', 'id' => 'translator.logging.inner']); } } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,15 +41,15 @@ if (!isset($attributes[0]['id'])) { throw new InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template', $id)); } - $template = array($attributes[0]['id'], $attributes[0]['template']); + $template = [$attributes[0]['id'], $attributes[0]['template']]; } - $collectors->insert(array($id, $template), array($priority, --$order)); + $collectors->insert([$id, $template], [$priority, --$order]); } - $templates = array(); + $templates = []; foreach ($collectors as $collector) { - $definition->addMethodCall('add', array(new Reference($collector[0]))); + $definition->addMethodCall('add', [new Reference($collector[0])]); $templates[$collector[0]] = $collector[1]; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,8 +32,8 @@ } if ($container->hasDefinition('templating.engine.php')) { - $refs = array(); - $helpers = array(); + $refs = []; + $helpers = []; foreach ($container->findTaggedServiceIds('templating.helper', true) as $id => $attributes) { if (isset($attributes[0]['alias'])) { $helpers[$attributes[0]['alias']] = $id; @@ -43,7 +43,7 @@ if (\count($helpers) > 0) { $definition = $container->getDefinition('templating.engine.php'); - $definition->addMethodCall('setHelpers', array($helpers)); + $definition->addMethodCall('setHelpers', [$helpers]); if ($container->hasDefinition('templating.engine.php.helpers_locator')) { $container->getDefinition('templating.engine.php.helpers_locator')->replaceArgument(0, $refs); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ */ class UnusedTagsPass implements CompilerPassInterface { - private $whitelist = array( + private $whitelist = [ 'annotations.cached_reader', 'cache.pool.clearer', 'console.command', @@ -55,7 +55,7 @@ 'twig.loader', 'validator.constraint_validator', 'validator.initializer', - ); + ]; public function process(ContainerBuilder $container) { @@ -68,7 +68,7 @@ } // check for typos - $candidates = array(); + $candidates = []; foreach ($tags as $definedTag) { if ($definedTag === $tag) { continue; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,12 +32,12 @@ $container->getParameterBag()->remove('workflow.has_guard_listeners'); - $servicesNeeded = array( + $servicesNeeded = [ 'security.token_storage', 'security.authorization_checker', 'security.authentication.trust_resolver', 'security.role_hierarchy', - ); + ]; foreach ($servicesNeeded as $service) { if (!$container->has($service)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,7 +60,7 @@ ->beforeNormalization() ->ifTrue(function ($v) { return !isset($v['assets']) && isset($v['templating']) && class_exists(Package::class); }) ->then(function ($v) { - $v['assets'] = array(); + $v['assets'] = []; return $v; }) @@ -77,7 +77,7 @@ ->ifTrue(function ($v) { return !\is_array($v) && null !== $v; }) - ->then(function ($v) { return \is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); }) + ->then(function ($v) { return \is_bool($v) ? [] : preg_split('/\s*,\s*/', $v); }) ->end() ->prototype('scalar') ->validate() @@ -108,7 +108,7 @@ ->booleanNode('test')->end() ->scalarNode('default_locale')->defaultValue('en')->end() ->arrayNode('trusted_hosts') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() ->prototype('scalar')->end() ->end() ->end() @@ -145,9 +145,9 @@ $rootNode ->children() ->arrayNode('csrf_protection') - ->treatFalseLike(array('enabled' => false)) - ->treatTrueLike(array('enabled' => true)) - ->treatNullLike(array('enabled' => true)) + ->treatFalseLike(['enabled' => false]) + ->treatTrueLike(['enabled' => true]) + ->treatNullLike(['enabled' => true]) ->addDefaultsIfNotSet() ->children() // defaults to framework.session.enabled && !class_exists(FullStack::class) && interface_exists(CsrfTokenManagerInterface::class) @@ -167,9 +167,9 @@ ->{!class_exists(FullStack::class) && class_exists(Form::class) ? 'canBeDisabled' : 'canBeEnabled'}() ->children() ->arrayNode('csrf_protection') - ->treatFalseLike(array('enabled' => false)) - ->treatTrueLike(array('enabled' => true)) - ->treatNullLike(array('enabled' => true)) + ->treatFalseLike(['enabled' => false]) + ->treatTrueLike(['enabled' => true]) + ->treatNullLike(['enabled' => true]) ->addDefaultsIfNotSet() ->children() ->booleanNode('enabled')->defaultNull()->end() // defaults to framework.csrf_protection.enabled @@ -244,7 +244,7 @@ ->end() ->scalarNode('service')->end() ->arrayNode('ips') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() ->prototype('scalar')->end() ->end() ->end() @@ -269,10 +269,10 @@ unset($workflows['enabled']); if (1 === \count($workflows) && isset($workflows[0]['enabled']) && 1 === \count($workflows[0])) { - $workflows = array(); + $workflows = []; } - if (1 === \count($workflows) && isset($workflows['workflows']) && array_keys($workflows['workflows']) !== range(0, \count($workflows) - 1) && !empty(array_diff(array_keys($workflows['workflows']), array('audit_trail', 'type', 'marking_store', 'supports', 'support_strategy', 'initial_place', 'places', 'transitions')))) { + if (1 === \count($workflows) && isset($workflows['workflows']) && array_keys($workflows['workflows']) !== range(0, \count($workflows) - 1) && !empty(array_diff(array_keys($workflows['workflows']), ['audit_trail', 'type', 'marking_store', 'supports', 'support_strategy', 'initial_place', 'places', 'transitions']))) { $workflows = $workflows['workflows']; } @@ -284,10 +284,10 @@ unset($workflows[$key]['enabled']); } - $v = array( + $v = [ 'enabled' => true, 'workflows' => $workflows, - ); + ]; } return $v; @@ -305,18 +305,18 @@ ->canBeEnabled() ->end() ->enumNode('type') - ->values(array('workflow', 'state_machine')) + ->values(['workflow', 'state_machine']) ->end() ->arrayNode('marking_store') ->fixXmlConfig('argument') ->children() ->enumNode('type') - ->values(array('multiple_state', 'single_state')) + ->values(['multiple_state', 'single_state']) ->end() ->arrayNode('arguments') ->beforeNormalization() ->ifString() - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->requiresAtLeastOneElement() ->prototype('scalar') @@ -338,7 +338,7 @@ ->arrayNode('supports') ->beforeNormalization() ->ifString() - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar') ->cannotBeEmpty() @@ -397,7 +397,7 @@ ->arrayNode('from') ->beforeNormalization() ->ifString() - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->requiresAtLeastOneElement() ->prototype('scalar') @@ -407,7 +407,7 @@ ->arrayNode('to') ->beforeNormalization() ->ifString() - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->requiresAtLeastOneElement() ->prototype('scalar') @@ -527,7 +527,7 @@ ->end() ->beforeNormalization() ->ifTrue(function ($v) { return !\is_array($v); }) - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() @@ -547,7 +547,7 @@ ->canBeEnabled() ->beforeNormalization() ->ifTrue(function ($v) { return false === $v || \is_array($v) && false === $v['enabled']; }) - ->then(function () { return array('enabled' => false, 'engines' => false); }) + ->then(function () { return ['enabled' => false, 'engines' => false]; }) ->end() ->children() ->scalarNode('hinclude_default_template')->defaultNull()->end() @@ -562,7 +562,7 @@ ->validate() ->ifTrue(function ($v) {return !\in_array('FrameworkBundle:Form', $v); }) ->then(function ($v) { - return array_merge(array('FrameworkBundle:Form'), $v); + return array_merge(['FrameworkBundle:Form'], $v); }) ->end() ->end() @@ -572,13 +572,13 @@ ->fixXmlConfig('engine') ->children() ->arrayNode('engines') - ->example(array('twig')) + ->example(['twig']) ->isRequired() ->requiresAtLeastOneElement() ->canBeUnset() ->beforeNormalization() ->ifTrue(function ($v) { return !\is_array($v) && false !== $v; }) - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() @@ -588,7 +588,7 @@ ->arrayNode('loaders') ->beforeNormalization() ->ifTrue(function ($v) { return !\is_array($v); }) - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() @@ -616,7 +616,7 @@ ->requiresAtLeastOneElement() ->beforeNormalization() ->ifTrue(function ($v) { return !\is_array($v); }) - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() @@ -642,6 +642,7 @@ ->fixXmlConfig('package') ->children() ->arrayNode('packages') + ->normalizeKeys(false) ->useAttributeAsKey('name') ->prototype('array') ->fixXmlConfig('base_url') @@ -660,7 +661,7 @@ ->requiresAtLeastOneElement() ->beforeNormalization() ->ifTrue(function ($v) { return !\is_array($v); }) - ->then(function ($v) { return array($v); }) + ->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() @@ -702,9 +703,9 @@ ->fixXmlConfig('path') ->children() ->arrayNode('fallbacks') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() ->prototype('scalar')->end() - ->defaultValue(array('en')) + ->defaultValue(['en']) ->end() ->booleanNode('logging')->defaultValue($this->debug)->end() ->scalarNode('formatter')->defaultValue('translator.formatter.default')->end() @@ -744,9 +745,9 @@ ->end() ->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end() ->arrayNode('static_method') - ->defaultValue(array('loadValidatorMetadata')) + ->defaultValue(['loadValidatorMetadata']) ->prototype('scalar')->end() - ->treatFalseLike(array()) + ->treatFalseLike([]) ->validate() ->ifTrue(function ($v) { return !\is_array($v); }) ->then(function ($v) { return (array) $v; }) @@ -925,7 +926,7 @@ ->info('Lock configuration') ->{!class_exists(FullStack::class) && class_exists(Lock::class) ? 'canBeDisabled' : 'canBeEnabled'}() ->beforeNormalization() - ->ifString()->then(function ($v) { return array('enabled' => true, 'resources' => $v); }) + ->ifString()->then(function ($v) { return ['enabled' => true, 'resources' => $v]; }) ->end() ->beforeNormalization() ->ifTrue(function ($v) { return \is_array($v) && !isset($v['resources']); }) @@ -933,7 +934,7 @@ $e = $v['enabled']; unset($v['enabled']); - return array('enabled' => $e, 'resources' => $v); + return ['enabled' => $e, 'resources' => $v]; }) ->end() ->addDefaultsIfNotSet() @@ -941,16 +942,16 @@ ->children() ->arrayNode('resources') ->requiresAtLeastOneElement() - ->defaultValue(array('default' => array(class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock'))) + ->defaultValue(['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]) ->beforeNormalization() - ->ifString()->then(function ($v) { return array('default' => $v); }) + ->ifString()->then(function ($v) { return ['default' => $v]; }) ->end() ->beforeNormalization() ->ifTrue(function ($v) { return \is_array($v) && array_keys($v) === range(0, \count($v) - 1); }) - ->then(function ($v) { return array('default' => $v); }) + ->then(function ($v) { return ['default' => $v]; }) ->end() ->prototype('array') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() ->prototype('scalar')->end() ->end() ->end() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -131,7 +131,7 @@ if (!class_exists(ContainerAwareEventDispatcher::class)) { $definition = $container->getDefinition('event_dispatcher'); $definition->setClass(EventDispatcher::class); - $definition->setArguments(array()); + $definition->setArguments([]); } if (\PHP_VERSION_ID < 70000) { @@ -204,13 +204,13 @@ if (!$container->hasParameter('debug.file_link_format')) { if (!$container->hasParameter('templating.helper.code.file_link_format')) { - $links = array( + $links = [ 'textmate' => 'txmt://open?url=file://%%f&line=%%l', 'macvim' => 'mvim://open?url=file://%%f&line=%%l', 'emacs' => 'emacs://open?url=file://%%f&line=%%l', 'sublime' => 'subl://open?url=file://%%f&line=%%l', 'phpstorm' => 'phpstorm://open?file=%%f&line=%%l', - ); + ]; $ide = $config['ide']; $container->setParameter('templating.helper.code.file_link_format', str_replace('%', '%%', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) ?: (isset($links[$ide]) ? $links[$ide] : $ide)); @@ -317,14 +317,14 @@ $loader->load('web_link.xml'); } - $this->addAnnotatedClassesToCompile(array( + $this->addAnnotatedClassesToCompile([ '**\\Controller\\', '**\\Entity\\', // Added explicitly so that we don't rely on the class map being dumped to make it work 'Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', - )); + ]); $container->registerForAutoconfiguration(Command::class) ->addTag('console.command'); @@ -353,7 +353,7 @@ $container->registerForAutoconfiguration(EventSubscriberInterface::class) ->addTag('kernel.event_subscriber'); $container->registerForAutoconfiguration(ResettableInterface::class) - ->addTag('kernel.reset', array('method' => 'reset')); + ->addTag('kernel.reset', ['method' => 'reset']); $container->registerForAutoconfiguration(PropertyListExtractorInterface::class) ->addTag('property_info.list_extractor'); $container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class) @@ -377,11 +377,11 @@ if (!$container->getParameter('kernel.debug')) { // remove tagged iterator argument for resource checkers - $container->getDefinition('config_cache_factory')->setArguments(array()); + $container->getDefinition('config_cache_factory')->setArguments([]); } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Component\\Config\\ConfigCache', 'Symfony\\Component\\Config\\FileLocator', @@ -418,7 +418,7 @@ // cannot be included as commands are discovered based on the path to this class via Reflection // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', - )); + ]); } } @@ -511,7 +511,7 @@ { if (!$this->isConfigEnabled($container, $config)) { // this is needed for the WebProfiler to work even if the profiler is disabled - $container->setParameter('data_collector.templates', array()); + $container->setParameter('data_collector.templates', []); return; } @@ -563,22 +563,22 @@ $definition->setPublic(false); if (isset($config['matcher']['ip'])) { - $definition->addMethodCall('matchIp', array($config['matcher']['ip'])); + $definition->addMethodCall('matchIp', [$config['matcher']['ip']]); } if (isset($config['matcher']['ips'])) { - $definition->addMethodCall('matchIps', array($config['matcher']['ips'])); + $definition->addMethodCall('matchIps', [$config['matcher']['ips']]); } if (isset($config['matcher']['path'])) { - $definition->addMethodCall('matchPath', array($config['matcher']['path'])); + $definition->addMethodCall('matchPath', [$config['matcher']['path']]); } } } $container->getDefinition('profiler') ->addArgument($config['collect']) - ->addTag('kernel.reset', array('method' => 'reset')); + ->addTag('kernel.reset', ['method' => 'reset']); } private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) @@ -610,13 +610,13 @@ $workflowId = sprintf('%s.%s', $type, $name); // Create transitions - $transitions = array(); - $guardsConfiguration = array(); + $transitions = []; + $guardsConfiguration = []; // Global transition counter per workflow $transitionCounter = 0; foreach ($workflow['transitions'] as $transition) { if ('workflow' === $type) { - $transitionDefinition = new Definition(Workflow\Transition::class, array($transition['name'], $transition['from'], $transition['to'])); + $transitionDefinition = new Definition(Workflow\Transition::class, [$transition['name'], $transition['from'], $transition['to']]); $transitionDefinition->setPublic(false); $transitionId = sprintf('%s.transition.%s', $workflowId, $transitionCounter++); $container->setDefinition($transitionId, $transitionDefinition); @@ -632,7 +632,7 @@ } elseif ('state_machine' === $type) { foreach ($transition['from'] as $from) { foreach ($transition['to'] as $to) { - $transitionDefinition = new Definition(Workflow\Transition::class, array($transition['name'], $from, $to)); + $transitionDefinition = new Definition(Workflow\Transition::class, [$transition['name'], $from, $to]); $transitionDefinition->setPublic(false); $transitionId = sprintf('%s.transition.%s', $workflowId, $transitionCounter++); $container->setDefinition($transitionId, $transitionDefinition); @@ -655,11 +655,11 @@ $definitionDefinition->setPublic(false); $definitionDefinition->addArgument($workflow['places']); $definitionDefinition->addArgument($transitions); - $definitionDefinition->addTag('workflow.definition', array( + $definitionDefinition->addTag('workflow.definition', [ 'name' => $name, 'type' => $type, 'marking_store' => isset($workflow['marking_store']['type']) ? $workflow['marking_store']['type'] : null, - )); + ]); if (isset($workflow['initial_place'])) { $definitionDefinition->addArgument($workflow['initial_place']); } @@ -689,22 +689,22 @@ // Add workflow to Registry if ($workflow['supports']) { foreach ($workflow['supports'] as $supportedClassName) { - $strategyDefinition = new Definition(Workflow\SupportStrategy\ClassInstanceSupportStrategy::class, array($supportedClassName)); + $strategyDefinition = new Definition(Workflow\SupportStrategy\ClassInstanceSupportStrategy::class, [$supportedClassName]); $strategyDefinition->setPublic(false); - $registryDefinition->addMethodCall('add', array(new Reference($workflowId), $strategyDefinition)); + $registryDefinition->addMethodCall('add', [new Reference($workflowId), $strategyDefinition]); } } elseif (isset($workflow['support_strategy'])) { - $registryDefinition->addMethodCall('add', array(new Reference($workflowId), new Reference($workflow['support_strategy']))); + $registryDefinition->addMethodCall('add', [new Reference($workflowId), new Reference($workflow['support_strategy'])]); } // Enable the AuditTrail if ($workflow['audit_trail']['enabled']) { $listener = new Definition(Workflow\EventListener\AuditTrailListener::class); $listener->setPrivate(true); - $listener->addTag('monolog.logger', array('channel' => 'workflow')); - $listener->addTag('kernel.event_listener', array('event' => sprintf('workflow.%s.leave', $name), 'method' => 'onLeave')); - $listener->addTag('kernel.event_listener', array('event' => sprintf('workflow.%s.transition', $name), 'method' => 'onTransition')); - $listener->addTag('kernel.event_listener', array('event' => sprintf('workflow.%s.enter', $name), 'method' => 'onEnter')); + $listener->addTag('monolog.logger', ['channel' => 'workflow']); + $listener->addTag('kernel.event_listener', ['event' => sprintf('workflow.%s.leave', $name), 'method' => 'onLeave']); + $listener->addTag('kernel.event_listener', ['event' => sprintf('workflow.%s.transition', $name), 'method' => 'onTransition']); + $listener->addTag('kernel.event_listener', ['event' => sprintf('workflow.%s.enter', $name), 'method' => 'onEnter']); $listener->addArgument(new Reference('logger')); $container->setDefinition(sprintf('%s.listener.audit_trail', $workflowId), $listener); } @@ -722,7 +722,7 @@ $guard = new Definition(Workflow\EventListener\GuardListener::class); $guard->setPrivate(true); - $guard->setArguments(array( + $guard->setArguments([ $guardsConfiguration, new Reference('workflow.security.expression_language'), new Reference('security.token_storage'), @@ -730,9 +730,9 @@ new Reference('security.authentication.trust_resolver'), new Reference('security.role_hierarchy'), new Reference('validator', ContainerInterface::NULL_ON_INVALID_REFERENCE), - )); + ]); foreach ($guardsConfiguration as $eventName => $config) { - $guard->addTag('kernel.event_listener', array('event' => $eventName, 'method' => 'onTransition')); + $guard->addTag('kernel.event_listener', ['event' => $eventName, 'method' => 'onTransition']); } $container->setDefinition(sprintf('%s.listener.guard', $workflowId), $guard); @@ -751,7 +751,7 @@ $container->register('debug.stopwatch', Stopwatch::class) ->addArgument(true) ->setPrivate(true) - ->addTag('kernel.reset', array('method' => 'reset')); + ->addTag('kernel.reset', ['method' => 'reset']); $container->setAlias(Stopwatch::class, new Alias('debug.stopwatch', false)); } @@ -815,36 +815,36 @@ $container->setParameter('request_listener.https_port', $config['https_port']); if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'Symfony\\Component\\Routing\\RequestContext', 'Symfony\\Component\\Routing\\Router', 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', $container->findDefinition('router.default')->getClass(), - )); + ]); } if ($this->annotationsConfigEnabled) { $container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class) ->setPublic(false) - ->addTag('routing.loader', array('priority' => -10)) + ->addTag('routing.loader', ['priority' => -10]) ->addArgument(new Reference('annotation_reader')); $container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class) ->setPublic(false) - ->addTag('routing.loader', array('priority' => -10)) - ->setArguments(array( + ->addTag('routing.loader', ['priority' => -10]) + ->setArguments([ new Reference('file_locator'), new Reference('routing.loader.annotation'), - )); + ]); $container->register('routing.loader.annotation.file', AnnotationFileLoader::class) ->setPublic(false) - ->addTag('routing.loader', array('priority' => -10)) - ->setArguments(array( + ->addTag('routing.loader', ['priority' => -10]) + ->setArguments([ new Reference('file_locator'), new Reference('routing.loader.annotation'), - )); + ]); } } @@ -860,8 +860,8 @@ // session storage $container->setAlias('session.storage', $config['storage_id'])->setPrivate(true); - $options = array('cache_limiter' => '0'); - foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor', 'use_strict_mode') as $key) { + $options = ['cache_limiter' => '0']; + foreach (['name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor', 'use_strict_mode'] as $key) { if (isset($config[$key])) { $options[$key] = $config[$key]; } @@ -881,7 +881,7 @@ $container->setParameter('session.save_path', $config['save_path']); if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Component\\HttpKernel\\EventListener\\SessionListener', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', @@ -889,12 +889,12 @@ 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', $container->getDefinition('session')->getClass(), - )); + ]); if ($container->hasDefinition($config['storage_id'])) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ $container->findDefinition('session.storage')->getClass(), - )); + ]); } } @@ -925,11 +925,11 @@ $logger = new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE); $container->getDefinition('templating.loader.cache') - ->addTag('monolog.logger', array('channel' => 'templating')) - ->addMethodCall('setLogger', array($logger)); + ->addTag('monolog.logger', ['channel' => 'templating']) + ->addMethodCall('setLogger', [$logger]); $container->getDefinition('templating.loader.chain') - ->addTag('monolog.logger', array('channel' => 'templating')) - ->addMethodCall('setLogger', array($logger)); + ->addTag('monolog.logger', ['channel' => 'templating']) + ->addMethodCall('setLogger', [$logger]); } if (!empty($config['loaders'])) { @@ -955,12 +955,12 @@ } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', $container->findDefinition('templating.locator')->getClass(), - )); + ]); } $container->setParameter('templating.engines', $config['engines']); @@ -972,13 +972,13 @@ } else { $templateEngineDefinition = $container->getDefinition('templating.engine.delegating'); foreach ($engines as $engine) { - $templateEngineDefinition->addMethodCall('addEngine', array($engine)); + $templateEngineDefinition->addMethodCall('addEngine', [$engine]); } $container->setAlias('templating', 'templating.engine.delegating')->setPublic(true); } $container->getDefinition('fragment.renderer.hinclude') - ->addTag('kernel.fragment_renderer', array('alias' => 'hinclude')) + ->addTag('kernel.fragment_renderer', ['alias' => 'hinclude']) ->replaceArgument(0, new Reference('templating')) ; @@ -1008,11 +1008,11 @@ } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Component\\Templating\\Storage\\FileStorage', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', - )); + ]); } if ($container->has('assets.packages')) { @@ -1048,7 +1048,7 @@ $defaultPackage = $this->createPackageDefinition($config['base_path'], $config['base_urls'], $defaultVersion); $container->setDefinition('assets._default_package', $defaultPackage); - $namedPackages = array(); + $namedPackages = []; foreach ($config['packages'] as $name => $package) { if (null !== $package['version_strategy']) { $version = new Reference($package['version_strategy']); @@ -1160,13 +1160,13 @@ $container->setAlias('translator', 'translator.default')->setPublic(true); $container->setAlias('translator.formatter', new Alias($config['formatter'], false)); $translator = $container->findDefinition('translator.default'); - $translator->addMethodCall('setFallbackLocales', array($config['fallbacks'])); + $translator->addMethodCall('setFallbackLocales', [$config['fallbacks']]); $container->setParameter('translator.logging', $config['logging']); $container->setParameter('translator.default_path', $config['default_path']); // Discover translation directories - $dirs = array(); + $dirs = []; if (class_exists('Symfony\Component\Validator\Validation')) { $r = new \ReflectionClass('Symfony\Component\Validator\Validation'); @@ -1210,7 +1210,7 @@ // Register translation resources if ($dirs) { - $files = array(); + $files = []; $finder = Finder::create() ->followLinks() ->files() @@ -1224,7 +1224,7 @@ foreach ($finder as $file) { list(, $locale) = explode('.', $file->getBasename(), 3); if (!isset($files[$locale])) { - $files[$locale] = array(); + $files[$locale] = []; } $files[$locale][] = (string) $file; @@ -1232,7 +1232,7 @@ $options = array_merge( $translator->getArgument(4), - array('resource_files' => $files) + ['resource_files' => $files] ); $translator->replaceArgument(4, $options); @@ -1259,15 +1259,15 @@ $container->setParameter('validator.translation_domain', $config['translation_domain']); - $files = array('xml' => array(), 'yml' => array()); + $files = ['xml' => [], 'yml' => []]; $this->registerValidatorMapping($container, $config, $files); if (!empty($files['xml'])) { - $validatorBuilder->addMethodCall('addXmlMappings', array($files['xml'])); + $validatorBuilder->addMethodCall('addXmlMappings', [$files['xml']]); } if (!empty($files['yml'])) { - $validatorBuilder->addMethodCall('addYamlMappings', array($files['yml'])); + $validatorBuilder->addMethodCall('addYamlMappings', [$files['yml']]); } $definition = $container->findDefinition('validator.email'); @@ -1278,12 +1278,12 @@ throw new \LogicException('"enable_annotations" on the validator cannot be set as Annotations support is disabled.'); } - $validatorBuilder->addMethodCall('enableAnnotationMapping', array(new Reference('annotation_reader'))); + $validatorBuilder->addMethodCall('enableAnnotationMapping', [new Reference('annotation_reader')]); } if (array_key_exists('static_method', $config) && $config['static_method']) { foreach ($config['static_method'] as $methodName) { - $validatorBuilder->addMethodCall('addMethodMapping', array($methodName)); + $validatorBuilder->addMethodCall('addMethodMapping', [$methodName]); } } @@ -1293,9 +1293,9 @@ 'validator_'.$this->getKernelRootHash($container) ); - $validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache']))); + $validatorBuilder->addMethodCall('setMetadataCache', [new Reference($config['cache'])]); } elseif (!$container->getParameter('kernel.debug')) { - $validatorBuilder->addMethodCall('setMetadataCache', array(new Reference('validator.mapping.cache.symfony'))); + $validatorBuilder->addMethodCall('setMetadataCache', [new Reference('validator.mapping.cache.symfony')]); } } @@ -1377,7 +1377,7 @@ if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) { $container->getDefinition('annotations.dummy_registry') - ->setMethodCalls(array(array('registerLoader', array('class_exists')))); + ->setMethodCalls([['registerLoader', ['class_exists']]]); } if ('none' !== $config['cache']) { @@ -1395,10 +1395,10 @@ $definition->addTag('kernel.cache_warmer'); if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\Component\Cache\Adapter\PhpArrayAdapter', 'Symfony\Component\Cache\DoctrineProvider', - )); + ]); } } elseif ('file' === $config['cache']) { $cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']); @@ -1486,7 +1486,7 @@ $container->removeDefinition('serializer.encoder.yaml'); } - $serializerLoaders = array(); + $serializerLoaders = []; if (isset($config['enable_annotations']) && $config['enable_annotations']) { if (!$this->annotationsConfigEnabled) { throw new \LogicException('"enable_annotations" on the serializer cannot be set as Annotations support is disabled.'); @@ -1494,7 +1494,7 @@ $annotationLoader = new Definition( 'Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader', - array(new Reference('annotation_reader')) + [new Reference('annotation_reader')] ); $annotationLoader->setPublic(false); @@ -1502,7 +1502,7 @@ } $fileRecorder = function ($extension, $path) use (&$serializerLoaders) { - $definition = new Definition(\in_array($extension, array('yaml', 'yml')) ? 'Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader' : 'Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($path)); + $definition = new Definition(\in_array($extension, ['yaml', 'yml']) ? 'Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader' : 'Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', [$path]); $definition->setPublic(false); $serializerLoaders[] = $definition; }; @@ -1548,10 +1548,10 @@ } elseif (!$container->getParameter('kernel.debug')) { $cacheMetadataFactory = new Definition( CacheClassMetadataFactory::class, - array( + [ new Reference('serializer.mapping.cache_class_metadata_factory.inner'), new Reference('serializer.mapping.cache.symfony'), - ) + ] ); $cacheMetadataFactory->setPublic(false); $cacheMetadataFactory->setDecoratedService('serializer.mapping.class_metadata_factory'); @@ -1564,7 +1564,7 @@ } if (isset($config['circular_reference_handler']) && $config['circular_reference_handler']) { - $container->getDefinition('serializer.normalizer.object')->addMethodCall('setCircularReferenceHandler', array(new Reference($config['circular_reference_handler']))); + $container->getDefinition('serializer.normalizer.object')->addMethodCall('setCircularReferenceHandler', [new Reference($config['circular_reference_handler'])]); } } @@ -1581,8 +1581,8 @@ if (interface_exists('phpDocumentor\Reflection\DocBlockFactoryInterface')) { $definition = $container->register('property_info.php_doc_extractor', 'Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor'); $definition->setPrivate(true); - $definition->addTag('property_info.description_extractor', array('priority' => -1000)); - $definition->addTag('property_info.type_extractor', array('priority' => -1001)); + $definition->addTag('property_info.description_extractor', ['priority' => -1000]); + $definition->addTag('property_info.type_extractor', ['priority' => -1001]); } } @@ -1596,7 +1596,7 @@ } // Generate stores - $storeDefinitions = array(); + $storeDefinitions = []; foreach ($resourceStores as $storeDsn) { $storeDsn = $container->resolveEnvPlaceholders($storeDsn, null, $usedEnvs); switch (true) { @@ -1610,15 +1610,15 @@ if (!$container->hasDefinition($connectionDefinitionId = $container->hash($storeDsn))) { $connectionDefinition = new Definition(\stdClass::class); $connectionDefinition->setPublic(false); - $connectionDefinition->setFactory(array(AbstractAdapter::class, 'createConnection')); - $connectionDefinition->setArguments(array($storeDsn, array('lazy' => true))); + $connectionDefinition->setFactory([AbstractAdapter::class, 'createConnection']); + $connectionDefinition->setArguments([$storeDsn, ['lazy' => true]]); $container->setDefinition($connectionDefinitionId, $connectionDefinition); } $storeDefinition = new Definition(StoreInterface::class); $storeDefinition->setPublic(false); - $storeDefinition->setFactory(array(StoreFactory::class, 'createStore')); - $storeDefinition->setArguments(array(new Reference($connectionDefinitionId))); + $storeDefinition->setFactory([StoreFactory::class, 'createStore']); + $storeDefinition->setArguments([new Reference($connectionDefinitionId)]); $container->setDefinition($storeDefinitionId = 'lock.'.$resourceName.'.store.'.$container->hash($storeDsn), $storeDefinition); @@ -1648,8 +1648,8 @@ // Generate services for lock instances $lockDefinition = new Definition(Lock::class); $lockDefinition->setPublic(false); - $lockDefinition->setFactory(array(new Reference('lock.'.$resourceName.'.factory'), 'createLock')); - $lockDefinition->setArguments(array($resourceName)); + $lockDefinition->setFactory([new Reference('lock.'.$resourceName.'.factory'), 'createLock']); + $lockDefinition->setArguments([$resourceName]); $container->setDefinition('lock.'.$resourceName, $lockDefinition); // provide alias for default resource @@ -1678,16 +1678,16 @@ // Inline any env vars referenced in the parameter $container->setParameter('cache.prefix.seed', $container->resolveEnvPlaceholders($container->getParameter('cache.prefix.seed'), true)); } - foreach (array('doctrine', 'psr6', 'redis', 'memcached') as $name) { + foreach (['doctrine', 'psr6', 'redis', 'memcached'] as $name) { if (isset($config[$name = 'default_'.$name.'_provider'])) { $container->setAlias('cache.'.$name, new Alias(Compiler\CachePoolPass::getServiceProvider($container, $config[$name]), false)); } } - foreach (array('app', 'system') as $name) { - $config['pools']['cache.'.$name] = array( + foreach (['app', 'system'] as $name) { + $config['pools']['cache.'.$name] = [ 'adapter' => $config[$name], 'public' => true, - ); + ]; } foreach ($config['pools'] as $name => $pool) { $definition = new ChildDefinition($pool['adapter']); @@ -1703,22 +1703,22 @@ $propertyAccessDefinition->setPublic(false); if (!$container->getParameter('kernel.debug')) { - $propertyAccessDefinition->setFactory(array(PropertyAccessor::class, 'createCache')); - $propertyAccessDefinition->setArguments(array(null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))); - $propertyAccessDefinition->addTag('cache.pool', array('clearer' => 'cache.system_clearer')); - $propertyAccessDefinition->addTag('monolog.logger', array('channel' => 'cache')); + $propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']); + $propertyAccessDefinition->setArguments([null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]); + $propertyAccessDefinition->addTag('cache.pool', ['clearer' => 'cache.system_clearer']); + $propertyAccessDefinition->addTag('monolog.logger', ['channel' => 'cache']); } else { $propertyAccessDefinition->setClass(ArrayAdapter::class); - $propertyAccessDefinition->setArguments(array(0, false)); + $propertyAccessDefinition->setArguments([0, false]); } } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\Component\Cache\Adapter\ApcuAdapter', 'Symfony\Component\Cache\Adapter\FilesystemAdapter', 'Symfony\Component\Cache\CacheItem', - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,8 +41,8 @@ public static function getSubscribedEvents() { - return array( - KernelEvents::REQUEST => array('onKernelRequest', 24), - ); + return [ + KernelEvents::REQUEST => ['onKernelRequest', 24], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php 2019-02-03 12:23:08.000000000 +0000 @@ -84,13 +84,13 @@ { parent::build($container); - $hotPathEvents = array( + $hotPathEvents = [ KernelEvents::REQUEST, KernelEvents::CONTROLLER, KernelEvents::CONTROLLER_ARGUMENTS, KernelEvents::RESPONSE, KernelEvents::FINISH_REQUEST, - ); + ]; $container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32); $container->addCompilerPass(new RegisterControllerArgumentLocatorsPass()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ $this->kernel = $kernel; $this->cacheDir = $cacheDir; - parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge(array('debug' => $kernel->isDebug()), $this->getOptions())); + parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge(['debug' => $kernel->isDebug()], $this->getOptions())); } /** @@ -64,7 +64,7 @@ */ protected function getOptions() { - return array(); + return []; } protected function createSurrogate() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,9 +39,9 @@ * * You can register extensions: * - * $c->loadFromExtension('framework', array( + * $c->loadFromExtension('framework', [ * 'secret' => '%secret%' - * )); + * ]); * * Or services: * @@ -62,12 +62,12 @@ public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(function (ContainerBuilder $container) use ($loader) { - $container->loadFromExtension('framework', array( - 'router' => array( + $container->loadFromExtension('framework', [ + 'router' => [ 'resource' => 'kernel:loadRoutes', 'type' => 'service', - ), - )); + ], + ]); if ($this instanceof EventSubscriberInterface) { $container->register('kernel', static::class) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,6 +1,6 @@ $v): ?> -escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?> +escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, [], $translation_domain) : $v)) ?> escape($k), $view->escape($k)) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,4 +1,4 @@ $name, '%id%' => $id)) + ? strtr($label_format, ['%name%' => $name, '%id%' => $id]) : $view['form']->humanize($name); } ?> - + diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,17 +2,17 @@ - block($form, 'widget_attributes', array( + block($form, 'widget_attributes', [ 'required' => $required, - )) ?> + ]) ?> multiple="multiple" > - + 0): ?> - block($form, 'choice_widget_options', array('choices' => $preferred_choices)) ?> + block($form, 'choice_widget_options', ['choices' => $preferred_choices]) ?> 0 && null !== $separator): ?> - block($form, 'choice_widget_options', array('choices' => $choices)) ?> + block($form, 'choice_widget_options', ['choices' => $choices]) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_expanded.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,6 +1,6 @@
block($form, 'widget_container_attributes') ?>> widget($child) ?> - label($child, null, array('translation_domain' => $choice_translation_domain)) ?> + label($child, null, ['translation_domain' => $choice_translation_domain]) ?>
diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -4,10 +4,10 @@ $choice): ?> - - block($form, 'choice_widget_options', array('choices' => $choice)) ?> + + block($form, 'choice_widget_options', ['choices' => $choice]) ?> - + diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,4 +1,4 @@ escape($view['form']->row($prototype)) ?> -widget($form, array('attr' => $attr)) ?> +widget($form, ['attr' => $attr]) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/color_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/color_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/color_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/color_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'color')); +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'color']); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,10 +2,10 @@ block($form, 'form_widget_simple'); ?>
block($form, 'widget_container_attributes') ?>> - widget($form['year']), $view['form']->widget($form['month']), $view['form']->widget($form['day']), - ), $date_pattern) ?> + ], $date_pattern) ?>
diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/email_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'email')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'email']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,7 +2,7 @@ $name, '%id%' => $id)) + ? strtr($label_format, ['%name%' => $name, '%id%' => $id]) : $view['form']->humanize($name); } ?> -block($form, 'attributes', array('attr' => $label_attr)); } ?>>escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?> +block($form, 'attributes', ['attr' => $label_attr]); } ?>>escape(false !== $translation_domain ? $view['translator']->trans($label, [], $translation_domain) : $label) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/hidden_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'hidden')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'hidden']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/integer_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'number')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'number']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'password']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> % +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?> % diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/range_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'range')); +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'range']); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> +block($form, 'button_widget', ['type' => isset($type) ? $type : 'reset']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'search']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> +block($form, 'button_widget', ['type' => isset($type) ? $type : 'submit']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/tel_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/tel_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/tel_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/tel_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'tel')); +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'tel']); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ block($form, 'form_widget_simple'); ?> - array('size' => 1)) : array() ?> + ['size' => 1]] : [] ?>
block($form, 'widget_container_attributes') ?>> block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?> +block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'url']) ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,14 +43,14 @@ */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { - return preg_replace(array( + return preg_replace([ '/(bundle|controller)_/', '/action(_\d+)?$/', '/__/', - ), array( + ], [ '_', '\\1', '_', - ), parent::getDefaultRouteName($class, $method)); + ], parent::getDefaultRouteName($class, $method)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ */ public function redirect($path, $route, $scheme = null) { - return array( + return [ '_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction', 'path' => $path, 'permanent' => true, @@ -37,6 +37,6 @@ 'httpPort' => $this->context->getHttpPort(), 'httpsPort' => $this->context->getHttpsPort(), '_route' => $route, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface { private $container; - private $collectedParameters = array(); + private $collectedParameters = []; /** * @param ContainerInterface $container A ContainerInterface instance @@ -38,7 +38,7 @@ * @param array $options An array of options * @param RequestContext $context The context */ - public function __construct(ContainerInterface $container, $resource, array $options = array(), RequestContext $context = null) + public function __construct(ContainerInterface $container, $resource, array $options = [], RequestContext $context = null) { $this->container = $container; @@ -99,13 +99,13 @@ $route->setPath($this->resolve($route->getPath())); $route->setHost($this->resolve($route->getHost())); - $schemes = array(); + $schemes = []; foreach ($route->getSchemes() as $scheme) { $schemes = array_merge($schemes, explode('|', $this->resolve($scheme))); } $route->setSchemes($schemes); - $methods = array(); + $methods = []; foreach ($route->getMethods() as $method) { $methods = array_merge($methods, explode('|', $this->resolve($method))); } @@ -170,8 +170,8 @@ */ public static function getSubscribedServices() { - return array( + return [ 'routing.loader' => LoaderInterface::class, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,7 +43,7 @@ /** * {@inheritdoc} */ - public function renderResponse($view, array $parameters = array(), Response $response = null) + public function renderResponse($view, array $parameters = [], Response $response = null) { $engine = $this->getEngine($view); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/EngineInterface.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,5 +32,5 @@ * * @throws \RuntimeException if the template cannot be rendered */ - public function renderResponse($view, array $parameters = array(), Response $response = null); + public function renderResponse($view, array $parameters = [], Response $response = null); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ * * @see FragmentHandler::render() */ - public function render($uri, array $options = array()) + public function render($uri, array $options = []) { $strategy = isset($options['strategy']) ? $options['strategy'] : 'inline'; unset($options['strategy']); @@ -47,7 +47,7 @@ return $this->handler->render($uri, $strategy, $options); } - public function controller($controller, $attributes = array(), $query = array()) + public function controller($controller, $attributes = [], $query = []) { return new ControllerReference($controller, $attributes, $query); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -78,7 +78,7 @@ */ public function formatArgs(array $args) { - $result = array(); + $result = []; foreach ($args as $key => $item) { if ('object' === $item[0]) { $parts = explode('\\', $item[1]); @@ -131,7 +131,7 @@ $code = preg_replace('#^\s*(.*)\s*#s', '\\1', $code); $content = explode('
', $code); - $lines = array(); + $lines = []; for ($i = max($line - 3, 1), $max = min($line + 3, \count($content)); $i <= $max; ++$i) { $lines[] = ''.self::fixCodeMarkup($content[$i - 1]).''; } @@ -157,7 +157,7 @@ $file = trim($file); $fileStr = $file; if (0 === strpos($fileStr, $this->rootDir)) { - $fileStr = str_replace(array('\\', $this->rootDir), array('/', ''), $fileStr); + $fileStr = str_replace(['\\', $this->rootDir], ['/', ''], $fileStr); $fileStr = htmlspecialchars($fileStr, $flags, $this->charset); $fileStr = sprintf('kernel.root_dir/%s', htmlspecialchars($this->rootDir, $flags, $this->charset), $fileStr); } @@ -183,7 +183,7 @@ public function getFileLink($file, $line) { if ($fmt = $this->fileLinkFormat) { - return \is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line); + return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line); } return false; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -61,9 +61,9 @@ * * You can pass options during the call: * - * form($form, array('attr' => array('class' => 'foo'))) ?> + * form($form, ['attr' => ['class' => 'foo']]) ?> * - * form($form, array('separator' => '+++++')) ?> + * form($form, ['separator' => '+++++']) ?> * * This method is mainly intended for prototyping purposes. If you want to * control the layout of a form in a more fine-grained manner, you are @@ -76,7 +76,7 @@ * * @return string The HTML markup */ - public function form(FormView $view, array $variables = array()) + public function form(FormView $view, array $variables = []) { return $this->renderer->renderBlock($view, 'form', $variables); } @@ -93,7 +93,7 @@ * * @return string The HTML markup */ - public function start(FormView $view, array $variables = array()) + public function start(FormView $view, array $variables = []) { return $this->renderer->renderBlock($view, 'form_start', $variables); } @@ -110,7 +110,7 @@ * * @return string The HTML markup */ - public function end(FormView $view, array $variables = array()) + public function end(FormView $view, array $variables = []) { return $this->renderer->renderBlock($view, 'form_end', $variables); } @@ -124,16 +124,16 @@ * * You can pass options during the call: * - * widget($form, array('attr' => array('class' => 'foo'))) ?> + * widget($form, ['attr' => ['class' => 'foo']]) ?> * - * widget($form, array('separator' => '+++++')) ?> + * widget($form, ['separator' => '+++++']) ?> * * @param FormView $view The view for which to render the widget * @param array $variables Additional variables passed to the template * * @return string The HTML markup */ - public function widget(FormView $view, array $variables = array()) + public function widget(FormView $view, array $variables = []) { return $this->renderer->searchAndRenderBlock($view, 'widget', $variables); } @@ -146,7 +146,7 @@ * * @return string The HTML markup */ - public function row(FormView $view, array $variables = array()) + public function row(FormView $view, array $variables = []) { return $this->renderer->searchAndRenderBlock($view, 'row', $variables); } @@ -160,10 +160,10 @@ * * @return string The HTML markup */ - public function label(FormView $view, $label = null, array $variables = array()) + public function label(FormView $view, $label = null, array $variables = []) { if (null !== $label) { - $variables += array('label' => $label); + $variables += ['label' => $label]; } return $this->renderer->searchAndRenderBlock($view, 'label', $variables); @@ -187,7 +187,7 @@ * * @return string The HTML markup */ - public function rest(FormView $view, array $variables = array()) + public function rest(FormView $view, array $variables = []) { return $this->renderer->searchAndRenderBlock($view, 'rest', $variables); } @@ -201,7 +201,7 @@ * * @return string The HTML markup */ - public function block(FormView $view, $blockName, array $variables = array()) + public function block(FormView $view, $blockName, array $variables = []) { return $this->renderer->renderBlock($view, $blockName, $variables); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ * * @see UrlGeneratorInterface */ - public function path($name, $parameters = array(), $relative = false) + public function path($name, $parameters = [], $relative = false) { return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH); } @@ -55,7 +55,7 @@ * * @see UrlGeneratorInterface */ - public function url($name, $parameters = array(), $schemeRelative = false) + public function url($name, $parameters = [], $schemeRelative = false) { return $this->generator->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,7 +42,7 @@ return $this->getSession()->get($name, $default); } - public function getFlash($name, array $default = array()) + public function getFlash($name, array $default = []) { return $this->getSession()->getFlashBag()->get($name, $default); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/StopwatchHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/StopwatchHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/StopwatchHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/StopwatchHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,11 +33,11 @@ return 'stopwatch'; } - public function __call($method, $arguments = array()) + public function __call($method, $arguments = []) { if (null !== $this->stopwatch) { if (method_exists($this->stopwatch, $method)) { - return \call_user_func_array(array($this->stopwatch, $method), $arguments); + return \call_user_func_array([$this->stopwatch, $method], $arguments); } throw new \BadMethodCallException(sprintf('Method "%s" of Stopwatch does not exist', $method)); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ /** * @see TranslatorInterface::trans() */ - public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null) + public function trans($id, array $parameters = [], $domain = 'messages', $locale = null) { return $this->translator->trans($id, $parameters, $domain, $locale); } @@ -37,7 +37,7 @@ /** * @see TranslatorInterface::transChoice() */ - public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) + public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null) { return $this->translator->transChoice($id, $number, $parameters, $domain, $locale); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ protected $locator; protected $cache; - private $cacheHits = array(); + private $cacheHits = []; /** * @param FileLocatorInterface $locator A FileLocatorInterface instance diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,7 +65,7 @@ /** * {@inheritdoc} */ - public function renderResponse($view, array $parameters = array(), Response $response = null) + public function renderResponse($view, array $parameters = [], Response $response = null) { if (null === $response) { $response = new Response(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ class TemplateNameParser extends BaseTemplateNameParser { protected $kernel; - protected $cache = array(); + protected $cache = []; public function __construct(KernelInterface $kernel) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,13 +22,13 @@ { public function __construct($bundle = null, $controller = null, $name = null, $format = null, $engine = null) { - $this->parameters = array( + $this->parameters = [ 'bundle' => $bundle, 'controller' => $controller, 'name' => $name, 'format' => $format, 'engine' => $engine, - ); + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TimedPhpEngine.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TimedPhpEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TimedPhpEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Templating/TimedPhpEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,7 +35,7 @@ /** * {@inheritdoc} */ - public function render($name, array $parameters = array()) + public function render($name, array $parameters = []) { $e = $this->stopwatch->start(sprintf('template.php (%s)', $name), 'template'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -158,7 +158,7 @@ * * @return KernelInterface A KernelInterface instance */ - protected static function bootKernel(array $options = array()) + protected static function bootKernel(array $options = []) { static::ensureKernelShutdown(); @@ -178,7 +178,7 @@ * * @return KernelInterface A KernelInterface instance */ - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { if (null === static::$class) { static::$class = static::getKernelClass(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ * * @return Client A Client instance */ - protected static function createClient(array $options = array(), array $server = array()) + protected static function createClient(array $options = [], array $server = []) { $kernel = static::bootKernel($options); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ public function testAnnotationsCacheWarmerWithDebugDisabled() { - file_put_contents($this->cacheDir.'/annotations.map', sprintf('cacheDir.'/annotations.map', sprintf('cacheDir, __FUNCTION__); $reader = new AnnotationReader(); $fallbackPool = new ArrayAdapter(); @@ -60,7 +60,7 @@ public function testAnnotationsCacheWarmerWithDebugEnabled() { - file_put_contents($this->cacheDir.'/annotations.map', sprintf('cacheDir.'/annotations.map', sprintf('cacheDir, __FUNCTION__); $reader = new AnnotationReader(); $fallbackPool = new ArrayAdapter(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,9 +27,9 @@ $dir = sys_get_temp_dir(); @unlink($dir.'/classes.php'); - file_put_contents($dir.'/classes.map', sprintf('warmUp($dir); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,10 +28,10 @@ $this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.'); } - $loaders = array( + $loaders = [ new XmlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/person.xml'), new YamlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/author.yml'), - ); + ]; $file = sys_get_temp_dir().'/cache-serializer.php'; @unlink($file); @@ -67,7 +67,7 @@ $fallbackPool = new ArrayAdapter(); - $warmer = new SerializerCacheWarmer(array(), $file, $fallbackPool); + $warmer = new SerializerCacheWarmer([], $file, $fallbackPool); $warmer->warmUp(\dirname($file)); $this->assertFileExists($file); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ $kernel ->expects($this->once()) ->method('getBundles') - ->will($this->returnValue(array('BaseBundle' => new BaseBundle()))) + ->will($this->returnValue(['BaseBundle' => new BaseBundle()])) ; $parser = new TemplateFilenameParser(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplatePathsCacheWarmerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplatePathsCacheWarmerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplatePathsCacheWarmerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplatePathsCacheWarmerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,13 +39,13 @@ { $this->templateFinder = $this ->getMockBuilder(TemplateFinderInterface::class) - ->setMethods(array('findAllTemplates')) + ->setMethods(['findAllTemplates']) ->getMock(); $this->fileLocator = $this ->getMockBuilder(FileLocator::class) - ->setMethods(array('locate')) - ->setConstructorArgs(array('/path/to/fallback')) + ->setMethods(['locate']) + ->setConstructorArgs(['/path/to/fallback']) ->getMock(); $this->templateLocator = new TemplateLocator($this->fileLocator); @@ -68,7 +68,7 @@ $this->templateFinder ->expects($this->once()) ->method('findAllTemplates') - ->will($this->returnValue(array($template))); + ->will($this->returnValue([$template])); $this->fileLocator ->expects($this->once()) @@ -87,7 +87,7 @@ $this->templateFinder ->expects($this->once()) ->method('findAllTemplates') - ->will($this->returnValue(array())); + ->will($this->returnValue([])); $this->fileLocator ->expects($this->never()) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/ClientTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/ClientTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/ClientTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/ClientTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,7 +54,7 @@ private function getKernelMock() { $mock = $this->getMockBuilder($this->getKernelClass()) - ->setMethods(array('shutdown', 'boot', 'handle')) + ->setMethods(['shutdown', 'boot', 'handle']) ->disableOriginalConstructor() ->getMock(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,7 +45,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup() { - $input = new ArrayInput(array('cache:clear')); + $input = new ArrayInput(['cache:clear']); $application = new Application($this->kernel); $application->setCatchExceptions(false); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,9 +21,9 @@ { public function registerBundles() { - return array( + return [ new FrameworkBundle(), - ); + ]; } public function setRootDir($rootDir) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePruneCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePruneCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePruneCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePruneCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,13 +24,13 @@ public function testCommandWithPools() { $tester = $this->getCommandTester($this->getKernel(), $this->getRewindableGenerator()); - $tester->execute(array()); + $tester->execute([]); } public function testCommandWithNoPools() { $tester = $this->getCommandTester($this->getKernel(), $this->getEmptyRewindableGenerator()); - $tester->execute(array()); + $tester->execute([]); } /** @@ -50,7 +50,7 @@ private function getEmptyRewindableGenerator() { return new RewindableGenerator(function () { - return new \ArrayIterator(array()); + return new \ArrayIterator([]); }, 0); } @@ -75,7 +75,7 @@ $kernel ->expects($this->once()) ->method('getBundles') - ->willReturn(array()); + ->willReturn([]); return $kernel; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ public function testDebugAllRoutes() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => null), array('decorated' => false)); + $ret = $tester->execute(['name' => null], ['decorated' => false]); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); $this->assertContains('Name Method Scheme Host Path', $tester->getDisplay()); @@ -33,7 +33,7 @@ public function testDebugSingleRoute() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => 'foo'), array('decorated' => false)); + $ret = $tester->execute(['name' => 'foo'], ['decorated' => false]); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); $this->assertContains('Route Name | foo', $tester->getDisplay()); @@ -44,7 +44,7 @@ */ public function testDebugInvalidRoute() { - $this->createCommandTester()->execute(array('name' => 'test')); + $this->createCommandTester()->execute(['name' => 'test']); } /** @@ -58,7 +58,7 @@ $tester = new CommandTester($application->find('debug:router')); - $tester->execute(array()); + $tester->execute([]); $this->assertRegExp('/foo\s+ANY\s+ANY\s+ANY\s+\\/foo/', $tester->getDisplay()); } @@ -117,7 +117,7 @@ $kernel ->expects($this->once()) ->method('getBundles') - ->willReturn(array()) + ->willReturn([]) ; return $kernel; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ public function testWithMatchPath() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('path_info' => '/foo', 'foo'), array('decorated' => false)); + $ret = $tester->execute(['path_info' => '/foo', 'foo'], ['decorated' => false]); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); $this->assertContains('Route Name | foo', $tester->getDisplay()); @@ -35,7 +35,7 @@ public function testWithNotMatchPath() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('path_info' => '/test', 'foo'), array('decorated' => false)); + $ret = $tester->execute(['path_info' => '/test', 'foo'], ['decorated' => false]); $this->assertEquals(1, $ret, 'Returns 1 in case of failure'); $this->assertContains('None of the routes match the path "/test"', $tester->getDisplay()); @@ -54,7 +54,7 @@ $tester = new CommandTester($application->find('router:match')); - $tester->execute(array('path_info' => '/')); + $tester->execute(['path_info' => '/']); $this->assertContains('None of the routes match the path "/"', $tester->getDisplay()); } @@ -119,7 +119,7 @@ $kernel ->expects($this->once()) ->method('getBundles') - ->willReturn(array()) + ->willReturn([]) ; return $kernel; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,24 +25,24 @@ public function testDebugMissingMessages() { - $tester = $this->createCommandTester(array('foo' => 'foo')); - $tester->execute(array('locale' => 'en', 'bundle' => 'foo')); + $tester = $this->createCommandTester(['foo' => 'foo']); + $tester->execute(['locale' => 'en', 'bundle' => 'foo']); $this->assertRegExp('/missing/', $tester->getDisplay()); } public function testDebugUnusedMessages() { - $tester = $this->createCommandTester(array(), array('foo' => 'foo')); - $tester->execute(array('locale' => 'en', 'bundle' => 'foo')); + $tester = $this->createCommandTester([], ['foo' => 'foo']); + $tester->execute(['locale' => 'en', 'bundle' => 'foo']); $this->assertRegExp('/unused/', $tester->getDisplay()); } public function testDebugFallbackMessages() { - $tester = $this->createCommandTester(array(), array('foo' => 'foo')); - $tester->execute(array('locale' => 'fr', 'bundle' => 'foo')); + $tester = $this->createCommandTester([], ['foo' => 'foo']); + $tester->execute(['locale' => 'fr', 'bundle' => 'foo']); $this->assertRegExp('/fallback/', $tester->getDisplay()); } @@ -50,15 +50,15 @@ public function testNoDefinedMessages() { $tester = $this->createCommandTester(); - $tester->execute(array('locale' => 'fr', 'bundle' => 'test')); + $tester->execute(['locale' => 'fr', 'bundle' => 'test']); $this->assertRegExp('/No defined or extracted messages for locale "fr"/', $tester->getDisplay()); } public function testDebugDefaultDirectory() { - $tester = $this->createCommandTester(array('foo' => 'foo'), array('bar' => 'bar')); - $tester->execute(array('locale' => 'en')); + $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']); + $tester->execute(['locale' => 'en']); $this->assertRegExp('/missing/', $tester->getDisplay()); $this->assertRegExp('/unused/', $tester->getDisplay()); @@ -72,8 +72,8 @@ $this->fs->mkdir($this->translationDir.'/translations'); $this->fs->mkdir($this->translationDir.'/templates'); - $tester = $this->createCommandTester(array('foo' => 'foo'), array('bar' => 'bar')); - $tester->execute(array('locale' => 'en')); + $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']); + $tester->execute(['locale' => 'en']); $this->assertRegExp('/missing/', $tester->getDisplay()); $this->assertRegExp('/unused/', $tester->getDisplay()); @@ -87,8 +87,8 @@ ->with($this->equalTo($this->translationDir)) ->willThrowException(new \InvalidArgumentException()); - $tester = $this->createCommandTester(array('foo' => 'foo'), array('bar' => 'bar'), $kernel); - $tester->execute(array('locale' => 'en', 'bundle' => $this->translationDir)); + $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], $kernel); + $tester->execute(['locale' => 'en', 'bundle' => $this->translationDir]); $this->assertRegExp('/missing/', $tester->getDisplay()); $this->assertRegExp('/unused/', $tester->getDisplay()); @@ -105,8 +105,8 @@ ->with($this->equalTo('dir')) ->willThrowException(new \InvalidArgumentException()); - $tester = $this->createCommandTester(array(), array(), $kernel); - $tester->execute(array('locale' => 'en', 'bundle' => 'dir')); + $tester = $this->createCommandTester([], [], $kernel); + $tester->execute(['locale' => 'en', 'bundle' => 'dir']); } protected function setUp() @@ -127,7 +127,7 @@ /** * @return CommandTester */ - private function createCommandTester($extractedMessages = array(), $loadedMessages = array(), $kernel = null) + private function createCommandTester($extractedMessages = [], $loadedMessages = [], $kernel = null) { $translator = $this->getMockBuilder('Symfony\Component\Translation\Translator') ->disableOriginalConstructor() @@ -136,7 +136,7 @@ $translator ->expects($this->any()) ->method('getFallbackLocales') - ->will($this->returnValue(array('en'))); + ->will($this->returnValue(['en'])); $extractor = $this->getMockBuilder('Symfony\Component\Translation\Extractor\ExtractorInterface')->getMock(); $extractor @@ -159,15 +159,15 @@ ); if (null === $kernel) { - $returnValues = array( - array('foo', $this->getBundle($this->translationDir)), - array('test', $this->getBundle('test')), - ); + $returnValues = [ + ['foo', $this->getBundle($this->translationDir)], + ['test', $this->getBundle('test')], + ]; if (HttpKernel\Kernel::VERSION_ID < 40000) { - $returnValues = array( - array('foo', true, $this->getBundle($this->translationDir)), - array('test', true, $this->getBundle('test')), - ); + $returnValues = [ + ['foo', true, $this->getBundle($this->translationDir)], + ['test', true, $this->getBundle('test')], + ]; } $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel @@ -184,7 +184,7 @@ $kernel ->expects($this->any()) ->method('getBundles') - ->will($this->returnValue(array())); + ->will($this->returnValue([])); $kernel ->expects($this->any()) @@ -214,18 +214,18 @@ $kernel ->expects($this->any()) ->method('getBundles') - ->will($this->returnValue(array())); + ->will($this->returnValue([])); $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); $container ->expects($this->any()) ->method('get') - ->will($this->returnValueMap(array( - array('translation.extractor', 1, $extractor), - array('translation.reader', 1, $loader), - array('translator', 1, $translator), - array('kernel', 1, $kernel), - ))); + ->will($this->returnValueMap([ + ['translation.extractor', 1, $extractor], + ['translation.reader', 1, $loader], + ['translator', 1, $translator], + ['kernel', 1, $kernel], + ])); $kernel ->expects($this->any()) @@ -239,7 +239,7 @@ $application->add($command); $tester = new CommandTester($application->find('debug:translation')); - $tester->execute(array('locale' => 'en')); + $tester->execute(['locale' => 'en']); $this->assertContains('No defined or extracted', $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,8 +25,8 @@ public function testDumpMessagesAndClean() { - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true)); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]); $this->assertRegExp('/foo/', $tester->getDisplay()); $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); } @@ -38,16 +38,16 @@ $this->fs->mkdir($this->translationDir.'/translations'); $this->fs->mkdir($this->translationDir.'/templates'); - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', '--dump-messages' => true, '--clean' => true)); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', '--dump-messages' => true, '--clean' => true]); $this->assertRegExp('/foo/', $tester->getDisplay()); $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); } public function testDumpTwoMessagesAndClean() { - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo', 'bar' => 'bar'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true)); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'bar' => 'bar']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]); $this->assertRegExp('/foo/', $tester->getDisplay()); $this->assertRegExp('/bar/', $tester->getDisplay()); $this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay()); @@ -55,16 +55,16 @@ public function testDumpMessagesForSpecificDomain() { - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'), 'mydomain' => array('bar' => 'bar'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--domain' => 'mydomain')); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--domain' => 'mydomain']); $this->assertRegExp('/bar/', $tester->getDisplay()); $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); } public function testWriteMessages() { - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true)); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true]); $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); } @@ -75,15 +75,15 @@ $this->fs->mkdir($this->translationDir.'/translations'); $this->fs->mkdir($this->translationDir.'/templates'); - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', '--force' => true)); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', '--force' => true]); $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); } public function testWriteMessagesForSpecificDomain() { - $tester = $this->createCommandTester(array('messages' => array('foo' => 'foo'), 'mydomain' => array('bar' => 'bar'))); - $tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain')); + $tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]); + $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain']); $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); } @@ -105,7 +105,7 @@ /** * @return CommandTester */ - private function createCommandTester($extractedMessages = array(), $loadedMessages = array(), HttpKernel\KernelInterface $kernel = null) + private function createCommandTester($extractedMessages = [], $loadedMessages = [], HttpKernel\KernelInterface $kernel = null) { $translator = $this->getMockBuilder('Symfony\Component\Translation\Translator') ->disableOriginalConstructor() @@ -114,7 +114,7 @@ $translator ->expects($this->any()) ->method('getFallbackLocales') - ->will($this->returnValue(array('en'))); + ->will($this->returnValue(['en'])); $extractor = $this->getMockBuilder('Symfony\Component\Translation\Extractor\ExtractorInterface')->getMock(); $extractor @@ -143,19 +143,19 @@ ->expects($this->any()) ->method('getFormats') ->will( - $this->returnValue(array('xlf', 'yml')) + $this->returnValue(['xlf', 'yml']) ); if (null === $kernel) { - $returnValues = array( - array('foo', $this->getBundle($this->translationDir)), - array('test', $this->getBundle('test')), - ); + $returnValues = [ + ['foo', $this->getBundle($this->translationDir)], + ['test', $this->getBundle('test')], + ]; if (HttpKernel\Kernel::VERSION_ID < 40000) { - $returnValues = array( - array('foo', true, $this->getBundle($this->translationDir)), - array('test', true, $this->getBundle('test')), - ); + $returnValues = [ + ['foo', true, $this->getBundle($this->translationDir)], + ['test', true, $this->getBundle('test')], + ]; } $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel @@ -172,7 +172,7 @@ $kernel ->expects($this->any()) ->method('getBundles') - ->will($this->returnValue(array())); + ->will($this->returnValue([])); $kernel ->expects($this->any()) @@ -203,19 +203,19 @@ $kernel ->expects($this->any()) ->method('getBundles') - ->will($this->returnValue(array())); + ->will($this->returnValue([])); $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); $container ->expects($this->any()) ->method('get') - ->will($this->returnValueMap(array( - array('translation.extractor', 1, $extractor), - array('translation.reader', 1, $loader), - array('translation.writer', 1, $writer), - array('translator', 1, $translator), - array('kernel', 1, $kernel), - ))); + ->will($this->returnValueMap([ + ['translation.extractor', 1, $extractor], + ['translation.reader', 1, $loader], + ['translation.writer', 1, $writer], + ['translator', 1, $translator], + ['kernel', 1, $kernel], + ])); $kernel ->expects($this->any()) @@ -229,7 +229,7 @@ $application->add($command); $tester = new CommandTester($application->find('translation:update')); - $tester->execute(array('locale' => 'en')); + $tester->execute(['locale' => 'en']); $this->assertContains('You must choose one of --force or --dump-messages', $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,8 +36,8 @@ $filename = $this->createFile('foo: bar'); $tester->execute( - array('filename' => $filename), - array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false) + ['filename' => $filename], + ['verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false] ); $this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success'); @@ -52,7 +52,7 @@ $tester = $this->createCommandTester(); $filename = $this->createFile($incorrectContent); - $tester->execute(array('filename' => $filename), array('decorated' => false)); + $tester->execute(['filename' => $filename], ['decorated' => false]); $this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error'); $this->assertContains('Unable to parse at line 3 (near "bar").', trim($tester->getDisplay())); @@ -67,7 +67,7 @@ $filename = $this->createFile(''); unlink($filename); - $tester->execute(array('filename' => $filename), array('decorated' => false)); + $tester->execute(['filename' => $filename], ['decorated' => false]); } public function testGetHelp() @@ -103,8 +103,8 @@ { $tester = $this->createCommandTester($this->getKernelAwareApplicationMock()); $tester->execute( - array('filename' => '@AppBundle/Resources'), - array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false) + ['filename' => '@AppBundle/Resources'], + ['verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false] ); $this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success'); @@ -186,7 +186,7 @@ protected function setUp() { @mkdir(sys_get_temp_dir().'/yml-lint-test'); - $this->files = array(); + $this->files = []; } protected function tearDown() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,30 +29,30 @@ { $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface')->getMock(); - $kernel = $this->getKernel(array($bundle), true); + $kernel = $this->getKernel([$bundle], true); $application = new Application($kernel); - $application->doRun(new ArrayInput(array('list')), new NullOutput()); + $application->doRun(new ArrayInput(['list']), new NullOutput()); } public function testBundleCommandsAreRegistered() { - $bundle = $this->createBundleMock(array()); + $bundle = $this->createBundleMock([]); - $kernel = $this->getKernel(array($bundle), true); + $kernel = $this->getKernel([$bundle], true); $application = new Application($kernel); - $application->doRun(new ArrayInput(array('list')), new NullOutput()); + $application->doRun(new ArrayInput(['list']), new NullOutput()); // Calling twice: registration should only be done once. - $application->doRun(new ArrayInput(array('list')), new NullOutput()); + $application->doRun(new ArrayInput(['list']), new NullOutput()); } public function testBundleCommandsAreRetrievable() { - $bundle = $this->createBundleMock(array()); + $bundle = $this->createBundleMock([]); - $kernel = $this->getKernel(array($bundle)); + $kernel = $this->getKernel([$bundle]); $application = new Application($kernel); $application->all(); @@ -65,9 +65,9 @@ { $command = new Command('example'); - $bundle = $this->createBundleMock(array($command)); + $bundle = $this->createBundleMock([$command]); - $kernel = $this->getKernel(array($bundle)); + $kernel = $this->getKernel([$bundle]); $application = new Application($kernel); @@ -78,9 +78,9 @@ { $command = new Command('example'); - $bundle = $this->createBundleMock(array($command)); + $bundle = $this->createBundleMock([$command]); - $kernel = $this->getKernel(array($bundle)); + $kernel = $this->getKernel([$bundle]); $application = new Application($kernel); @@ -90,11 +90,11 @@ public function testBundleCommandCanBeFoundByAlias() { $command = new Command('example'); - $command->setAliases(array('alias')); + $command->setAliases(['alias']); - $bundle = $this->createBundleMock(array($command)); + $bundle = $this->createBundleMock([$command]); - $kernel = $this->getKernel(array($bundle)); + $kernel = $this->getKernel([$bundle]); $application = new Application($kernel); @@ -103,30 +103,30 @@ public function testBundleCommandsHaveRightContainer() { - $command = $this->getMockForAbstractClass('Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand', array('foo'), '', true, true, true, array('setContainer')); + $command = $this->getMockForAbstractClass('Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand', ['foo'], '', true, true, true, ['setContainer']); $command->setCode(function () {}); $command->expects($this->exactly(2))->method('setContainer'); - $application = new Application($this->getKernel(array(), true)); + $application = new Application($this->getKernel([], true)); $application->setAutoExit(false); $application->setCatchExceptions(false); $application->add($command); $tester = new ApplicationTester($application); // set container is called here - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); // as the container might have change between two runs, setContainer must called again - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); } public function testBundleCommandCanOverriddeAPreExistingCommandWithTheSameName() { $command = new Command('example'); - $bundle = $this->createBundleMock(array($command)); + $bundle = $this->createBundleMock([$command]); - $kernel = $this->getKernel(array($bundle)); + $kernel = $this->getKernel([$bundle]); $application = new Application($kernel); $newCommand = new Command('example'); @@ -140,14 +140,14 @@ $container = new ContainerBuilder(); $container->register('event_dispatcher', EventDispatcher::class); $container->register(ThrowingCommand::class, ThrowingCommand::class); - $container->setParameter('console.command.ids', array(ThrowingCommand::class => ThrowingCommand::class)); + $container->setParameter('console.command.ids', [ThrowingCommand::class => ThrowingCommand::class]); $kernel = $this->getMockBuilder(KernelInterface::class)->getMock(); $kernel ->method('getBundles') - ->willReturn(array($this->createBundleMock( - array((new Command('fine'))->setCode(function (InputInterface $input, OutputInterface $output) { $output->write('fine'); })) - ))); + ->willReturn([$this->createBundleMock( + [(new Command('fine'))->setCode(function (InputInterface $input, OutputInterface $output) { $output->write('fine'); })] + )]); $kernel ->method('getContainer') ->willReturn($container); @@ -156,7 +156,7 @@ $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'fine')); + $tester->run(['command' => 'fine']); $output = $tester->getDisplay(); $this->assertSame(0, $tester->getStatusCode()); @@ -173,9 +173,9 @@ $kernel = $this->getMockBuilder(KernelInterface::class)->getMock(); $kernel ->method('getBundles') - ->willReturn(array($this->createBundleMock( - array((new Command(null))->setCode(function (InputInterface $input, OutputInterface $output) { $output->write('fine'); })) - ))); + ->willReturn([$this->createBundleMock( + [(new Command(null))->setCode(function (InputInterface $input, OutputInterface $output) { $output->write('fine'); })] + )]); $kernel ->method('getContainer') ->willReturn($container); @@ -184,7 +184,7 @@ $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'fine')); + $tester->run(['command' => 'fine']); $output = $tester->getDisplay(); $this->assertSame(1, $tester->getStatusCode()); @@ -212,14 +212,14 @@ $container ->expects($this->exactly(2)) ->method('hasParameter') - ->withConsecutive(array('console.command.ids'), array('console.lazy_command.ids')) + ->withConsecutive(['console.command.ids'], ['console.lazy_command.ids']) ->willReturnOnConsecutiveCalls(true, true) ; $container ->expects($this->exactly(2)) ->method('getParameter') - ->withConsecutive(array('console.lazy_command.ids'), array('console.command.ids')) - ->willReturnOnConsecutiveCalls(array(), array()) + ->withConsecutive(['console.lazy_command.ids'], ['console.command.ids']) + ->willReturnOnConsecutiveCalls([], []) ; $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -83,13 +83,13 @@ /** @dataProvider getDescribeContainerDefinitionWithArgumentsShownTestData */ public function testDescribeContainerDefinitionWithArgumentsShown(Definition $definition, $expectedDescription) { - $this->assertDescription($expectedDescription, $definition, array('show_arguments' => true)); + $this->assertDescription($expectedDescription, $definition, ['show_arguments' => true]); } public function getDescribeContainerDefinitionWithArgumentsShownTestData() { $definitions = ObjectsProvider::getContainerDefinitions(); - $definitionsWithArgs = array(); + $definitionsWithArgs = []; foreach ($definitions as $key => $definition) { $definitionsWithArgs[str_replace('definition_', 'definition_arguments_', $key)] = $definition; @@ -110,7 +110,7 @@ } /** @dataProvider getDescribeContainerDefinitionWhichIsAnAliasTestData */ - public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = array()) + public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = []) { $this->assertDescription($expectedDescription, $builder, $options); } @@ -122,7 +122,7 @@ $builder->setDefinition('service_2', $builder->getDefinition('definition_2')); $aliases = ObjectsProvider::getContainerAliases(); - $aliasesWithDefinitions = array(); + $aliasesWithDefinitions = []; foreach ($aliases as $name => $alias) { $aliasesWithDefinitions[str_replace('alias_', 'alias_with_definition_', $name)] = $alias; } @@ -131,7 +131,7 @@ $data = $this->getDescriptionTestData($aliasesWithDefinitions); foreach ($aliases as $name => $alias) { $data[$i][] = $builder; - $data[$i][] = array('id' => $name); + $data[$i][] = ['id' => $name]; ++$i; } @@ -148,8 +148,8 @@ { $data = $this->getDescriptionTestData(ObjectsProvider::getContainerParameter()); - $data[0][] = array('parameter' => 'database_name'); - $data[1][] = array('parameter' => 'twig.form.resources'); + $data[0][] = ['parameter' => 'database_name']; + $data[1][] = ['parameter' => 'twig.form.resources']; return $data; } @@ -180,14 +180,14 @@ abstract protected function getFormat(); - private function assertDescription($expectedDescription, $describedObject, array $options = array()) + private function assertDescription($expectedDescription, $describedObject, array $options = []) { $options['raw_output'] = true; $options['raw_text'] = true; $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); if ('txt' === $this->getFormat()) { - $options['output'] = new SymfonyStyle(new ArrayInput(array()), $output); + $options['output'] = new SymfonyStyle(new ArrayInput([]), $output); } $this->getDescriptor()->describe($output, $describedObject, $options); @@ -201,10 +201,10 @@ private function getDescriptionTestData(array $objects) { - $data = array(); + $data = []; foreach ($objects as $name => $object) { $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s.%s', __DIR__, $name, $this->getFormat())); - $data[] = array($object, $description); + $data[] = [$object, $description]; } return $data; @@ -212,19 +212,19 @@ private function getContainerBuilderDescriptionTestData(array $objects) { - $variations = array( - 'services' => array('show_private' => true), - 'public' => array('show_private' => false), - 'tag1' => array('show_private' => true, 'tag' => 'tag1'), - 'tags' => array('group_by' => 'tags', 'show_private' => true), - 'arguments' => array('show_private' => false, 'show_arguments' => true), - ); + $variations = [ + 'services' => ['show_private' => true], + 'public' => ['show_private' => false], + 'tag1' => ['show_private' => true, 'tag' => 'tag1'], + 'tags' => ['group_by' => 'tags', 'show_private' => true], + 'arguments' => ['show_private' => false, 'show_arguments' => true], + ]; - $data = array(); + $data = []; foreach ($objects as $name => $object) { foreach ($variations as $suffix => $options) { $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s_%s.%s', __DIR__, $name, $suffix, $this->getFormat())); - $data[] = array($object, $description, $options); + $data[] = [$object, $description, $options]; } } @@ -233,16 +233,16 @@ private function getEventDispatcherDescriptionTestData(array $objects) { - $variations = array( - 'events' => array(), - 'event1' => array('event' => 'event1'), - ); + $variations = [ + 'events' => [], + 'event1' => ['event' => 'event1'], + ]; - $data = array(); + $data = []; foreach ($objects as $name => $object) { foreach ($variations as $suffix => $options) { $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s_%s.%s', __DIR__, $name, $suffix, $this->getFormat())); - $data[] = array($object, $description, $options); + $data[] = [$object, $description, $options]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,60 +31,60 @@ $collection1->add($name, $route); } - return array('route_collection_1' => $collection1); + return ['route_collection_1' => $collection1]; } public static function getRoutes() { - return array( + return [ 'route_1' => new RouteStub( '/hello/{name}', - array('name' => 'Joseph'), - array('name' => '[a-z]+'), - array('opt1' => 'val1', 'opt2' => 'val2'), + ['name' => 'Joseph'], + ['name' => '[a-z]+'], + ['opt1' => 'val1', 'opt2' => 'val2'], 'localhost', - array('http', 'https'), - array('get', 'head') + ['http', 'https'], + ['get', 'head'] ), 'route_2' => new RouteStub( '/name/add', - array(), - array(), - array('opt1' => 'val1', 'opt2' => 'val2'), + [], + [], + ['opt1' => 'val1', 'opt2' => 'val2'], 'localhost', - array('http', 'https'), - array('put', 'post') + ['http', 'https'], + ['put', 'post'] ), - ); + ]; } public static function getContainerParameters() { - return array( - 'parameters_1' => new ParameterBag(array( + return [ + 'parameters_1' => new ParameterBag([ 'integer' => 12, 'string' => 'Hello world!', 'boolean' => true, - 'array' => array(12, 'Hello world!', true), - )), - ); + 'array' => [12, 'Hello world!', true], + ]), + ]; } public static function getContainerParameter() { $builder = new ContainerBuilder(); $builder->setParameter('database_name', 'symfony'); - $builder->setParameter('twig.form.resources', array( + $builder->setParameter('twig.form.resources', [ 'bootstrap_3_horizontal_layout.html.twig', 'bootstrap_3_layout.html.twig', 'form_div_layout.html.twig', 'form_table_layout.html.twig', - )); + ]); - return array( + return [ 'parameter' => $builder, 'array_parameter' => $builder, - ); + ]; } public static function getContainerBuilders() @@ -93,7 +93,7 @@ $builder1->setDefinitions(self::getContainerDefinitions()); $builder1->setAliases(self::getContainerAliases()); - return array('builder_1' => $builder1); + return ['builder_1' => $builder1]; } public static function getContainerDefinitions() @@ -101,7 +101,7 @@ $definition1 = new Definition('Full\\Qualified\\Class1'); $definition2 = new Definition('Full\\Qualified\\Class2'); - return array( + return [ 'definition_1' => $definition1 ->setPublic(true) ->setSynthetic(false) @@ -109,37 +109,37 @@ ->setAbstract(true) ->addArgument(new Reference('definition2')) ->addArgument('%parameter%') - ->addArgument(new Definition('inline_service', array('arg1', 'arg2'))) - ->addArgument(array( + ->addArgument(new Definition('inline_service', ['arg1', 'arg2'])) + ->addArgument([ 'foo', new Reference('definition2'), new Definition('inline_service'), - )) - ->addArgument(new IteratorArgument(array( + ]) + ->addArgument(new IteratorArgument([ new Reference('definition_1'), new Reference('definition_2'), - ))) - ->setFactory(array('Full\\Qualified\\FactoryClass', 'get')), + ])) + ->setFactory(['Full\\Qualified\\FactoryClass', 'get']), 'definition_2' => $definition2 ->setPublic(false) ->setSynthetic(true) ->setFile('/path/to/file') ->setLazy(false) ->setAbstract(false) - ->addTag('tag1', array('attr1' => 'val1', 'attr2' => 'val2')) - ->addTag('tag1', array('attr3' => 'val3')) + ->addTag('tag1', ['attr1' => 'val1', 'attr2' => 'val2']) + ->addTag('tag1', ['attr3' => 'val3']) ->addTag('tag2') - ->addMethodCall('setMailer', array(new Reference('mailer'))) - ->setFactory(array(new Reference('factory.service'), 'get')), - ); + ->addMethodCall('setMailer', [new Reference('mailer')]) + ->setFactory([new Reference('factory.service'), 'get']), + ]; } public static function getContainerAliases() { - return array( + return [ 'alias_1' => new Alias('service_1', true), 'alias_2' => new Alias('service_2', false), - ); + ]; } public static function getEventDispatchers() @@ -150,20 +150,20 @@ $eventDispatcher->addListener('event1', function () { return 'Closure'; }, -1); $eventDispatcher->addListener('event2', new CallableClass()); - return array('event_dispatcher_1' => $eventDispatcher); + return ['event_dispatcher_1' => $eventDispatcher]; } public static function getCallables() { - $callables = array( + $callables = [ 'callable_1' => 'array_key_exists', - 'callable_2' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'), - 'callable_3' => array(new CallableClass(), 'method'), + 'callable_2' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'], + 'callable_3' => [new CallableClass(), 'method'], 'callable_4' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass::staticMethod', - 'callable_5' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'), + 'callable_5' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'], 'callable_6' => function () { return 'Closure'; }, 'callable_7' => new CallableClass(), - ); + ]; if (\PHP_VERSION_ID >= 70100) { $callables['callable_from_callable'] = \Closure::fromCallable(new CallableClass()); @@ -199,6 +199,6 @@ { public function compile() { - return new CompiledRoute('', '#PATH_REGEX#', array(), array(), '#HOST_REGEX#'); + return new CompiledRoute('', '#PATH_REGEX#', [], [], '#HOST_REGEX#'); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -100,13 +100,13 @@ public function getMissingControllersTest() { // a normal bundle - $bundles = array( - array('FooBundle:Fake:index'), - ); + $bundles = [ + ['FooBundle:Fake:index'], + ]; // a bundle with children if (Kernel::VERSION_ID < 40000) { - $bundles[] = array('SensioFooBundle:Fake:index'); + $bundles[] = ['SensioFooBundle:Fake:index']; } return $bundles; @@ -136,21 +136,21 @@ public function getInvalidBundleNameTests() { - return array( - 'Alternative will be found using levenshtein' => array('FoodBundle:Default:index', 'FooBundle:Default:index'), - 'Alternative will be found using partial match' => array('FabpotFooBund:Default:index', 'FabpotFooBundle:Default:index'), - 'Bundle does not exist at all' => array('CrazyBundle:Default:index', false), - ); + return [ + 'Alternative will be found using levenshtein' => ['FoodBundle:Default:index', 'FooBundle:Default:index'], + 'Alternative will be found using partial match' => ['FabpotFooBund:Default:index', 'FabpotFooBundle:Default:index'], + 'Bundle does not exist at all' => ['CrazyBundle:Default:index', false], + ]; } private function createParser() { - $bundles = array( - 'SensioFooBundle' => array($this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')), - 'SensioCmsFooBundle' => array($this->getBundle('TestBundle\Sensio\Cms\FooBundle', 'SensioCmsFooBundle')), - 'FooBundle' => array($this->getBundle('TestBundle\FooBundle', 'FooBundle')), - 'FabpotFooBundle' => array($this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')), - ); + $bundles = [ + 'SensioFooBundle' => [$this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')], + 'SensioCmsFooBundle' => [$this->getBundle('TestBundle\Sensio\Cms\FooBundle', 'SensioCmsFooBundle')], + 'FooBundle' => [$this->getBundle('TestBundle\FooBundle', 'FooBundle')], + 'FabpotFooBundle' => [$this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')], + ]; $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel @@ -165,13 +165,13 @@ })) ; - $bundles = array( + $bundles = [ 'SensioFooBundle' => $this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), 'SensioCmsFooBundle' => $this->getBundle('TestBundle\Sensio\Cms\FooBundle', 'SensioCmsFooBundle'), 'FoooooBundle' => $this->getBundle('TestBundle\FooBundle', 'FoooooBundle'), 'FooBundle' => $this->getBundle('TestBundle\FooBundle', 'FooBundle'), 'FabpotFooBundle' => $this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), - ); + ]; $kernel ->expects($this->any()) ->method('getBundles') diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -83,7 +83,7 @@ $request = Request::create('/'); $request->attributes->set('_controller', TestAbstractController::class.':testAction'); - $this->assertSame(array($controller, 'testAction'), $resolver->getController($request)); + $this->assertSame([$controller, 'testAction'], $resolver->getController($request)); $this->assertSame($container, $controller->getContainer()); } @@ -101,7 +101,7 @@ $request = Request::create('/'); $request->attributes->set('_controller', TestAbstractController::class.'::fooAction'); - $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame([$controller, 'fooAction'], $resolver->getController($request)); $this->assertSame($container, $controller->setContainer($container)); } @@ -119,7 +119,7 @@ $request = Request::create('/'); $request->attributes->set('_controller', DummyController::class.':fooAction'); - $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame([$controller, 'fooAction'], $resolver->getController($request)); $this->assertSame($container, $controller->getContainer()); } @@ -139,7 +139,7 @@ $request = Request::create('/'); $request->attributes->set('_controller', TestAbstractController::class.'::fooAction'); - $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame([$controller, 'fooAction'], $resolver->getController($request)); $this->assertSame($controllerContainer, $controller->setContainer($container)); } @@ -159,7 +159,7 @@ $request = Request::create('/'); $request->attributes->set('_controller', DummyController::class.':fooAction'); - $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame([$controller, 'fooAction'], $resolver->getController($request)); $this->assertSame($controllerContainer, $controller->getContainer()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -14,6 +14,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormConfigInterface; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\JsonResponse; @@ -59,7 +61,7 @@ public function testGetUser() { $user = new User('user', 'pass'); - $token = new UsernamePasswordToken($user, 'pass', 'default', array('ROLE_USER')); + $token = new UsernamePasswordToken($user, 'pass', 'default', ['ROLE_USER']); $controller = $this->createController(); $controller->setContainer($this->getContainerWithTokenStorage($token)); @@ -121,7 +123,7 @@ $controller = $this->createController(); $controller->setContainer(new Container()); - $response = $controller->json(array()); + $response = $controller->json([]); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertEquals('[]', $response->getContent()); } @@ -134,7 +136,7 @@ $serializer ->expects($this->once()) ->method('serialize') - ->with(array(), 'json', array('json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS)) + ->with([], 'json', ['json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS]) ->will($this->returnValue('[]')); $container->set('serializer', $serializer); @@ -142,7 +144,7 @@ $controller = $this->createController(); $controller->setContainer($container); - $response = $controller->json(array()); + $response = $controller->json([]); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertEquals('[]', $response->getContent()); } @@ -155,7 +157,7 @@ $serializer ->expects($this->once()) ->method('serialize') - ->with(array(), 'json', array('json_encode_options' => 0, 'other' => 'context')) + ->with([], 'json', ['json_encode_options' => 0, 'other' => 'context']) ->will($this->returnValue('[]')); $container->set('serializer', $serializer); @@ -163,7 +165,7 @@ $controller = $this->createController(); $controller->setContainer($container); - $response = $controller->json(array(), 200, array(), array('json_encode_options' => 0, 'other' => 'context')); + $response = $controller->json([], 200, [], ['json_encode_options' => 0, 'other' => 'context']); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertEquals('[]', $response->getContent()); $response->setEncodingOptions(JSON_FORCE_OBJECT); @@ -388,7 +390,7 @@ $controller->setContainer($container); $controller->addFlash('foo', 'bar'); - $this->assertSame(array('bar'), $flashBag->get('foo')); + $this->assertSame(['bar'], $flashBag->get('foo')); } public function testCreateAccessDeniedException() @@ -486,7 +488,7 @@ public function testCreateForm() { - $form = $this->getMockBuilder('Symfony\Component\Form\FormInterface')->getMock(); + $form = new Form($this->getMockBuilder(FormConfigInterface::class)->getMock()); $formFactory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock(); $formFactory->expects($this->once())->method('create')->willReturn($form); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,17 +53,17 @@ $route = 'new-route'; $url = '/redirect-url'; - $attributes = array( + $attributes = [ 'route' => $route, 'permanent' => $permanent, '_route' => 'current-route', - '_route_params' => array( + '_route_params' => [ 'route' => $route, 'permanent' => $permanent, 'additional-parameter' => 'value', 'ignoreAttributes' => $ignoreAttributes, - ), - ); + ], + ]; $request->attributes = new ParameterBag($attributes); @@ -84,12 +84,12 @@ public function provider() { - return array( - array(true, false, 301, array('additional-parameter' => 'value')), - array(false, false, 302, array('additional-parameter' => 'value')), - array(false, true, 302, array()), - array(false, array('additional-parameter'), 302, array()), - ); + return [ + [true, false, 301, ['additional-parameter' => 'value']], + [false, false, 302, ['additional-parameter' => 'value']], + [false, true, 302, []], + [false, ['additional-parameter'], 302, []], + ]; } public function testEmptyPath() @@ -169,33 +169,33 @@ public function urlRedirectProvider() { - return array( + return [ // Standard ports - array('http', null, null, 'http', 80, ''), - array('http', 80, null, 'http', 80, ''), - array('https', null, null, 'http', 80, ''), - array('https', 80, null, 'http', 80, ''), - - array('http', null, null, 'https', 443, ''), - array('http', null, 443, 'https', 443, ''), - array('https', null, null, 'https', 443, ''), - array('https', null, 443, 'https', 443, ''), + ['http', null, null, 'http', 80, ''], + ['http', 80, null, 'http', 80, ''], + ['https', null, null, 'http', 80, ''], + ['https', 80, null, 'http', 80, ''], + + ['http', null, null, 'https', 443, ''], + ['http', null, 443, 'https', 443, ''], + ['https', null, null, 'https', 443, ''], + ['https', null, 443, 'https', 443, ''], // Non-standard ports - array('http', null, null, 'http', 8080, ':8080'), - array('http', 4080, null, 'http', 8080, ':4080'), - array('http', 80, null, 'http', 8080, ''), - array('https', null, null, 'http', 8080, ''), - array('https', null, 8443, 'http', 8080, ':8443'), - array('https', null, 443, 'http', 8080, ''), - - array('https', null, null, 'https', 8443, ':8443'), - array('https', null, 4443, 'https', 8443, ':4443'), - array('https', null, 443, 'https', 8443, ''), - array('http', null, null, 'https', 8443, ''), - array('http', 8080, 4443, 'https', 8443, ':8080'), - array('http', 80, 4443, 'https', 8443, ''), - ); + ['http', null, null, 'http', 8080, ':8080'], + ['http', 4080, null, 'http', 8080, ':4080'], + ['http', 80, null, 'http', 8080, ''], + ['https', null, null, 'http', 8080, ''], + ['https', null, 8443, 'http', 8080, ':8443'], + ['https', null, 443, 'http', 8080, ''], + + ['https', null, null, 'https', 8443, ':8443'], + ['https', null, 4443, 'https', 8443, ':4443'], + ['https', null, 443, 'https', 8443, ''], + ['http', null, null, 'https', 8443, ''], + ['http', 8080, 4443, 'https', 8443, ':8080'], + ['http', 80, 4443, 'https', 8443, ''], + ]; } /** @@ -217,13 +217,13 @@ public function pathQueryParamsProvider() { - return array( - array('http://www.example.com/base/redirect-path', '/redirect-path', ''), - array('http://www.example.com/base/redirect-path?foo=bar', '/redirect-path?foo=bar', ''), - array('http://www.example.com/base/redirect-path?foo=bar', '/redirect-path', 'foo=bar'), - array('http://www.example.com/base/redirect-path?foo=bar&abc=example', '/redirect-path?foo=bar', 'abc=example'), - array('http://www.example.com/base/redirect-path?foo=bar&abc=example&baz=def', '/redirect-path?foo=bar', 'abc=example&baz=def'), - ); + return [ + ['http://www.example.com/base/redirect-path', '/redirect-path', ''], + ['http://www.example.com/base/redirect-path?foo=bar', '/redirect-path?foo=bar', ''], + ['http://www.example.com/base/redirect-path?foo=bar', '/redirect-path', 'foo=bar'], + ['http://www.example.com/base/redirect-path?foo=bar&abc=example', '/redirect-path?foo=bar', 'abc=example'], + ['http://www.example.com/base/redirect-path?foo=bar&abc=example&baz=def', '/redirect-path?foo=bar', 'abc=example&baz=def'], + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,20 +24,20 @@ public function testThatCacheWarmersAreProcessedInPriorityOrder() { $container = new ContainerBuilder(); - $cacheWarmerDefinition = $container->register('cache_warmer')->addArgument(array()); - $container->register('my_cache_warmer_service1')->addTag('kernel.cache_warmer', array('priority' => 100)); - $container->register('my_cache_warmer_service2')->addTag('kernel.cache_warmer', array('priority' => 200)); + $cacheWarmerDefinition = $container->register('cache_warmer')->addArgument([]); + $container->register('my_cache_warmer_service1')->addTag('kernel.cache_warmer', ['priority' => 100]); + $container->register('my_cache_warmer_service2')->addTag('kernel.cache_warmer', ['priority' => 200]); $container->register('my_cache_warmer_service3')->addTag('kernel.cache_warmer'); $addCacheWarmerPass = new AddCacheWarmerPass(); $addCacheWarmerPass->process($container); $this->assertEquals( - array( + [ new Reference('my_cache_warmer_service2'), new Reference('my_cache_warmer_service1'), new Reference('my_cache_warmer_service3'), - ), + ], $cacheWarmerDefinition->getArgument(0) ); } @@ -56,11 +56,11 @@ public function testThatCacheWarmersMightBeNotDefined() { $container = new ContainerBuilder(); - $cacheWarmerDefinition = $container->register('cache_warmer')->addArgument(array()); + $cacheWarmerDefinition = $container->register('cache_warmer')->addArgument([]); $addCacheWarmerPass = new AddCacheWarmerPass(); $addCacheWarmerPass->process($container); - $this->assertSame(array(), $cacheWarmerDefinition->getArgument(0)); + $this->assertSame([], $cacheWarmerDefinition->getArgument(0)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,15 +53,15 @@ } $this->assertTrue($container->hasParameter('console.command.ids')); - $this->assertSame(array($alias => $id), $container->getParameter('console.command.ids')); + $this->assertSame([$alias => $id], $container->getParameter('console.command.ids')); } public function visibilityProvider() { - return array( - array(true), - array(false), - ); + return [ + [true], + [false], + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,21 +28,21 @@ { $container = new ContainerBuilder(); $validatorFactory = $container->register('validator.validator_factory') - ->addArgument(array()); + ->addArgument([]); $container->register('my_constraint_validator_service1', Validator1::class) - ->addTag('validator.constraint_validator', array('alias' => 'my_constraint_validator_alias1')); + ->addTag('validator.constraint_validator', ['alias' => 'my_constraint_validator_alias1']); $container->register('my_constraint_validator_service2', Validator2::class) ->addTag('validator.constraint_validator'); $addConstraintValidatorsPass = new AddConstraintValidatorsPass(); $addConstraintValidatorsPass->process($container); - $expected = (new Definition(ServiceLocator::class, array(array( + $expected = (new Definition(ServiceLocator::class, [[ Validator1::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')), 'my_constraint_validator_alias1' => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')), Validator2::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service2')), - ))))->addTag('container.service_locator')->setPublic(false); + ]]))->addTag('container.service_locator')->setPublic(false); $this->assertEquals($expected, $container->getDefinition((string) $validatorFactory->getArgument(0))); } @@ -54,7 +54,7 @@ { $container = new ContainerBuilder(); $validatorFactory = $container->register('validator.validator_factory') - ->addArgument(array()); + ->addArgument([]); $container->register('my_abstract_constraint_validator') ->setAbstract(true) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CacheCollectorPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CacheCollectorPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CacheCollectorPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CacheCollectorPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,10 +37,10 @@ $collector = $container->register('data_collector.cache', CacheDataCollector::class); (new CacheCollectorPass())->process($container); - $this->assertEquals(array( - array('addInstance', array('fs', new Reference('fs'))), - array('addInstance', array('tagged_fs', new Reference('tagged_fs'))), - ), $collector->getMethodCalls()); + $this->assertEquals([ + ['addInstance', ['fs', new Reference('fs')]], + ['addInstance', ['tagged_fs', new Reference('tagged_fs')]], + ], $collector->getMethodCalls()); $this->assertSame(TraceableAdapter::class, $container->findDefinition('fs')->getClass()); $this->assertSame(TraceableTagAwareAdapter::class, $container->getDefinition('tagged_fs')->getClass()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolClearerPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolClearerPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolClearerPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolClearerPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,13 +36,13 @@ $publicPool = new Definition(); $publicPool->addArgument('namespace'); - $publicPool->addTag('cache.pool', array('clearer' => 'clearer_alias')); + $publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias']); $container->setDefinition('public.pool', $publicPool); $privatePool = new Definition(); $privatePool->setPublic(false); $privatePool->addArgument('namespace'); - $privatePool->addTag('cache.pool', array('clearer' => 'clearer_alias')); + $privatePool->addTag('cache.pool', ['clearer' => 'clearer_alias']); $container->setDefinition('private.pool', $privatePool); $clearer = new Definition(); @@ -50,12 +50,12 @@ $container->setAlias('clearer_alias', 'clearer'); $pass = new RemoveUnusedDefinitionsPass(); - $pass->setRepeatedPass(new RepeatedPass(array($pass))); - foreach (array(new CachePoolPass(), $pass, new CachePoolClearerPass()) as $pass) { + $pass->setRepeatedPass(new RepeatedPass([$pass])); + foreach ([new CachePoolPass(), $pass, new CachePoolClearerPass()] as $pass) { $pass->process($container); } - $this->assertEquals(array(array('public.pool' => new Reference('public.pool'))), $clearer->getArguments()); - $this->assertEquals(array(array('public.pool' => new Reference('public.pool'))), $globalClearer->getArguments()); + $this->assertEquals([['public.pool' => new Reference('public.pool')]], $clearer->getArguments()); + $this->assertEquals([['public.pool' => new Reference('public.pool')]], $globalClearer->getArguments()); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -76,10 +76,10 @@ $container->setParameter('kernel.environment', 'prod'); $container->setParameter('cache.prefix.seed', 'foo'); $cachePool = new Definition(); - $cachePool->addTag('cache.pool', array( + $cachePool->addTag('cache.pool', [ 'provider' => 'foobar', 'default_lifetime' => 3, - )); + ]); $cachePool->addArgument(null); $cachePool->addArgument(null); $cachePool->addArgument(null); @@ -109,7 +109,7 @@ $adapter->addTag('cache.pool'); $container->setDefinition('app.cache_adapter', $adapter); $cachePool = new ChildDefinition('app.cache_adapter'); - $cachePool->addTag('cache.pool', array('foobar' => 123)); + $cachePool->addTag('cache.pool', ['foobar' => 123]); $container->setDefinition('app.cache_pool', $cachePool); $this->cachePoolPass->process($container); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPrunerPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPrunerPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPrunerPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPrunerPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,17 +24,17 @@ public function testCompilerPassReplacesCommandArgument() { $container = new ContainerBuilder(); - $container->register('console.command.cache_pool_prune')->addArgument(array()); + $container->register('console.command.cache_pool_prune')->addArgument([]); $container->register('pool.foo', FilesystemAdapter::class)->addTag('cache.pool'); $container->register('pool.bar', PhpFilesAdapter::class)->addTag('cache.pool'); $pass = new CachePoolPrunerPass(); $pass->process($container); - $expected = array( + $expected = [ 'pool.foo' => new Reference('pool.foo'), 'pool.bar' => new Reference('pool.bar'), - ); + ]; $argument = $container->getDefinition('console.command.cache_pool_prune')->getArgument(0); $this->assertInstanceOf(IteratorArgument::class, $argument); @@ -63,7 +63,7 @@ public function testCompilerPassThrowsOnInvalidDefinitionClass() { $container = new ContainerBuilder(); - $container->register('console.command.cache_pool_prune')->addArgument(array()); + $container->register('console.command.cache_pool_prune')->addArgument([]); $container->register('pool.not-found', NotFound::class)->addTag('cache.pool'); $pass = new CachePoolPrunerPass(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ConfigCachePassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ConfigCachePassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ConfigCachePassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ConfigCachePassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,18 +27,18 @@ $container = new ContainerBuilder(); $definition = $container->register('config_cache_factory')->addArgument(null); - $container->register('checker_2')->addTag('config_cache.resource_checker', array('priority' => 100)); - $container->register('checker_1')->addTag('config_cache.resource_checker', array('priority' => 200)); + $container->register('checker_2')->addTag('config_cache.resource_checker', ['priority' => 100]); + $container->register('checker_1')->addTag('config_cache.resource_checker', ['priority' => 200]); $container->register('checker_3')->addTag('config_cache.resource_checker'); $pass = new ConfigCachePass(); $pass->process($container); - $expected = new IteratorArgument(array( + $expected = new IteratorArgument([ new Reference('checker_1'), new Reference('checker_2'), new Reference('checker_3'), - )); + ]); $this->assertEquals($expected, $definition->getArgument(0)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ControllerArgumentValueResolverPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ControllerArgumentValueResolverPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ControllerArgumentValueResolverPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ControllerArgumentValueResolverPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,19 +25,19 @@ { public function testServicesAreOrderedAccordingToPriority() { - $services = array( - 'n3' => array(array()), - 'n1' => array(array('priority' => 200)), - 'n2' => array(array('priority' => 100)), - ); + $services = [ + 'n3' => [[]], + 'n1' => [['priority' => 200]], + 'n2' => [['priority' => 100]], + ]; - $expected = array( + $expected = [ new Reference('n1'), new Reference('n2'), new Reference('n3'), - ); + ]; - $definition = new Definition(ArgumentResolver::class, array(null, array())); + $definition = new Definition(ArgumentResolver::class, [null, []]); $container = new ContainerBuilder(); $container->setDefinition('argument_resolver', $definition); @@ -51,12 +51,12 @@ public function testReturningEmptyArrayWhenNoService() { - $definition = new Definition(ArgumentResolver::class, array(null, array())); + $definition = new Definition(ArgumentResolver::class, [null, []]); $container = new ContainerBuilder(); $container->setDefinition('argument_resolver', $definition); (new ControllerArgumentValueResolverPass())->process($container); - $this->assertEquals(array(), $definition->getArgument(1)->getValues()); + $this->assertEquals([], $definition->getArgument(1)->getValues()); } public function testNoArgumentResolver() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/DataCollectorTranslatorPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,11 +33,11 @@ $this->container->register('translator.data_collector', 'Symfony\Component\Translation\DataCollectorTranslator') ->setPublic(false) ->setDecoratedService('translator') - ->setArguments(array(new Reference('translator.data_collector.inner'))) + ->setArguments([new Reference('translator.data_collector.inner')]) ; $this->container->register('data_collector.translation', 'Symfony\Component\Translation\DataCollector\TranslationDataCollector') - ->setArguments(array(new Reference('translator.data_collector'))) + ->setArguments([new Reference('translator.data_collector')]) ; } @@ -67,10 +67,10 @@ public function getImplementingTranslatorBagInterfaceTranslatorClassNames() { - return array( - array('Symfony\Component\Translation\Translator'), - array('%translator_implementing_bag%'), - ); + return [ + ['Symfony\Component\Translation\Translator'], + ['%translator_implementing_bag%'], + ]; } /** @@ -99,20 +99,20 @@ public function getNotImplementingTranslatorBagInterfaceTranslatorClassNames() { - return array( - array('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\TranslatorWithTranslatorBag'), - array('%translator_not_implementing_bag%'), - ); + return [ + ['Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\TranslatorWithTranslatorBag'], + ['%translator_not_implementing_bag%'], + ]; } } class TranslatorWithTranslatorBag implements TranslatorInterface { - public function trans($id, array $parameters = array(), $domain = null, $locale = null) + public function trans($id, array $parameters = [], $domain = null, $locale = null) { } - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) { } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,12 +42,12 @@ $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension'); $extDefinition->setPublic(true); - $extDefinition->setArguments(array( + $extDefinition->setArguments([ new Reference('service_container'), - array(), - array(), - array(), - )); + [], + [], + [], + ]); $container->setDefinition('form.extension', $extDefinition); $container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type')->setPublic(true); @@ -57,10 +57,10 @@ $extDefinition = $container->getDefinition('form.extension'); - $this->assertEquals(array( + $this->assertEquals([ __CLASS__.'_Type1' => 'my.type1', __CLASS__.'_Type2' => 'my.type2', - ), $extDefinition->getArgument(1)); + ], $extDefinition->getArgument(1)); } /** @@ -71,12 +71,12 @@ $container = new ContainerBuilder(); $container->addCompilerPass(new FormPass()); - $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension', array( + $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension', [ new Reference('service_container'), - array(), - array(), - array(), - )); + [], + [], + [], + ]); $extDefinition->setPublic(true); $container->setDefinition('form.extension', $extDefinition); @@ -96,33 +96,33 @@ */ public function addTaggedTypeExtensionsDataProvider() { - return array( - array( - array( - 'my.type_extension1' => array('extended_type' => 'type1'), - 'my.type_extension2' => array('extended_type' => 'type1'), - 'my.type_extension3' => array('extended_type' => 'type2'), - ), - array( - 'type1' => array('my.type_extension1', 'my.type_extension2'), - 'type2' => array('my.type_extension3'), - ), - ), - array( - array( - 'my.type_extension1' => array('extended_type' => 'type1', 'priority' => 1), - 'my.type_extension2' => array('extended_type' => 'type1', 'priority' => 2), - 'my.type_extension3' => array('extended_type' => 'type1', 'priority' => -1), - 'my.type_extension4' => array('extended_type' => 'type2', 'priority' => 2), - 'my.type_extension5' => array('extended_type' => 'type2', 'priority' => 1), - 'my.type_extension6' => array('extended_type' => 'type2', 'priority' => 1), - ), - array( - 'type1' => array('my.type_extension2', 'my.type_extension1', 'my.type_extension3'), - 'type2' => array('my.type_extension4', 'my.type_extension5', 'my.type_extension6'), - ), - ), - ); + return [ + [ + [ + 'my.type_extension1' => ['extended_type' => 'type1'], + 'my.type_extension2' => ['extended_type' => 'type1'], + 'my.type_extension3' => ['extended_type' => 'type2'], + ], + [ + 'type1' => ['my.type_extension1', 'my.type_extension2'], + 'type2' => ['my.type_extension3'], + ], + ], + [ + [ + 'my.type_extension1' => ['extended_type' => 'type1', 'priority' => 1], + 'my.type_extension2' => ['extended_type' => 'type1', 'priority' => 2], + 'my.type_extension3' => ['extended_type' => 'type1', 'priority' => -1], + 'my.type_extension4' => ['extended_type' => 'type2', 'priority' => 2], + 'my.type_extension5' => ['extended_type' => 'type2', 'priority' => 1], + 'my.type_extension6' => ['extended_type' => 'type2', 'priority' => 1], + ], + [ + 'type1' => ['my.type_extension2', 'my.type_extension1', 'my.type_extension3'], + 'type2' => ['my.type_extension4', 'my.type_extension5', 'my.type_extension6'], + ], + ], + ]; } /** @@ -134,12 +134,12 @@ $container = new ContainerBuilder(); $container->addCompilerPass(new FormPass()); - $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension', array( + $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension', [ new Reference('service_container'), - array(), - array(), - array(), - )); + [], + [], + [], + ]); $extDefinition->setPublic(true); $container->setDefinition('form.extension', $extDefinition); @@ -156,12 +156,12 @@ $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension'); $extDefinition->setPublic(true); - $extDefinition->setArguments(array( + $extDefinition->setArguments([ new Reference('service_container'), - array(), - array(), - array(), - )); + [], + [], + [], + ]); $definition1 = new Definition('stdClass'); $definition1->addTag('form.type_guesser'); @@ -176,10 +176,10 @@ $extDefinition = $container->getDefinition('form.extension'); - $this->assertSame(array( + $this->assertSame([ 'my.guesser1', 'my.guesser2', - ), $extDefinition->getArgument(3)); + ], $extDefinition->getArgument(3)); } /** @@ -191,15 +191,15 @@ $container->addCompilerPass(new FormPass()); $extDefinition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension'); - $extDefinition->setArguments(array( + $extDefinition->setArguments([ new Reference('service_container'), - array(), - array(), - array(), - )); + [], + [], + [], + ]); $container->setDefinition('form.extension', $extDefinition); - $container->register($id, 'stdClass')->setPublic(false)->addTag($tagName, array('extended_type' => 'Foo')); + $container->register($id, 'stdClass')->setPublic(false)->addTag($tagName, ['extended_type' => 'Foo']); $container->compile(); $this->assertTrue($container->getDefinition($id)->isPublic()); @@ -207,11 +207,11 @@ public function privateTaggedServicesProvider() { - return array( - array('my.type', 'form.type'), - array('my.type_extension', 'form.type_extension'), - array('my.guesser', 'form.type_guesser'), - ); + return [ + ['my.type', 'form.type'], + ['my.type_extension', 'form.type_extension'], + ['my.guesser', 'form.type_guesser'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,17 +30,17 @@ $container->setAlias('translator', 'translator.default'); $translationWarmerDefinition = $container->register('translation.warmer') ->addArgument(new Reference('translator')) - ->addTag('container.service_subscriber', array('id' => 'translator')) - ->addTag('container.service_subscriber', array('id' => 'foo')); + ->addTag('container.service_subscriber', ['id' => 'translator']) + ->addTag('container.service_subscriber', ['id' => 'foo']); $pass = new LoggingTranslatorPass(); $pass->process($container); $this->assertEquals( - array('container.service_subscriber' => array( - array('id' => 'foo'), - array('key' => 'translator', 'id' => 'translator.logging.inner'), - )), + ['container.service_subscriber' => [ + ['id' => 'foo'], + ['key' => 'translator', 'id' => 'translator.logging.inner'], + ]], $translationWarmerDefinition->getTags() ); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ $builder = new ContainerBuilder(); $builder->register('profiler', 'ProfilerClass'); $builder->register('my_collector_service') - ->addTag('data_collector', array('template' => 'foo')); + ->addTag('data_collector', ['template' => 'foo']); $profilerPass = new ProfilerPass(); $profilerPass->process($builder); @@ -43,12 +43,12 @@ $container = new ContainerBuilder(); $profilerDefinition = $container->register('profiler', 'ProfilerClass'); $container->register('my_collector_service') - ->addTag('data_collector', array('template' => 'foo', 'id' => 'my_collector')); + ->addTag('data_collector', ['template' => 'foo', 'id' => 'my_collector']); $profilerPass = new ProfilerPass(); $profilerPass->process($container); - $this->assertSame(array('my_collector_service' => array('my_collector', 'foo')), $container->getParameter('data_collector.templates')); + $this->assertSame(['my_collector_service' => ['my_collector', 'foo']], $container->getParameter('data_collector.templates')); // grab the method calls off of the "profiler" definition $methodCalls = $profilerDefinition->getMethodCalls(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,44 +29,44 @@ { $container = new ContainerBuilder(); - $definition = $container->register('property_info')->setArguments(array(null, null, null, null)); - $container->register('n2')->addTag($tag, array('priority' => 100)); - $container->register('n1')->addTag($tag, array('priority' => 200)); + $definition = $container->register('property_info')->setArguments([null, null, null, null]); + $container->register('n2')->addTag($tag, ['priority' => 100]); + $container->register('n1')->addTag($tag, ['priority' => 200]); $container->register('n3')->addTag($tag); $propertyInfoPass = new PropertyInfoPass(); $propertyInfoPass->process($container); - $expected = new IteratorArgument(array( + $expected = new IteratorArgument([ new Reference('n1'), new Reference('n2'), new Reference('n3'), - )); + ]); $this->assertEquals($expected, $definition->getArgument($index)); } public function provideTags() { - return array( - array(0, 'property_info.list_extractor'), - array(1, 'property_info.type_extractor'), - array(2, 'property_info.description_extractor'), - array(3, 'property_info.access_extractor'), - ); + return [ + [0, 'property_info.list_extractor'], + [1, 'property_info.type_extractor'], + [2, 'property_info.description_extractor'], + [3, 'property_info.access_extractor'], + ]; } public function testReturningEmptyArrayWhenNoService() { $container = new ContainerBuilder(); $propertyInfoExtractorDefinition = $container->register('property_info') - ->setArguments(array(array(), array(), array(), array())); + ->setArguments([[], [], [], []]); $propertyInfoPass = new PropertyInfoPass(); $propertyInfoPass->process($container); - $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(0)); - $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(1)); - $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(2)); - $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(3)); + $this->assertEquals(new IteratorArgument([]), $propertyInfoExtractorDefinition->getArgument(0)); + $this->assertEquals(new IteratorArgument([]), $propertyInfoExtractorDefinition->getArgument(1)); + $this->assertEquals(new IteratorArgument([]), $propertyInfoExtractorDefinition->getArgument(2)); + $this->assertEquals(new IteratorArgument([]), $propertyInfoExtractorDefinition->getArgument(3)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -46,8 +46,8 @@ { $container = new ContainerBuilder(); $container->register('serializer') - ->addArgument(array()) - ->addArgument(array()); + ->addArgument([]) + ->addArgument([]); $container->register('normalizer')->addTag('serializer.normalizer'); $serializerPass = new SerializerPass(); @@ -58,19 +58,19 @@ { $container = new ContainerBuilder(); - $definition = $container->register('serializer')->setArguments(array(null, null)); - $container->register('n2')->addTag('serializer.normalizer', array('priority' => 100))->addTag('serializer.encoder', array('priority' => 100)); - $container->register('n1')->addTag('serializer.normalizer', array('priority' => 200))->addTag('serializer.encoder', array('priority' => 200)); + $definition = $container->register('serializer')->setArguments([null, null]); + $container->register('n2')->addTag('serializer.normalizer', ['priority' => 100])->addTag('serializer.encoder', ['priority' => 100]); + $container->register('n1')->addTag('serializer.normalizer', ['priority' => 200])->addTag('serializer.encoder', ['priority' => 200]); $container->register('n3')->addTag('serializer.normalizer')->addTag('serializer.encoder'); $serializerPass = new SerializerPass(); $serializerPass->process($container); - $expected = array( + $expected = [ new Reference('n1'), new Reference('n2'), new Reference('n3'), - ); + ]; $this->assertEquals($expected, $definition->getArgument(0)); $this->assertEquals($expected, $definition->getArgument(1)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,10 +26,10 @@ public function testValidCollector() { $loader = (new Definition()) - ->addTag('translation.loader', array('alias' => 'xliff', 'legacy-alias' => 'xlf')); + ->addTag('translation.loader', ['alias' => 'xliff', 'legacy-alias' => 'xlf']); $translator = (new Definition()) - ->setArguments(array(null, null, null, null)); + ->setArguments([null, null, null, null]); $container = new ContainerBuilder(); $container->setDefinition('translator.default', $translator); @@ -39,15 +39,15 @@ $pass->process($container); $expected = (new Definition()) - ->addTag('translation.loader', array('alias' => 'xliff', 'legacy-alias' => 'xlf')) - ->addMethodCall('addLoader', array('xliff', new Reference('translation.loader'))) - ->addMethodCall('addLoader', array('xlf', new Reference('translation.loader'))) + ->addTag('translation.loader', ['alias' => 'xliff', 'legacy-alias' => 'xlf']) + ->addMethodCall('addLoader', ['xliff', new Reference('translation.loader')]) + ->addMethodCall('addLoader', ['xlf', new Reference('translation.loader')]) ; $this->assertEquals($expected, $loader); - $this->assertSame(array('translation.loader' => array('xliff', 'xlf')), $translator->getArgument(3)); + $this->assertSame(['translation.loader' => ['xliff', 'xlf']], $translator->getArgument(3)); - $expected = array('translation.loader' => new ServiceClosureArgument(new Reference('translation.loader'))); + $expected = ['translation.loader' => new ServiceClosureArgument(new Reference('translation.loader'))]; $this->assertEquals($expected, $container->getDefinition((string) $translator->getArgument(0))->getArgument(0)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,6 +29,6 @@ $pass->process($container); - $this->assertSame(array(sprintf('%s: Tag "kenrel.event_subscriber" was defined on service(s) "foo", "bar", but was never used. Did you mean "kernel.event_subscriber"?', UnusedTagsPass::class)), $container->getCompiler()->getLog()); + $this->assertSame([sprintf('%s: Tag "kenrel.event_subscriber" was defined on service(s) "foo", "bar", but was never used. Did you mean "kernel.event_subscriber"?', UnusedTagsPass::class)], $container->getCompiler()->getLog()); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,25 +23,25 @@ public function testDefaultConfig() { $processor = new Processor(); - $config = $processor->processConfiguration(new Configuration(true), array(array('secret' => 's3cr3t'))); + $config = $processor->processConfiguration(new Configuration(true), [['secret' => 's3cr3t']]); $this->assertEquals( - array_merge(array('secret' => 's3cr3t', 'trusted_hosts' => array()), self::getBundleDefaultConfig()), + array_merge(['secret' => 's3cr3t', 'trusted_hosts' => []], self::getBundleDefaultConfig()), $config ); } public function testDoNoDuplicateDefaultFormResources() { - $input = array('templating' => array( - 'form' => array('resources' => array('FrameworkBundle:Form')), - 'engines' => array('php'), - )); + $input = ['templating' => [ + 'form' => ['resources' => ['FrameworkBundle:Form']], + 'engines' => ['php'], + ]]; $processor = new Processor(); - $config = $processor->processConfiguration(new Configuration(true), array($input)); + $config = $processor->processConfiguration(new Configuration(true), [$input]); - $this->assertEquals(array('FrameworkBundle:Form'), $config['templating']['form']['resources']); + $this->assertEquals(['FrameworkBundle:Form'], $config['templating']['form']['resources']); } /** @@ -52,7 +52,7 @@ { $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array(array('trusted_proxies' => null))); + $processor->processConfiguration($configuration, [['trusted_proxies' => null]]); } /** @@ -63,7 +63,7 @@ { $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array(array('trusted_proxies' => array()))); + $processor->processConfiguration($configuration, [['trusted_proxies' => []]]); } /** @@ -74,7 +74,7 @@ { $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array(array('trusted_proxies' => array('127.0.0.1')))); + $processor->processConfiguration($configuration, [['trusted_proxies' => ['127.0.0.1']]]); } /** @@ -86,7 +86,7 @@ $processor = new Processor(); $config = $processor->processConfiguration( new Configuration(true), - array(array('session' => array('name' => $sessionName))) + [['session' => ['name' => $sessionName]]] ); $this->assertEquals($sessionName, $config['session']['name']); @@ -94,12 +94,12 @@ public function getTestValidSessionName() { - return array( - array(null), - array('PHPSESSID'), - array('a&b'), - array(',_-!@#$%^*(){}:<>/?'), - ); + return [ + [null], + ['PHPSESSID'], + ['a&b'], + [',_-!@#$%^*(){}:<>/?'], + ]; } /** @@ -111,20 +111,20 @@ $processor = new Processor(); $processor->processConfiguration( new Configuration(true), - array(array('session' => array('name' => $sessionName))) + [['session' => ['name' => $sessionName]]] ); } public function getTestInvalidSessionName() { - return array( - array('a.b'), - array('a['), - array('a[]'), - array('a[b]'), - array('a=b'), - array('a+b'), - ); + return [ + ['a.b'], + ['a['], + ['a[]'], + ['a[b]'], + ['a=b'], + ['a+b'], + ]; } /** @@ -135,27 +135,27 @@ { $processor = new Processor(); $configuration = new Configuration(true); - $config = $processor->processConfiguration($configuration, array(array( + $config = $processor->processConfiguration($configuration, [[ 'secret' => 's3cr3t', 'trusted_proxies' => $trustedProxies, - ))); + ]]); $this->assertEquals($processedProxies, $config['trusted_proxies']); } public function getTestValidTrustedProxiesData() { - return array( - array(array('127.0.0.1'), array('127.0.0.1')), - array(array('::1'), array('::1')), - array(array('127.0.0.1', '::1'), array('127.0.0.1', '::1')), - array(null, array()), - array(false, array()), - array(array(), array()), - array(array('10.0.0.0/8'), array('10.0.0.0/8')), - array(array('::ffff:0:0/96'), array('::ffff:0:0/96')), - array(array('0.0.0.0/0'), array('0.0.0.0/0')), - ); + return [ + [['127.0.0.1'], ['127.0.0.1']], + [['::1'], ['::1']], + [['127.0.0.1', '::1'], ['127.0.0.1', '::1']], + [null, []], + [false, []], + [[], []], + [['10.0.0.0/8'], ['10.0.0.0/8']], + [['::ffff:0:0/96'], ['::ffff:0:0/96']], + [['0.0.0.0/0'], ['0.0.0.0/0']], + ]; } /** @@ -166,12 +166,12 @@ { $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array( - array( + $processor->processConfiguration($configuration, [ + [ 'secret' => 's3cr3t', 'trusted_proxies' => 'Not an IP address', - ), - )); + ], + ]); } /** @@ -183,35 +183,64 @@ $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array( - array( + $processor->processConfiguration($configuration, [ + [ 'secret' => 's3cr3t', - 'trusted_proxies' => array('Not an IP address'), - ), - )); + 'trusted_proxies' => ['Not an IP address'], + ], + ]); } public function testAssetsCanBeEnabled() { $processor = new Processor(); $configuration = new Configuration(true); - $config = $processor->processConfiguration($configuration, array(array('assets' => null))); + $config = $processor->processConfiguration($configuration, [['assets' => null]]); - $defaultConfig = array( + $defaultConfig = [ 'enabled' => true, 'version_strategy' => null, 'version' => null, 'version_format' => '%%s?%%s', 'base_path' => '', - 'base_urls' => array(), - 'packages' => array(), + 'base_urls' => [], + 'packages' => [], 'json_manifest_path' => null, - ); + ]; $this->assertEquals($defaultConfig, $config['assets']); } /** + * @dataProvider provideValidAssetsPackageNameConfigurationTests + */ + public function testValidAssetsPackageNameConfiguration($packageName) + { + $processor = new Processor(); + $configuration = new Configuration(true); + $config = $processor->processConfiguration($configuration, [ + [ + 'assets' => [ + 'packages' => [ + $packageName => [], + ], + ], + ], + ]); + + $this->assertArrayHasKey($packageName, $config['assets']['packages']); + } + + public function provideValidAssetsPackageNameConfigurationTests() + { + return [ + ['foobar'], + ['foo-bar'], + ['foo_bar'], + ]; + } + + /** * @dataProvider provideInvalidAssetConfigurationTests */ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMessage) @@ -225,125 +254,125 @@ $processor = new Processor(); $configuration = new Configuration(true); - $processor->processConfiguration($configuration, array( - array( + $processor->processConfiguration($configuration, [ + [ 'assets' => $assetConfig, - ), - )); + ], + ]); } public function provideInvalidAssetConfigurationTests() { // helper to turn config into embedded package config $createPackageConfig = function (array $packageConfig) { - return array( + return [ 'base_urls' => '//example.com', 'version' => 1, - 'packages' => array( + 'packages' => [ 'foo' => $packageConfig, - ), - ); + ], + ]; }; - $config = array( + $config = [ 'version' => 1, 'version_strategy' => 'foo', - ); - yield array($config, 'You cannot use both "version_strategy" and "version" at the same time under "assets".'); - yield array($createPackageConfig($config), 'You cannot use both "version_strategy" and "version" at the same time under "assets" packages.'); + ]; + yield [$config, 'You cannot use both "version_strategy" and "version" at the same time under "assets".']; + yield [$createPackageConfig($config), 'You cannot use both "version_strategy" and "version" at the same time under "assets" packages.']; - $config = array( + $config = [ 'json_manifest_path' => '/foo.json', 'version_strategy' => 'foo', - ); - yield array($config, 'You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets".'); - yield array($createPackageConfig($config), 'You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets" packages.'); + ]; + yield [$config, 'You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets".']; + yield [$createPackageConfig($config), 'You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets" packages.']; - $config = array( + $config = [ 'json_manifest_path' => '/foo.json', 'version' => '1', - ); - yield array($config, 'You cannot use both "version" and "json_manifest_path" at the same time under "assets".'); - yield array($createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.'); + ]; + yield [$config, 'You cannot use both "version" and "json_manifest_path" at the same time under "assets".']; + yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.']; } protected static function getBundleDefaultConfig() { - return array( + return [ 'http_method_override' => true, - 'trusted_proxies' => array(), + 'trusted_proxies' => [], 'ide' => null, 'default_locale' => 'en', - 'csrf_protection' => array( + 'csrf_protection' => [ 'enabled' => false, - ), - 'form' => array( + ], + 'form' => [ 'enabled' => !class_exists(FullStack::class), - 'csrf_protection' => array( + 'csrf_protection' => [ 'enabled' => null, // defaults to csrf_protection.enabled 'field_name' => '_token', - ), - ), - 'esi' => array('enabled' => false), - 'ssi' => array('enabled' => false), - 'fragments' => array( + ], + ], + 'esi' => ['enabled' => false], + 'ssi' => ['enabled' => false], + 'fragments' => [ 'enabled' => false, 'path' => '/_fragment', - ), - 'profiler' => array( + ], + 'profiler' => [ 'enabled' => false, 'only_exceptions' => false, 'only_master_requests' => false, 'dsn' => 'file:%kernel.cache_dir%/profiler', 'collect' => true, - 'matcher' => array( + 'matcher' => [ 'enabled' => false, - 'ips' => array(), - ), - ), - 'translator' => array( + 'ips' => [], + ], + ], + 'translator' => [ 'enabled' => !class_exists(FullStack::class), - 'fallbacks' => array('en'), + 'fallbacks' => ['en'], 'logging' => true, 'formatter' => 'translator.formatter.default', - 'paths' => array(), + 'paths' => [], 'default_path' => '%kernel.project_dir%/translations', - ), - 'validation' => array( + ], + 'validation' => [ 'enabled' => !class_exists(FullStack::class), 'enable_annotations' => !class_exists(FullStack::class), - 'static_method' => array('loadValidatorMetadata'), + 'static_method' => ['loadValidatorMetadata'], 'translation_domain' => 'validators', 'strict_email' => false, - 'mapping' => array( - 'paths' => array(), - ), - ), - 'annotations' => array( + 'mapping' => [ + 'paths' => [], + ], + ], + 'annotations' => [ 'cache' => 'php_array', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => true, 'enabled' => true, - ), - 'serializer' => array( + ], + 'serializer' => [ 'enabled' => !class_exists(FullStack::class), 'enable_annotations' => !class_exists(FullStack::class), - 'mapping' => array('paths' => array()), - ), - 'property_access' => array( + 'mapping' => ['paths' => []], + ], + 'property_access' => [ 'magic_call' => false, 'throw_exception_on_invalid_index' => false, - ), - 'property_info' => array( + ], + 'property_info' => [ 'enabled' => !class_exists(FullStack::class), - ), - 'router' => array( + ], + 'router' => [ 'enabled' => false, 'http_port' => 80, 'https_port' => 443, 'strict_requirements' => true, - ), - 'session' => array( + ], + 'session' => [ 'enabled' => false, 'storage_id' => 'session.storage.native', 'handler_id' => 'session.handler.native_file', @@ -352,57 +381,57 @@ 'save_path' => '%kernel.cache_dir%/sessions', 'metadata_update_threshold' => '0', 'use_strict_mode' => true, - ), - 'request' => array( + ], + 'request' => [ 'enabled' => false, - 'formats' => array(), - ), - 'templating' => array( + 'formats' => [], + ], + 'templating' => [ 'enabled' => false, 'hinclude_default_template' => null, - 'form' => array( - 'resources' => array('FrameworkBundle:Form'), - ), - 'engines' => array(), - 'loaders' => array(), - ), - 'assets' => array( + 'form' => [ + 'resources' => ['FrameworkBundle:Form'], + ], + 'engines' => [], + 'loaders' => [], + ], + 'assets' => [ 'enabled' => !class_exists(FullStack::class), 'version_strategy' => null, 'version' => null, 'version_format' => '%%s?%%s', 'base_path' => '', - 'base_urls' => array(), - 'packages' => array(), + 'base_urls' => [], + 'packages' => [], 'json_manifest_path' => null, - ), - 'cache' => array( - 'pools' => array(), + ], + 'cache' => [ + 'pools' => [], 'app' => 'cache.adapter.filesystem', 'system' => 'cache.adapter.system', 'directory' => '%kernel.cache_dir%/pools', 'default_redis_provider' => 'redis://localhost', 'default_memcached_provider' => 'memcached://localhost', - ), - 'workflows' => array( + ], + 'workflows' => [ 'enabled' => false, - 'workflows' => array(), - ), - 'php_errors' => array( + 'workflows' => [], + ], + 'php_errors' => [ 'log' => true, 'throw' => true, - ), - 'web_link' => array( + ], + 'web_link' => [ 'enabled' => !class_exists(FullStack::class), - ), - 'lock' => array( + ], + 'lock' => [ 'enabled' => !class_exists(FullStack::class), - 'resources' => array( - 'default' => array( + 'resources' => [ + 'default' => [ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock', - ), - ), - ), - ); + ], + ], + ], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'assets' => array( +$container->loadFromExtension('framework', [ + 'assets' => [ 'enabled' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,32 +1,32 @@ loadFromExtension('framework', array( - 'assets' => array( +$container->loadFromExtension('framework', [ + 'assets' => [ 'version' => 'SomeVersionScheme', 'base_urls' => 'http://cdn.example.com', 'version_format' => '%%s?version=%%s', - 'packages' => array( - 'images_path' => array( + 'packages' => [ + 'images_path' => [ 'base_path' => '/foo', - ), - 'images' => array( + ], + 'images' => [ 'version' => '1.0.0', - 'base_urls' => array('http://images1.example.com', 'http://images2.example.com'), - ), - 'foo' => array( + 'base_urls' => ['http://images1.example.com', 'http://images2.example.com'], + ], + 'foo' => [ 'version' => '1.0.0', 'version_format' => '%%s-%%s', - ), - 'bar' => array( - 'base_urls' => array('https://bar2.example.com'), - ), - 'bar_version_strategy' => array( - 'base_urls' => array('https://bar2.example.com'), + ], + 'bar' => [ + 'base_urls' => ['https://bar2.example.com'], + ], + 'bar_version_strategy' => [ + 'base_urls' => ['https://bar2.example.com'], 'version_strategy' => 'assets.custom_version_strategy', - ), - 'json_manifest_strategy' => array( + ], + 'json_manifest_strategy' => [ 'json_manifest_path' => '/path/to/manifest.json', - ), - ), - ), -)); + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( - 'assets' => array( +$container->loadFromExtension('framework', [ + 'assets' => [ 'version_strategy' => 'assets.custom_version_strategy', 'base_urls' => 'http://cdn.example.com', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,8 +2,8 @@ $container->setParameter('env(REDIS_URL)', 'redis://paas.com'); -$container->loadFromExtension('framework', array( - 'cache' => array( +$container->loadFromExtension('framework', [ + 'cache' => [ 'default_redis_provider' => '%env(REDIS_URL)%', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,29 +1,29 @@ loadFromExtension('framework', array( - 'cache' => array( - 'pools' => array( - 'cache.foo' => array( +$container->loadFromExtension('framework', [ + 'cache' => [ + 'pools' => [ + 'cache.foo' => [ 'adapter' => 'cache.adapter.apcu', 'default_lifetime' => 30, - ), - 'cache.bar' => array( + ], + 'cache.bar' => [ 'adapter' => 'cache.adapter.doctrine', 'default_lifetime' => 5, 'provider' => 'app.doctrine_cache_provider', - ), - 'cache.baz' => array( + ], + 'cache.baz' => [ 'adapter' => 'cache.adapter.filesystem', 'default_lifetime' => 7, - ), - 'cache.foobar' => array( + ], + 'cache.foobar' => [ 'adapter' => 'cache.adapter.psr6', 'default_lifetime' => 10, 'provider' => 'app.cache_pool', - ), - 'cache.def' => array( + ], + 'cache.def' => [ 'default_lifetime' => 11, - ), - ), - ), -)); + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'csrf_protection' => array( +$container->loadFromExtension('framework', [ + 'csrf_protection' => [ 'enabled' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,9 +1,9 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'csrf_protection' => true, 'form' => true, - 'session' => array( + 'session' => [ 'handler_id' => null, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/default_config.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/default_config.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/default_config.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/default_config.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,3 +1,3 @@ loadFromExtension('framework', array()); +$container->loadFromExtension('framework', []); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,13 +1,13 @@ loadFromExtension('framework', array( - 'fragments' => array( +$container->loadFromExtension('framework', [ + 'fragments' => [ 'enabled' => false, - ), - 'esi' => array( + ], + 'esi' => [ 'enabled' => true, - ), - 'ssi' => array( + ], + 'ssi' => [ 'enabled' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'esi' => array( +$container->loadFromExtension('framework', [ + 'esi' => [ 'enabled' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,9 +1,9 @@ loadFromExtension('framework', array( - 'form' => array( - 'csrf_protection' => array( +$container->loadFromExtension('framework', [ + 'form' => [ + 'csrf_protection' => [ 'enabled' => false, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,30 +1,30 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'secret' => 's3cr3t', 'default_locale' => 'fr', 'csrf_protection' => true, - 'form' => array( - 'csrf_protection' => array( + 'form' => [ + 'csrf_protection' => [ 'field_name' => '_csrf', - ), - ), + ], + ], 'http_method_override' => false, - 'esi' => array( + 'esi' => [ 'enabled' => true, - ), - 'ssi' => array( + ], + 'ssi' => [ 'enabled' => true, - ), - 'profiler' => array( + ], + 'profiler' => [ 'only_exceptions' => true, 'enabled' => false, - ), - 'router' => array( + ], + 'router' => [ 'resource' => '%kernel.project_dir%/config/routing.xml', 'type' => 'xml', - ), - 'session' => array( + ], + 'session' => [ 'storage_id' => 'session.storage.native', 'handler_id' => 'session.handler.native_file', 'name' => '_SYMFONY', @@ -38,47 +38,47 @@ 'gc_divisor' => 108, 'gc_probability' => 1, 'save_path' => '/path/to/sessions', - ), - 'templating' => array( + ], + 'templating' => [ 'cache' => '/path/to/cache', - 'engines' => array('php', 'twig'), - 'loader' => array('loader.foo', 'loader.bar'), - 'form' => array( - 'resources' => array('theme1', 'theme2'), - ), + 'engines' => ['php', 'twig'], + 'loader' => ['loader.foo', 'loader.bar'], + 'form' => [ + 'resources' => ['theme1', 'theme2'], + ], 'hinclude_default_template' => 'global_hinclude_template', - ), - 'assets' => array( + ], + 'assets' => [ 'version' => 'v1', - ), - 'translator' => array( + ], + 'translator' => [ 'enabled' => true, 'fallback' => 'fr', - 'paths' => array('%kernel.project_dir%/Fixtures/translations'), - ), - 'validation' => array( + 'paths' => ['%kernel.project_dir%/Fixtures/translations'], + ], + 'validation' => [ 'enabled' => true, - ), - 'annotations' => array( + ], + 'annotations' => [ 'cache' => 'file', 'debug' => true, 'file_cache_dir' => '%kernel.cache_dir%/annotations', - ), - 'serializer' => array( + ], + 'serializer' => [ 'enabled' => true, 'enable_annotations' => true, 'name_converter' => 'serializer.name_converter.camel_case_to_snake_case', 'circular_reference_handler' => 'my.circular.reference.handler', - ), + ], 'property_info' => true, 'ide' => 'file%%link%%format', - 'request' => array( - 'formats' => array( - 'csv' => array( + 'request' => [ + 'formats' => [ + 'csv' => [ 'text/csv', 'text/plain', - ), + ], 'pdf' => 'application/pdf', - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( - 'php_errors' => array( +$container->loadFromExtension('framework', [ + 'php_errors' => [ 'log' => false, 'throw' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( - 'php_errors' => array( +$container->loadFromExtension('framework', [ + 'php_errors' => [ 'log' => true, 'throw' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/profiler.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'profiler' => array( +$container->loadFromExtension('framework', [ + 'profiler' => [ 'enabled' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_accessor.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_accessor.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_accessor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_accessor.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( - 'property_access' => array( +$container->loadFromExtension('framework', [ + 'property_access' => [ 'magic_call' => true, 'throw_exception_on_invalid_index' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_info.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_info.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_info.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/property_info.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'property_info' => array( +$container->loadFromExtension('framework', [ + 'property_info' => [ 'enabled' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/request.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/request.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/request.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/request.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'request' => array( - 'formats' => array(), - ), -)); +$container->loadFromExtension('framework', [ + 'request' => [ + 'formats' => [], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'serializer' => array( +$container->loadFromExtension('framework', [ + 'serializer' => [ 'enabled' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'serializer' => array( +$container->loadFromExtension('framework', [ + 'serializer' => [ 'enabled' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_legacy_cache.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_legacy_cache.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_legacy_cache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_legacy_cache.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( - 'serializer' => array( +$container->loadFromExtension('framework', [ + 'serializer' => [ 'enabled' => true, 'cache' => 'foo', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,15 +1,15 @@ loadFromExtension('framework', array( - 'annotations' => array('enabled' => true), - 'serializer' => array( +$container->loadFromExtension('framework', [ + 'annotations' => ['enabled' => true], + 'serializer' => [ 'enable_annotations' => true, - 'mapping' => array( - 'paths' => array( + 'mapping' => [ + 'paths' => [ '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/files', '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/serialization.yml', '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/serialization.yaml', - ), - ), - ), -)); + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/session.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/session.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/session.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/session.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'session' => array( +$container->loadFromExtension('framework', [ + 'session' => [ 'handler_id' => null, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'ssi' => array( +$container->loadFromExtension('framework', [ + 'ssi' => [ 'enabled' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,5 +1,5 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'templating' => false, -)); +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_no_assets.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_no_assets.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_no_assets.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_no_assets.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'templating' => array( - 'engines' => array('php', 'twig'), - ), -)); +$container->loadFromExtension('framework', [ + 'templating' => [ + 'engines' => ['php', 'twig'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_assets_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_assets_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_assets_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_assets_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'assets' => false, - 'templating' => array( - 'engines' => array('php'), - ), -)); + 'templating' => [ + 'engines' => ['php'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_disabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_disabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_disabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_disabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'translator' => false, - 'templating' => array( - 'engines' => array('php'), - ), -)); + 'templating' => [ + 'engines' => ['php'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_enabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_enabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_enabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_php_translator_enabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,8 +1,8 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'translator' => true, - 'templating' => array( - 'engines' => array('php'), - ), -)); + 'templating' => [ + 'engines' => ['php'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'translator' => array( - 'fallbacks' => array('en', 'fr'), - ), -)); +$container->loadFromExtension('framework', [ + 'translator' => [ + 'fallbacks' => ['en', 'fr'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_annotations.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,9 +1,9 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'secret' => 's3cr3t', - 'validation' => array( + 'validation' => [ 'enabled' => true, 'enable_annotations' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_mapping.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_mapping.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_mapping.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_mapping.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,13 +1,13 @@ loadFromExtension('framework', array( - 'validation' => array( - 'mapping' => array( - 'paths' => array( +$container->loadFromExtension('framework', [ + 'validation' => [ + 'mapping' => [ + 'paths' => [ '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files', '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yml', '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yaml', - ), - ), - ), -)); + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,9 +1,9 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'secret' => 's3cr3t', - 'validation' => array( + 'validation' => [ 'enabled' => true, - 'static_method' => array('loadFoo', 'loadBar'), - ), -)); + 'static_method' => ['loadFoo', 'loadBar'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,9 +1,9 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'secret' => 's3cr3t', - 'validation' => array( + 'validation' => [ 'enabled' => true, 'static_method' => false, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_strict_email.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_strict_email.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_strict_email.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_strict_email.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'validation' => array( +$container->loadFromExtension('framework', [ + 'validation' => [ 'strict_email' => true, - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('framework', array( - 'validation' => array( +$container->loadFromExtension('framework', [ + 'validation' => [ 'translation_domain' => 'messages', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/web_link.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/web_link.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/web_link.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/web_link.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,5 +1,5 @@ loadFromExtension('framework', array( - 'web_link' => array('enabled' => true), -)); +$container->loadFromExtension('framework', [ + 'web_link' => ['enabled' => true], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,5 +1,5 @@ loadFromExtension('framework', array( +$container->loadFromExtension('framework', [ 'workflows' => null, -)); +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,19 +1,19 @@ loadFromExtension('framework', array( - 'workflows' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ 'enabled' => true, - 'workflows' => array( + 'workflows' => [ 'type' => 'workflow', - 'supports' => array('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'), + 'supports' => ['Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'], 'initial_place' => 'bar', - 'places' => array('bar', 'baz'), - 'transitions' => array( - 'bar_baz' => array( - 'from' => array('foo'), - 'to' => array('bar'), - ), - ), - ), - ), -)); + 'places' => ['bar', 'baz'], + 'transitions' => [ + 'bar_baz' => [ + 'from' => ['foo'], + 'to' => ['bar'], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,19 +1,19 @@ loadFromExtension('framework', array( - 'workflows' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ 'enabled' => true, - 'foo' => array( + 'foo' => [ 'type' => 'workflow', - 'supports' => array('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'), + 'supports' => ['Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest'], 'initial_place' => 'bar', - 'places' => array('bar', 'baz'), - 'transitions' => array( - 'bar_baz' => array( - 'from' => array('foo'), - 'to' => array('bar'), - ), - ), - ), - ), -)); + 'places' => ['bar', 'baz'], + 'transitions' => [ + 'bar_baz' => [ + 'from' => ['foo'], + 'to' => ['bar'], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,110 +2,110 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'article' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'article' => [ 'type' => 'workflow', - 'marking_store' => array( + 'marking_store' => [ 'type' => 'multiple_state', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), + ], 'initial_place' => 'draft', - 'places' => array( + 'places' => [ 'draft', 'wait_for_journalist', 'approved_by_journalist', 'wait_for_spellchecker', 'approved_by_spellchecker', 'published', - ), - 'transitions' => array( - 'request_review' => array( + ], + 'transitions' => [ + 'request_review' => [ 'from' => 'draft', - 'to' => array('wait_for_journalist', 'wait_for_spellchecker'), - ), - 'journalist_approval' => array( + 'to' => ['wait_for_journalist', 'wait_for_spellchecker'], + ], + 'journalist_approval' => [ 'from' => 'wait_for_journalist', 'to' => 'approved_by_journalist', - ), - 'spellchecker_approval' => array( + ], + 'spellchecker_approval' => [ 'from' => 'wait_for_spellchecker', 'to' => 'approved_by_spellchecker', - ), - 'publish' => array( - 'from' => array('approved_by_journalist', 'approved_by_spellchecker'), + ], + 'publish' => [ + 'from' => ['approved_by_journalist', 'approved_by_spellchecker'], 'to' => 'published', - ), - ), - ), - 'pull_request' => array( + ], + ], + ], + 'pull_request' => [ 'type' => 'state_machine', - 'marking_store' => array( + 'marking_store' => [ 'type' => 'single_state', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), + ], 'initial_place' => 'start', - 'places' => array( + 'places' => [ 'start', 'coding', 'travis', 'review', 'merged', 'closed', - ), - 'transitions' => array( - 'submit' => array( + ], + 'transitions' => [ + 'submit' => [ 'from' => 'start', 'to' => 'travis', - ), - 'update' => array( - 'from' => array('coding', 'travis', 'review'), + ], + 'update' => [ + 'from' => ['coding', 'travis', 'review'], 'to' => 'travis', - ), - 'wait_for_review' => array( + ], + 'wait_for_review' => [ 'from' => 'travis', 'to' => 'review', - ), - 'request_change' => array( + ], + 'request_change' => [ 'from' => 'review', 'to' => 'coding', - ), - 'accept' => array( + ], + 'accept' => [ 'from' => 'review', 'to' => 'merged', - ), - 'reject' => array( + ], + 'reject' => [ 'from' => 'review', 'to' => 'closed', - ), - 'reopen' => array( + ], + 'reopen' => [ 'from' => 'closed', 'to' => 'review', - ), - ), - ), - 'service_marking_store_workflow' => array( + ], + ], + ], + 'service_marking_store_workflow' => [ 'type' => 'workflow', - 'marking_store' => array( + 'marking_store' => [ 'service' => 'workflow_service', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), - 'places' => array( + ], + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( + ], + 'transitions' => [ + 'go' => [ 'from' => 'first', 'to' => 'last', - ), - ), - ), - ), -)); + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_without_type.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_without_type.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_without_type.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows_without_type.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,25 +2,25 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'missing_type' => array( - 'marking_store' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'missing_type' => [ + 'marking_store' => [ 'service' => 'workflow_service', - ), - 'supports' => array( + ], + 'supports' => [ \stdClass::class, - ), - 'places' => array( + ], + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( + ], + 'transitions' => [ + 'go' => [ 'from' => 'first', 'to' => 'last', - ), - ), - ), - ), -)); + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_arguments_and_service.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_arguments_and_service.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_arguments_and_service.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_arguments_and_service.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,30 +2,30 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'my_workflow' => array( - 'marking_store' => array( - 'arguments' => array('a', 'b'), +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'my_workflow' => [ + 'marking_store' => [ + 'arguments' => ['a', 'b'], 'service' => 'workflow_service', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), - 'places' => array( + ], + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( - 'from' => array( + ], + 'transitions' => [ + 'go' => [ + 'from' => [ 'first', - ), - 'to' => array( + ], + 'to' => [ 'last', - ), - ), - ), - ), - ), -)); + ], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,50 +2,50 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'article' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'article' => [ 'type' => 'workflow', - 'marking_store' => array( + 'marking_store' => [ 'type' => 'multiple_state', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), + ], 'initial_place' => 'draft', - 'places' => array( + 'places' => [ 'draft', 'wait_for_journalist', 'approved_by_journalist', 'wait_for_spellchecker', 'approved_by_spellchecker', 'published', - ), - 'transitions' => array( - 'request_review' => array( + ], + 'transitions' => [ + 'request_review' => [ 'from' => 'draft', - 'to' => array('wait_for_journalist', 'wait_for_spellchecker'), - ), - 'journalist_approval' => array( + 'to' => ['wait_for_journalist', 'wait_for_spellchecker'], + ], + 'journalist_approval' => [ 'from' => 'wait_for_journalist', 'to' => 'approved_by_journalist', - ), - 'spellchecker_approval' => array( + ], + 'spellchecker_approval' => [ 'from' => 'wait_for_spellchecker', 'to' => 'approved_by_spellchecker', - ), - 'publish' => array( - 'from' => array('approved_by_journalist', 'approved_by_spellchecker'), + ], + 'publish' => [ + 'from' => ['approved_by_journalist', 'approved_by_spellchecker'], 'to' => 'published', 'guard' => '!!true', - ), - 'publish_editor_in_chief' => array( + ], + 'publish_editor_in_chief' => [ 'name' => 'publish', 'from' => 'draft', 'to' => 'published', 'guard' => '!!false', - ), - ), - ), - ), -)); + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,48 +2,48 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'article' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'article' => [ 'type' => 'workflow', - 'marking_store' => array( + 'marking_store' => [ 'type' => 'multiple_state', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), + ], 'initial_place' => 'draft', - 'places' => array( + 'places' => [ 'draft', 'wait_for_journalist', 'approved_by_journalist', 'wait_for_spellchecker', 'approved_by_spellchecker', 'published', - ), - 'transitions' => array( - 'request_review' => array( + ], + 'transitions' => [ + 'request_review' => [ 'from' => 'draft', - 'to' => array('wait_for_journalist', 'wait_for_spellchecker'), - ), - 'journalist_approval' => array( + 'to' => ['wait_for_journalist', 'wait_for_spellchecker'], + ], + 'journalist_approval' => [ 'from' => 'wait_for_journalist', 'to' => 'approved_by_journalist', - ), - 'spellchecker_approval' => array( + ], + 'spellchecker_approval' => [ 'from' => 'wait_for_spellchecker', 'to' => 'approved_by_spellchecker', - ), - 'publish' => array( - 'from' => array('approved_by_journalist', 'approved_by_spellchecker'), + ], + 'publish' => [ + 'from' => ['approved_by_journalist', 'approved_by_spellchecker'], 'to' => 'published', - ), - 'publish_editor_in_chief' => array( + ], + 'publish_editor_in_chief' => [ 'name' => 'publish', 'from' => 'draft', 'to' => 'published', - ), - ), - ), - ), -)); + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,26 +2,26 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'my_workflow' => array( - 'marking_store' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'my_workflow' => [ + 'marking_store' => [ 'type' => 'multiple_state', - ), - 'places' => array( + ], + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( - 'from' => array( + ], + 'transitions' => [ + 'go' => [ + 'from' => [ 'first', - ), - 'to' => array( + ], + 'to' => [ 'last', - ), - ), - ), - ), - ), -)); + ], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,30 +2,30 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'my_workflow' => array( - 'marking_store' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'my_workflow' => [ + 'marking_store' => [ 'type' => 'multiple_state', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), + ], 'support_strategy' => 'foobar', - 'places' => array( + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( - 'from' => array( + ], + 'transitions' => [ + 'go' => [ + 'from' => [ 'first', - ), - 'to' => array( + ], + 'to' => [ 'last', - ), - ), - ), - ), - ), -)); + ], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_type_and_service.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_type_and_service.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_type_and_service.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_type_and_service.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,30 +2,30 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; -$container->loadFromExtension('framework', array( - 'workflows' => array( - 'my_workflow' => array( - 'marking_store' => array( +$container->loadFromExtension('framework', [ + 'workflows' => [ + 'my_workflow' => [ + 'marking_store' => [ 'type' => 'multiple_state', 'service' => 'workflow_service', - ), - 'supports' => array( + ], + 'supports' => [ FrameworkExtensionTest::class, - ), - 'places' => array( + ], + 'places' => [ 'first', 'last', - ), - 'transitions' => array( - 'go' => array( - 'from' => array( + ], + 'transitions' => [ + 'go' => [ + 'from' => [ 'first', - ), - 'to' => array( + ], + 'to' => [ 'last', - ), - ), - ), - ), - ), -)); + ], + ], + ], + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -48,7 +48,7 @@ abstract class FrameworkExtensionTest extends TestCase { - private static $containerCache = array(); + private static $containerCache = []; abstract protected function loadFromFile(ContainerBuilder $container, $file); @@ -90,13 +90,13 @@ } $cache = $container->getDefinition('cache.property_access'); - $this->assertSame(array(PropertyAccessor::class, 'createCache'), $cache->getFactory(), 'PropertyAccessor::createCache() should be used in non-debug mode'); + $this->assertSame([PropertyAccessor::class, 'createCache'], $cache->getFactory(), 'PropertyAccessor::createCache() should be used in non-debug mode'); $this->assertSame(AdapterInterface::class, $cache->getClass()); } public function testPropertyAccessCacheWithDebug() { - $container = $this->createContainerFromFile('property_accessor', array('kernel.debug' => true)); + $container = $this->createContainerFromFile('property_accessor', ['kernel.debug' => true]); if (!method_exists(PropertyAccessor::class, 'createCache')) { return $this->assertFalse($container->hasDefinition('cache.property_access')); @@ -197,18 +197,18 @@ $workflowDefinition = $container->getDefinition('workflow.article.definition'); $this->assertSame( - array( + [ 'draft', 'wait_for_journalist', 'approved_by_journalist', 'wait_for_spellchecker', 'approved_by_spellchecker', 'published', - ), + ], $workflowDefinition->getArgument(0), 'Places are passed to the workflow definition' ); - $this->assertSame(array('workflow.definition' => array(array('name' => 'article', 'type' => 'workflow', 'marking_store' => 'multiple_state'))), $workflowDefinition->getTags()); + $this->assertSame(['workflow.definition' => [['name' => 'article', 'type' => 'workflow', 'marking_store' => 'multiple_state']]], $workflowDefinition->getTags()); $this->assertTrue($container->hasDefinition('state_machine.pull_request'), 'State machine is registered as a service'); $this->assertTrue($container->hasDefinition('state_machine.pull_request.definition'), 'State machine definition is registered as a service'); @@ -218,18 +218,18 @@ $stateMachineDefinition = $container->getDefinition('state_machine.pull_request.definition'); $this->assertSame( - array( + [ 'start', 'coding', 'travis', 'review', 'merged', 'closed', - ), + ], $stateMachineDefinition->getArgument(0), 'Places are passed to the state machine definition' ); - $this->assertSame(array('workflow.definition' => array(array('name' => 'pull_request', 'type' => 'state_machine', 'marking_store' => 'single_state'))), $stateMachineDefinition->getTags()); + $this->assertSame(['workflow.definition' => [['name' => 'pull_request', 'type' => 'state_machine', 'marking_store' => 'single_state']]], $stateMachineDefinition->getTags()); $this->assertCount(9, $stateMachineDefinition->getArgument(1)); $this->assertSame('start', $stateMachineDefinition->getArgument(2)); @@ -303,60 +303,60 @@ $this->assertCount(5, $transitions); $this->assertSame('workflow.article.transition.0', (string) $transitions[0]); - $this->assertSame(array( + $this->assertSame([ 'request_review', - array( + [ 'draft', - ), - array( + ], + [ 'wait_for_journalist', 'wait_for_spellchecker', - ), - ), $container->getDefinition($transitions[0])->getArguments()); + ], + ], $container->getDefinition($transitions[0])->getArguments()); $this->assertSame('workflow.article.transition.1', (string) $transitions[1]); - $this->assertSame(array( + $this->assertSame([ 'journalist_approval', - array( + [ 'wait_for_journalist', - ), - array( + ], + [ 'approved_by_journalist', - ), - ), $container->getDefinition($transitions[1])->getArguments()); + ], + ], $container->getDefinition($transitions[1])->getArguments()); $this->assertSame('workflow.article.transition.2', (string) $transitions[2]); - $this->assertSame(array( + $this->assertSame([ 'spellchecker_approval', - array( + [ 'wait_for_spellchecker', - ), - array( + ], + [ 'approved_by_spellchecker', - ), - ), $container->getDefinition($transitions[2])->getArguments()); + ], + ], $container->getDefinition($transitions[2])->getArguments()); $this->assertSame('workflow.article.transition.3', (string) $transitions[3]); - $this->assertSame(array( + $this->assertSame([ 'publish', - array( + [ 'approved_by_journalist', 'approved_by_spellchecker', - ), - array( + ], + [ 'published', - ), - ), $container->getDefinition($transitions[3])->getArguments()); + ], + ], $container->getDefinition($transitions[3])->getArguments()); $this->assertSame('workflow.article.transition.4', (string) $transitions[4]); - $this->assertSame(array( + $this->assertSame([ 'publish', - array( + [ 'draft', - ), - array( + ], + [ 'published', - ), - ), $container->getDefinition($transitions[4])->getArguments()); + ], + ], $container->getDefinition($transitions[4])->getArguments()); } public function testGuardExpressions() @@ -367,12 +367,12 @@ $this->assertTrue($container->hasParameter('workflow.has_guard_listeners'), 'Workflow guard listeners parameter exists'); $this->assertTrue(true === $container->getParameter('workflow.has_guard_listeners'), 'Workflow guard listeners parameter is enabled'); $guardDefinition = $container->getDefinition('workflow.article.listener.guard'); - $this->assertSame(array( - array( + $this->assertSame([ + [ 'event' => 'workflow.article.guard.publish', 'method' => 'onTransition', - ), - ), $guardDefinition->getTag('kernel.event_listener')); + ], + ], $guardDefinition->getTag('kernel.event_listener')); $guardsConfiguration = $guardDefinition->getArgument(0); $this->assertTrue(1 === \count($guardsConfiguration), 'Workflow guard configuration contains one element per transition name'); $transitionGuardExpressions = $guardsConfiguration['workflow.article.guard.publish']; @@ -438,7 +438,7 @@ { $container = $this->createContainer(); $loader = new FrameworkExtension(); - $loader->load(array(array('router' => true)), $container); + $loader->load([['router' => true]], $container); } public function testSession() @@ -480,7 +480,7 @@ $this->assertTrue($container->hasDefinition('request.add_request_formats_listener'), '->registerRequestConfiguration() loads request.xml'); $listenerDef = $container->getDefinition('request.add_request_formats_listener'); - $this->assertEquals(array('csv' => array('text/csv', 'text/plain'), 'pdf' => array('application/pdf')), $listenerDef->getArgument(0)); + $this->assertEquals(['csv' => ['text/csv', 'text/plain'], 'pdf' => ['application/pdf']], $listenerDef->getArgument(0)); } public function testEmptyRequestFormats() @@ -505,9 +505,9 @@ $this->assertEquals('%templating.loader.cache.path%', $container->getDefinition('templating.loader.cache')->getArgument(1)); $this->assertEquals('/path/to/cache', $container->getParameter('templating.loader.cache.path')); - $this->assertEquals(array('php', 'twig'), $container->getParameter('templating.engines'), '->registerTemplatingConfiguration() sets a templating.engines parameter'); + $this->assertEquals(['php', 'twig'], $container->getParameter('templating.engines'), '->registerTemplatingConfiguration() sets a templating.engines parameter'); - $this->assertEquals(array('FrameworkBundle:Form', 'theme1', 'theme2'), $container->getParameter('templating.helper.form.resources'), '->registerTemplatingConfiguration() registers the theme and adds the base theme'); + $this->assertEquals(['FrameworkBundle:Form', 'theme1', 'theme2'], $container->getParameter('templating.helper.form.resources'), '->registerTemplatingConfiguration() registers the theme and adds the base theme'); $this->assertEquals('global_hinclude_template', $container->getParameter('fragment.renderer.hinclude.global_template'), '->registerTemplatingConfiguration() registers the global hinclude.js template'); } @@ -525,7 +525,7 @@ // default package $defaultPackage = $container->getDefinition((string) $packages->getArgument(0)); - $this->assertUrlPackage($container, $defaultPackage, array('http://cdn.example.com'), 'SomeVersionScheme', '%%s?version=%%s'); + $this->assertUrlPackage($container, $defaultPackage, ['http://cdn.example.com'], 'SomeVersionScheme', '%%s?version=%%s'); // packages $packages = $packages->getArgument(1); @@ -535,13 +535,13 @@ $this->assertPathPackage($container, $package, '/foo', 'SomeVersionScheme', '%%s?version=%%s'); $package = $container->getDefinition((string) $packages['images']); - $this->assertUrlPackage($container, $package, array('http://images1.example.com', 'http://images2.example.com'), '1.0.0', '%%s?version=%%s'); + $this->assertUrlPackage($container, $package, ['http://images1.example.com', 'http://images2.example.com'], '1.0.0', '%%s?version=%%s'); $package = $container->getDefinition((string) $packages['foo']); $this->assertPathPackage($container, $package, '', '1.0.0', '%%s-%%s'); $package = $container->getDefinition((string) $packages['bar']); - $this->assertUrlPackage($container, $package, array('https://bar2.example.com'), 'SomeVersionScheme', '%%s?version=%%s'); + $this->assertUrlPackage($container, $package, ['https://bar2.example.com'], 'SomeVersionScheme', '%%s?version=%%s'); $package = $container->getDefinition((string) $packages['bar_version_strategy']); $this->assertEquals('assets.custom_version_strategy', (string) $package->getArgument(1)); @@ -613,7 +613,7 @@ ); $calls = $container->getDefinition('translator.default')->getMethodCalls(); - $this->assertEquals(array('fr'), $calls[1][1][0]); + $this->assertEquals(['fr'], $calls[1][1][0]); } public function testTranslatorMultipleFallbacks() @@ -621,7 +621,7 @@ $container = $this->createContainerFromFile('translator_fallbacks'); $calls = $container->getDefinition('translator.default')->getMethodCalls(); - $this->assertEquals(array('en', 'fr'), $calls[1][1][0]); + $this->assertEquals(['en', 'fr'], $calls[1][1][0]); } public function testTranslatorHelperIsRegisteredWhenTranslatorIsEnabled() @@ -645,7 +645,7 @@ { $container = $this->createContainer(); $loader = new FrameworkExtension(); - $loader->load(array(array('templating' => null)), $container); + $loader->load([['templating' => null]], $container); } public function testValidation() @@ -654,10 +654,10 @@ $projectDir = $container->getParameter('kernel.project_dir'); $ref = new \ReflectionClass('Symfony\Component\Form\Form'); - $xmlMappings = array( + $xmlMappings = [ \dirname($ref->getFileName()).'/Resources/config/validation.xml', strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR), - ); + ]; $calls = $container->getDefinition('validator.builder')->getMethodCalls(); @@ -665,33 +665,33 @@ $this->assertCount($annotations ? 7 : 6, $calls); $this->assertSame('setConstraintValidatorFactory', $calls[0][0]); - $this->assertEquals(array(new Reference('validator.validator_factory')), $calls[0][1]); + $this->assertEquals([new Reference('validator.validator_factory')], $calls[0][1]); $this->assertSame('setTranslator', $calls[1][0]); - $this->assertEquals(array(new Reference('translator')), $calls[1][1]); + $this->assertEquals([new Reference('translator')], $calls[1][1]); $this->assertSame('setTranslationDomain', $calls[2][0]); - $this->assertSame(array('%validator.translation_domain%'), $calls[2][1]); + $this->assertSame(['%validator.translation_domain%'], $calls[2][1]); $this->assertSame('addXmlMappings', $calls[3][0]); - $this->assertSame(array($xmlMappings), $calls[3][1]); + $this->assertSame([$xmlMappings], $calls[3][1]); $i = 3; if ($annotations) { $this->assertSame('enableAnnotationMapping', $calls[++$i][0]); } $this->assertSame('addMethodMapping', $calls[++$i][0]); - $this->assertSame(array('loadValidatorMetadata'), $calls[$i][1]); + $this->assertSame(['loadValidatorMetadata'], $calls[$i][1]); $this->assertSame('setMetadataCache', $calls[++$i][0]); - $this->assertEquals(array(new Reference('validator.mapping.cache.symfony')), $calls[$i][1]); + $this->assertEquals([new Reference('validator.mapping.cache.symfony')], $calls[$i][1]); } public function testValidationService() { - $container = $this->createContainerFromFile('validation_annotations', array('kernel.charset' => 'UTF-8'), false); + $container = $this->createContainerFromFile('validation_annotations', ['kernel.charset' => 'UTF-8'], false); $this->assertInstanceOf('Symfony\Component\Validator\Validator\ValidatorInterface', $container->get('validator')); } public function testAnnotations() { - $container = $this->createContainerFromFile('full', array(), true, false); + $container = $this->createContainerFromFile('full', [], true, false); $container->addCompilerPass(new TestAnnotationsPass()); $container->compile(); @@ -718,11 +718,11 @@ $this->assertCount(7, $calls); $this->assertSame('enableAnnotationMapping', $calls[4][0]); - $this->assertEquals(array(new Reference('annotation_reader')), $calls[4][1]); + $this->assertEquals([new Reference('annotation_reader')], $calls[4][1]); $this->assertSame('addMethodMapping', $calls[5][0]); - $this->assertSame(array('loadValidatorMetadata'), $calls[5][1]); + $this->assertSame(['loadValidatorMetadata'], $calls[5][1]); $this->assertSame('setMetadataCache', $calls[6][0]); - $this->assertEquals(array(new Reference('validator.mapping.cache.symfony')), $calls[6][1]); + $this->assertEquals([new Reference('validator.mapping.cache.symfony')], $calls[6][1]); // no cache this time } @@ -730,10 +730,10 @@ { require_once __DIR__.'/Fixtures/TestBundle/TestBundle.php'; - $container = $this->createContainerFromFile('validation_annotations', array( - 'kernel.bundles' => array('TestBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\TestBundle'), - 'kernel.bundles_metadata' => array('TestBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/TestBundle')), - )); + $container = $this->createContainerFromFile('validation_annotations', [ + 'kernel.bundles' => ['TestBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\TestBundle'], + 'kernel.bundles_metadata' => ['TestBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/TestBundle']], + ]); $calls = $container->getDefinition('validator.builder')->getMethodCalls(); @@ -742,9 +742,9 @@ $this->assertSame('addYamlMappings', $calls[4][0]); $this->assertSame('enableAnnotationMapping', $calls[5][0]); $this->assertSame('addMethodMapping', $calls[6][0]); - $this->assertSame(array('loadValidatorMetadata'), $calls[6][1]); + $this->assertSame(['loadValidatorMetadata'], $calls[6][1]); $this->assertSame('setMetadataCache', $calls[7][0]); - $this->assertEquals(array(new Reference('validator.mapping.cache.symfony')), $calls[7][1]); + $this->assertEquals([new Reference('validator.mapping.cache.symfony')], $calls[7][1]); $xmlMappings = $calls[3][1][0]; $this->assertCount(3, $xmlMappings); @@ -766,10 +766,10 @@ { require_once __DIR__.'/Fixtures/CustomPathBundle/src/CustomPathBundle.php'; - $container = $this->createContainerFromFile('validation_annotations', array( - 'kernel.bundles' => array('CustomPathBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\CustomPathBundle'), - 'kernel.bundles_metadata' => array('TestBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/CustomPathBundle')), - )); + $container = $this->createContainerFromFile('validation_annotations', [ + 'kernel.bundles' => ['CustomPathBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\CustomPathBundle'], + 'kernel.bundles_metadata' => ['TestBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/CustomPathBundle']], + ]); $calls = $container->getDefinition('validator.builder')->getMethodCalls(); $xmlMappings = $calls[3][1][0]; @@ -804,7 +804,7 @@ $this->assertSame('enableAnnotationMapping', $calls[++$i][0]); } $this->assertSame('setMetadataCache', $calls[++$i][0]); - $this->assertEquals(array(new Reference('validator.mapping.cache.symfony')), $calls[$i][1]); + $this->assertEquals([new Reference('validator.mapping.cache.symfony')], $calls[$i][1]); // no cache, no annotations, no static methods } @@ -847,19 +847,19 @@ public function testStopwatchEnabledWithDebugModeEnabled() { - $container = $this->createContainerFromFile('default_config', array( + $container = $this->createContainerFromFile('default_config', [ 'kernel.container_class' => 'foo', 'kernel.debug' => true, - )); + ]); $this->assertTrue($container->has('debug.stopwatch')); } public function testStopwatchEnabledWithDebugModeDisabled() { - $container = $this->createContainerFromFile('default_config', array( + $container = $this->createContainerFromFile('default_config', [ 'kernel.container_class' => 'foo', - )); + ]); $this->assertTrue($container->has('debug.stopwatch')); } @@ -882,7 +882,7 @@ $this->assertNull($container->getDefinition('serializer.mapping.class_metadata_factory')->getArgument(1)); $this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.normalizer.object')->getArgument(1)); $this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3)); - $this->assertEquals(array('setCircularReferenceHandler', array(new Reference('my.circular.reference.handler'))), $container->getDefinition('serializer.normalizer.object')->getMethodCalls()[0]); + $this->assertEquals(['setCircularReferenceHandler', [new Reference('my.circular.reference.handler')]], $container->getDefinition('serializer.normalizer.object')->getMethodCalls()[0]); } public function testRegisterSerializerExtractor() @@ -894,7 +894,7 @@ $this->assertEquals('serializer.mapping.class_metadata_factory', $serializerExtractorDefinition->getArgument(0)->__toString()); $this->assertFalse($serializerExtractorDefinition->isPublic()); $tag = $serializerExtractorDefinition->getTag('property_info.list_extractor'); - $this->assertEquals(array('priority' => -999), $tag[0]); + $this->assertEquals(['priority' => -999], $tag[0]); } public function testDataUriNormalizerRegistered() @@ -968,7 +968,7 @@ public function testSerializerCacheDisabled() { - $container = $this->createContainerFromFile('serializer_enabled', array('kernel.debug' => true, 'kernel.container_class' => __CLASS__)); + $container = $this->createContainerFromFile('serializer_enabled', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); $this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); } @@ -978,7 +978,7 @@ */ public function testDeprecatedSerializerCacheOption() { - $container = $this->createContainerFromFile('serializer_legacy_cache', array('kernel.debug' => true, 'kernel.container_class' => __CLASS__)); + $container = $this->createContainerFromFile('serializer_legacy_cache', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); $this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); $this->assertTrue($container->hasDefinition('serializer.mapping.class_metadata_factory')); @@ -989,19 +989,19 @@ public function testSerializerMapping() { - $container = $this->createContainerFromFile('serializer_mapping', array('kernel.bundles_metadata' => array('TestBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'path' => __DIR__.'/Fixtures/TestBundle', 'parent' => null)))); + $container = $this->createContainerFromFile('serializer_mapping', ['kernel.bundles_metadata' => ['TestBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'path' => __DIR__.'/Fixtures/TestBundle', 'parent' => null]]]); $projectDir = $container->getParameter('kernel.project_dir'); $configDir = __DIR__.'/Fixtures/TestBundle/Resources/config'; - $expectedLoaders = array( - new Definition(AnnotationLoader::class, array(new Reference('annotation_reader'))), - new Definition(XmlFileLoader::class, array($configDir.'/serialization.xml')), - new Definition(YamlFileLoader::class, array($configDir.'/serialization.yml')), - new Definition(YamlFileLoader::class, array($projectDir.'/config/serializer/foo.yml')), - new Definition(XmlFileLoader::class, array($configDir.'/serializer_mapping/files/foo.xml')), - new Definition(YamlFileLoader::class, array($configDir.'/serializer_mapping/files/foo.yml')), - new Definition(YamlFileLoader::class, array($configDir.'/serializer_mapping/serialization.yml')), - new Definition(YamlFileLoader::class, array($configDir.'/serializer_mapping/serialization.yaml')), - ); + $expectedLoaders = [ + new Definition(AnnotationLoader::class, [new Reference('annotation_reader')]), + new Definition(XmlFileLoader::class, [$configDir.'/serialization.xml']), + new Definition(YamlFileLoader::class, [$configDir.'/serialization.yml']), + new Definition(YamlFileLoader::class, [$projectDir.'/config/serializer/foo.yml']), + new Definition(XmlFileLoader::class, [$configDir.'/serializer_mapping/files/foo.xml']), + new Definition(YamlFileLoader::class, [$configDir.'/serializer_mapping/files/foo.yml']), + new Definition(YamlFileLoader::class, [$configDir.'/serializer_mapping/serialization.yml']), + new Definition(YamlFileLoader::class, [$configDir.'/serializer_mapping/serialization.yaml']), + ]; foreach ($expectedLoaders as $definition) { if (is_file($arg = $definition->getArgument(0))) { @@ -1071,7 +1071,7 @@ public function testEventDispatcherService() { - $container = $this->createContainer(array('kernel.charset' => 'UTF-8', 'kernel.secret' => 'secret')); + $container = $this->createContainer(['kernel.charset' => 'UTF-8', 'kernel.secret' => 'secret']); $container->registerExtension(new FrameworkExtension()); $this->loadFromFile($container, 'default_config'); $container @@ -1123,20 +1123,20 @@ public function testRemovesResourceCheckerConfigCacheFactoryArgumentOnlyIfNoDebug() { - $container = $this->createContainer(array('kernel.debug' => true)); - (new FrameworkExtension())->load(array(), $container); + $container = $this->createContainer(['kernel.debug' => true]); + (new FrameworkExtension())->load([], $container); $this->assertCount(1, $container->getDefinition('config_cache_factory')->getArguments()); - $container = $this->createContainer(array('kernel.debug' => false)); - (new FrameworkExtension())->load(array(), $container); + $container = $this->createContainer(['kernel.debug' => false]); + (new FrameworkExtension())->load([], $container); $this->assertEmpty($container->getDefinition('config_cache_factory')->getArguments()); } - protected function createContainer(array $data = array()) + protected function createContainer(array $data = []) { - return new ContainerBuilder(new ParameterBag(array_merge(array( - 'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'), - 'kernel.bundles_metadata' => array('FrameworkBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle', 'path' => __DIR__.'/../..', 'parent' => null)), + return new ContainerBuilder(new ParameterBag(array_merge([ + 'kernel.bundles' => ['FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'], + 'kernel.bundles_metadata' => ['FrameworkBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle', 'path' => __DIR__.'/../..', 'parent' => null]], 'kernel.cache_dir' => __DIR__, 'kernel.project_dir' => __DIR__, 'kernel.debug' => false, @@ -1147,10 +1147,10 @@ 'container.build_hash' => 'Abc1234', 'container.build_id' => hash('crc32', 'Abc123423456789'), 'container.build_time' => 23456789, - ), $data))); + ], $data))); } - protected function createContainerFromFile($file, $data = array(), $resetCompilerPasses = true, $compile = true) + protected function createContainerFromFile($file, $data = [], $resetCompilerPasses = true, $compile = true) { $cacheKey = md5(\get_class($this).$file.serialize($data)); if ($compile && isset(self::$containerCache[$cacheKey])) { @@ -1161,11 +1161,11 @@ $this->loadFromFile($container, $file); if ($resetCompilerPasses) { - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); } - $container->getCompilerPassConfig()->setBeforeRemovingPasses(array(new AddConstraintValidatorsPass(), new TranslatorPass('translator.default', 'translation.reader'))); - $container->getCompilerPassConfig()->setAfterRemovingPasses(array(new AddAnnotationsCachedReaderPass())); + $container->getCompilerPassConfig()->setBeforeRemovingPasses([new AddConstraintValidatorsPass(), new TranslatorPass('translator.default', 'translation.reader')]); + $container->getCompilerPassConfig()->setAfterRemovingPasses([new AddAnnotationsCachedReaderPass()]); if (!$compile) { return $container; @@ -1175,15 +1175,15 @@ return self::$containerCache[$cacheKey] = $container; } - protected function createContainerFromClosure($closure, $data = array()) + protected function createContainerFromClosure($closure, $data = []) { $container = $this->createContainer($data); $container->registerExtension(new FrameworkExtension()); $loader = new ClosureLoader($container); $loader->load($closure); - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); return $container; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,12 +29,12 @@ public function testAssetsCannotHavePathAndUrl() { $this->createContainerFromClosure(function ($container) { - $container->loadFromExtension('framework', array( - 'assets' => array( + $container->loadFromExtension('framework', [ + 'assets' => [ 'base_urls' => 'http://cdn.example.com', 'base_path' => '/foo', - ), - )); + ], + ]); }); } @@ -44,16 +44,16 @@ public function testAssetPackageCannotHavePathAndUrl() { $this->createContainerFromClosure(function ($container) { - $container->loadFromExtension('framework', array( - 'assets' => array( - 'packages' => array( - 'impossible' => array( + $container->loadFromExtension('framework', [ + 'assets' => [ + 'packages' => [ + 'impossible' => [ 'base_urls' => 'http://cdn.example.com', 'base_path' => '/foo', - ), - ), - ), - )); + ], + ], + ], + ]); }); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -57,7 +57,7 @@ public function provideSkippedControllers() { - yield array('Other:format'); - yield array(function () {}); + yield ['Other:format']; + yield [function () {}]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,21 +29,21 @@ transChoice( '{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples', 10, - array('%count%' => 10) + ['%count%' => 10] ) ?> -trans('other-domain-test-no-params-short-array', array(), 'not_messages'); ?> +trans('other-domain-test-no-params-short-array', [], 'not_messages'); ?> -trans('other-domain-test-no-params-long-array', array(), 'not_messages'); ?> +trans('other-domain-test-no-params-long-array', [], 'not_messages'); ?> -trans('other-domain-test-params-short-array', array('foo' => 'bar'), 'not_messages'); ?> +trans('other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?> -trans('other-domain-test-params-long-array', array('foo' => 'bar'), 'not_messages'); ?> +trans('other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?> -transChoice('other-domain-test-trans-choice-short-array-%count%', 10, array('%count%' => 10), 'not_messages'); ?> +transChoice('other-domain-test-trans-choice-short-array-%count%', 10, ['%count%' => 10], 'not_messages'); ?> -transChoice('other-domain-test-trans-choice-long-array-%count%', 10, array('%count%' => 10), 'not_messages'); ?> +transChoice('other-domain-test-trans-choice-long-array-%count%', 10, ['%count%' => 10], 'not_messages'); ?> -trans('typecast', array('a' => (int) '123'), 'not_messages'); ?> -transChoice('msg1', 10 + 1, array(), 'not_messages'); ?> -transChoice('msg2', ceil(4.5), array(), 'not_messages'); ?> +trans('typecast', ['a' => (int) '123'], 'not_messages'); ?> +transChoice('msg1', 10 + 1, [], 'not_messages'); ?> +transChoice('msg2', ceil(4.5), [], 'not_messages'); ?> diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Author.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Author.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Author.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Author.php 2019-02-03 12:23:08.000000000 +0000 @@ -4,5 +4,5 @@ class Author { - public $gender; + public $eyeColor; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Person.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Person.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Person.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Person.php 2019-02-03 12:23:08.000000000 +0000 @@ -4,5 +4,5 @@ class Person { - public $gender; + public $eyeColor; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/author.yml symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/author.yml --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/author.yml 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/author.yml 2019-02-03 12:23:08.000000000 +0000 @@ -1,4 +1,4 @@ Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serialization\Author: attributes: - gender: + eyeColor: groups: ['group1', 'group2'] diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/person.xml symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/person.xml --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/person.xml 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/person.xml 2019-02-03 12:23:08.000000000 +0000 @@ -5,7 +5,7 @@ http://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + group1 group2 diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,5 +1,5 @@ __DIR__.'/../Fixtures/Resources/views/this.is.a.template.format.engine', -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Author.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Author.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Author.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Author.php 2019-02-03 12:23:08.000000000 +0000 @@ -4,5 +4,5 @@ class Author { - public $gender; + public $eyeColor; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Person.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Person.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Person.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Person.php 2019-02-03 12:23:08.000000000 +0000 @@ -4,5 +4,5 @@ class Person { - public $gender; + public $eyeColor; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/author.yml symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/author.yml --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/author.yml 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/author.yml 2019-02-03 12:23:08.000000000 +0000 @@ -1,4 +1,4 @@ Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Author: properties: - gender: - - Choice: { choices: [male, female, other], message: Choose a valid gender. } + eyeColor: + - Choice: { choices: [brown, green, blue], message: Choose a valid eye color. } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/person.xml symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/person.xml --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/person.xml 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Resources/person.xml 2019-02-03 12:23:08.000000000 +0000 @@ -4,14 +4,14 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AnnotatedControllerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AnnotatedControllerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AnnotatedControllerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AnnotatedControllerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testAnnotatedController($path, $expectedValue) { - $client = $this->createClient(array('test_case' => 'AnnotatedController', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'AnnotatedController', 'root_config' => 'config.yml']); $client->request('GET', '/annotated'.$path); $this->assertSame(200, $client->getResponse()->getStatusCode()); @@ -27,13 +27,13 @@ public function getRoutes() { - return array( - array('/null_request', 'Symfony\Component\HttpFoundation\Request'), - array('/null_argument', ''), - array('/null_argument_with_route_param', ''), - array('/null_argument_with_route_param/value', 'value'), - array('/argument_with_route_param_and_default', 'value'), - array('/argument_with_route_param_and_default/custom', 'custom'), - ); + return [ + ['/null_request', 'Symfony\Component\HttpFoundation\Request'], + ['/null_argument', ''], + ['/null_argument_with_route_param', ''], + ['/null_argument_with_route_param/value', 'value'], + ['/argument_with_route_param_and_default', 'value'], + ['/argument_with_route_param_and_default/custom', 'custom'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AnnotatedController/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AnnotatedController/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AnnotatedController/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AnnotatedController/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,7 +81,7 @@ public function serialize() { - return serialize(array($this->varDir, $this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug())); + return serialize([$this->varDir, $this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug()]); } public function unserialize($str) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AutowiringTypes/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AutowiringTypes/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AutowiringTypes/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AutowiringTypes/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePoolClear/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePoolClear/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePoolClear/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePoolClear/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePools/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePools/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePools/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CachePools/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDump/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDump/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDump/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDump/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ControllerServiceResolution/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ControllerServiceResolution/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ControllerServiceResolution/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ControllerServiceResolution/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Resources/views/fragment.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Resources/views/fragment.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Resources/views/fragment.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Resources/views/fragment.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,13 +1,13 @@ -get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:inlined', array( - 'options' => array( +get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:inlined', [ + 'options' => [ 'bar' => $bar, 'eleven' => 11, - ), - ))); + ], + ])); ?>--get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customformat', array('_format' => 'html'))); + echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customformat', ['_format' => 'html'])); ?>--get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customlocale', array('_locale' => 'es'))); + echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customlocale', ['_locale' => 'es'])); ?>--getRequest()->setLocale('fr'); echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:forwardlocale')); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -11,6 +11,6 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; -return array( +return [ new FrameworkBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; -return array( +return [ new FrameworkBundle(), new TestBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { public function testAnnotationReaderAutowiring() { - static::bootKernel(array('root_config' => 'no_annotations_cache.yml', 'environment' => 'no_annotations_cache')); + static::bootKernel(['root_config' => 'no_annotations_cache.yml', 'environment' => 'no_annotations_cache']); $container = static::$kernel->getContainer(); $annotationReader = $container->get('test.autowiring_types.autowired_services')->getAnnotationReader(); @@ -52,7 +52,7 @@ public function testEventDispatcherAutowiring() { - static::bootKernel(array('debug' => false)); + static::bootKernel(['debug' => false]); $container = static::$kernel->getContainer(); $autowiredServices = $container->get('test.autowiring_types.autowired_services'); @@ -63,7 +63,7 @@ $this->assertInstanceOf(EventDispatcher::class, $autowiredServices->getDispatcher(), 'The event_dispatcher service should be injected if the debug is not enabled'); } - static::bootKernel(array('debug' => true)); + static::bootKernel(['debug' => true]); $container = static::$kernel->getContainer(); $autowiredServices = $container->get('test.autowiring_types.autowired_services'); @@ -79,8 +79,8 @@ $this->assertInstanceOf(FilesystemAdapter::class, $autowiredServices->getCachePool()); } - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { - return parent::createKernel(array('test_case' => 'AutowiringTypes') + $options); + return parent::createKernel(['test_case' => 'AutowiringTypes'] + $options); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ public function indexAction(Request $request) { - return $this->container->get('templating')->renderResponse('fragment.html.php', array('bar' => new Bar())); + return $this->container->get('templating')->renderResponse('fragment.html.php', ['bar' => new Bar()]); } public function inlinedAction($options, $_format) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,12 +23,12 @@ public function indexAction($handler) { - $errorUrl = $this->generateUrl('subrequest_fragment_error', array('_locale' => 'fr', '_format' => 'json')); - $altUrl = $this->generateUrl('subrequest_fragment', array('_locale' => 'fr', '_format' => 'json')); + $errorUrl = $this->generateUrl('subrequest_fragment_error', ['_locale' => 'fr', '_format' => 'json']); + $altUrl = $this->generateUrl('subrequest_fragment', ['_locale' => 'fr', '_format' => 'json']); // simulates a failure during the rendering of a fragment... // should render fr/json - $content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl)); + $content = $handler->render($errorUrl, 'inline', ['alt' => $altUrl]); // ...to check that the FragmentListener still references the right Request // when rendering another fragment after the error occurred @@ -59,7 +59,7 @@ throw new \RuntimeException('error'); } - protected function generateUrl($name, $arguments = array()) + protected function generateUrl($name, $arguments = []) { return $this->container->get('router')->generate($name, $arguments); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestServiceResolutionController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestServiceResolutionController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestServiceResolutionController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestServiceResolutionController.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ $request = $this->container->get('request_stack')->getCurrentRequest(); $path['_forwarded'] = $request->attributes; $path['_controller'] = 'TestBundle:SubRequestServiceResolution:fragment'; - $subRequest = $request->duplicate(array(), null, $path); + $subRequest = $request->duplicate([], null, $path); return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,7 +36,7 @@ */ public function prepend(ContainerBuilder $container) { - $container->prependExtensionConfig('test', array('custom' => 'foo')); + $container->prependExtensionConfig('test', ['custom' => 'foo']); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,13 +22,13 @@ { protected function setUp() { - static::bootKernel(array('test_case' => 'CachePoolClear', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'CachePoolClear', 'root_config' => 'config.yml']); } public function testClearPrivatePool() { $tester = $this->createCommandTester(); - $tester->execute(array('pools' => array('cache.private_pool')), array('decorated' => false)); + $tester->execute(['pools' => ['cache.private_pool']], ['decorated' => false]); $this->assertSame(0, $tester->getStatusCode(), 'cache:pool:clear exits with 0 in case of success'); $this->assertContains('Clearing cache pool: cache.private_pool', $tester->getDisplay()); @@ -38,7 +38,7 @@ public function testClearPublicPool() { $tester = $this->createCommandTester(); - $tester->execute(array('pools' => array('cache.public_pool')), array('decorated' => false)); + $tester->execute(['pools' => ['cache.public_pool']], ['decorated' => false]); $this->assertSame(0, $tester->getStatusCode(), 'cache:pool:clear exits with 0 in case of success'); $this->assertContains('Clearing cache pool: cache.public_pool', $tester->getDisplay()); @@ -48,7 +48,7 @@ public function testClearPoolWithCustomClearer() { $tester = $this->createCommandTester(); - $tester->execute(array('pools' => array('cache.pool_with_clearer')), array('decorated' => false)); + $tester->execute(['pools' => ['cache.pool_with_clearer']], ['decorated' => false]); $this->assertSame(0, $tester->getStatusCode(), 'cache:pool:clear exits with 0 in case of success'); $this->assertContains('Clearing cache pool: cache.pool_with_clearer', $tester->getDisplay()); @@ -58,7 +58,7 @@ public function testCallClearer() { $tester = $this->createCommandTester(); - $tester->execute(array('pools' => array('cache.app_clearer')), array('decorated' => false)); + $tester->execute(['pools' => ['cache.app_clearer']], ['decorated' => false]); $this->assertSame(0, $tester->getStatusCode(), 'cache:pool:clear exits with 0 in case of success'); $this->assertContains('Calling cache clearer: cache.app_clearer', $tester->getDisplay()); @@ -72,7 +72,7 @@ public function testClearUnexistingPool() { $this->createCommandTester() - ->execute(array('pools' => array('unknown_pool')), array('decorated' => false)); + ->execute(['pools' => ['unknown_pool']], ['decorated' => false]); } /** @@ -86,7 +86,7 @@ $tester = new CommandTester($application->find('cache:pool:clear')); - $tester->execute(array('pools' => array())); + $tester->execute(['pools' => []]); $this->assertContains('Cache was successfully cleared', $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,7 +19,7 @@ { public function testCachePools() { - $this->doTestCachePools(array(), AdapterInterface::class); + $this->doTestCachePools([], AdapterInterface::class); } /** @@ -28,7 +28,7 @@ public function testRedisCachePools() { try { - $this->doTestCachePools(array('root_config' => 'redis_config.yml', 'environment' => 'redis_cache'), RedisAdapter::class); + $this->doTestCachePools(['root_config' => 'redis_config.yml', 'environment' => 'redis_cache'], RedisAdapter::class); } catch (\PHPUnit\Framework\Error\Warning $e) { if (0 !== strpos($e->getMessage(), 'unable to connect to')) { throw $e; @@ -53,7 +53,7 @@ public function testRedisCustomCachePools() { try { - $this->doTestCachePools(array('root_config' => 'redis_custom_config.yml', 'environment' => 'custom_redis_cache'), RedisAdapter::class); + $this->doTestCachePools(['root_config' => 'redis_custom_config.yml', 'environment' => 'custom_redis_cache'], RedisAdapter::class); } catch (\PHPUnit\Framework\Error\Warning $e) { if (0 !== strpos($e->getMessage(), 'unable to connect to')) { throw $e; @@ -96,8 +96,8 @@ $this->assertTrue($item->isHit()); } - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { - return parent::createKernel(array('test_case' => 'CachePools') + $options); + return parent::createKernel(['test_case' => 'CachePools'] + $options); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,15 +25,15 @@ protected function setUp() { - $kernel = static::createKernel(array('test_case' => 'ConfigDump', 'root_config' => 'config.yml')); + $kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']); $this->application = new Application($kernel); - $this->application->doRun(new ArrayInput(array()), new NullOutput()); + $this->application->doRun(new ArrayInput([]), new NullOutput()); } public function testDumpBundleName() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => 'TestBundle')); + $ret = $tester->execute(['name' => 'TestBundle']); $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertContains('custom: foo', $tester->getDisplay()); @@ -42,7 +42,7 @@ public function testDumpBundleOption() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => 'TestBundle', 'path' => 'custom')); + $ret = $tester->execute(['name' => 'TestBundle', 'path' => 'custom']); $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertContains('foo', $tester->getDisplay()); @@ -51,7 +51,7 @@ public function testParametersValuesAreResolved() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => 'framework')); + $ret = $tester->execute(['name' => 'framework']); $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertContains("locale: '%env(LOCALE)%'", $tester->getDisplay()); @@ -61,7 +61,7 @@ public function testDumpUndefinedBundleOption() { $tester = $this->createCommandTester(); - $tester->execute(array('name' => 'TestBundle', 'path' => 'foo')); + $tester->execute(['name' => 'TestBundle', 'path' => 'foo']); $this->assertContains('Unable to find configuration for "test.foo"', $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDumpReferenceCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDumpReferenceCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDumpReferenceCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDumpReferenceCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,15 +25,15 @@ protected function setUp() { - $kernel = static::createKernel(array('test_case' => 'ConfigDump', 'root_config' => 'config.yml')); + $kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']); $this->application = new Application($kernel); - $this->application->doRun(new ArrayInput(array()), new NullOutput()); + $this->application->doRun(new ArrayInput([]), new NullOutput()); } public function testDumpBundleName() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array('name' => 'TestBundle')); + $ret = $tester->execute(['name' => 'TestBundle']); $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertContains('test:', $tester->getDisplay()); @@ -43,10 +43,10 @@ public function testDumpAtPath() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array( + $ret = $tester->execute([ 'name' => 'test', 'path' => 'array', - )); + ]); $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertSame(<<<'EOL' @@ -63,11 +63,11 @@ public function testDumpAtPathXml() { $tester = $this->createCommandTester(); - $ret = $tester->execute(array( + $ret = $tester->execute([ 'name' => 'test', 'path' => 'array', '--format' => 'xml', - )); + ]); $this->assertSame(1, $ret); $this->assertContains('[ERROR] The "path" option is only available for the "yaml" format.', $tester->getDisplay()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ { public function testDumpContainerIfNotExists() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); $application = new Application(static::$kernel); $application->setAutoExit(false); @@ -29,37 +29,37 @@ @unlink(static::$kernel->getContainer()->getParameter('debug.container.dump')); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:container')); + $tester->run(['command' => 'debug:container']); $this->assertFileExists(static::$kernel->getContainer()->getParameter('debug.container.dump')); } public function testNoDebug() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => false)); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => false]); $application = new Application(static::$kernel); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:container')); + $tester->run(['command' => 'debug:container']); $this->assertContains('public', $tester->getDisplay()); } public function testPrivateAlias() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); $application = new Application(static::$kernel); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:container', '--show-private' => true)); + $tester->run(['command' => 'debug:container', '--show-private' => true]); $this->assertContains('public', $tester->getDisplay()); $this->assertContains('private_alias', $tester->getDisplay()); - $tester->run(array('command' => 'debug:container')); + $tester->run(['command' => 'debug:container']); $this->assertContains('public', $tester->getDisplay()); $this->assertNotContains('private_alias', $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,14 +18,14 @@ { public function testContainerCompilationInDebug() { - $client = $this->createClient(array('test_case' => 'ContainerDump', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml']); $this->assertTrue($client->getContainer()->has('serializer')); } public function testContainerCompilation() { - $client = $this->createClient(array('test_case' => 'ContainerDump', 'root_config' => 'config.yml', 'debug' => false)); + $client = $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml', 'debug' => false]); $this->assertTrue($client->getContainer()->has('serializer')); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/DebugAutowiringCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/DebugAutowiringCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/DebugAutowiringCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/DebugAutowiringCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,13 +21,13 @@ { public function testBasicFunctionality() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); $application = new Application(static::$kernel); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:autowiring')); + $tester->run(['command' => 'debug:autowiring']); $this->assertContains('Symfony\Component\HttpKernel\HttpKernelInterface', $tester->getDisplay()); $this->assertContains('alias to http_kernel', $tester->getDisplay()); @@ -35,13 +35,13 @@ public function testSearchArgument() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); $application = new Application(static::$kernel); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:autowiring', 'search' => 'kern')); + $tester->run(['command' => 'debug:autowiring', 'search' => 'kern']); $this->assertContains('Symfony\Component\HttpKernel\HttpKernelInterface', $tester->getDisplay()); $this->assertNotContains('Symfony\Component\Routing\RouterInterface', $tester->getDisplay()); @@ -49,13 +49,13 @@ public function testSearchNoResults() { - static::bootKernel(array('test_case' => 'ContainerDebug', 'root_config' => 'config.yml')); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); $application = new Application(static::$kernel); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'debug:autowiring', 'search' => 'foo_fake'), array('capture_stderr_separately' => true)); + $tester->run(['command' => 'debug:autowiring', 'search' => 'foo_fake'], ['capture_stderr_separately' => true]); $this->assertContains('No autowirable classes or interfaces found matching "foo_fake"', $tester->getErrorOutput()); $this->assertEquals(1, $tester->getStatusCode()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testFragment($insulate) { - $client = $this->createClient(array('test_case' => 'Fragment', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'Fragment', 'root_config' => 'config.yml']); if ($insulate) { $client->insulate(); } @@ -30,9 +30,9 @@ public function getConfigs() { - return array( - array(false), - array(true), - ); + return [ + [false], + [true], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testProfilerIsDisabled($insulate) { - $client = $this->createClient(array('test_case' => 'Profiler', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'Profiler', 'root_config' => 'config.yml']); if ($insulate) { $client->insulate(); } @@ -38,9 +38,9 @@ public function getConfigs() { - return array( - array(false), - array(true), - ); + return [ + [false], + [true], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/PropertyInfoTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/PropertyInfoTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/PropertyInfoTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/PropertyInfoTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -17,10 +17,10 @@ { public function testPhpDocPriority() { - static::bootKernel(array('test_case' => 'Serializer')); + static::bootKernel(['test_case' => 'Serializer']); $container = static::$kernel->getContainer(); - $this->assertEquals(array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_INT))), $container->get('test.property_info')->getTypes('Symfony\Bundle\FrameworkBundle\Tests\Functional\Dummy', 'codes')); + $this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_INT))], $container->get('test.property_info')->getTypes('Symfony\Bundle\FrameworkBundle\Tests\Functional\Dummy', 'codes')); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ { public function testDeserializeArrayOfObject() { - static::bootKernel(array('test_case' => 'Serializer')); + static::bootKernel(['test_case' => 'Serializer']); $container = static::$kernel->getContainer(); $result = $container->get('serializer')->deserialize('{"bars": [{"id": 1}, {"id": 2}]}', Foo::class, 'json'); @@ -29,7 +29,7 @@ $bar2->id = 2; $expected = new Foo(); - $expected->bars = array($bar1, $bar2); + $expected->bars = [$bar1, $bar2]; $this->assertEquals($expected, $result); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ */ public function testWelcome($config, $insulate) { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); if ($insulate) { $client->insulate(); } @@ -53,7 +53,7 @@ */ public function testFlash($config, $insulate) { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); if ($insulate) { $client->insulate(); } @@ -78,13 +78,13 @@ public function testTwoClients($config, $insulate) { // start first client - $client1 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + $client1 = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); if ($insulate) { $client1->insulate(); } // start second client - $client2 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + $client2 = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); if ($insulate) { $client2->insulate(); } @@ -131,7 +131,7 @@ */ public function testCorrectCacheControlHeadersForCacheableAction($config, $insulate) { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); if ($insulate) { $client->insulate(); } @@ -144,10 +144,10 @@ public function getConfigs() { - return array( + return [ // configfile, insulate - array('config.yml', true), - array('config.yml', false), - ); + ['config.yml', true], + ['config.yml', false], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,7 +15,7 @@ { public function testStateAfterSubRequest() { - $client = $this->createClient(array('test_case' => 'Session', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'Session', 'root_config' => 'config.yml']); $client->request('GET', 'https://localhost/subrequest/en'); $this->assertEquals('--fr/json--en/html--fr/json--http://localhost/subrequest/fragment/en', $client->getResponse()->getContent()); @@ -23,7 +23,7 @@ public function testSubRequestControllerServicesAreResolved() { - $client = $this->createClient(array('test_case' => 'ControllerServiceResolution', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'ControllerServiceResolution', 'root_config' => 'config.yml']); $client->request('GET', 'https://localhost/subrequest'); $this->assertEquals('---', $client->getResponse()->getContent()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ return 'Symfony\Bundle\FrameworkBundle\Tests\Functional\app\AppKernel'; } - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { $class = self::getKernelClass(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,9 +49,9 @@ public function registerBundles() { - return array( + return [ new FrameworkBundle(), - ); + ]; } public function getCacheDir() @@ -79,9 +79,9 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) { $c->register('logger', NullLogger::class); - $c->loadFromExtension('framework', array( + $c->loadFromExtension('framework', [ 'secret' => '$ecret', - )); + ]); $c->setParameter('halloween', 'Have a great day!'); $c->register('halloween', 'stdClass')->setPublic(true); @@ -92,9 +92,9 @@ */ public static function getSubscribedEvents() { - return array( + return [ KernelEvents::EXCEPTION => 'onKernelException', - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ $matcher = new RedirectableUrlMatcher($coll, $context = new RequestContext()); - $this->assertEquals(array( + $this->assertEquals([ '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'path' => '/foo/', 'permanent' => true, @@ -34,7 +34,7 @@ 'httpPort' => $context->getHttpPort(), 'httpsPort' => $context->getHttpsPort(), '_route' => 'foo', - ), + ], $matcher->match('/foo') ); } @@ -42,11 +42,11 @@ public function testSchemeRedirect() { $coll = new RouteCollection(); - $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https'))); + $coll->add('foo', new Route('/foo', [], [], [], '', ['https'])); $matcher = new RedirectableUrlMatcher($coll, $context = new RequestContext()); - $this->assertEquals(array( + $this->assertEquals([ '_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'path' => '/foo', 'permanent' => true, @@ -54,7 +54,7 @@ 'httpPort' => $context->getHttpPort(), 'httpsPort' => $context->getHttpsPort(), '_route' => 'foo', - ), + ], $matcher->match('/foo') ); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,12 +25,12 @@ $routes->add('foo', new Route( ' /{_locale}', - array( + [ '_locale' => '%locale%', - ), - array( + ], + [ '_locale' => 'en|es', - ), array(), '', array(), array(), '"%foo%" == "bar"' + ], [], '', [], [], '"%foo%" == "bar"' )); $sc = $this->getServiceContainer($routes); @@ -39,8 +39,8 @@ $router = new Router($sc, 'foo'); - $this->assertSame('/en', $router->generate('foo', array('_locale' => 'en'))); - $this->assertSame('/', $router->generate('foo', array('_locale' => 'es'))); + $this->assertSame('/en', $router->generate('foo', ['_locale' => 'en'])); + $this->assertSame('/', $router->generate('foo', ['_locale' => 'es'])); $this->assertSame('"bar" == "bar"', $router->getRouteCollection()->get('foo')->getCondition()); } @@ -50,15 +50,15 @@ $routes->add('foo', new Route( '/foo', - array( + [ 'foo' => 'before_%parameter.foo%', 'bar' => '%parameter.bar%_after', 'baz' => '%%escaped%%', - 'boo' => array('%parameter%', '%%escaped_parameter%%', array('%bee_parameter%', 'bee')), - 'bee' => array('bee', 'bee'), - ), - array( - ) + 'boo' => ['%parameter%', '%%escaped_parameter%%', ['%bee_parameter%', 'bee']], + 'bee' => ['bee', 'bee'], + ], + [ + ] )); $sc = $this->getServiceContainer($routes); @@ -72,13 +72,13 @@ $route = $router->getRouteCollection()->get('foo'); $this->assertEquals( - array( + [ 'foo' => 'before_foo', 'bar' => 'bar_after', 'baz' => '%escaped%', - 'boo' => array('boo', '%escaped_parameter%', array('foo_bee', 'bee')), - 'bee' => array('bee', 'bee'), - ), + 'boo' => ['boo', '%escaped_parameter%', ['foo_bee', 'bee']], + 'bee' => ['bee', 'bee'], + ], $route->getDefaults() ); } @@ -89,13 +89,13 @@ $routes->add('foo', new Route( '/foo', - array( - ), - array( + [ + ], + [ 'foo' => 'before_%parameter.foo%', 'bar' => '%parameter.bar%_after', 'baz' => '%%escaped%%', - ) + ] )); $sc = $this->getServiceContainer($routes); @@ -106,11 +106,11 @@ $route = $router->getRouteCollection()->get('foo'); $this->assertEquals( - array( + [ 'foo' => 'before_foo', 'bar' => 'bar_after', 'baz' => '%escaped%', - ), + ], $route->getRequirements() ); } @@ -207,7 +207,7 @@ public function testDefaultValuesAsNonStrings($value) { $routes = new RouteCollection(); - $routes->add('foo', new Route('foo', array('foo' => $value), array('foo' => '\d+'))); + $routes->add('foo', new Route('foo', ['foo' => $value], ['foo' => '\d+'])); $sc = $this->getServiceContainer($routes); @@ -230,12 +230,12 @@ $routeCollection = $router->getRouteCollection(); - $this->assertEquals(array(new ContainerParametersResource(array('locale' => 'en'))), $routeCollection->getResources()); + $this->assertEquals([new ContainerParametersResource(['locale' => 'en'])], $routeCollection->getResources()); } public function getNonStringValues() { - return array(array(null), array(false), array(true), array(new \stdClass()), array(array('foo', 'bar')), array(array(array()))); + return [[null], [false], [true], [new \stdClass()], [['foo', 'bar']], [[[]]]]; } /** @@ -251,7 +251,7 @@ ->will($this->returnValue($routes)) ; - $sc = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')->setMethods(array('get'))->getMock(); + $sc = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')->setMethods(['get'])->getMock(); $sc ->expects($this->once()) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,12 +19,12 @@ { public function testSupportsRetrievesEngineFromTheContainer() { - $container = $this->getContainerMock(array( + $container = $this->getContainerMock([ 'engine.first' => $this->getEngineMock('template.php', false), 'engine.second' => $this->getEngineMock('template.php', true), - )); + ]); - $delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second')); + $delegatingEngine = new DelegatingEngine($container, ['engine.first', 'engine.second']); $this->assertTrue($delegatingEngine->supports('template.php')); } @@ -33,12 +33,12 @@ { $firstEngine = $this->getEngineMock('template.php', false); $secondEngine = $this->getEngineMock('template.php', true); - $container = $this->getContainerMock(array( + $container = $this->getContainerMock([ 'engine.first' => $firstEngine, 'engine.second' => $secondEngine, - )); + ]); - $delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second')); + $delegatingEngine = new DelegatingEngine($container, ['engine.first', 'engine.second']); $this->assertSame($secondEngine, $delegatingEngine->getEngine('template.php')); } @@ -51,12 +51,12 @@ { $firstEngine = $this->getEngineMock('template.php', false); $secondEngine = $this->getEngineMock('template.php', false); - $container = $this->getContainerMock(array( + $container = $this->getContainerMock([ 'engine.first' => $firstEngine, 'engine.second' => $secondEngine, - )); + ]); - $delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second')); + $delegatingEngine = new DelegatingEngine($container, ['engine.first', 'engine.second']); $delegatingEngine->getEngine('template.php'); } @@ -66,22 +66,22 @@ $engine = $this->getFrameworkEngineMock('template.php', true); $engine->expects($this->once()) ->method('renderResponse') - ->with('template.php', array('foo' => 'bar')) + ->with('template.php', ['foo' => 'bar']) ->will($this->returnValue($response)); - $container = $this->getContainerMock(array('engine' => $engine)); + $container = $this->getContainerMock(['engine' => $engine]); - $delegatingEngine = new DelegatingEngine($container, array('engine')); + $delegatingEngine = new DelegatingEngine($container, ['engine']); - $this->assertSame($response, $delegatingEngine->renderResponse('template.php', array('foo' => 'bar'))); + $this->assertSame($response, $delegatingEngine->renderResponse('template.php', ['foo' => 'bar'])); } public function testRenderResponseWithTemplatingEngine() { $engine = $this->getEngineMock('template.php', true); - $container = $this->getContainerMock(array('engine' => $engine)); - $delegatingEngine = new DelegatingEngine($container, array('engine')); + $container = $this->getContainerMock(['engine' => $engine]); + $delegatingEngine = new DelegatingEngine($container, ['engine']); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $delegatingEngine->renderResponse('template.php', array('foo' => 'bar'))); + $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $delegatingEngine->renderResponse('template.php', ['foo' => 'bar'])); } private function getEngineMock($template, $supports) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -93,14 +93,14 @@ $std = new \stdClass(); $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); - return array( - array($user, $user), - array($std, $std), - array($token, $token), - array('Anon.', null), - array(null, null), - array(10, null), - array(true, null), - ); + return [ + [$user, $user], + [$std, $std], + [$token, $token], + ['Anon.', null], + [null, null], + [10, null], + [true, null], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/AssetsHelperTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/AssetsHelperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/AssetsHelperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/AssetsHelperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ $fooPackage = new Package(new StaticVersionStrategy('42', '%s?v=%s')); $barPackage = new Package(new StaticVersionStrategy('22', '%s?%s')); - $packages = new Packages($fooPackage, array('bar' => $barPackage)); + $packages = new Packages($fooPackage, ['bar' => $barPackage]); $this->helper = new AssetsHelper($packages); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Fixtures/StubTranslator.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,12 +15,12 @@ class StubTranslator implements TranslatorInterface { - public function trans($id, array $parameters = array(), $domain = null, $locale = null) + public function trans($id, array $parameters = [], $domain = null, $locale = null) { return '[trans]'.$id.'[/trans]'; } - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) { return '[trans]'.$id.'[/trans]'; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,19 +35,19 @@ $root = realpath(\dirname($reflClass->getFileName()).'/Resources/views'); $rootTheme = realpath(__DIR__.'/Resources'); $templateNameParser = new StubTemplateNameParser($root, $rootTheme); - $loader = new FilesystemLoader(array()); + $loader = new FilesystemLoader([]); $this->engine = new PhpEngine($templateNameParser, $loader); $this->engine->addGlobal('global', ''); - $this->engine->setHelpers(array( + $this->engine->setHelpers([ new TranslatorHelper(new StubTranslator()), - )); + ]); - return array_merge(parent::getExtensions(), array( - new TemplatingExtension($this->engine, $this->csrfTokenManager, array( + return array_merge(parent::getExtensions(), [ + new TemplatingExtension($this->engine, $this->csrfTokenManager, [ 'FrameworkBundle:Form', - )), - )); + ]), + ]); } protected function tearDown() @@ -59,10 +59,10 @@ public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -71,10 +71,10 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); @@ -93,12 +93,12 @@ $this->assertSame('€ ', $this->renderWidget($view)); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->form($view, $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { return (string) $this->engine->get('form')->label($view, $label, $vars); } @@ -108,27 +108,27 @@ return (string) $this->engine->get('form')->errors($view); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->widget($view, $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->row($view, $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->rest($view, $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->start($view, $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->end($view, $vars); } @@ -140,15 +140,15 @@ public static function themeBlockInheritanceProvider() { - return array( - array(array('TestBundle:Parent')), - ); + return [ + [['TestBundle:Parent']], + ]; } public static function themeInheritanceProvider() { - return array( - array(array('TestBundle:Parent'), array('TestBundle:Child')), - ); + return [ + [['TestBundle:Parent'], ['TestBundle:Child']], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,10 +29,10 @@ public function testStartTagHasNoActionAttributeWhenActionIsEmpty() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '', - )); + ]); $html = $this->renderStart($form->createView()); @@ -41,10 +41,10 @@ public function testStartTagHasActionAttributeWhenActionIsZero() { - $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [ 'method' => 'get', 'action' => '0', - )); + ]); $html = $this->renderStart($form->createView()); @@ -59,20 +59,20 @@ $root = realpath(\dirname($reflClass->getFileName()).'/Resources/views'); $rootTheme = realpath(__DIR__.'/Resources'); $templateNameParser = new StubTemplateNameParser($root, $rootTheme); - $loader = new FilesystemLoader(array()); + $loader = new FilesystemLoader([]); $this->engine = new PhpEngine($templateNameParser, $loader); $this->engine->addGlobal('global', ''); - $this->engine->setHelpers(array( + $this->engine->setHelpers([ new TranslatorHelper(new StubTranslator()), - )); + ]); - return array_merge(parent::getExtensions(), array( - new TemplatingExtension($this->engine, $this->csrfTokenManager, array( + return array_merge(parent::getExtensions(), [ + new TemplatingExtension($this->engine, $this->csrfTokenManager, [ 'FrameworkBundle:Form', 'FrameworkBundle:FormTable', - )), - )); + ]), + ]); } protected function tearDown() @@ -82,12 +82,12 @@ parent::tearDown(); } - protected function renderForm(FormView $view, array $vars = array()) + protected function renderForm(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->form($view, $vars); } - protected function renderLabel(FormView $view, $label = null, array $vars = array()) + protected function renderLabel(FormView $view, $label = null, array $vars = []) { return (string) $this->engine->get('form')->label($view, $label, $vars); } @@ -97,27 +97,27 @@ return (string) $this->engine->get('form')->errors($view); } - protected function renderWidget(FormView $view, array $vars = array()) + protected function renderWidget(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->widget($view, $vars); } - protected function renderRow(FormView $view, array $vars = array()) + protected function renderRow(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->row($view, $vars); } - protected function renderRest(FormView $view, array $vars = array()) + protected function renderRest(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->rest($view, $vars); } - protected function renderStart(FormView $view, array $vars = array()) + protected function renderStart(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->start($view, $vars); } - protected function renderEnd(FormView $view, array $vars = array()) + protected function renderEnd(FormView $view, array $vars = []) { return (string) $this->engine->get('form')->end($view, $vars); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/RequestHelperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { $this->requestStack = new RequestStack(); $request = new Request(); - $request->initialize(array('foobar' => 'bar')); + $request->initialize(['foobar' => 'bar']); $this->requestStack->push($request); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_c_entry_label.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_c_entry_label.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_c_entry_label.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_c_entry_label.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,2 +1,2 @@ humanize($name); } ?> - + diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_names_entry_label.html.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_names_entry_label.html.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_names_entry_label.html.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_names_entry_label.html.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,4 +1,4 @@ humanize($name); } ?> - + diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -47,13 +47,13 @@ $this->assertTrue($helper->hasFlash('notice')); - $this->assertEquals(array('bar'), $helper->getFlash('notice')); + $this->assertEquals(['bar'], $helper->getFlash('notice')); } public function testGetFlashes() { $helper = new SessionHelper($this->requestStack); - $this->assertEquals(array('notice' => array('bar')), $helper->getFlashes()); + $this->assertEquals(['notice' => ['bar']], $helper->getFlashes()); } public function testGet() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -90,8 +90,8 @@ { return $this ->getMockBuilder('Symfony\Component\Config\FileLocator') - ->setMethods(array('locate')) - ->setConstructorArgs(array('/path/to/fallback')) + ->setMethods(['locate']) + ->setConstructorArgs(['/path/to/fallback']) ->getMock() ; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateFilenameParserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,12 +45,12 @@ public function getFilenameToTemplateProvider() { - return array( - array('/path/to/section/name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')), - array('\\path\\to\\section\\name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')), - array('name.format.engine', new TemplateReference('', '', 'name', 'format', 'engine')), - array('name.format', false), - array('name', false), - ); + return [ + ['/path/to/section/name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')], + ['\\path\\to\\section\\name.format.engine', new TemplateReference('', '/path/to/section', 'name', 'format', 'engine')], + ['name.format.engine', new TemplateReference('', '', 'name', 'format', 'engine')], + ['name.format', false], + ['name', false], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ ->expects($this->any()) ->method('getBundle') ->will($this->returnCallback(function ($bundle) { - if (\in_array($bundle, array('SensioFooBundle', 'SensioCmsFooBundle', 'FooBundle'))) { + if (\in_array($bundle, ['SensioFooBundle', 'SensioCmsFooBundle', 'FooBundle'])) { return true; } @@ -56,22 +56,22 @@ public function parseProvider() { - return array( - array('FooBundle:Post:index.html.php', 'FooBundle:Post:index.html.php', '@FooBundle/Resources/views/Post/index.html.php', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php')), - array('FooBundle:Post:index.html.twig', 'FooBundle:Post:index.html.twig', '@FooBundle/Resources/views/Post/index.html.twig', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'twig')), - array('FooBundle:Post:index.xml.php', 'FooBundle:Post:index.xml.php', '@FooBundle/Resources/views/Post/index.xml.php', new TemplateReference('FooBundle', 'Post', 'index', 'xml', 'php')), - array('SensioFooBundle:Post:index.html.php', 'SensioFooBundle:Post:index.html.php', '@SensioFooBundle/Resources/views/Post/index.html.php', new TemplateReference('SensioFooBundle', 'Post', 'index', 'html', 'php')), - array('SensioCmsFooBundle:Post:index.html.php', 'SensioCmsFooBundle:Post:index.html.php', '@SensioCmsFooBundle/Resources/views/Post/index.html.php', new TemplateReference('SensioCmsFooBundle', 'Post', 'index', 'html', 'php')), - array(':Post:index.html.php', ':Post:index.html.php', 'views/Post/index.html.php', new TemplateReference('', 'Post', 'index', 'html', 'php')), - array('::index.html.php', '::index.html.php', 'views/index.html.php', new TemplateReference('', '', 'index', 'html', 'php')), - array('index.html.php', '::index.html.php', 'views/index.html.php', new TemplateReference('', '', 'index', 'html', 'php')), - array('FooBundle:Post:foo.bar.index.html.php', 'FooBundle:Post:foo.bar.index.html.php', '@FooBundle/Resources/views/Post/foo.bar.index.html.php', new TemplateReference('FooBundle', 'Post', 'foo.bar.index', 'html', 'php')), - array('@FooBundle/Resources/views/layout.html.twig', '@FooBundle/Resources/views/layout.html.twig', '@FooBundle/Resources/views/layout.html.twig', new BaseTemplateReference('@FooBundle/Resources/views/layout.html.twig', 'twig')), - array('@FooBundle/Foo/layout.html.twig', '@FooBundle/Foo/layout.html.twig', '@FooBundle/Foo/layout.html.twig', new BaseTemplateReference('@FooBundle/Foo/layout.html.twig', 'twig')), - array('name.twig', 'name.twig', 'name.twig', new BaseTemplateReference('name.twig', 'twig')), - array('name', 'name', 'name', new BaseTemplateReference('name')), - array('default/index.html.php', '::default/index.html.php', 'views/default/index.html.php', new TemplateReference(null, null, 'default/index', 'html', 'php')), - ); + return [ + ['FooBundle:Post:index.html.php', 'FooBundle:Post:index.html.php', '@FooBundle/Resources/views/Post/index.html.php', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php')], + ['FooBundle:Post:index.html.twig', 'FooBundle:Post:index.html.twig', '@FooBundle/Resources/views/Post/index.html.twig', new TemplateReference('FooBundle', 'Post', 'index', 'html', 'twig')], + ['FooBundle:Post:index.xml.php', 'FooBundle:Post:index.xml.php', '@FooBundle/Resources/views/Post/index.xml.php', new TemplateReference('FooBundle', 'Post', 'index', 'xml', 'php')], + ['SensioFooBundle:Post:index.html.php', 'SensioFooBundle:Post:index.html.php', '@SensioFooBundle/Resources/views/Post/index.html.php', new TemplateReference('SensioFooBundle', 'Post', 'index', 'html', 'php')], + ['SensioCmsFooBundle:Post:index.html.php', 'SensioCmsFooBundle:Post:index.html.php', '@SensioCmsFooBundle/Resources/views/Post/index.html.php', new TemplateReference('SensioCmsFooBundle', 'Post', 'index', 'html', 'php')], + [':Post:index.html.php', ':Post:index.html.php', 'views/Post/index.html.php', new TemplateReference('', 'Post', 'index', 'html', 'php')], + ['::index.html.php', '::index.html.php', 'views/index.html.php', new TemplateReference('', '', 'index', 'html', 'php')], + ['index.html.php', '::index.html.php', 'views/index.html.php', new TemplateReference('', '', 'index', 'html', 'php')], + ['FooBundle:Post:foo.bar.index.html.php', 'FooBundle:Post:foo.bar.index.html.php', '@FooBundle/Resources/views/Post/foo.bar.index.html.php', new TemplateReference('FooBundle', 'Post', 'foo.bar.index', 'html', 'php')], + ['@FooBundle/Resources/views/layout.html.twig', '@FooBundle/Resources/views/layout.html.twig', '@FooBundle/Resources/views/layout.html.twig', new BaseTemplateReference('@FooBundle/Resources/views/layout.html.twig', 'twig')], + ['@FooBundle/Foo/layout.html.twig', '@FooBundle/Foo/layout.html.twig', '@FooBundle/Foo/layout.html.twig', new BaseTemplateReference('@FooBundle/Foo/layout.html.twig', 'twig')], + ['name.twig', 'name.twig', 'name.twig', new BaseTemplateReference('name.twig', 'twig')], + ['name', 'name', 'name', new BaseTemplateReference('name')], + ['default/index.html.php', '::default/index.html.php', 'views/default/index.html.php', new TemplateReference(null, null, 'default/index', 'html', 'php')], + ]; } /** @@ -98,12 +98,12 @@ public function provideAbsolutePaths() { - return array( - array('/path/to/section/index.html.php', '/path/to/section/index.html.php', '/path/to/section/index.html.php', new BaseTemplateReference('/path/to/section/index.html.php', 'php')), - array('C:\\path\\to\\section\\name.html.php', 'C:path/to/section/name.html.php', 'C:path/to/section/name.html.php', new BaseTemplateReference('C:path/to/section/name.html.php', 'php')), - array('C:\\path\\to\\section\\name:foo.html.php', 'C:path/to/section/name:foo.html.php', 'C:path/to/section/name:foo.html.php', new BaseTemplateReference('C:path/to/section/name:foo.html.php', 'php')), - array('\\path\\to\\section\\name.html.php', '/path/to/section/name.html.php', '/path/to/section/name.html.php', new BaseTemplateReference('/path/to/section/name.html.php', 'php')), - array('/path/to/section/name.php', '/path/to/section/name.php', '/path/to/section/name.php', new BaseTemplateReference('/path/to/section/name.php', 'php')), - ); + return [ + ['/path/to/section/index.html.php', '/path/to/section/index.html.php', '/path/to/section/index.html.php', new BaseTemplateReference('/path/to/section/index.html.php', 'php')], + ['C:\\path\\to\\section\\name.html.php', 'C:path/to/section/name.html.php', 'C:path/to/section/name.html.php', new BaseTemplateReference('C:path/to/section/name.html.php', 'php')], + ['C:\\path\\to\\section\\name:foo.html.php', 'C:path/to/section/name:foo.html.php', 'C:path/to/section/name:foo.html.php', new BaseTemplateReference('C:path/to/section/name:foo.html.php', 'php')], + ['\\path\\to\\section\\name.html.php', '/path/to/section/name.html.php', '/path/to/section/name.html.php', new BaseTemplateReference('/path/to/section/name.html.php', 'php')], + ['/path/to/section/name.php', '/path/to/section/name.php', '/path/to/section/name.php', new BaseTemplateReference('/path/to/section/name.php', 'php')], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,11 +26,11 @@ public function getTemplateToPathProvider() { - return array( - array(new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php'), '@FooBundle/Resources/views/Post/index.html.php'), - array(new TemplateReference('FooBundle', '', 'index', 'html', 'twig'), '@FooBundle/Resources/views/index.html.twig'), - array(new TemplateReference('', 'Post', 'index', 'html', 'php'), 'views/Post/index.html.php'), - array(new TemplateReference('', '', 'index', 'html', 'php'), 'views/index.html.php'), - ); + return [ + [new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php'), '@FooBundle/Resources/views/Post/index.html.php'], + [new TemplateReference('FooBundle', '', 'index', 'html', 'twig'), '@FooBundle/Resources/views/index.html.twig'], + [new TemplateReference('', 'Post', 'index', 'html', 'php'), 'views/Post/index.html.php'], + [new TemplateReference('', '', 'index', 'html', 'php'), 'views/index.html.php'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,8 +42,8 @@ nowdoc key with whitespace and nonescaped \$\n sequences EOF; // Assert - $expectedCatalogue = array( - 'messages' => array( + $expectedCatalogue = [ + 'messages' => [ 'single-quoted key' => 'prefixsingle-quoted key', 'double-quoted key' => 'prefixdouble-quoted key', 'heredoc key' => 'prefixheredoc key', @@ -54,8 +54,8 @@ $expectedHeredoc => 'prefix'.$expectedHeredoc, $expectedNowdoc => 'prefix'.$expectedNowdoc, '{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples' => 'prefix{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples', - ), - 'not_messages' => array( + ], + 'not_messages' => [ 'other-domain-test-no-params-short-array' => 'prefixother-domain-test-no-params-short-array', 'other-domain-test-no-params-long-array' => 'prefixother-domain-test-no-params-long-array', 'other-domain-test-params-short-array' => 'prefixother-domain-test-params-short-array', @@ -65,8 +65,8 @@ 'typecast' => 'prefixtypecast', 'msg1' => 'prefixmsg1', 'msg2' => 'prefixmsg2', - ), - ); + ], + ]; $actualCatalogue = $catalogue->all(); $this->assertEquals($expectedCatalogue, $actualCatalogue); @@ -75,7 +75,7 @@ public function resourcesProvider() { $directory = __DIR__.'/../Fixtures/Resources/views/'; - $splFiles = array(); + $splFiles = []; foreach (new \DirectoryIterator($directory) as $fileInfo) { if ($fileInfo->isDot()) { continue; @@ -86,13 +86,13 @@ $splFiles[] = $fileInfo->getFileInfo(); } - return array( - array($directory), - array($phpFile), - array(glob($directory.'*')), - array($splFiles), - array(new \ArrayObject(glob($directory.'*'))), - array(new \ArrayObject($splFiles)), - ); + return [ + [$directory], + [$phpFile], + [glob($directory.'*')], + [$splFiles], + [new \ArrayObject(glob($directory.'*'))], + [new \ArrayObject($splFiles)], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,9 +49,9 @@ */ public function testTransWithoutCachingOmittingLocale() { - $translator = $this->getTranslator($this->getLoader(), array(), 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator = $this->getTranslator($this->getLoader(), [], 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -71,9 +71,9 @@ public function testTransWithCachingOmittingLocale() { // prime the cache - $translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir), 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator = $this->getTranslator($this->getLoader(), ['cache_dir' => $this->tmpDir], 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -89,9 +89,9 @@ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); $loader->expects($this->never())->method('load'); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir), 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir], 'loader', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -112,7 +112,7 @@ public function testTransWithCachingWithInvalidLocaleOmittingLocale() { $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir), 'loader', '\Symfony\Bundle\FrameworkBundle\Tests\Translation\TranslatorWithInvalidLocale', null); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir], 'loader', '\Symfony\Bundle\FrameworkBundle\Tests\Translation\TranslatorWithInvalidLocale', null); $translator->trans('foo'); } @@ -124,13 +124,13 @@ public function testLoadResourcesWithoutCachingOmittingLocale() { $loader = new \Symfony\Component\Translation\Loader\YamlFileLoader(); - $resourceFiles = array( - 'fr' => array( + $resourceFiles = [ + 'fr' => [ __DIR__.'/../Fixtures/Resources/translations/messages.fr.yml', - ), - ); + ], + ]; - $translator = $this->getTranslator($loader, array('resource_files' => $resourceFiles), 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator = $this->getTranslator($loader, ['resource_files' => $resourceFiles], 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); $translator->setLocale('fr'); $this->assertEquals('répertoire', $translator->trans('folder')); @@ -172,15 +172,15 @@ public function testWarmupOmittingLocale() { $loader = new \Symfony\Component\Translation\Loader\YamlFileLoader(); - $resourceFiles = array( - 'fr' => array( + $resourceFiles = [ + 'fr' => [ __DIR__.'/../Fixtures/Resources/translations/messages.fr.yml', - ), - ); + ], + ]; // prime the cache - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); - $translator->setFallbackLocales(array('fr')); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles], 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator->setFallbackLocales(['fr']); $translator->warmup($this->tmpDir); $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); @@ -188,9 +188,9 @@ ->expects($this->never()) ->method('load'); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles], 'yml', '\Symfony\Bundle\FrameworkBundle\Translation\Translator', null); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('fr')); + $translator->setFallbackLocales(['fr']); $this->assertEquals('répertoire', $translator->trans('folder')); } @@ -198,7 +198,7 @@ { $translator = $this->getTranslator($this->getLoader()); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -214,9 +214,9 @@ public function testTransWithCaching() { // prime the cache - $translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir)); + $translator = $this->getTranslator($this->getLoader(), ['cache_dir' => $this->tmpDir]); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -232,9 +232,9 @@ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); $loader->expects($this->never())->method('load'); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir)); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir]); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); + $translator->setFallbackLocales(['en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin']); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); @@ -254,7 +254,7 @@ public function testTransWithCachingWithInvalidLocale() { $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir), 'loader', '\Symfony\Bundle\FrameworkBundle\Tests\Translation\TranslatorWithInvalidLocale'); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir], 'loader', '\Symfony\Bundle\FrameworkBundle\Tests\Translation\TranslatorWithInvalidLocale'); $translator->trans('foo'); } @@ -262,13 +262,13 @@ public function testLoadResourcesWithoutCaching() { $loader = new \Symfony\Component\Translation\Loader\YamlFileLoader(); - $resourceFiles = array( - 'fr' => array( + $resourceFiles = [ + 'fr' => [ __DIR__.'/../Fixtures/Resources/translations/messages.fr.yml', - ), - ); + ], + ]; - $translator = $this->getTranslator($loader, array('resource_files' => $resourceFiles), 'yml'); + $translator = $this->getTranslator($loader, ['resource_files' => $resourceFiles], 'yml'); $translator->setLocale('fr'); $this->assertEquals('répertoire', $translator->trans('folder')); @@ -290,13 +290,13 @@ { $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); - (new Translator($container, new MessageFormatter(), 'en', array(), array('foo' => 'bar'))); + (new Translator($container, new MessageFormatter(), 'en', [], ['foo' => 'bar'])); } /** @dataProvider getDebugModeAndCacheDirCombinations */ public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug, $enableCache) { - $someCatalogue = $this->getCatalogue('some_locale', array()); + $someCatalogue = $this->getCatalogue('some_locale', []); $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); @@ -312,10 +312,10 @@ ->with('second_resource.some_locale.loader', 'some_locale', 'messages') ->willReturn($someCatalogue); - $options = array( - 'resource_files' => array('some_locale' => array('messages.some_locale.loader')), + $options = [ + 'resource_files' => ['some_locale' => ['messages.some_locale.loader']], 'debug' => $debug, - ); + ]; if ($enableCache) { $options['cache_dir'] = $this->tmpDir; @@ -325,20 +325,20 @@ $translator = $this->createTranslator($loader, $options); $translator->addResource('loader', 'second_resource.some_locale.loader', 'some_locale', 'messages'); - $translator->trans('some_message', array(), null, 'some_locale'); + $translator->trans('some_message', [], null, 'some_locale'); } public function getDebugModeAndCacheDirCombinations() { - return array( - array(false, false), - array(true, false), - array(false, true), - array(true, true), - ); + return [ + [false, false], + [true, false], + [false, true], + [true, true], + ]; } - protected function getCatalogue($locale, $messages, $resources = array()) + protected function getCatalogue($locale, $messages, $resources = []) { $catalogue = new MessageCatalogue($locale); foreach ($messages as $key => $translation) { @@ -357,53 +357,53 @@ $loader ->expects($this->at(0)) ->method('load') - ->will($this->returnValue($this->getCatalogue('fr', array( + ->will($this->returnValue($this->getCatalogue('fr', [ 'foo' => 'foo (FR)', - )))) + ]))) ; $loader ->expects($this->at(1)) ->method('load') - ->will($this->returnValue($this->getCatalogue('en', array( + ->will($this->returnValue($this->getCatalogue('en', [ 'foo' => 'foo (EN)', 'bar' => 'bar (EN)', 'choice' => '{0} choice 0 (EN)|{1} choice 1 (EN)|]1,Inf] choice inf (EN)', - )))) + ]))) ; $loader ->expects($this->at(2)) ->method('load') - ->will($this->returnValue($this->getCatalogue('es', array( + ->will($this->returnValue($this->getCatalogue('es', [ 'foobar' => 'foobar (ES)', - )))) + ]))) ; $loader ->expects($this->at(3)) ->method('load') - ->will($this->returnValue($this->getCatalogue('pt-PT', array( + ->will($this->returnValue($this->getCatalogue('pt-PT', [ 'foobarfoo' => 'foobarfoo (PT-PT)', - )))) + ]))) ; $loader ->expects($this->at(4)) ->method('load') - ->will($this->returnValue($this->getCatalogue('pt_BR', array( + ->will($this->returnValue($this->getCatalogue('pt_BR', [ 'other choice' => '{0} other choice 0 (PT-BR)|{1} other choice 1 (PT-BR)|]1,Inf] other choice inf (PT-BR)', - )))) + ]))) ; $loader ->expects($this->at(5)) ->method('load') - ->will($this->returnValue($this->getCatalogue('fr.UTF-8', array( + ->will($this->returnValue($this->getCatalogue('fr.UTF-8', [ 'foobarbaz' => 'foobarbaz (fr.UTF-8)', - )))) + ]))) ; $loader ->expects($this->at(6)) ->method('load') - ->will($this->returnValue($this->getCatalogue('sr@latin', array( + ->will($this->returnValue($this->getCatalogue('sr@latin', [ 'foobarbax' => 'foobarbax (sr@latin)', - )))) + ]))) ; return $loader; @@ -421,7 +421,7 @@ return $container; } - public function getTranslator($loader, $options = array(), $loaderFomat = 'loader', $translatorClass = '\Symfony\Bundle\FrameworkBundle\Translation\Translator', $defaultLocale = 'en') + public function getTranslator($loader, $options = [], $loaderFomat = 'loader', $translatorClass = '\Symfony\Bundle\FrameworkBundle\Translation\Translator', $defaultLocale = 'en') { $translator = $this->createTranslator($loader, $options, $translatorClass, $loaderFomat, $defaultLocale); @@ -441,15 +441,15 @@ public function testWarmup() { $loader = new \Symfony\Component\Translation\Loader\YamlFileLoader(); - $resourceFiles = array( - 'fr' => array( + $resourceFiles = [ + 'fr' => [ __DIR__.'/../Fixtures/Resources/translations/messages.fr.yml', - ), - ); + ], + ]; // prime the cache - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml'); - $translator->setFallbackLocales(array('fr')); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles], 'yml'); + $translator->setFallbackLocales(['fr']); $translator->warmup($this->tmpDir); $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock(); @@ -457,9 +457,9 @@ ->expects($this->never()) ->method('load'); - $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml'); + $translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles], 'yml'); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('fr')); + $translator->setFallbackLocales(['fr']); $this->assertEquals('répertoire', $translator->trans('folder')); } @@ -469,7 +469,7 @@ return new $translatorClass( $this->getContainer($loader), new MessageFormatter(), - array($loaderFomat => array($loaderFomat)), + [$loaderFomat => [$loaderFomat]], $options ); } @@ -478,7 +478,7 @@ $this->getContainer($loader), new MessageFormatter(), $defaultLocale, - array($loaderFomat => array($loaderFomat)), + [$loaderFomat => [$loaderFomat]], $options ); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -55,7 +55,7 @@ $container = new Container(); $container->set('validator_constraint_service', $validator); - $factory = new ConstraintValidatorFactory($container, array('validator_constraint_alias' => 'validator_constraint_service')); + $factory = new ConstraintValidatorFactory($container, ['validator_constraint_alias' => 'validator_constraint_service']); $this->assertSame($validator, $factory->getInstance(new ConstraintAliasStub())); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,11 +28,11 @@ protected $container; protected $loaderIds; - protected $options = array( + protected $options = [ 'cache_dir' => null, 'debug' => false, - 'resource_files' => array(), - ); + 'resource_files' => [], + ]; /** * @var array @@ -45,7 +45,7 @@ * * @var array */ - private $resources = array(); + private $resources = []; /** * Constructor. @@ -64,7 +64,7 @@ * * @throws InvalidArgumentException */ - public function __construct(ContainerInterface $container, $formatter, $defaultLocale = null, array $loaderIds = array(), array $options = array()) + public function __construct(ContainerInterface $container, $formatter, $defaultLocale = null, array $loaderIds = [], array $options = []) { // BC 3.x, to be removed in 4.0 along with the $defaultLocale default value if (\is_array($defaultLocale) || 3 > \func_num_args()) { @@ -103,7 +103,7 @@ return; } - $locales = array_merge($this->getFallbackLocales(), array($this->getLocale()), $this->resourceLocales); + $locales = array_merge($this->getFallbackLocales(), [$this->getLocale()], $this->resourceLocales); foreach (array_unique($locales) as $locale) { // reset catalogue in case it's already loaded during the dump of the other locales. if (isset($this->catalogues[$locale])) { @@ -116,7 +116,7 @@ public function addResource($format, $resource, $locale, $domain = null) { - $this->resources[] = array($format, $resource, $locale, $domain); + $this->resources[] = [$format, $resource, $locale, $domain]; } /** @@ -134,7 +134,7 @@ list($format, $resource, $locale, $domain) = $params; parent::addResource($format, $resource, $locale, $domain); } - $this->resources = array(); + $this->resources = []; foreach ($this->loaderIds as $id => $aliases) { foreach ($aliases as $alias) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -47,7 +47,7 @@ protected $container; protected $validators; - public function __construct(ContainerInterface $container, array $validators = array()) + public function __construct(ContainerInterface $container, array $validators = []) { parent::__construct($container); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -125,7 +125,7 @@ } // Parse arguments - $objectIdentities = array(); + $objectIdentities = []; $maskBuilder = $this->getMaskBuilder(); foreach ($input->getArgument('arguments') as $argument) { $data = explode(':', $argument, 2); @@ -149,7 +149,7 @@ } // Create security identities - $securityIdentities = array(); + $securityIdentities = []; if ($userOption) { foreach ($userOption as $user) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ private $encoderFactory; private $userClasses; - public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = array()) + public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = []) { if (null === $encoderFactory) { @trigger_error(sprintf('Passing null as the first argument of "%s()" is deprecated since Symfony 3.3 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); @@ -152,14 +152,14 @@ $encodedPassword = $encoder->encodePassword($password, $salt); - $rows = array( - array('Encoder used', \get_class($encoder)), - array('Encoded password', $encodedPassword), - ); + $rows = [ + ['Encoder used', \get_class($encoder)], + ['Encoded password', $encodedPassword], + ]; if (!$emptySalt) { - $rows[] = array('Generated salt', $salt); + $rows[] = ['Generated salt', $salt]; } - $io->table(array('Key', 'Value'), $rows); + $io->table(['Key', 'Value'], $rows); if (!$emptySalt) { $errorIo->note(sprintf('Make sure that your salt storage field fits the salt length: %s chars', \strlen($salt))); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,7 +60,7 @@ public function collect(Request $request, Response $response, \Exception $exception = null) { if (null === $this->tokenStorage) { - $this->data = array( + $this->data = [ 'enabled' => false, 'authenticated' => false, 'impersonated' => false, @@ -70,12 +70,12 @@ 'token_class' => null, 'logout_url' => null, 'user' => '', - 'roles' => array(), - 'inherited_roles' => array(), + 'roles' => [], + 'inherited_roles' => [], 'supports_role_hierarchy' => null !== $this->roleHierarchy, - ); + ]; } elseif (null === $token = $this->tokenStorage->getToken()) { - $this->data = array( + $this->data = [ 'enabled' => true, 'authenticated' => false, 'impersonated' => false, @@ -85,12 +85,12 @@ 'token_class' => null, 'logout_url' => null, 'user' => '', - 'roles' => array(), - 'inherited_roles' => array(), + 'roles' => [], + 'inherited_roles' => [], 'supports_role_hierarchy' => null !== $this->roleHierarchy, - ); + ]; } else { - $inheritedRoles = array(); + $inheritedRoles = []; $assignedRoles = $token->getRoles(); $impersonatorUser = null; @@ -127,7 +127,7 @@ return $role->getRole(); }; - $this->data = array( + $this->data = [ 'enabled' => true, 'authenticated' => $token->isAuthenticated(), 'impersonated' => null !== $impersonatorUser, @@ -140,7 +140,7 @@ 'roles' => array_map($extractRoles, $assignedRoles), 'inherited_roles' => array_unique(array_map($extractRoles, $inheritedRoles)), 'supports_role_hierarchy' => null !== $this->roleHierarchy, - ); + ]; } // collect voters and access decision manager information @@ -152,9 +152,9 @@ $this->data['voters'][] = $this->hasVarDumper ? new ClassStub(\get_class($voter)) : \get_class($voter); } } else { - $this->data['access_decision_log'] = array(); + $this->data['access_decision_log'] = []; $this->data['voter_strategy'] = 'unknown'; - $this->data['voters'] = array(); + $this->data['voters'] = []; } // collect firewall context information @@ -162,7 +162,7 @@ if ($this->firewallMap instanceof FirewallMap) { $firewallConfig = $this->firewallMap->getFirewallConfig($request); if (null !== $firewallConfig) { - $this->data['firewall'] = array( + $this->data['firewall'] = [ 'name' => $firewallConfig->getName(), 'allows_anonymous' => $firewallConfig->allowsAnonymous(), 'request_matcher' => $firewallConfig->getRequestMatcher(), @@ -175,7 +175,7 @@ 'access_denied_url' => $firewallConfig->getAccessDeniedUrl(), 'user_checker' => $firewallConfig->getUserChecker(), 'listeners' => $firewallConfig->getListeners(), - ); + ]; // generate exit impersonation path from current request if ($this->data['impersonated'] && null !== $switchUserConfig = $firewallConfig->getSwitchUser()) { @@ -189,7 +189,7 @@ } // collect firewall listeners information - $this->data['listeners'] = array(); + $this->data['listeners'] = []; if ($this->firewall) { $this->data['listeners'] = $this->firewall->getWrappedListeners(); } @@ -200,7 +200,7 @@ */ public function reset() { - $this->data = array(); + $this->data = []; } public function lateCollect() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Debug/WrappedListener.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,7 +53,7 @@ */ public function __call($method, $arguments) { - return \call_user_func_array(array($this->listener, $method), $arguments); + return \call_user_func_array([$this->listener, $method], $arguments); } public function getWrappedListener() @@ -67,10 +67,10 @@ $this->stub = self::$hasVarDumper ? new ClassStub(\get_class($this->listener)) : \get_class($this->listener); } - return array( + return [ 'response' => $this->response, 'time' => $this->time, 'stub' => $this->stub, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfTokenClearingLogoutHandlerPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfTokenClearingLogoutHandlerPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfTokenClearingLogoutHandlerPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfTokenClearingLogoutHandlerPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,6 +37,6 @@ ->addArgument(new Reference('security.csrf.token_storage')) ->setPublic(false); - $container->findDefinition('security.logout_listener')->addMethodCall('addHandler', array(new Reference('security.logout.handler.csrf_token_clearing'))); + $container->findDefinition('security.logout_listener')->addMethodCall('addHandler', [new Reference('security.logout.handler.csrf_token_clearing')]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php 2019-02-03 12:23:08.000000000 +0000 @@ -74,7 +74,7 @@ ->children() ->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end() ->enumNode('session_fixation_strategy') - ->values(array(SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE)) + ->values([SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE]) ->defaultValue(SessionAuthenticationStrategy::MIGRATE) ->end() ->booleanNode('hide_user_not_found')->defaultTrue()->end() @@ -84,7 +84,7 @@ ->addDefaultsIfNotSet() ->children() ->enumNode('strategy') - ->values(array(AccessDecisionManager::STRATEGY_AFFIRMATIVE, AccessDecisionManager::STRATEGY_CONSENSUS, AccessDecisionManager::STRATEGY_UNANIMOUS)) + ->values([AccessDecisionManager::STRATEGY_AFFIRMATIVE, AccessDecisionManager::STRATEGY_CONSENSUS, AccessDecisionManager::STRATEGY_UNANIMOUS]) ->end() ->scalarNode('service')->end() ->booleanNode('allow_if_all_abstain')->defaultFalse()->end() @@ -158,7 +158,7 @@ ->useAttributeAsKey('id') ->prototype('array') ->performNoDeepMerging() - ->beforeNormalization()->ifString()->then(function ($v) { return array('value' => $v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return ['value' => $v]; })->end() ->beforeNormalization() ->ifTrue(function ($v) { return \is_array($v) && isset($v['value']); }) ->then(function ($v) { return preg_split('/\s*,\s*/', $v['value']); }) @@ -189,7 +189,7 @@ ->end() ->scalarNode('host')->defaultNull()->end() ->arrayNode('ips') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() ->prototype('scalar')->end() ->end() ->arrayNode('methods') @@ -250,7 +250,7 @@ ->info('When true, it will trigger a logout for the user if something has changed. This will be the default behavior as of Syfmony 4.0.') ->end() ->arrayNode('logout') - ->treatTrueLike(array()) + ->treatTrueLike([]) ->canBeUnset() ->children() ->scalarNode('csrf_parameter')->defaultValue('_csrf_token')->end() @@ -266,7 +266,7 @@ ->arrayNode('delete_cookies') ->beforeNormalization() ->ifTrue(function ($v) { return \is_array($v) && \is_int(key($v)); }) - ->then(function ($v) { return array_map(function ($v) { return array('name' => $v); }, $v); }) + ->then(function ($v) { return array_map(function ($v) { return ['name' => $v]; }, $v); }) ->end() ->useAttributeAsKey('name') ->prototype('array') @@ -301,7 +301,7 @@ ->end() ; - $abstractFactoryKeys = array(); + $abstractFactoryKeys = []; foreach ($factories as $factoriesAtPosition) { foreach ($factoriesAtPosition as $factory) { $name = str_replace('-', '_', $factory->getKey()); @@ -347,17 +347,17 @@ ->fixXmlConfig('provider') ->children() ->arrayNode('providers') - ->example(array( - 'my_memory_provider' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - 'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]'), - ), - ), - ), - 'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')), - )) + ->example([ + 'my_memory_provider' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + 'bar' => ['password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]'], + ], + ], + ], + 'my_entity_provider' => ['entity' => ['class' => 'SecurityBundle:User', 'property' => 'username']], + ]) ->isRequired() ->requiresAtLeastOneElement() ->useAttributeAsKey('name') @@ -407,19 +407,19 @@ ->fixXmlConfig('encoder') ->children() ->arrayNode('encoders') - ->example(array( + ->example([ 'App\Entity\User1' => 'bcrypt', - 'App\Entity\User2' => array( + 'App\Entity\User2' => [ 'algorithm' => 'bcrypt', 'cost' => 13, - ), - )) + ], + ]) ->requiresAtLeastOneElement() ->useAttributeAsKey('class') ->prototype('array') ->canBeUnset() ->performNoDeepMerging() - ->beforeNormalization()->ifString()->then(function ($v) { return array('algorithm' => $v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return ['algorithm' => $v]; })->end() ->children() ->scalarNode('algorithm')->cannotBeEmpty()->end() ->scalarNode('hash_algorithm')->info('Name of hashing algorithm for PBKDF2 (i.e. sha256, sha512, etc..) See hash_algos() for a list of supported algorithms.')->defaultValue('sha512')->end() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,26 +26,26 @@ */ abstract class AbstractFactory implements SecurityFactoryInterface { - protected $options = array( + protected $options = [ 'check_path' => '/login_check', 'use_forward' => false, 'require_previous_session' => false, - ); + ]; - protected $defaultSuccessHandlerOptions = array( + protected $defaultSuccessHandlerOptions = [ 'always_use_default_target_path' => false, 'default_target_path' => '/', 'login_path' => '/login', 'target_path_parameter' => '_target_path', 'use_referer' => false, - ); + ]; - protected $defaultFailureHandlerOptions = array( + protected $defaultFailureHandlerOptions = [ 'failure_path' => null, 'failure_forward' => false, 'login_path' => '/login', 'failure_path_parameter' => '_failure_path', - ); + ]; public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId) { @@ -59,14 +59,14 @@ if ($this->isRememberMeAware($config)) { $container ->getDefinition($listenerId) - ->addTag('security.remember_me_aware', array('id' => $id, 'provider' => $userProviderId)) + ->addTag('security.remember_me_aware', ['id' => $id, 'provider' => $userProviderId]) ; } // create entry point if applicable (optional) $entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPointId); - return array($authProviderId, $listenerId, $entryPointId); + return [$authProviderId, $listenerId, $entryPointId]; } public function addConfiguration(NodeDefinition $node) @@ -178,8 +178,8 @@ $successHandler->replaceArgument(2, $id); } else { $successHandler = $container->setDefinition($successHandlerId, new ChildDefinition('security.authentication.success_handler')); - $successHandler->addMethodCall('setOptions', array($options)); - $successHandler->addMethodCall('setProviderKey', array($id)); + $successHandler->addMethodCall('setOptions', [$options]); + $successHandler->addMethodCall('setProviderKey', [$id]); } return $successHandlerId; @@ -196,7 +196,7 @@ $failureHandler->replaceArgument(1, $options); } else { $failureHandler = $container->setDefinition($id, new ChildDefinition('security.authentication.failure_handler')); - $failureHandler->addMethodCall('setOptions', array($options)); + $failureHandler->addMethodCall('setOptions', [$options]); } return $id; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ ; if (!empty($config['query_string'])) { - $definition->addMethodCall('setQueryString', array($config['query_string'])); + $definition->addMethodCall('setQueryString', [$config['query_string']]); } return $provider; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -58,7 +58,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) { $authenticatorIds = $config['authenticators']; - $authenticatorReferences = array(); + $authenticatorReferences = []; foreach ($authenticatorIds as $authenticatorId) { $authenticatorReferences[] = new Reference($authenticatorId); } @@ -87,9 +87,9 @@ // this is always injected - then the listener decides if it should be used $container ->getDefinition($listenerId) - ->addTag('security.remember_me_aware', array('id' => $id, 'provider' => $userProvider)); + ->addTag('security.remember_me_aware', ['id' => $id, 'provider' => $userProvider]); - return array($providerId, $listenerId, $entryPointId); + return [$providerId, $listenerId, $entryPointId]; } private function determineEntryPoint($defaultEntryPointId, array $config) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,9 +41,9 @@ $listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic')); $listener->replaceArgument(2, $id); $listener->replaceArgument(3, new Reference($entryPointId)); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); - return array($provider, $listenerId, $entryPointId); + return [$provider, $listenerId, $entryPointId]; } public function getPosition() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,7 +41,7 @@ $entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPoint); if (!empty($config['query_string'])) { - $definition->addMethodCall('setQueryString', array($config['query_string'])); + $definition->addMethodCall('setQueryString', [$config['query_string']]); } // listener @@ -50,7 +50,7 @@ $listener->replaceArgument(2, $id); $listener->replaceArgument(3, new Reference($entryPointId)); - return array($provider, $listenerId, $entryPointId); + return [$provider, $listenerId, $entryPointId]; } public function addConfiguration(NodeDefinition $node) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpDigestFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -51,9 +51,9 @@ $listener->replaceArgument(1, new Reference($userProvider)); $listener->replaceArgument(2, $id); $listener->replaceArgument(3, new Reference($entryPointId)); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); - return array($provider, $listenerId, $entryPointId); + return [$provider, $listenerId, $entryPointId]; } public function getPosition() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,8 +26,8 @@ { $this->addOption('username_path', 'username'); $this->addOption('password_path', 'password'); - $this->defaultFailureHandlerOptions = array(); - $this->defaultSuccessHandlerOptions = array(); + $this->defaultFailureHandlerOptions = []; + $this->defaultSuccessHandlerOptions = []; } /** @@ -89,7 +89,7 @@ $listener->replaceArgument(4, isset($config['success_handler']) ? new Reference($this->createAuthenticationSuccessHandler($container, $id, $config)) : null); $listener->replaceArgument(5, isset($config['failure_handler']) ? new Reference($this->createAuthenticationFailureHandler($container, $id, $config)) : null); $listener->replaceArgument(6, array_intersect_key($config, $this->options)); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); $listenerId .= '.'.$id; $container->setDefinition($listenerId, $listener); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ class RememberMeFactory implements SecurityFactoryInterface { - protected $options = array( + protected $options = [ 'name' => 'REMEMBERME', 'lifetime' => 31536000, 'path' => '/', @@ -27,7 +27,7 @@ 'httponly' => true, 'always_remember_me' => false, 'remember_me_parameter' => '_remember_me', - ); + ]; public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) { @@ -52,7 +52,7 @@ if ($container->hasDefinition('security.logout_listener.'.$id)) { $container ->getDefinition('security.logout_listener.'.$id) - ->addMethodCall('addHandler', array(new Reference($rememberMeServicesId))) + ->addMethodCall('addHandler', [new Reference($rememberMeServicesId)]) ; } @@ -61,16 +61,16 @@ $rememberMeServices->replaceArgument(2, $id); if (isset($config['token_provider'])) { - $rememberMeServices->addMethodCall('setTokenProvider', array( + $rememberMeServices->addMethodCall('setTokenProvider', [ new Reference($config['token_provider']), - )); + ]); } // remember-me options $rememberMeServices->replaceArgument(3, array_intersect_key($config, $this->options)); // attach to remember-me aware listeners - $userProviders = array(); + $userProviders = []; foreach ($container->findTaggedServiceIds('security.remember_me_aware') as $serviceId => $attributes) { foreach ($attributes as $attribute) { if (!isset($attribute['id']) || $attribute['id'] !== $id) { @@ -84,12 +84,12 @@ $userProviders[] = new Reference($attribute['provider']); $container ->getDefinition($serviceId) - ->addMethodCall('setRememberMeServices', array(new Reference($rememberMeServicesId))) + ->addMethodCall('setRememberMeServices', [new Reference($rememberMeServicesId)]) ; } } if ($config['user_providers']) { - $userProviders = array(); + $userProviders = []; foreach ($config['user_providers'] as $providerName) { $userProviders[] = new Reference('security.user.provider.concrete.'.$providerName); } @@ -106,7 +106,7 @@ $listener->replaceArgument(1, new Reference($rememberMeServicesId)); $listener->replaceArgument(5, $config['catch_exceptions']); - return array($authProviderId, $listenerId, $defaultEntryPoint); + return [$authProviderId, $listenerId, $defaultEntryPoint]; } public function getPosition() @@ -131,7 +131,7 @@ ->scalarNode('token_provider')->end() ->arrayNode('user_providers') ->beforeNormalization() - ->ifString()->then(function ($v) { return array($v); }) + ->ifString()->then(function ($v) { return [$v]; }) ->end() ->prototype('scalar')->end() ->end() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,9 +38,9 @@ $listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.remote_user')); $listener->replaceArgument(2, $id); $listener->replaceArgument(3, $config['user']); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); - return array($providerId, $listenerId, $defaultEntryPoint); + return [$providerId, $listenerId, $defaultEntryPoint]; } public function getPosition() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -57,8 +57,8 @@ $listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.simple_preauth')); $listener->replaceArgument(2, $id); $listener->replaceArgument(3, new Reference($config['authenticator'])); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); - return array($provider, $listenerId, null); + return [$provider, $listenerId, null]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,9 +39,9 @@ $listener->replaceArgument(2, $id); $listener->replaceArgument(3, $config['user']); $listener->replaceArgument(4, $config['credentials']); - $listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id))); + $listener->addMethodCall('setSessionAuthenticationStrategy', [new Reference('security.authentication.session_strategy.'.$id)]); - return array($providerId, $listenerId, $defaultEntryPoint); + return [$providerId, $listenerId, $defaultEntryPoint]; } public function getPosition() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,10 +28,10 @@ { $definition = $container->setDefinition($id, new ChildDefinition('security.user.provider.in_memory')); $defaultPassword = new Parameter('container.build_id'); - $users = array(); + $users = []; foreach ($config['users'] as $username => $user) { - $users[$username] = array('password' => null !== $user['password'] ? (string) $user['password'] : $defaultPassword, 'roles' => $user['roles']); + $users[$username] = ['password' => null !== $user['password'] ? (string) $user['password'] : $defaultPassword, 'roles' => $user['roles']]; } $definition->addArgument($users); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,20 +37,20 @@ */ class SecurityExtension extends Extension { - private $requestMatchers = array(); - private $expressions = array(); - private $contextListeners = array(); - private $listenerPositions = array('pre_auth', 'form', 'http', 'remember_me'); - private $factories = array(); - private $userProviderFactories = array(); + private $requestMatchers = []; + private $expressions = []; + private $contextListeners = []; + private $listenerPositions = ['pre_auth', 'form', 'http', 'remember_me']; + private $factories = []; + private $userProviderFactories = []; private $expressionLanguage; - private $logoutOnUserChangeByContextKey = array(); - private $statelessFirewallKeys = array(); + private $logoutOnUserChangeByContextKey = []; + private $statelessFirewallKeys = []; public function __construct() { foreach ($this->listenerPositions as $position) { - $this->factories[$position] = array(); + $this->factories[$position] = []; } } @@ -141,7 +141,7 @@ if (\PHP_VERSION_ID < 70000) { // add some required classes for compilation - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\Component\Security\Http\Firewall', 'Symfony\Component\Security\Core\User\UserProviderInterface', 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', @@ -152,7 +152,7 @@ 'Symfony\Bundle\SecurityBundle\Security\FirewallConfig', 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', 'Symfony\Component\HttpFoundation\RequestMatcher', - )); + ]); } } @@ -194,11 +194,11 @@ $container ->getDefinition('security.acl.dbal.schema_listener') - ->addTag('doctrine.event_listener', array( + ->addTag('doctrine.event_listener', [ 'connection' => $config['connection'], 'event' => 'postGenerateSchema', 'lazy' => true, - )) + ]) ; $container->getDefinition('security.acl.cache.doctrine')->addArgument($config['cache']['prefix']); @@ -229,9 +229,9 @@ } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Symfony\\Component\\Security\\Http\\AccessMap', - )); + ]); } foreach ($config['access_control'] as $access) { @@ -249,7 +249,7 @@ } $container->getDefinition('security.access_map') - ->addMethodCall('add', array($matcher, $attributes, $access['requires_channel'])); + ->addMethodCall('add', [$matcher, $attributes, $access['requires_channel']]); } } @@ -265,7 +265,7 @@ // make the ContextListener aware of the configured user providers $contextListenerDefinition = $container->getDefinition('security.context_listener'); $arguments = $contextListenerDefinition->getArguments(); - $userProviders = array(); + $userProviders = []; foreach ($providerIds as $userProviderId) { $userProviders[] = new Reference($userProviderId); } @@ -276,7 +276,7 @@ // load firewall map $mapDef = $container->getDefinition('security.firewall.map'); - $map = $authenticationProviders = $contextRefs = array(); + $map = $authenticationProviders = $contextRefs = []; foreach ($firewalls as $name => $firewall) { if (isset($firewall['user_checker']) && 'security.user_checker' !== $firewall['user_checker']) { $customUserChecker = true; @@ -329,7 +329,7 @@ } elseif (isset($firewall['pattern']) || isset($firewall['host'])) { $pattern = isset($firewall['pattern']) ? $firewall['pattern'] : null; $host = isset($firewall['host']) ? $firewall['host'] : null; - $methods = isset($firewall['methods']) ? $firewall['methods'] : array(); + $methods = isset($firewall['methods']) ? $firewall['methods'] : []; $matcher = $this->createRequestMatcher($container, $pattern, $host, $methods); } @@ -338,7 +338,7 @@ // Security disabled? if (false === $firewall['security']) { - return array($matcher, array(), null, null); + return [$matcher, [], null, null]; } $config->replaceArgument(4, $firewall['stateless']); @@ -357,8 +357,8 @@ $config->replaceArgument(5, $defaultProvider); // Register listeners - $listeners = array(); - $listenerKeys = array(); + $listeners = []; + $listenerKeys = []; // Channel listener $listeners[] = new Reference('security.channel_listener'); @@ -379,7 +379,7 @@ throw new InvalidConfigurationException(sprintf('Firewalls "%s" and "%s" need to have the same value for option "logout_on_user_change" as they are sharing the context "%s"', $this->logoutOnUserChangeByContextKey[$contextKey][0], $id, $contextKey)); } - $this->logoutOnUserChangeByContextKey[$contextKey] = array($id, $logoutOnUserChange); + $this->logoutOnUserChangeByContextKey[$contextKey] = [$id, $logoutOnUserChange]; $listeners[] = new Reference($this->createContextListener($container, $contextKey, $logoutOnUserChange)); $sessionStrategyId = 'security.authentication.session_strategy'; } else { @@ -395,11 +395,11 @@ if (isset($firewall['logout'])) { $logoutListenerId = 'security.logout_listener.'.$id; $logoutListener = $container->setDefinition($logoutListenerId, new ChildDefinition('security.logout_listener')); - $logoutListener->replaceArgument(3, array( + $logoutListener->replaceArgument(3, [ 'csrf_parameter' => $firewall['logout']['csrf_parameter'], 'csrf_token_id' => $firewall['logout']['csrf_token_id'], 'logout_path' => $firewall['logout']['path'], - )); + ]); // add logout success handler if (isset($firewall['logout']['success_handler'])) { @@ -418,7 +418,7 @@ // add session logout handler if (true === $firewall['logout']['invalidate_session'] && false === $firewall['stateless']) { - $logoutListener->addMethodCall('addHandler', array(new Reference('security.logout.handler.session'))); + $logoutListener->addMethodCall('addHandler', [new Reference('security.logout.handler.session')]); } // add cookie logout handler @@ -427,25 +427,25 @@ $cookieHandler = $container->setDefinition($cookieHandlerId, new ChildDefinition('security.logout.handler.cookie_clearing')); $cookieHandler->addArgument($firewall['logout']['delete_cookies']); - $logoutListener->addMethodCall('addHandler', array(new Reference($cookieHandlerId))); + $logoutListener->addMethodCall('addHandler', [new Reference($cookieHandlerId)]); } // add custom handlers foreach ($firewall['logout']['handlers'] as $handlerId) { - $logoutListener->addMethodCall('addHandler', array(new Reference($handlerId))); + $logoutListener->addMethodCall('addHandler', [new Reference($handlerId)]); } // register with LogoutUrlGenerator $container ->getDefinition('security.logout_url_generator') - ->addMethodCall('registerListener', array( + ->addMethodCall('registerListener', [ $id, $firewall['logout']['path'], $firewall['logout']['csrf_token_id'], $firewall['logout']['csrf_parameter'], isset($firewall['logout']['csrf_token_generator']) ? new Reference($firewall['logout']['csrf_token_generator']) : null, false === $firewall['stateless'] && isset($firewall['context']) ? $firewall['context'] : null, - )) + ]) ; } @@ -492,7 +492,7 @@ $config->replaceArgument(10, $listenerKeys); $config->replaceArgument(11, isset($firewall['switch_user']) ? $firewall['switch_user'] : null); - return array($matcher, $listeners, $exceptionListener, null !== $logoutListenerId ? new Reference($logoutListenerId) : null); + return [$matcher, $listeners, $exceptionListener, null !== $logoutListenerId ? new Reference($logoutListenerId) : null]; } private function createContextListener($container, $contextKey, $logoutUserOnChange) @@ -504,14 +504,14 @@ $listenerId = 'security.context_listener.'.\count($this->contextListeners); $listener = $container->setDefinition($listenerId, new ChildDefinition('security.context_listener')); $listener->replaceArgument(2, $contextKey); - $listener->addMethodCall('setLogoutOnUserChange', array($logoutUserOnChange)); + $listener->addMethodCall('setLogoutOnUserChange', [$logoutUserOnChange]); return $this->contextListeners[$contextKey] = $listenerId; } private function createAuthenticationListeners($container, $id, $firewall, &$authenticationProviders, $defaultProvider = null, array $providerIds, $defaultEntryPoint) { - $listeners = array(); + $listeners = []; $hasListeners = false; foreach ($this->listenerPositions as $position) { @@ -568,19 +568,19 @@ throw new InvalidConfigurationException(sprintf('No authentication listener registered for firewall "%s".', $id)); } - return array($listeners, $defaultEntryPoint); + return [$listeners, $defaultEntryPoint]; } private function createEncoders($encoders, ContainerBuilder $container) { - $encoderMap = array(); + $encoderMap = []; foreach ($encoders as $class => $encoder) { $encoderMap[$class] = $this->createEncoder($encoder, $container); } $container ->getDefinition('security.encoder_factory.generic') - ->setArguments(array($encoderMap)) + ->setArguments([$encoderMap]) ; } @@ -593,33 +593,33 @@ // plaintext encoder if ('plaintext' === $config['algorithm']) { - $arguments = array($config['ignore_case']); + $arguments = [$config['ignore_case']]; - return array( + return [ 'class' => 'Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder', 'arguments' => $arguments, - ); + ]; } // pbkdf2 encoder if ('pbkdf2' === $config['algorithm']) { - return array( + return [ 'class' => 'Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder', - 'arguments' => array( + 'arguments' => [ $config['hash_algorithm'], $config['encode_as_base64'], $config['iterations'], $config['key_length'], - ), - ); + ], + ]; } // bcrypt encoder if ('bcrypt' === $config['algorithm']) { - return array( + return [ 'class' => 'Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder', - 'arguments' => array($config['cost']), - ); + 'arguments' => [$config['cost']], + ]; } // Argon2i encoder @@ -628,10 +628,10 @@ throw new InvalidConfigurationException('Argon2i algorithm is not supported. Please install the libsodium extension or upgrade to PHP 7.2+.'); } - return array( + return [ 'class' => 'Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder', - 'arguments' => array(), - ); + 'arguments' => [], + ]; } // run-time configured encoder @@ -641,7 +641,7 @@ // Parses user providers and returns an array of their ids private function createUserProviders($config, ContainerBuilder $container) { - $providerIds = array(); + $providerIds = []; foreach ($config['providers'] as $name => $provider) { $id = $this->createUserDaoProvider($name, $provider, $container); $providerIds[str_replace('-', '_', $name)] = $id; @@ -675,7 +675,7 @@ // Chain provider if (isset($provider['chain'])) { - $providers = array(); + $providers = []; foreach ($provider['chain']['providers'] as $providerName) { $providers[] = new Reference($this->getUserProviderId($providerName)); } @@ -744,26 +744,26 @@ ->register($id, 'Symfony\Component\ExpressionLanguage\SerializedParsedExpression') ->setPublic(false) ->addArgument($expression) - ->addArgument(serialize($this->getExpressionLanguage()->parse($expression, array('token', 'user', 'object', 'roles', 'request', 'trust_resolver'))->getNodes())) + ->addArgument(serialize($this->getExpressionLanguage()->parse($expression, ['token', 'user', 'object', 'roles', 'request', 'trust_resolver'])->getNodes())) ; return $this->expressions[$id] = new Reference($id); } - private function createRequestMatcher($container, $path = null, $host = null, $methods = array(), $ip = null, array $attributes = array()) + private function createRequestMatcher($container, $path = null, $host = null, $methods = [], $ip = null, array $attributes = []) { if ($methods) { $methods = array_map('strtoupper', (array) $methods); } - $id = 'security.request_matcher.'.ContainerBuilder::hash(array($path, $host, $methods, $ip, $attributes)); + $id = 'security.request_matcher.'.ContainerBuilder::hash([$path, $host, $methods, $ip, $attributes]); if (isset($this->requestMatchers[$id])) { return $this->requestMatchers[$id]; } // only add arguments that are necessary - $arguments = array($path, $host, $methods, $ip, $attributes); + $arguments = [$path, $host, $methods, $ip, $attributes]; while (\count($arguments) > 0 && !end($arguments)) { array_pop($arguments); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallConfig.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallConfig.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallConfig.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallConfig.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,7 +43,7 @@ * @param string[] $listeners * @param array|null $switchUser */ - public function __construct($name, $userChecker, $requestMatcher = null, $securityEnabled = true, $stateless = false, $provider = null, $context = null, $entryPoint = null, $accessDeniedHandler = null, $accessDeniedUrl = null, $listeners = array(), $switchUser = null) + public function __construct($name, $userChecker, $requestMatcher = null, $securityEnabled = true, $stateless = false, $provider = null, $context = null, $entryPoint = null, $accessDeniedHandler = null, $accessDeniedUrl = null, $listeners = [], $switchUser = null) { $this->name = $name; $this->userChecker = $userChecker; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php 2019-02-03 12:23:08.000000000 +0000 @@ -57,7 +57,7 @@ { @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED); - return array($this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener()); + return [$this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener()]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php 2019-02-03 12:23:08.000000000 +0000 @@ -121,10 +121,10 @@ $context = $this->getFirewallContext($request); if (null === $context) { - return array(array(), null, null); + return [[], null, null]; } - return array($context->getListeners(), $context->getExceptionListener(), $context->getLogoutListener()); + return [$context->getListeners(), $context->getExceptionListener(), $context->getLogoutListener()]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -92,12 +92,12 @@ public function testCollectImpersonatedToken() { - $adminToken = new UsernamePasswordToken('yceruto', 'P4$$w0rD', 'provider', array('ROLE_ADMIN')); + $adminToken = new UsernamePasswordToken('yceruto', 'P4$$w0rD', 'provider', ['ROLE_ADMIN']); - $userRoles = array( + $userRoles = [ 'ROLE_USER', new SwitchUserRole('ROLE_PREVIOUS_ADMIN', $adminToken), - ); + ]; $tokenStorage = new TokenStorage(); $tokenStorage->setToken(new UsernamePasswordToken('hhamon', 'P4$$w0rD', 'provider', $userRoles)); @@ -112,8 +112,8 @@ $this->assertSame('yceruto', $collector->getImpersonatorUser()); $this->assertSame('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken', $collector->getTokenClass()->getValue()); $this->assertTrue($collector->supportsRoleHierarchy()); - $this->assertSame(array('ROLE_USER', 'ROLE_PREVIOUS_ADMIN'), $collector->getRoles()->getValue(true)); - $this->assertSame(array(), $collector->getInheritedRoles()->getValue(true)); + $this->assertSame(['ROLE_USER', 'ROLE_PREVIOUS_ADMIN'], $collector->getRoles()->getValue(true)); + $this->assertSame([], $collector->getInheritedRoles()->getValue(true)); $this->assertSame('hhamon', $collector->getUser()); } @@ -208,7 +208,7 @@ ->expects($this->once()) ->method('getListeners') ->with($request) - ->willReturn(array(array($listener), null)); + ->willReturn([[$listener], null]); $firewall = new TraceableFirewallListener($firewallMap, new EventDispatcher(), new LogoutUrlGenerator()); $firewall->onKernelRequest($event); @@ -223,43 +223,43 @@ public function provideRoles() { - return array( + return [ // Basic roles - array( - array('ROLE_USER'), - array('ROLE_USER'), - array(), - ), - array( - array(new Role('ROLE_USER')), - array('ROLE_USER'), - array(), - ), + [ + ['ROLE_USER'], + ['ROLE_USER'], + [], + ], + [ + [new Role('ROLE_USER')], + ['ROLE_USER'], + [], + ], // Inherited roles - array( - array('ROLE_ADMIN'), - array('ROLE_ADMIN'), - array('ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'), - ), - array( - array(new Role('ROLE_ADMIN')), - array('ROLE_ADMIN'), - array('ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'), - ), - array( - array('ROLE_ADMIN', 'ROLE_OPERATOR'), - array('ROLE_ADMIN', 'ROLE_OPERATOR'), - array('ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'), - ), - ); + [ + ['ROLE_ADMIN'], + ['ROLE_ADMIN'], + ['ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'], + ], + [ + [new Role('ROLE_ADMIN')], + ['ROLE_ADMIN'], + ['ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'], + ], + [ + ['ROLE_ADMIN', 'ROLE_OPERATOR'], + ['ROLE_ADMIN', 'ROLE_OPERATOR'], + ['ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'], + ], + ]; } private function getRoleHierarchy() { - return new RoleHierarchy(array( - 'ROLE_ADMIN' => array('ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'), - 'ROLE_OPERATOR' => array('ROLE_USER'), - )); + return new RoleHierarchy([ + 'ROLE_ADMIN' => ['ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH'], + 'ROLE_OPERATOR' => ['ROLE_USER'], + ]); } private function getRequest() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -51,7 +51,7 @@ ->expects($this->once()) ->method('getListeners') ->with($request) - ->willReturn(array(array($listener), null)); + ->willReturn([[$listener], null]); $firewall = new TraceableFirewallListener($firewallMap, new EventDispatcher(), new LogoutUrlGenerator()); $firewall->onKernelRequest($event); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ $container = new ContainerBuilder(); $container ->register('security.access.decision_manager', AccessDecisionManager::class) - ->addArgument(array()) + ->addArgument([]) ; $compilerPass = new AddSecurityVotersPass(); @@ -41,7 +41,7 @@ $container = new ContainerBuilder(); $container ->register('security.access.decision_manager', AccessDecisionManager::class) - ->addArgument(array()) + ->addArgument([]) ; $container ->register('no_prio_service', Voter::class) @@ -49,15 +49,15 @@ ; $container ->register('lowest_prio_service', Voter::class) - ->addTag('security.voter', array('priority' => 100)) + ->addTag('security.voter', ['priority' => 100]) ; $container ->register('highest_prio_service', Voter::class) - ->addTag('security.voter', array('priority' => 200)) + ->addTag('security.voter', ['priority' => 200]) ; $container ->register('zero_prio_service', Voter::class) - ->addTag('security.voter', array('priority' => 0)) + ->addTag('security.voter', ['priority' => 0]) ; $compilerPass = new AddSecurityVotersPass(); $compilerPass->process($container); @@ -78,7 +78,7 @@ $container = new ContainerBuilder(); $container ->register('security.access.decision_manager', AccessDecisionManager::class) - ->addArgument(array()) + ->addArgument([]) ; $container ->register('without_interface', VoterWithoutInterface::class) @@ -111,7 +111,7 @@ $container = new ContainerBuilder(); $container ->register('security.access.decision_manager', AccessDecisionManager::class) - ->addArgument(array()) + ->addArgument([]) ; $container ->register('without_method', 'stdClass') diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { public function testSessionCookie() { - $container = $this->createContainer(array('cookie_domain' => '.symfony.com.', 'cookie_secure' => true)); + $container = $this->createContainer(['cookie_domain' => '.symfony.com.', 'cookie_secure' => true]); $utils = $container->get('security.http_utils'); $request = Request::create('/', 'get'); @@ -37,7 +37,7 @@ public function testSessionNoDomain() { - $container = $this->createContainer(array('cookie_secure' => true)); + $container = $this->createContainer(['cookie_secure' => true]); $utils = $container->get('security.http_utils'); $request = Request::create('/', 'get'); @@ -52,7 +52,7 @@ public function testSessionNoSecure() { - $container = $this->createContainer(array('cookie_domain' => '.symfony.com.')); + $container = $this->createContainer(['cookie_domain' => '.symfony.com.']); $utils = $container->get('security.http_utils'); $request = Request::create('/', 'get'); @@ -67,7 +67,7 @@ public function testSessionNoSecureAndNoDomain() { - $container = $this->createContainer(array()); + $container = $this->createContainer([]); $utils = $container->get('security.http_utils'); $request = Request::create('/', 'get'); @@ -99,7 +99,7 @@ private function createContainer($sessionStorageOptions) { $container = new ContainerBuilder(); - $container->setParameter('kernel.bundles_metadata', array()); + $container->setParameter('kernel.bundles_metadata', []); $container->setParameter('kernel.cache_dir', __DIR__); $container->setParameter('kernel.charset', 'UTF-8'); $container->setParameter('kernel.container_class', 'cc'); @@ -113,15 +113,15 @@ $container->setParameter('request_listener.http_port', 80); $container->setParameter('request_listener.https_port', 443); - $config = array( - 'security' => array( - 'providers' => array('some_provider' => array('id' => 'foo')), - 'firewalls' => array('some_firewall' => array('security' => false)), - ), - ); + $config = [ + 'security' => [ + 'providers' => ['some_provider' => ['id' => 'foo']], + 'firewalls' => ['some_firewall' => ['security' => false]], + ], + ]; $ext = new FrameworkExtension(); - $ext->load(array('framework' => array('csrf_protection' => false)), $container); + $ext->load(['framework' => ['csrf_protection' => false]], $container); $ext = new SecurityExtension(); $ext->load($config, $container); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,11 +29,11 @@ public function testRolesHierarchy() { $container = $this->getContainer('container1'); - $this->assertEquals(array( - 'ROLE_ADMIN' => array('ROLE_USER'), - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), - 'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'), - ), $container->getParameter('security.role_hierarchy.roles')); + $this->assertEquals([ + 'ROLE_ADMIN' => ['ROLE_USER'], + 'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'], + 'ROLE_REMOTE' => ['ROLE_USER', 'ROLE_ADMIN'], + ], $container->getParameter('security.role_hierarchy.roles')); } /** @@ -43,11 +43,11 @@ public function testRolesHierarchyWithAcl() { $container = $this->getContainer('container1_with_acl'); - $this->assertEquals(array( - 'ROLE_ADMIN' => array('ROLE_USER'), - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), - 'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'), - ), $container->getParameter('security.role_hierarchy.roles')); + $this->assertEquals([ + 'ROLE_ADMIN' => ['ROLE_USER'], + 'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'], + 'ROLE_REMOTE' => ['ROLE_USER', 'ROLE_ADMIN'], + ], $container->getParameter('security.role_hierarchy.roles')); } public function testUserProviders() @@ -56,30 +56,30 @@ $providers = array_values(array_filter($container->getServiceIds(), function ($key) { return 0 === strpos($key, 'security.user.provider.concrete'); })); - $expectedProviders = array( + $expectedProviders = [ 'security.user.provider.concrete.default', 'security.user.provider.concrete.digest', 'security.user.provider.concrete.basic', 'security.user.provider.concrete.service', 'security.user.provider.concrete.chain', - ); + ]; - $this->assertEquals(array(), array_diff($expectedProviders, $providers)); - $this->assertEquals(array(), array_diff($providers, $expectedProviders)); + $this->assertEquals([], array_diff($expectedProviders, $providers)); + $this->assertEquals([], array_diff($providers, $expectedProviders)); // chain provider - $this->assertEquals(array(new IteratorArgument(array( + $this->assertEquals([new IteratorArgument([ new Reference('security.user.provider.concrete.service'), new Reference('security.user.provider.concrete.basic'), - ))), $container->getDefinition('security.user.provider.concrete.chain')->getArguments()); + ])], $container->getDefinition('security.user.provider.concrete.chain')->getArguments()); } public function testFirewalls() { $container = $this->getContainer('container1'); $arguments = $container->getDefinition('security.firewall.map')->getArguments(); - $listeners = array(); - $configs = array(); + $listeners = []; + $configs = []; foreach (array_keys($arguments[1]->getValues()) as $contextId) { $contextDef = $container->getDefinition($contextId); $arguments = $contextDef->getArguments(); @@ -94,14 +94,14 @@ $configs[0][2] = strtolower($configs[0][2]); $configs[2][2] = strtolower($configs[2][2]); - $this->assertEquals(array( - array( + $this->assertEquals([ + [ 'simple', 'security.user_checker', 'security.request_matcher.6tndozi', false, - ), - array( + ], + [ 'secure', 'security.user_checker', null, @@ -112,7 +112,7 @@ 'security.authentication.form_entry_point.secure', null, null, - array( + [ 'switch_user', 'x509', 'remote_user', @@ -120,14 +120,14 @@ 'http_basic', 'remember_me', 'anonymous', - ), - array( + ], + [ 'parameter' => '_switch_user', 'role' => 'ROLE_ALLOWED_TO_SWITCH', 'stateless' => true, - ), - ), - array( + ], + ], + [ 'host', 'security.user_checker', 'security.request_matcher.and0kk1', @@ -138,13 +138,13 @@ 'security.authentication.basic_entry_point.host', null, null, - array( + [ 'http_basic', 'anonymous', - ), + ], null, - ), - array( + ], + [ 'with_user_checker', 'app.user_checker', null, @@ -155,13 +155,13 @@ 'security.authentication.basic_entry_point.with_user_checker', null, null, - array( + [ 'http_basic', 'anonymous', - ), + ], null, - ), - array( + ], + [ 'simple_auth', 'security.user_checker', null, @@ -172,17 +172,17 @@ 'security.authentication.form_entry_point.simple_auth', null, null, - array( + [ 'simple_form', 'anonymous', - ), + ], null, - ), - ), $configs); + ], + ], $configs); - $this->assertEquals(array( - array(), - array( + $this->assertEquals([ + [], + [ 'security.channel_listener', 'security.authentication.listener.x509.secure', 'security.authentication.listener.remote_user.secure', @@ -192,29 +192,29 @@ 'security.authentication.listener.anonymous.secure', 'security.authentication.switchuser_listener.secure', 'security.access_listener', - ), - array( + ], + [ 'security.channel_listener', 'security.context_listener.0', 'security.authentication.listener.basic.host', 'security.authentication.listener.anonymous.host', 'security.access_listener', - ), - array( + ], + [ 'security.channel_listener', 'security.context_listener.1', 'security.authentication.listener.basic.with_user_checker', 'security.authentication.listener.anonymous.with_user_checker', 'security.access_listener', - ), - array( + ], + [ 'security.channel_listener', 'security.context_listener.2', 'security.authentication.listener.simple_form.simple_auth', 'security.authentication.listener.anonymous.simple_auth', 'security.access_listener', - ), - ), $listeners); + ], + ], $listeners); $this->assertFalse($container->hasAlias('Symfony\Component\Security\Core\User\UserCheckerInterface', 'No user checker alias is registered when custom user checker services are registered')); } @@ -226,8 +226,8 @@ { $container = $this->getContainer('container1_with_digest'); $arguments = $container->getDefinition('security.firewall.map')->getArguments(); - $listeners = array(); - $configs = array(); + $listeners = []; + $configs = []; foreach (array_keys($arguments[1]->getValues()) as $contextId) { $contextDef = $container->getDefinition($contextId); $arguments = $contextDef->getArguments(); @@ -242,14 +242,14 @@ $configs[0][2] = strtolower($configs[0][2]); $configs[2][2] = strtolower($configs[2][2]); - $this->assertEquals(array( - array( + $this->assertEquals([ + [ 'simple', 'security.user_checker', 'security.request_matcher.6tndozi', false, - ), - array( + ], + [ 'secure', 'security.user_checker', null, @@ -260,7 +260,7 @@ 'security.authentication.form_entry_point.secure', null, null, - array( + [ 'switch_user', 'x509', 'remote_user', @@ -269,14 +269,14 @@ 'http_digest', 'remember_me', 'anonymous', - ), - array( + ], + [ 'parameter' => '_switch_user', 'role' => 'ROLE_ALLOWED_TO_SWITCH', 'stateless' => true, - ), - ), - array( + ], + ], + [ 'host', 'security.user_checker', 'security.request_matcher.and0kk1', @@ -287,13 +287,13 @@ 'security.authentication.basic_entry_point.host', null, null, - array( + [ 'http_basic', 'anonymous', - ), + ], null, - ), - array( + ], + [ 'with_user_checker', 'app.user_checker', null, @@ -304,17 +304,17 @@ 'security.authentication.basic_entry_point.with_user_checker', null, null, - array( + [ 'http_basic', 'anonymous', - ), + ], null, - ), - ), $configs); + ], + ], $configs); - $this->assertEquals(array( - array(), - array( + $this->assertEquals([ + [], + [ 'security.channel_listener', 'security.authentication.listener.x509.secure', 'security.authentication.listener.remote_user.secure', @@ -325,22 +325,22 @@ 'security.authentication.listener.anonymous.secure', 'security.authentication.switchuser_listener.secure', 'security.access_listener', - ), - array( + ], + [ 'security.channel_listener', 'security.context_listener.0', 'security.authentication.listener.basic.host', 'security.authentication.listener.anonymous.host', 'security.access_listener', - ), - array( + ], + [ 'security.channel_listener', 'security.context_listener.1', 'security.authentication.listener.basic.with_user_checker', 'security.authentication.listener.anonymous.with_user_checker', 'security.access_listener', - ), - ), $listeners); + ], + ], $listeners); $this->assertFalse($container->hasAlias('Symfony\Component\Security\Core\User\UserCheckerInterface', 'No user checker alias is registered when custom user checker services are registered')); } @@ -350,7 +350,7 @@ $container = $this->getContainer('container1'); $arguments = $container->getDefinition('security.firewall.map')->getArguments(); - $matchers = array(); + $matchers = []; foreach ($arguments[1]->getValues() as $reference) { if ($reference instanceof Reference) { @@ -359,16 +359,16 @@ } } - $this->assertEquals(array( - array( + $this->assertEquals([ + [ '/login', - ), - array( + ], + [ '/test', 'foo\\.example\\.org', - array('GET', 'POST'), - ), - ), $matchers); + ['GET', 'POST'], + ], + ], $matchers); } public function testUserCheckerAliasIsRegistered() @@ -383,14 +383,14 @@ { $container = $this->getContainer('container1'); - $rules = array(); + $rules = []; foreach ($container->getDefinition('security.access_map')->getMethodCalls() as $call) { if ('add' == $call[0]) { - $rules[] = array((string) $call[1][0], $call[1][1], $call[1][2]); + $rules[] = [(string) $call[1][0], $call[1][1], $call[1][2]]; } } - $matcherIds = array(); + $matcherIds = []; foreach ($rules as list($matcherId, $attributes, $channel)) { $requestMatcher = $container->getDefinition($matcherId); @@ -399,17 +399,17 @@ $i = \count($matcherIds); if (1 === $i) { - $this->assertEquals(array('ROLE_USER'), $attributes); + $this->assertEquals(['ROLE_USER'], $attributes); $this->assertEquals('https', $channel); $this->assertEquals( - array('/blog/524', null, array('GET', 'POST')), + ['/blog/524', null, ['GET', 'POST']], $requestMatcher->getArguments() ); } elseif (2 === $i) { - $this->assertEquals(array('IS_AUTHENTICATED_ANONYMOUSLY'), $attributes); + $this->assertEquals(['IS_AUTHENTICATED_ANONYMOUSLY'], $attributes); $this->assertNull($channel); $this->assertEquals( - array('/blog/.*'), + ['/blog/.*'], $requestMatcher->getArguments() ); } elseif (3 === $i) { @@ -424,22 +424,22 @@ { $container = $this->getContainer('merge'); - $this->assertEquals(array( - 'FOO' => array('MOO'), - 'ADMIN' => array('USER'), - ), $container->getParameter('security.role_hierarchy.roles')); + $this->assertEquals([ + 'FOO' => ['MOO'], + 'ADMIN' => ['USER'], + ], $container->getParameter('security.role_hierarchy.roles')); } public function testEncoders() { $container = $this->getContainer('container1'); - $this->assertEquals(array(array( - 'JMS\FooBundle\Entity\User1' => array( + $this->assertEquals([[ + 'JMS\FooBundle\Entity\User1' => [ 'class' => 'Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder', - 'arguments' => array(false), - ), - 'JMS\FooBundle\Entity\User2' => array( + 'arguments' => [false], + ], + 'JMS\FooBundle\Entity\User2' => [ 'algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, @@ -447,8 +447,8 @@ 'key_length' => 40, 'ignore_case' => false, 'cost' => 13, - ), - 'JMS\FooBundle\Entity\User3' => array( + ], + 'JMS\FooBundle\Entity\User3' => [ 'algorithm' => 'md5', 'hash_algorithm' => 'sha512', 'key_length' => 40, @@ -456,17 +456,17 @@ 'encode_as_base64' => true, 'iterations' => 5000, 'cost' => 13, - ), + ], 'JMS\FooBundle\Entity\User4' => new Reference('security.encoder.foo'), - 'JMS\FooBundle\Entity\User5' => array( + 'JMS\FooBundle\Entity\User5' => [ 'class' => 'Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder', - 'arguments' => array('sha1', false, 5, 30), - ), - 'JMS\FooBundle\Entity\User6' => array( + 'arguments' => ['sha1', false, 5, 30], + ], + 'JMS\FooBundle\Entity\User6' => [ 'class' => 'Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder', - 'arguments' => array(15), - ), - )), $container->getDefinition('security.encoder_factory.generic')->getArguments()); + 'arguments' => [15], + ], + ]], $container->getDefinition('security.encoder_factory.generic')->getArguments()); } public function testArgon2iEncoder() @@ -475,10 +475,10 @@ $this->markTestSkipped('Argon2i algorithm is not supported.'); } - $this->assertSame(array(array('JMS\FooBundle\Entity\User7' => array( + $this->assertSame([['JMS\FooBundle\Entity\User7' => [ 'class' => 'Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder', - 'arguments' => array(), - ))), $this->getContainer('argon2i_encoder')->getDefinition('security.encoder_factory.generic')->getArguments()); + 'arguments' => [], + ]]], $this->getContainer('argon2i_encoder')->getDefinition('security.encoder_factory.generic')->getArguments()); } /** @@ -615,8 +615,8 @@ $bundle->build($container); // Attach all default factories $this->getLoader($container)->load($file); - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); return $container; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_customized_config.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_customized_config.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_customized_config.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_customized_config.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,20 +1,20 @@ loadFromExtension('security', array( - 'access_decision_manager' => array( +$container->loadFromExtension('security', [ + 'access_decision_manager' => [ 'allow_if_all_abstain' => true, 'allow_if_equal_granted_denied' => false, - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - ), - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - ), -)); + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + ], + 'firewalls' => [ + 'simple' => ['pattern' => '/login', 'security' => false], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_default_strategy.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_default_strategy.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_default_strategy.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_default_strategy.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,16 +1,16 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - ), - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - ), -)); +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + ], + 'firewalls' => [ + 'simple' => ['pattern' => '/login', 'security' => false], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service_and_strategy.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service_and_strategy.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service_and_strategy.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service_and_strategy.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,20 +1,20 @@ loadFromExtension('security', array( - 'access_decision_manager' => array( +$container->loadFromExtension('security', [ + 'access_decision_manager' => [ 'service' => 'app.access_decision_manager', 'strategy' => 'affirmative', - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - ), - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - ), -)); + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + ], + 'firewalls' => [ + 'simple' => ['pattern' => '/login', 'security' => false], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_service.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,19 +1,19 @@ loadFromExtension('security', array( - 'access_decision_manager' => array( +$container->loadFromExtension('security', [ + 'access_decision_manager' => [ 'service' => 'app.access_decision_manager', - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - ), - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - ), -)); + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + ], + 'firewalls' => [ + 'simple' => ['pattern' => '/login', 'security' => false], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,19 +1,19 @@ loadFromExtension('security', array( - 'encoders' => array( - 'JMS\FooBundle\Entity\User7' => array( +$container->loadFromExtension('security', [ + 'encoders' => [ + 'JMS\FooBundle\Entity\User7' => [ 'algorithm' => 'argon2i', - ), - ), - 'providers' => array( - 'default' => array('id' => 'foo'), - ), - 'firewalls' => array( - 'main' => array( + ], + ], + 'providers' => [ + 'default' => ['id' => 'foo'], + ], + 'firewalls' => [ + 'main' => [ 'form_login' => false, 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,112 +1,112 @@ loadFromExtension('security', array( - 'encoders' => array( +$container->loadFromExtension('security', [ + 'encoders' => [ 'JMS\FooBundle\Entity\User1' => 'plaintext', - 'JMS\FooBundle\Entity\User2' => array( + 'JMS\FooBundle\Entity\User2' => [ 'algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, - ), - 'JMS\FooBundle\Entity\User3' => array( + ], + 'JMS\FooBundle\Entity\User3' => [ 'algorithm' => 'md5', - ), - 'JMS\FooBundle\Entity\User4' => array( + ], + 'JMS\FooBundle\Entity\User4' => [ 'id' => 'security.encoder.foo', - ), - 'JMS\FooBundle\Entity\User5' => array( + ], + 'JMS\FooBundle\Entity\User5' => [ 'algorithm' => 'pbkdf2', 'hash_algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, 'key_length' => 30, - ), - 'JMS\FooBundle\Entity\User6' => array( + ], + 'JMS\FooBundle\Entity\User6' => [ 'algorithm' => 'bcrypt', 'cost' => 15, - ), - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - 'digest' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'), - ), - ), - ), - 'basic' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'), - 'bar' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => array('ROLE_USER', 'ROLE_ADMIN')), - ), - ), - ), - 'service' => array( + ], + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + 'digest' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'], + ], + ], + ], + 'basic' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'], + 'bar' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => ['ROLE_USER', 'ROLE_ADMIN']], + ], + ], + ], + 'service' => [ 'id' => 'user.manager', - ), - 'chain' => array( - 'chain' => array( - 'providers' => array('service', 'basic'), - ), - ), - ), + ], + 'chain' => [ + 'chain' => [ + 'providers' => ['service', 'basic'], + ], + ], + ], - 'firewalls' => array( - 'simple' => array('provider' => 'default', 'pattern' => '/login', 'security' => false), - 'secure' => array('stateless' => true, + 'firewalls' => [ + 'simple' => ['provider' => 'default', 'pattern' => '/login', 'security' => false], + 'secure' => ['stateless' => true, 'provider' => 'default', 'http_basic' => true, 'form_login' => true, 'anonymous' => true, - 'switch_user' => array('stateless' => true), + 'switch_user' => ['stateless' => true], 'x509' => true, 'remote_user' => true, 'logout' => true, - 'remember_me' => array('secret' => 'TheSecret'), + 'remember_me' => ['secret' => 'TheSecret'], 'user_checker' => null, 'logout_on_user_change' => true, - ), - 'host' => array( + ], + 'host' => [ 'provider' => 'default', 'pattern' => '/test', 'host' => 'foo\\.example\\.org', - 'methods' => array('GET', 'POST'), + 'methods' => ['GET', 'POST'], 'anonymous' => true, 'http_basic' => true, 'logout_on_user_change' => true, - ), - 'with_user_checker' => array( + ], + 'with_user_checker' => [ 'provider' => 'default', 'user_checker' => 'app.user_checker', 'anonymous' => true, 'http_basic' => true, 'logout_on_user_change' => true, - ), - 'simple_auth' => array( + ], + 'simple_auth' => [ 'provider' => 'default', 'anonymous' => true, - 'simple_form' => array('authenticator' => 'simple_authenticator'), + 'simple_form' => ['authenticator' => 'simple_authenticator'], 'logout_on_user_change' => true, - ), - ), + ], + ], - 'access_control' => array( - array('path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => array('get', 'POST')), - array('path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'), - array('path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"), - ), + 'access_control' => [ + ['path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => ['get', 'POST']], + ['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'], + ['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"], + ], - 'role_hierarchy' => array( + 'role_hierarchy' => [ 'ROLE_ADMIN' => 'ROLE_USER', - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), + 'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'], 'ROLE_REMOTE' => 'ROLE_USER,ROLE_ADMIN', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_acl.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_acl.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_acl.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_acl.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,105 +1,105 @@ loadFromExtension('security', array( - 'acl' => array(), - 'encoders' => array( +$container->loadFromExtension('security', [ + 'acl' => [], + 'encoders' => [ 'JMS\FooBundle\Entity\User1' => 'plaintext', - 'JMS\FooBundle\Entity\User2' => array( + 'JMS\FooBundle\Entity\User2' => [ 'algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, - ), - 'JMS\FooBundle\Entity\User3' => array( + ], + 'JMS\FooBundle\Entity\User3' => [ 'algorithm' => 'md5', - ), - 'JMS\FooBundle\Entity\User4' => array( + ], + 'JMS\FooBundle\Entity\User4' => [ 'id' => 'security.encoder.foo', - ), - 'JMS\FooBundle\Entity\User5' => array( + ], + 'JMS\FooBundle\Entity\User5' => [ 'algorithm' => 'pbkdf2', 'hash_algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, 'key_length' => 30, - ), - 'JMS\FooBundle\Entity\User6' => array( + ], + 'JMS\FooBundle\Entity\User6' => [ 'algorithm' => 'bcrypt', 'cost' => 15, - ), - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - 'digest' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'), - ), - ), - ), - 'basic' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'), - 'bar' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => array('ROLE_USER', 'ROLE_ADMIN')), - ), - ), - ), - 'service' => array( + ], + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + 'digest' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'], + ], + ], + ], + 'basic' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'], + 'bar' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => ['ROLE_USER', 'ROLE_ADMIN']], + ], + ], + ], + 'service' => [ 'id' => 'user.manager', - ), - 'chain' => array( - 'chain' => array( - 'providers' => array('service', 'basic'), - ), - ), - ), + ], + 'chain' => [ + 'chain' => [ + 'providers' => ['service', 'basic'], + ], + ], + ], - 'firewalls' => array( - 'simple' => array('provider' => 'default', 'pattern' => '/login', 'security' => false), - 'secure' => array('stateless' => true, + 'firewalls' => [ + 'simple' => ['provider' => 'default', 'pattern' => '/login', 'security' => false], + 'secure' => ['stateless' => true, 'provider' => 'default', 'http_basic' => true, - 'http_digest' => array('secret' => 'TheSecret'), + 'http_digest' => ['secret' => 'TheSecret'], 'form_login' => true, 'anonymous' => true, - 'switch_user' => array('stateless' => true), + 'switch_user' => ['stateless' => true], 'x509' => true, 'remote_user' => true, 'logout' => true, - 'remember_me' => array('secret' => 'TheSecret'), + 'remember_me' => ['secret' => 'TheSecret'], 'user_checker' => null, - ), - 'host' => array( + ], + 'host' => [ 'provider' => 'default', 'pattern' => '/test', 'host' => 'foo\\.example\\.org', - 'methods' => array('GET', 'POST'), + 'methods' => ['GET', 'POST'], 'anonymous' => true, 'http_basic' => true, - ), - 'with_user_checker' => array( + ], + 'with_user_checker' => [ 'provider' => 'default', 'user_checker' => 'app.user_checker', 'anonymous' => true, 'http_basic' => true, - ), - ), + ], + ], - 'access_control' => array( - array('path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => array('get', 'POST')), - array('path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'), - array('path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"), - ), + 'access_control' => [ + ['path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => ['get', 'POST']], + ['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'], + ['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"], + ], - 'role_hierarchy' => array( + 'role_hierarchy' => [ 'ROLE_ADMIN' => 'ROLE_USER', - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), + 'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'], 'ROLE_REMOTE' => 'ROLE_USER,ROLE_ADMIN', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_digest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_digest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_digest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1_with_digest.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,108 +1,108 @@ loadFromExtension('security', array( - 'acl' => array(), - 'encoders' => array( +$container->loadFromExtension('security', [ + 'acl' => [], + 'encoders' => [ 'JMS\FooBundle\Entity\User1' => 'plaintext', - 'JMS\FooBundle\Entity\User2' => array( + 'JMS\FooBundle\Entity\User2' => [ 'algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, - ), - 'JMS\FooBundle\Entity\User3' => array( + ], + 'JMS\FooBundle\Entity\User3' => [ 'algorithm' => 'md5', - ), - 'JMS\FooBundle\Entity\User4' => array( + ], + 'JMS\FooBundle\Entity\User4' => [ 'id' => 'security.encoder.foo', - ), - 'JMS\FooBundle\Entity\User5' => array( + ], + 'JMS\FooBundle\Entity\User5' => [ 'algorithm' => 'pbkdf2', 'hash_algorithm' => 'sha1', 'encode_as_base64' => false, 'iterations' => 5, 'key_length' => 30, - ), - 'JMS\FooBundle\Entity\User6' => array( + ], + 'JMS\FooBundle\Entity\User6' => [ 'algorithm' => 'bcrypt', 'cost' => 15, - ), - ), - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - 'digest' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'), - ), - ), - ), - 'basic' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'), - 'bar' => array('password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => array('ROLE_USER', 'ROLE_ADMIN')), - ), - ), - ), - 'service' => array( + ], + ], + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + 'digest' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'], + ], + ], + ], + 'basic' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'], + 'bar' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => ['ROLE_USER', 'ROLE_ADMIN']], + ], + ], + ], + 'service' => [ 'id' => 'user.manager', - ), - 'chain' => array( - 'chain' => array( - 'providers' => array('service', 'basic'), - ), - ), - ), + ], + 'chain' => [ + 'chain' => [ + 'providers' => ['service', 'basic'], + ], + ], + ], - 'firewalls' => array( - 'simple' => array('provider' => 'default', 'pattern' => '/login', 'security' => false), - 'secure' => array('stateless' => true, + 'firewalls' => [ + 'simple' => ['provider' => 'default', 'pattern' => '/login', 'security' => false], + 'secure' => ['stateless' => true, 'provider' => 'default', 'http_basic' => true, - 'http_digest' => array('secret' => 'TheSecret'), + 'http_digest' => ['secret' => 'TheSecret'], 'form_login' => true, 'anonymous' => true, - 'switch_user' => array('stateless' => true), + 'switch_user' => ['stateless' => true], 'x509' => true, 'remote_user' => true, 'logout' => true, - 'remember_me' => array('secret' => 'TheSecret'), + 'remember_me' => ['secret' => 'TheSecret'], 'user_checker' => null, 'logout_on_user_change' => true, - ), - 'host' => array( + ], + 'host' => [ 'provider' => 'default', 'pattern' => '/test', 'host' => 'foo\\.example\\.org', - 'methods' => array('GET', 'POST'), + 'methods' => ['GET', 'POST'], 'anonymous' => true, 'http_basic' => true, 'logout_on_user_change' => true, - ), - 'with_user_checker' => array( + ], + 'with_user_checker' => [ 'provider' => 'default', 'user_checker' => 'app.user_checker', 'anonymous' => true, 'http_basic' => true, 'logout_on_user_change' => true, - ), - ), + ], + ], - 'access_control' => array( - array('path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => array('get', 'POST')), - array('path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'), - array('path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"), - ), + 'access_control' => [ + ['path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => ['get', 'POST']], + ['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'], + ['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"], + ], - 'role_hierarchy' => array( + 'role_hierarchy' => [ 'ROLE_ADMIN' => 'ROLE_USER', - 'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'), + 'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'], 'ROLE_REMOTE' => 'ROLE_USER,ROLE_ADMIN', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,8 +2,8 @@ $this->load('container1.php', $container); -$container->loadFromExtension('security', array( - 'acl' => array( +$container->loadFromExtension('security', [ + 'acl' => [ 'provider' => 'foo', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,26 +1,26 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => $memory = array( - 'users' => array('foo' => array('password' => 'foo', 'roles' => 'ROLE_USER')), - ), - ), - 'with-dash' => array( +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => $memory = [ + 'users' => ['foo' => ['password' => 'foo', 'roles' => 'ROLE_USER']], + ], + ], + 'with-dash' => [ 'memory' => $memory, - ), - ), - 'firewalls' => array( - 'main' => array( + ], + ], + 'firewalls' => [ + 'main' => [ 'provider' => 'default', 'form_login' => true, 'logout_on_user_change' => true, - ), - 'other' => array( + ], + 'other' => [ 'provider' => 'with-dash', 'form_login' => true, 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,18 +1,18 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array('foo' => array('password' => 'foo', 'roles' => 'ROLE_USER')), - ), - ), - ), - 'firewalls' => array( - 'main' => array( +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => ['foo' => ['password' => 'foo', 'roles' => 'ROLE_USER']], + ], + ], + ], + 'firewalls' => [ + 'main' => [ 'provider' => 'undefined', 'form_login' => true, 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,17 +1,17 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array('foo' => array('password' => 'foo', 'roles' => 'ROLE_USER')), - ), - ), - ), - 'firewalls' => array( - 'main' => array( - 'form_login' => array('provider' => 'default'), +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => ['foo' => ['password' => 'foo', 'roles' => 'ROLE_USER']], + ], + ], + ], + 'firewalls' => [ + 'main' => [ + 'form_login' => ['provider' => 'default'], 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,17 +1,17 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array('foo' => array('password' => 'foo', 'roles' => 'ROLE_USER')), - ), - ), - ), - 'firewalls' => array( - 'main' => array( - 'form_login' => array('provider' => 'undefined'), +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => ['foo' => ['password' => 'foo', 'roles' => 'ROLE_USER']], + ], + ], + ], + 'firewalls' => [ + 'main' => [ + 'form_login' => ['provider' => 'undefined'], 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,16 +1,16 @@ loadFromExtension('security', array( - 'firewalls' => array( - 'main' => array( - 'form_login' => array( +$container->loadFromExtension('security', [ + 'firewalls' => [ + 'main' => [ + 'form_login' => [ 'login_path' => '/login', - ), + ], 'logout_on_user_change' => true, - ), - ), - 'role_hierarchy' => array( + ], + ], + 'role_hierarchy' => [ 'FOO' => 'BAR', 'ADMIN' => 'USER', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php 2019-02-03 12:23:08.000000000 +0000 @@ -2,20 +2,20 @@ $this->load('merge_import.php', $container); -$container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'main' => array( + 'firewalls' => [ + 'main' => [ 'form_login' => false, 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), + ], + ], - 'role_hierarchy' => array( - 'FOO' => array('MOO'), - ), -)); + 'role_hierarchy' => [ + 'FOO' => ['MOO'], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/no_custom_user_checker.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/no_custom_user_checker.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/no_custom_user_checker.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/no_custom_user_checker.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,28 +1,28 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array( - 'memory' => array( - 'users' => array( - 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - ), - ), - ), - ), - 'firewalls' => array( - 'simple' => array('pattern' => '/login', 'security' => false), - 'secure' => array( +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => [ + 'memory' => [ + 'users' => [ + 'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'], + ], + ], + ], + ], + 'firewalls' => [ + 'simple' => ['pattern' => '/login', 'security' => false], + 'secure' => [ 'stateless' => true, 'http_basic' => true, 'form_login' => true, 'anonymous' => true, - 'switch_user' => array('stateless' => true), + 'switch_user' => ['stateless' => true], 'x509' => true, 'remote_user' => true, 'logout' => true, - 'remember_me' => array('secret' => 'TheSecret'), + 'remember_me' => ['secret' => 'TheSecret'], 'user_checker' => null, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,19 +1,19 @@ loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), +$container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'main' => array( + 'firewalls' => [ + 'main' => [ 'form_login' => true, - 'remember_me' => array( + 'remember_me' => [ 'secret' => 'TheSecret', 'catch_exceptions' => false, 'token_provider' => 'token_provider_id', - ), + ], 'logout_on_user_change' => true, - ), - ), -)); + ], + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,32 +21,32 @@ * The minimal, required config needed to not have any required validation * issues. */ - protected static $minimalConfig = array( - 'providers' => array( - 'stub' => array( + protected static $minimalConfig = [ + 'providers' => [ + 'stub' => [ 'id' => 'foo', - ), - ), - 'firewalls' => array( - 'stub' => array(), + ], + ], + 'firewalls' => [ + 'stub' => [], 'logout_on_user_change' => true, - ), - ); + ], + ]; /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException */ public function testNoConfigForProvider() { - $config = array( - 'providers' => array( - 'stub' => array(), - ), - ); + $config = [ + 'providers' => [ + 'stub' => [], + ], + ]; $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $processor->processConfiguration($configuration, array($config)); + $configuration = new MainConfiguration([], []); + $processor->processConfiguration($configuration, [$config]); } /** @@ -54,38 +54,38 @@ */ public function testManyConfigForProvider() { - $config = array( - 'providers' => array( - 'stub' => array( + $config = [ + 'providers' => [ + 'stub' => [ 'id' => 'foo', - 'chain' => array(), - ), - ), - ); + 'chain' => [], + ], + ], + ]; $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $processor->processConfiguration($configuration, array($config)); + $configuration = new MainConfiguration([], []); + $processor->processConfiguration($configuration, [$config]); } public function testCsrfAliases() { - $config = array( - 'firewalls' => array( - 'stub' => array( - 'logout' => array( + $config = [ + 'firewalls' => [ + 'stub' => [ + 'logout' => [ 'csrf_token_generator' => 'a_token_generator', 'csrf_token_id' => 'a_token_id', - ), + ], 'logout_on_user_change' => true, - ), - ), - ); + ], + ], + ]; $config = array_merge(static::$minimalConfig, $config); $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $processedConfig = $processor->processConfiguration($configuration, array($config)); + $configuration = new MainConfiguration([], []); + $processedConfig = $processor->processConfiguration($configuration, [$config]); $this->assertArrayHasKey('csrf_token_generator', $processedConfig['firewalls']['stub']['logout']); $this->assertEquals('a_token_generator', $processedConfig['firewalls']['stub']['logout']['csrf_token_generator']); $this->assertArrayHasKey('csrf_token_id', $processedConfig['firewalls']['stub']['logout']); @@ -95,27 +95,27 @@ public function testDefaultUserCheckers() { $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $processedConfig = $processor->processConfiguration($configuration, array(static::$minimalConfig)); + $configuration = new MainConfiguration([], []); + $processedConfig = $processor->processConfiguration($configuration, [static::$minimalConfig]); $this->assertEquals('security.user_checker', $processedConfig['firewalls']['stub']['user_checker']); } public function testUserCheckers() { - $config = array( - 'firewalls' => array( - 'stub' => array( + $config = [ + 'firewalls' => [ + 'stub' => [ 'user_checker' => 'app.henk_checker', 'logout_on_user_change' => true, - ), - ), - ); + ], + ], + ]; $config = array_merge(static::$minimalConfig, $config); $processor = new Processor(); - $configuration = new MainConfiguration(array(), array()); - $processedConfig = $processor->processConfiguration($configuration, array($config)); + $configuration = new MainConfiguration([], []); + $processedConfig = $processor->processConfiguration($configuration, [$config]); $this->assertEquals('app.henk_checker', $processedConfig['firewalls']['stub']['user_checker']); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,13 +19,13 @@ { public function testCreate() { - list($container, $authProviderId, $listenerId, $entryPointId) = $this->callFactory('foo', array( + list($container, $authProviderId, $listenerId, $entryPointId) = $this->callFactory('foo', [ 'use_forward' => true, 'failure_path' => '/foo', 'success_handler' => 'custom_success_handler', 'failure_handler' => 'custom_failure_handler', 'remember_me' => true, - ), 'user_provider', 'entry_point'); + ], 'user_provider', 'entry_point'); // auth provider $this->assertEquals('auth_provider', $authProviderId); @@ -34,14 +34,14 @@ $this->assertEquals('abstract_listener.foo', $listenerId); $this->assertTrue($container->hasDefinition('abstract_listener.foo')); $definition = $container->getDefinition('abstract_listener.foo'); - $this->assertEquals(array( + $this->assertEquals([ 'index_4' => 'foo', 'index_5' => new Reference('security.authentication.success_handler.foo.abstract_factory'), 'index_6' => new Reference('security.authentication.failure_handler.foo.abstract_factory'), - 'index_7' => array( + 'index_7' => [ 'use_forward' => true, - ), - ), $definition->getArguments()); + ], + ], $definition->getArguments()); // entry point $this->assertEquals('entry_point', $entryPointId, '->create() does not change the default entry point.'); @@ -52,10 +52,10 @@ */ public function testDefaultFailureHandler($serviceId, $defaultHandlerInjection) { - $options = array( + $options = [ 'remember_me' => true, 'login_path' => '/bar', - ); + ]; if ($serviceId) { $options['failure_handler'] = $serviceId; @@ -71,7 +71,7 @@ $methodCalls = $failureHandler->getMethodCalls(); if ($defaultHandlerInjection) { $this->assertEquals('setOptions', $methodCalls[0][0]); - $this->assertEquals(array('login_path' => '/bar'), $methodCalls[0][1][0]); + $this->assertEquals(['login_path' => '/bar'], $methodCalls[0][1][0]); } else { $this->assertCount(0, $methodCalls); } @@ -79,10 +79,10 @@ public function getFailureHandlers() { - return array( - array(null, true), - array('custom_failure_handler', false), - ); + return [ + [null, true], + ['custom_failure_handler', false], + ]; } /** @@ -90,10 +90,10 @@ */ public function testDefaultSuccessHandler($serviceId, $defaultHandlerInjection) { - $options = array( + $options = [ 'remember_me' => true, 'default_target_path' => '/bar', - ); + ]; if ($serviceId) { $options['success_handler'] = $serviceId; @@ -109,9 +109,9 @@ if ($defaultHandlerInjection) { $this->assertEquals('setOptions', $methodCalls[0][0]); - $this->assertEquals(array('default_target_path' => '/bar'), $methodCalls[0][1][0]); + $this->assertEquals(['default_target_path' => '/bar'], $methodCalls[0][1][0]); $this->assertEquals('setProviderKey', $methodCalls[1][0]); - $this->assertEquals(array('foo'), $methodCalls[1][1]); + $this->assertEquals(['foo'], $methodCalls[1][1]); } else { $this->assertCount(0, $methodCalls); } @@ -119,15 +119,15 @@ public function getSuccessHandlers() { - return array( - array(null, true), - array('custom_success_handler', false), - ); + return [ + [null, true], + ['custom_success_handler', false], + ]; } protected function callFactory($id, $config, $userProviderId, $defaultEntryPointId) { - $factory = $this->getMockForAbstractClass('Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory', array()); + $factory = $this->getMockForAbstractClass('Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory', []); $factory ->expects($this->once()) @@ -152,6 +152,6 @@ list($authProviderId, $listenerId, $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId); - return array($container, $authProviderId, $listenerId, $entryPointId); + return [$container, $authProviderId, $listenerId, $entryPointId]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,44 +54,44 @@ public function getValidConfigurationTests() { - $tests = array(); + $tests = []; // completely basic - $tests[] = array( - array( - 'authenticators' => array('authenticator1', 'authenticator2'), + $tests[] = [ + [ + 'authenticators' => ['authenticator1', 'authenticator2'], 'provider' => 'some_provider', 'entry_point' => 'the_entry_point', - ), - array( - 'authenticators' => array('authenticator1', 'authenticator2'), + ], + [ + 'authenticators' => ['authenticator1', 'authenticator2'], 'provider' => 'some_provider', 'entry_point' => 'the_entry_point', - ), - ); + ], + ]; // testing xml config fix: authenticator -> authenticators - $tests[] = array( - array( - 'authenticator' => array('authenticator1', 'authenticator2'), - ), - array( - 'authenticators' => array('authenticator1', 'authenticator2'), + $tests[] = [ + [ + 'authenticator' => ['authenticator1', 'authenticator2'], + ], + [ + 'authenticators' => ['authenticator1', 'authenticator2'], 'entry_point' => null, - ), - ); + ], + ]; return $tests; } public function getInvalidConfigurationTests() { - $tests = array(); + $tests = []; // testing not empty - $tests[] = array( - array('authenticators' => array()), - ); + $tests[] = [ + ['authenticators' => []], + ]; return $tests; } @@ -99,33 +99,33 @@ public function testBasicCreate() { // simple configuration - $config = array( - 'authenticators' => array('authenticator123'), + $config = [ + 'authenticators' => ['authenticator123'], 'entry_point' => null, - ); + ]; list($container, $entryPointId) = $this->executeCreate($config, null); $this->assertEquals('authenticator123', $entryPointId); $providerDefinition = $container->getDefinition('security.authentication.provider.guard.my_firewall'); - $this->assertEquals(array( - 'index_0' => new IteratorArgument(array(new Reference('authenticator123'))), + $this->assertEquals([ + 'index_0' => new IteratorArgument([new Reference('authenticator123')]), 'index_1' => new Reference('my_user_provider'), 'index_2' => 'my_firewall', 'index_3' => new Reference('security.user_checker.my_firewall'), - ), $providerDefinition->getArguments()); + ], $providerDefinition->getArguments()); $listenerDefinition = $container->getDefinition('security.authentication.listener.guard.my_firewall'); $this->assertEquals('my_firewall', $listenerDefinition->getArgument(2)); - $this->assertEquals(array(new Reference('authenticator123')), $listenerDefinition->getArgument(3)->getValues()); + $this->assertEquals([new Reference('authenticator123')], $listenerDefinition->getArgument(3)->getValues()); } public function testExistingDefaultEntryPointUsed() { // any existing default entry point is used - $config = array( - 'authenticators' => array('authenticator123'), + $config = [ + 'authenticators' => ['authenticator123'], 'entry_point' => null, - ); + ]; list(, $entryPointId) = $this->executeCreate($config, 'some_default_entry_point'); $this->assertEquals('some_default_entry_point', $entryPointId); } @@ -136,10 +136,10 @@ public function testCannotOverrideDefaultEntryPoint() { // any existing default entry point is used - $config = array( - 'authenticators' => array('authenticator123'), + $config = [ + 'authenticators' => ['authenticator123'], 'entry_point' => 'authenticator123', - ); + ]; $this->executeCreate($config, 'some_default_entry_point'); } @@ -149,20 +149,20 @@ public function testMultipleAuthenticatorsRequiresEntryPoint() { // any existing default entry point is used - $config = array( - 'authenticators' => array('authenticator123', 'authenticatorABC'), + $config = [ + 'authenticators' => ['authenticator123', 'authenticatorABC'], 'entry_point' => null, - ); + ]; $this->executeCreate($config, null); } public function testCreateWithEntryPoint() { // any existing default entry point is used - $config = array( - 'authenticators' => array('authenticator123', 'authenticatorABC'), + $config = [ + 'authenticators' => ['authenticator123', 'authenticatorABC'], 'entry_point' => 'authenticatorABC', - ); + ]; list($container, $entryPointId) = $this->executeCreate($config, null); $this->assertEquals('authenticatorABC', $entryPointId); } @@ -178,6 +178,6 @@ $factory = new GuardAuthenticationFactory(); list($providerId, $listenerId, $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId); - return array($container, $entryPointId); + return [$container, $entryPointId]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,21 +27,21 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/secured_area/.*', - 'form_login' => array( + 'form_login' => [ 'check_path' => '/some_area/login_check', - ), + ], 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -54,18 +54,18 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/.*', 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -81,19 +81,19 @@ $extension = $container->getExtension('security'); $extension->addUserProviderFactory(new DummyProvider()); - $container->loadFromExtension('security', array( - 'providers' => array( - 'my_foo' => array('foo' => array()), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'my_foo' => ['foo' => []], + ], - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/.*', - 'http_basic' => array(), + 'http_basic' => [], 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -102,21 +102,21 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], 'role_hierarchy' => null, - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/.*', 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); @@ -127,29 +127,29 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '^/admin', 'http_basic' => null, 'logout_on_user_change' => true, - ), - 'stateless_firewall' => array( + ], + 'stateless_firewall' => [ 'pattern' => '/.*', 'stateless' => true, 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); $definition = $container->getDefinition('security.authentication.guard_handler'); - $this->assertSame(array('stateless_firewall'), $definition->getArgument(2)); + $this->assertSame(['stateless_firewall'], $definition->getArgument(2)); } /** @@ -160,28 +160,28 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), - 'firewalls' => array( - 'some_firewall' => array( + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/.*', 'http_basic' => null, 'logout_on_user_change' => false, - ), - 'some_other_firewall' => array( + ], + 'some_other_firewall' => [ 'pattern' => '/.*', 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); - $this->assertEquals(array(array('setLogoutOnUserChange', array(false))), $container->getDefinition('security.context_listener.0')->getMethodCalls()); - $this->assertEquals(array(array('setLogoutOnUserChange', array(true))), $container->getDefinition('security.context_listener.1')->getMethodCalls()); + $this->assertEquals([['setLogoutOnUserChange', [false]]], $container->getDefinition('security.context_listener.0')->getMethodCalls()); + $this->assertEquals([['setLogoutOnUserChange', [true]]], $container->getDefinition('security.context_listener.1')->getMethodCalls()); } /** @@ -193,25 +193,25 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), - 'firewalls' => array( - 'some_firewall' => array( + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], + 'firewalls' => [ + 'some_firewall' => [ 'pattern' => '/.*', 'http_basic' => null, 'context' => 'my_context', 'logout_on_user_change' => false, - ), - 'some_other_firewall' => array( + ], + 'some_other_firewall' => [ 'pattern' => '/.*', 'http_basic' => null, 'context' => 'my_context', 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -224,20 +224,20 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'default' => array('id' => 'foo'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'default' => ['id' => 'foo'], + ], - 'firewalls' => array( - 'some_firewall' => array( + 'firewalls' => [ + 'some_firewall' => [ 'stateless' => true, 'http_basic' => null, - 'switch_user' => array('stateless' => false), + 'switch_user' => ['stateless' => false], 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -250,19 +250,19 @@ { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'first' => array('id' => 'foo'), - 'second' => array('id' => 'bar'), - ), + $container->loadFromExtension('security', [ + 'providers' => [ + 'first' => ['id' => 'foo'], + 'second' => ['id' => 'bar'], + ], - 'firewalls' => array( - 'default' => array( + 'firewalls' => [ + 'default' => [ 'http_basic' => null, 'logout_on_user_change' => true, - ), - ), - )); + ], + ], + ]); $container->compile(); } @@ -270,19 +270,19 @@ public function testPerListenerProvider() { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'first' => array('id' => 'foo'), - 'second' => array('id' => 'bar'), - ), - - 'firewalls' => array( - 'default' => array( - 'http_basic' => array('provider' => 'second'), - 'logout_on_user_change' => true, - ), - ), - )); + $container->loadFromExtension('security', [ + 'providers' => [ + 'first' => ['id' => 'foo'], + 'second' => ['id' => 'bar'], + ], + + 'firewalls' => [ + 'default' => [ + 'http_basic' => ['provider' => 'second'], + 'logout_on_user_change' => true, + ], + ], + ]); $container->compile(); $this->addToAssertionCount(1); @@ -291,20 +291,20 @@ public function testPerListenerProviderWithRememberMe() { $container = $this->getRawContainer(); - $container->loadFromExtension('security', array( - 'providers' => array( - 'first' => array('id' => 'foo'), - 'second' => array('id' => 'bar'), - ), - - 'firewalls' => array( - 'default' => array( - 'form_login' => array('provider' => 'second'), - 'logout_on_user_change' => true, - 'remember_me' => array('secret' => 'baz'), - ), - ), - )); + $container->loadFromExtension('security', [ + 'providers' => [ + 'first' => ['id' => 'foo'], + 'second' => ['id' => 'bar'], + ], + + 'firewalls' => [ + 'default' => [ + 'form_login' => ['provider' => 'second'], + 'logout_on_user_change' => true, + 'remember_me' => ['secret' => 'baz'], + ], + ], + ]); $container->compile(); $this->addToAssertionCount(1); @@ -319,8 +319,8 @@ $bundle = new SecurityBundle(); $bundle->build($container); - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); return $container; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -return array( +return [ new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AclBundle\AclBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php 2019-02-03 12:23:08.000000000 +0000 @@ -92,7 +92,7 @@ public function serialize() { - return serialize(array($this->varDir, $this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug())); + return serialize([$this->varDir, $this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug()]); } public function unserialize($str) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AutowiringTypes/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AutowiringTypes/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AutowiringTypes/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AutowiringTypes/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -return array( +return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AutowiringBundle\AutowiringBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -return array( +return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\CsrfFormLoginBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -return array( +return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\FirewallEntryPointBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -return array( +return [ new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\JsonLoginBundle\JsonLoginBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; -return array( +return [ new FrameworkBundle(), new SecurityBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutWithoutSessionInvalidation/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutWithoutSessionInvalidation/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutWithoutSessionInvalidation/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutWithoutSessionInvalidation/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; -return array( +return [ new FrameworkBundle(), new SecurityBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -return array( +return [ new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/RememberMeLogout/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/RememberMeLogout/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/RememberMeLogout/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/RememberMeLogout/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -12,7 +12,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; -return array( +return [ new FrameworkBundle(), new SecurityBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/SecurityHelper/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/SecurityHelper/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/SecurityHelper/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/SecurityHelper/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -13,8 +13,8 @@ use Symfony\Bundle\SecurityBundle\SecurityBundle; use Symfony\Bundle\TwigBundle\TwigBundle; -return array( +return [ new FrameworkBundle(), new SecurityBundle(), new TwigBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php 2019-02-03 12:23:08.000000000 +0000 @@ -14,9 +14,9 @@ use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\FormLoginBundle; use Symfony\Bundle\TwigBundle\TwigBundle; -return array( +return [ new FrameworkBundle(), new SecurityBundle(), new TwigBundle(), new FormLoginBundle(), -); +]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticationCommencingTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,7 +15,7 @@ { public function testAuthenticationIsCommencingIfAccessDeniedExceptionIsWrapped() { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'config.yml']); $client->request('GET', '/secure-but-not-covered-by-access-control'); $this->assertRedirect($client->getResponse(), '/login'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AutowiringTypesTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AutowiringTypesTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AutowiringTypesTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/AutowiringTypesTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,21 +18,21 @@ { public function testAccessDecisionManagerAutowiring() { - static::bootKernel(array('debug' => false)); + static::bootKernel(['debug' => false]); $container = static::$kernel->getContainer(); $autowiredServices = $container->get('test.autowiring_types.autowired_services'); $this->assertInstanceOf(AccessDecisionManager::class, $autowiredServices->getAccessDecisionManager(), 'The security.access.decision_manager service should be injected in debug mode'); - static::bootKernel(array('debug' => true)); + static::bootKernel(['debug' => true]); $container = static::$kernel->getContainer(); $autowiredServices = $container->get('test.autowiring_types.autowired_services'); $this->assertInstanceOf(TraceableAccessDecisionManager::class, $autowiredServices->getAccessDecisionManager(), 'The debug.security.access.decision_manager service should be injected in non-debug mode'); } - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { - return parent::createKernel(array('test_case' => 'AutowiringTypes') + $options); + return parent::createKernel(['test_case' => 'AutowiringTypes'] + $options); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,9 +24,9 @@ { $form = $this->container->get('form.factory')->create('Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginType'); - return new Response($this->container->get('twig')->render('@CsrfFormLogin/Login/login.html.twig', array( + return new Response($this->container->get('twig')->render('@CsrfFormLogin/Login/login.html.twig', [ 'form' => $form->createView(), - ))); + ])); } public function afterLoginAction() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,9 +65,9 @@ $event->getForm()->addError(new FormError($error->getMessage())); } - $event->setData(array_replace((array) $event->getData(), array( + $event->setData(array_replace((array) $event->getData(), [ 'username' => $request->getSession()->get(Security::LAST_USERNAME), - ))); + ])); }); } @@ -80,8 +80,8 @@ * listener in order for the CSRF token to validate successfully. */ - $resolver->setDefaults(array( + $resolver->setDefaults([ 'csrf_token_id' => 'authenticate', - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,11 +30,11 @@ $error = $request->getSession()->get(Security::AUTHENTICATION_ERROR); } - return new Response($this->container->get('twig')->render('@FormLogin/Localized/login.html.twig', array( + return new Response($this->container->get('twig')->render('@FormLogin/Localized/login.html.twig', [ // last username entered by the user 'last_username' => $request->getSession()->get(Security::LAST_USERNAME), 'error' => $error, - ))); + ])); } public function loginCheckAction() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,16 +32,16 @@ $error = $request->getSession()->get(Security::AUTHENTICATION_ERROR); } - return new Response($this->container->get('twig')->render('@FormLogin/Login/login.html.twig', array( + return new Response($this->container->get('twig')->render('@FormLogin/Login/login.html.twig', [ // last username entered by the user 'last_username' => $request->getSession()->get(Security::LAST_USERNAME), 'error' => $error, - ))); + ])); } public function afterLoginAction(UserInterface $user) { - return new Response($this->container->get('twig')->render('@FormLogin/Login/after_login.html.twig', array('user' => $user))); + return new Response($this->container->get('twig')->render('@FormLogin/Login/after_login.html.twig', ['user' => $user])); } public function loginCheckAction() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,6 +29,6 @@ public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { - return new RedirectResponse($this->router->generate('localized_login_path', array(), UrlGeneratorInterface::ABSOLUTE_URL)); + return new RedirectResponse($this->router->generate('localized_login_path', [], UrlGeneratorInterface::ABSOLUTE_URL)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Controller/TestController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Controller/TestController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Controller/TestController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Controller/TestController.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,6 +21,6 @@ { public function loginCheckAction(UserInterface $user) { - return new JsonResponse(array('message' => sprintf('Welcome @%s!', $user->getUsername()))); + return new JsonResponse(['message' => sprintf('Welcome @%s!', $user->getUsername())]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationFailureHandler.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationFailureHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationFailureHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationFailureHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,6 +20,6 @@ { public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { - return new JsonResponse(array('message' => 'Something went wrong'), 500); + return new JsonResponse(['message' => 'Something went wrong'], 500); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,6 +20,6 @@ { public function onAuthenticationSuccess(Request $request, TokenInterface $token) { - return new JsonResponse(array('message' => sprintf('Good game @%s!', $token->getUsername()))); + return new JsonResponse(['message' => sprintf('Good game @%s!', $token->getUsername())]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testFormLoginAndLogoutWithCsrfTokens($config) { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'CsrfFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['user_login[username]'] = 'johannes'; @@ -48,7 +48,7 @@ */ public function testFormLoginWithInvalidCsrfToken($config) { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'CsrfFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['user_login[_token]'] = ''; @@ -65,7 +65,7 @@ */ public function testFormLoginWithCustomTargetPath($config) { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'CsrfFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['user_login[username]'] = 'johannes'; @@ -85,7 +85,7 @@ */ public function testFormLoginRedirectsToProtectedResourceAfterLogin($config) { - $client = $this->createClient(array('test_case' => 'CsrfFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'CsrfFormLogin', 'root_config' => $config]); $client->request('GET', '/protected-resource'); $this->assertRedirect($client->getResponse(), '/login'); @@ -103,9 +103,9 @@ public function getConfigs() { - return array( - array('config.yml'), - array('routes_as_path.yml'), - ); + return [ + ['config.yml'], + ['routes_as_path.yml'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -17,12 +17,12 @@ { public function testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials() { - $client = $this->createClient(array('test_case' => 'FirewallEntryPoint')); + $client = $this->createClient(['test_case' => 'FirewallEntryPoint']); - $client->request('GET', '/secure/resource', array(), array(), array( + $client->request('GET', '/secure/resource', [], [], [ 'PHP_AUTH_USER' => 'unknown', 'PHP_AUTH_PW' => 'credentials', - )); + ]); $this->assertEquals( EntryPointStub::RESPONSE_TEXT, @@ -33,7 +33,7 @@ public function testItUsesTheConfiguredEntryPointFromTheExceptionListenerWithFormLoginAndNoCredentials() { - $client = $this->createClient(array('test_case' => 'FirewallEntryPoint', 'root_config' => 'config_form_login.yml')); + $client = $this->createClient(['test_case' => 'FirewallEntryPoint', 'root_config' => 'config_form_login.yml']); $client->request('GET', '/secure/resource'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testFormLogin($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['_username'] = 'johannes'; @@ -37,7 +37,7 @@ */ public function testFormLogout($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['_username'] = 'johannes'; @@ -70,7 +70,7 @@ */ public function testFormLoginWithCustomTargetPath($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['_username'] = 'johannes'; @@ -90,7 +90,7 @@ */ public function testFormLoginRedirectsToProtectedResourceAfterLogin($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $client->request('GET', '/protected_resource'); $this->assertRedirect($client->getResponse(), '/login'); @@ -108,9 +108,9 @@ public function getConfigs() { - return array( - array('config.yml'), - array('routes_as_path.yml'), - ); + return [ + ['config.yml'], + ['routes_as_path.yml'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,56 +20,56 @@ { public function testDefaultJsonLoginSuccess() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'config.yml')); - $client->request('POST', '/chk', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{"user": {"login": "dunglas", "password": "foo"}}'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'config.yml']); + $client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], '{"user": {"login": "dunglas", "password": "foo"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame(array('message' => 'Welcome @dunglas!'), json_decode($response->getContent(), true)); + $this->assertSame(['message' => 'Welcome @dunglas!'], json_decode($response->getContent(), true)); } public function testDefaultJsonLoginFailure() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'config.yml')); - $client->request('POST', '/chk', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{"user": {"login": "dunglas", "password": "bad"}}'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'config.yml']); + $client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], '{"user": {"login": "dunglas", "password": "bad"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertSame(401, $response->getStatusCode()); - $this->assertSame(array('error' => 'Invalid credentials.'), json_decode($response->getContent(), true)); + $this->assertSame(['error' => 'Invalid credentials.'], json_decode($response->getContent(), true)); } public function testCustomJsonLoginSuccess() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'custom_handlers.yml')); - $client->request('POST', '/chk', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{"user": {"login": "dunglas", "password": "foo"}}'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'custom_handlers.yml']); + $client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], '{"user": {"login": "dunglas", "password": "foo"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame(array('message' => 'Good game @dunglas!'), json_decode($response->getContent(), true)); + $this->assertSame(['message' => 'Good game @dunglas!'], json_decode($response->getContent(), true)); } public function testCustomJsonLoginFailure() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'custom_handlers.yml')); - $client->request('POST', '/chk', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{"user": {"login": "dunglas", "password": "bad"}}'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'custom_handlers.yml']); + $client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], '{"user": {"login": "dunglas", "password": "bad"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertSame(500, $response->getStatusCode()); - $this->assertSame(array('message' => 'Something went wrong'), json_decode($response->getContent(), true)); + $this->assertSame(['message' => 'Something went wrong'], json_decode($response->getContent(), true)); } public function testDefaultJsonLoginBadRequest() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'config.yml')); - $client->request('POST', '/chk', array(), array(), array('CONTENT_TYPE' => 'application/json'), 'Not a json content'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'config.yml']); + $client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], 'Not a json content'); $response = $client->getResponse(); $this->assertSame(400, $response->getStatusCode()); $this->assertSame('application/json', $response->headers->get('Content-Type')); - $this->assertArraySubset(array('error' => array('code' => 400, 'message' => 'Bad Request')), json_decode($response->getContent(), true)); + $this->assertArraySubset(['error' => ['code' => 400, 'message' => 'Bad Request']], json_decode($response->getContent(), true)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testLoginLogoutProcedure($locale) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml']); $crawler = $client->request('GET', '/'.$locale.'/login'); $form = $crawler->selectButton('login')->form(); @@ -39,7 +39,7 @@ */ public function testLoginFailureWithLocalizedFailurePath($locale) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_form_failure_handler.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'localized_form_failure_handler.yml']); $crawler = $client->request('GET', '/'.$locale.'/login'); $form = $crawler->selectButton('login')->form(); @@ -55,7 +55,7 @@ */ public function testAccessRestrictedResource($locale) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml']); $client->request('GET', '/'.$locale.'/secure/'); $this->assertRedirect($client->getResponse(), '/'.$locale.'/login'); @@ -66,7 +66,7 @@ */ public function testAccessRestrictedResourceWithForward($locale) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes_with_forward.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes_with_forward.yml']); $crawler = $client->request('GET', '/'.$locale.'/secure/'); $this->assertCount(1, $crawler->selectButton('login'), (string) $client->getResponse()); @@ -74,6 +74,6 @@ public function getLocales() { - return array(array('en'), array('de')); + return [['en'], ['de']]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,12 +15,12 @@ { public function testSessionLessRememberMeLogout() { - $client = $this->createClient(array('test_case' => 'RememberMeLogout', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'RememberMeLogout', 'root_config' => 'config.yml']); - $client->request('POST', '/login', array( + $client->request('POST', '/login', [ '_username' => 'johannes', '_password' => 'test', - )); + ]); $cookieJar = $client->getCookieJar(); $cookieJar->expire(session_name()); @@ -34,13 +34,13 @@ public function testCsrfTokensAreClearedOnLogout() { - $client = $this->createClient(array('test_case' => 'LogoutWithoutSessionInvalidation', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'LogoutWithoutSessionInvalidation', 'root_config' => 'config.yml']); static::$kernel->getContainer()->get('test.security.csrf.token_storage')->setToken('foo', 'bar'); - $client->request('POST', '/login', array( + $client->request('POST', '/login', [ '_username' => 'johannes', '_password' => 'test', - )); + ]); $this->assertTrue(static::$kernel->getContainer()->get('test.security.csrf.token_storage')->hasToken('foo')); $this->assertSame('bar', static::$kernel->getContainer()->get('test.security.csrf.token_storage')->getToken('foo')); @@ -52,9 +52,9 @@ public function testAccessControlDoesNotApplyOnLogout() { - $client = $this->createClient(array('test_case' => 'LogoutAccess', 'root_config' => 'config.yml')); + $client = $this->createClient(['test_case' => 'LogoutAccess', 'root_config' => 'config.yml']); - $client->request('POST', '/login', array('_username' => 'johannes', '_password' => 'test')); + $client->request('POST', '/login', ['_username' => 'johannes', '_password' => 'test']); $client->request('GET', '/logout'); $this->assertRedirect($client->getResponse(), '/'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ public function testRoutingErrorIsNotExposedForProtectedResourceWhenAnonymous($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $client->request('GET', '/protected_resource'); $this->assertRedirect($client->getResponse(), '/login'); @@ -29,7 +29,7 @@ */ public function testRoutingErrorIsExposedWhenNotProtected($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $client->request('GET', '/unprotected_resource'); $this->assertEquals(404, $client->getResponse()->getStatusCode(), (string) $client->getResponse()); @@ -40,7 +40,7 @@ */ public function testRoutingErrorIsNotExposedForProtectedResourceWhenLoggedInWithInsufficientRights($config) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config]); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['_username'] = 'johannes'; @@ -57,8 +57,8 @@ */ public function testSecurityConfigurationForSingleIPAddress($config) { - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '10.10.10.10')); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '10.10.20.10')); + $allowedClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['REMOTE_ADDR' => '10.10.10.10']); + $barredClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['REMOTE_ADDR' => '10.10.20.10']); $this->assertAllowed($allowedClient, '/secured-by-one-ip'); $this->assertRestricted($barredClient, '/secured-by-one-ip'); @@ -69,9 +69,9 @@ */ public function testSecurityConfigurationForMultipleIPAddresses($config) { - $allowedClientA = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '1.1.1.1')); - $allowedClientB = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '2.2.2.2')); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '192.168.1.1')); + $allowedClientA = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['REMOTE_ADDR' => '1.1.1.1']); + $allowedClientB = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['REMOTE_ADDR' => '2.2.2.2']); + $barredClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['REMOTE_ADDR' => '192.168.1.1']); $this->assertAllowed($allowedClientA, '/secured-by-two-ips'); $this->assertAllowed($allowedClientB, '/secured-by-two-ips'); @@ -83,13 +83,13 @@ */ public function testSecurityConfigurationForExpression($config) { - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0')); + $allowedClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], ['HTTP_USER_AGENT' => 'Firefox 1.0']); $this->assertAllowed($allowedClient, '/protected-via-expression'); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + $barredClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], []); $this->assertRestricted($barredClient, '/protected-via-expression'); - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + $allowedClient = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => $config], []); $allowedClient->request('GET', '/protected-via-expression'); $form = $allowedClient->followRedirect()->selectButton('login')->form(); @@ -114,6 +114,6 @@ public function getConfigs() { - return array(array('config.yml'), array('routes_as_path.yml')); + return [['config.yml'], ['routes_as_path.yml']]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,13 +18,13 @@ { public function testServiceIsFunctional() { - $kernel = self::createKernel(array('test_case' => 'SecurityHelper', 'root_config' => 'config.yml')); + $kernel = self::createKernel(['test_case' => 'SecurityHelper', 'root_config' => 'config.yml']); $kernel->boot(); $container = $kernel->getContainer(); // put a token into the storage so the final calls can function $user = new User('foo', 'pass'); - $token = new UsernamePasswordToken($user, '', 'provider', array('ROLE_USER')); + $token = new UsernamePasswordToken($user, '', 'provider', ['ROLE_USER']); $container->get('security.token_storage')->setToken($token); $security = $container->get('functional_test.security.helper'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,11 +53,11 @@ $setAclCommand = $application->find('acl:set'); $setAclCommandTester = new CommandTester($setAclCommand); - $setAclCommandTester->execute(array( + $setAclCommandTester->execute([ 'command' => 'acl:set', - 'arguments' => array($grantedPermission1, $grantedPermission2, sprintf('%s:%s', self::OBJECT_CLASS, $objectId)), - '--user' => array(sprintf('%s:%s', self::SECURITY_CLASS, $securityUsername1), sprintf('%s:%s', self::SECURITY_CLASS, $securityUsername2)), - )); + 'arguments' => [$grantedPermission1, $grantedPermission2, sprintf('%s:%s', self::OBJECT_CLASS, $objectId)], + '--user' => [sprintf('%s:%s', self::SECURITY_CLASS, $securityUsername1), sprintf('%s:%s', self::SECURITY_CLASS, $securityUsername2)], + ]); $objectIdentity = new ObjectIdentity($objectId, self::OBJECT_CLASS); $securityIdentity1 = new UserSecurityIdentity($securityUsername1, self::SECURITY_CLASS); @@ -66,20 +66,20 @@ /** @var \Symfony\Component\Security\Acl\Model\AclProviderInterface $aclProvider */ $aclProvider = $application->getKernel()->getContainer()->get('test.security.acl.provider'); - $acl = $aclProvider->findAcl($objectIdentity, array($securityIdentity1)); + $acl = $aclProvider->findAcl($objectIdentity, [$securityIdentity1]); - $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission1, null), array($securityIdentity1))); - $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission1, null), array($securityIdentity2))); - $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission2, null), array($securityIdentity2))); + $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission1, null), [$securityIdentity1])); + $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission1, null), [$securityIdentity2])); + $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission2, null), [$securityIdentity2])); try { - $acl->isGranted($permissionMap->getMasks('OWNER', null), array($securityIdentity1)); + $acl->isGranted($permissionMap->getMasks('OWNER', null), [$securityIdentity1]); $this->fail('NoAceFoundException not throwed'); } catch (NoAceFoundException $e) { } try { - $acl->isGranted($permissionMap->getMasks('OPERATOR', null), array($securityIdentity2)); + $acl->isGranted($permissionMap->getMasks('OPERATOR', null), [$securityIdentity2]); $this->fail('NoAceFoundException not throwed'); } catch (NoAceFoundException $e) { } @@ -97,11 +97,11 @@ $setAclCommand = $application->find('acl:set'); $setAclCommandTester = new CommandTester($setAclCommand); - $setAclCommandTester->execute(array( + $setAclCommandTester->execute([ 'command' => 'acl:set', - 'arguments' => array($grantedPermission, sprintf('%s:%s', str_replace('\\', '/', self::OBJECT_CLASS), $objectId)), - '--role' => array($role), - )); + 'arguments' => [$grantedPermission, sprintf('%s:%s', str_replace('\\', '/', self::OBJECT_CLASS), $objectId)], + '--role' => [$role], + ]); $objectIdentity = new ObjectIdentity($objectId, self::OBJECT_CLASS); $userSecurityIdentity = new UserSecurityIdentity($securityUsername, self::SECURITY_CLASS); @@ -110,19 +110,19 @@ /** @var \Symfony\Component\Security\Acl\Model\AclProviderInterface $aclProvider */ $aclProvider = $application->getKernel()->getContainer()->get('test.security.acl.provider'); - $acl = $aclProvider->findAcl($objectIdentity, array($roleSecurityIdentity, $userSecurityIdentity)); + $acl = $aclProvider->findAcl($objectIdentity, [$roleSecurityIdentity, $userSecurityIdentity]); - $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity))); - $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity))); + $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission, null), [$roleSecurityIdentity])); + $this->assertTrue($acl->isGranted($permissionMap->getMasks($grantedPermission, null), [$roleSecurityIdentity])); try { - $acl->isGranted($permissionMap->getMasks('VIEW', null), array($userSecurityIdentity)); + $acl->isGranted($permissionMap->getMasks('VIEW', null), [$userSecurityIdentity]); $this->fail('NoAceFoundException not throwed'); } catch (NoAceFoundException $e) { } try { - $acl->isGranted($permissionMap->getMasks('OPERATOR', null), array($userSecurityIdentity)); + $acl->isGranted($permissionMap->getMasks('OPERATOR', null), [$userSecurityIdentity]); $this->fail('NoAceFoundException not throwed'); } catch (NoAceFoundException $e) { } @@ -139,12 +139,12 @@ $setAclCommand = $application->find('acl:set'); $setAclCommandTester = new CommandTester($setAclCommand); - $setAclCommandTester->execute(array( + $setAclCommandTester->execute([ 'command' => 'acl:set', - 'arguments' => array($grantedPermission, sprintf('%s:%s', self::OBJECT_CLASS, $objectId)), + 'arguments' => [$grantedPermission, sprintf('%s:%s', self::OBJECT_CLASS, $objectId)], '--class-scope' => true, - '--role' => array($role), - )); + '--role' => [$role], + ]); $objectIdentity1 = new ObjectIdentity($objectId, self::OBJECT_CLASS); $objectIdentity2 = new ObjectIdentity(2, self::OBJECT_CLASS); @@ -154,23 +154,23 @@ /** @var \Symfony\Component\Security\Acl\Model\AclProviderInterface $aclProvider */ $aclProvider = $application->getKernel()->getContainer()->get('test.security.acl.provider'); - $acl1 = $aclProvider->findAcl($objectIdentity1, array($roleSecurityIdentity)); - $this->assertTrue($acl1->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity))); + $acl1 = $aclProvider->findAcl($objectIdentity1, [$roleSecurityIdentity]); + $this->assertTrue($acl1->isGranted($permissionMap->getMasks($grantedPermission, null), [$roleSecurityIdentity])); $acl2 = $aclProvider->createAcl($objectIdentity2); - $this->assertTrue($acl2->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity))); + $this->assertTrue($acl2->isGranted($permissionMap->getMasks($grantedPermission, null), [$roleSecurityIdentity])); } private function getApplication() { - $kernel = $this->createKernel(array('test_case' => 'Acl')); + $kernel = $this->createKernel(['test_case' => 'Acl']); $kernel->boot(); $application = new Application($kernel); $initAclCommand = $application->find('init:acl'); $initAclCommandTester = new CommandTester($initAclCommand); - $initAclCommandTester->execute(array('command' => 'init:acl')); + $initAclCommandTester->execute(['command' => 'init:acl']); return $application; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,29 +53,29 @@ public function testSwitchUserStateless() { - $client = $this->createClient(array('test_case' => 'JsonLogin', 'root_config' => 'switchuser_stateless.yml')); - $client->request('POST', '/chk', array(), array(), array('HTTP_X_SWITCH_USER' => 'dunglas', 'CONTENT_TYPE' => 'application/json'), '{"user": {"login": "user_can_switch", "password": "test"}}'); + $client = $this->createClient(['test_case' => 'JsonLogin', 'root_config' => 'switchuser_stateless.yml']); + $client->request('POST', '/chk', [], [], ['HTTP_X_SWITCH_USER' => 'dunglas', 'CONTENT_TYPE' => 'application/json'], '{"user": {"login": "user_can_switch", "password": "test"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame(array('message' => 'Welcome @dunglas!'), json_decode($response->getContent(), true)); + $this->assertSame(['message' => 'Welcome @dunglas!'], json_decode($response->getContent(), true)); $this->assertSame('dunglas', $client->getProfile()->getCollector('security')->getUser()); } public function getTestParameters() { - return array( - 'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403), - 'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200), - 'authorized_user_cannot_switch_to_non_existent' => array('user_can_switch', 'user_does_not_exist', 'user_can_switch', 500), - 'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200), - ); + return [ + 'unauthorized_user_cannot_switch' => ['user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403], + 'authorized_user_can_switch' => ['user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200], + 'authorized_user_cannot_switch_to_non_existent' => ['user_can_switch', 'user_does_not_exist', 'user_can_switch', 500], + 'authorized_user_can_switch_to_himself' => ['user_can_switch', 'user_can_switch', 'user_can_switch', 200], + ]; } protected function createAuthenticatedClient($username) { - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => 'switchuser.yml')); + $client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'switchuser.yml']); $client->followRedirects(true); $form = $client->request('GET', '/login')->selectButton('login')->form(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,12 +32,12 @@ public function testEncodePasswordEmptySalt() { - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', 'user-class' => 'Symfony\Component\Security\Core\User\User', '--empty-salt' => true, - ), array('decorated' => false)); + ], ['decorated' => false]); $expected = str_replace("\n", PHP_EOL, file_get_contents(__DIR__.'/app/PasswordEncode/emptysalt.txt')); $this->assertEquals($expected, $this->passwordEncoderCommandTester->getDisplay()); @@ -45,9 +45,9 @@ public function testEncodeNoPasswordNoInteraction() { - $statusCode = $this->passwordEncoderCommandTester->execute(array( + $statusCode = $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', - ), array('interactive' => false)); + ], ['interactive' => false]); $this->assertContains('[ERROR] The password must not be empty.', $this->passwordEncoderCommandTester->getDisplay()); $this->assertEquals($statusCode, 1); @@ -55,11 +55,11 @@ public function testEncodePasswordBcrypt() { - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', 'user-class' => 'Custom\Class\Bcrypt\User', - ), array('interactive' => false)); + ], ['interactive' => false]); $output = $this->passwordEncoderCommandTester->getDisplay(); $this->assertContains('Password encoding succeeded', $output); @@ -76,11 +76,11 @@ $this->markTestSkipped('Argon2i algorithm not available.'); } $this->setupArgon2i(); - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', 'user-class' => 'Custom\Class\Argon2i\User', - ), array('interactive' => false)); + ], ['interactive' => false]); $output = $this->passwordEncoderCommandTester->getDisplay(); $this->assertContains('Password encoding succeeded', $output); @@ -93,11 +93,11 @@ public function testEncodePasswordPbkdf2() { - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', 'user-class' => 'Custom\Class\Pbkdf2\User', - ), array('interactive' => false)); + ], ['interactive' => false]); $output = $this->passwordEncoderCommandTester->getDisplay(); $this->assertContains('Password encoding succeeded', $output); @@ -113,10 +113,10 @@ public function testEncodePasswordOutput() { $this->passwordEncoderCommandTester->execute( - array( + [ 'command' => 'security:encode-password', 'password' => 'p@ssw0rd', - ), array('interactive' => false) + ], ['interactive' => false] ); $this->assertContains('Password encoding succeeded', $this->passwordEncoderCommandTester->getDisplay()); @@ -127,12 +127,12 @@ public function testEncodePasswordEmptySaltOutput() { $this->passwordEncoderCommandTester->execute( - array( + [ 'command' => 'security:encode-password', 'password' => 'p@ssw0rd', 'user-class' => 'Symfony\Component\Security\Core\User\User', '--empty-salt' => true, - ) + ] ); $this->assertContains('Password encoding succeeded', $this->passwordEncoderCommandTester->getDisplay()); @@ -142,11 +142,11 @@ public function testEncodePasswordBcryptOutput() { - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'p@ssw0rd', 'user-class' => 'Custom\Class\Bcrypt\User', - ), array('interactive' => false)); + ], ['interactive' => false]); $this->assertNotContains(' Generated salt ', $this->passwordEncoderCommandTester->getDisplay()); } @@ -158,11 +158,11 @@ } $this->setupArgon2i(); - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'p@ssw0rd', 'user-class' => 'Custom\Class\Argon2i\User', - ), array('interactive' => false)); + ], ['interactive' => false]); $this->assertNotContains(' Generated salt ', $this->passwordEncoderCommandTester->getDisplay()); } @@ -176,20 +176,20 @@ $this->setExpectedException('\RuntimeException', 'No encoder has been configured for account "Foo\Bar\User".'); } - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', 'user-class' => 'Foo\Bar\User', - ), array('interactive' => false)); + ], ['interactive' => false]); } public function testEncodePasswordAsksNonProvidedUserClass() { - $this->passwordEncoderCommandTester->setInputs(array('Custom\Class\Pbkdf2\User', "\n")); - $this->passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->setInputs(['Custom\Class\Pbkdf2\User', "\n"]); + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', - ), array('decorated' => false)); + ], ['decorated' => false]); $this->assertContains(<<passwordEncoderCommandTester->execute(array( + $this->passwordEncoderCommandTester->execute([ 'command' => 'security:encode-password', 'password' => 'password', - ), array('interactive' => false)); + ], ['interactive' => false]); $this->assertContains('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder', $this->passwordEncoderCommandTester->getDisplay()); } @@ -218,15 +218,15 @@ public function testThrowsExceptionOnNoConfiguredEncoders() { $application = new ConsoleApplication(); - $application->add(new UserPasswordEncoderCommand($this->getMockBuilder(EncoderFactoryInterface::class)->getMock(), array())); + $application->add(new UserPasswordEncoderCommand($this->getMockBuilder(EncoderFactoryInterface::class)->getMock(), [])); $passwordEncoderCommand = $application->find('security:encode-password'); $tester = new CommandTester($passwordEncoderCommand); - $tester->execute(array( + $tester->execute([ 'command' => 'security:encode-password', 'password' => 'password', - ), array('interactive' => false)); + ], ['interactive' => false]); } /** @@ -239,14 +239,14 @@ $application->add(new UserPasswordEncoderCommand()); $passwordEncoderCommand = $application->find('security:encode-password'); - self::bootKernel(array('test_case' => 'PasswordEncode')); + self::bootKernel(['test_case' => 'PasswordEncode']); $passwordEncoderCommand->setContainer(self::$kernel->getContainer()); $tester = new CommandTester($passwordEncoderCommand); - $tester->execute(array( + $tester->execute([ 'command' => 'security:encode-password', 'password' => 'password', - ), array('interactive' => false)); + ], ['interactive' => false]); $this->assertContains('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder', $tester->getDisplay()); } @@ -254,7 +254,7 @@ protected function setUp() { putenv('COLUMNS='.(119 + \strlen(PHP_EOL))); - $kernel = $this->createKernel(array('test_case' => 'PasswordEncode')); + $kernel = $this->createKernel(['test_case' => 'PasswordEncode']); $kernel->boot(); $application = new Application($kernel); @@ -272,7 +272,7 @@ private function setupArgon2i() { putenv('COLUMNS='.(119 + \strlen(PHP_EOL))); - $kernel = $this->createKernel(array('test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml')); + $kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml']); $kernel->boot(); $application = new Application($kernel); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ return 'Symfony\Bundle\SecurityBundle\Tests\Functional\app\AppKernel'; } - protected static function createKernel(array $options = array()) + protected static function createKernel(array $options = []) { $class = self::getKernelClass(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallConfigTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallConfigTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallConfigTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallConfigTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,8 +18,8 @@ { public function testGetters() { - $listeners = array('logout', 'remember_me', 'anonymous'); - $options = array( + $listeners = ['logout', 'remember_me', 'anonymous']; + $options = [ 'request_matcher' => 'foo_request_matcher', 'security' => false, 'stateless' => false, @@ -29,8 +29,8 @@ 'access_denied_url' => 'foo_access_denied_url', 'access_denied_handler' => 'foo_access_denied_handler', 'user_checker' => 'foo_user_checker', - 'switch_user' => array('provider' => null, 'parameter' => '_switch_user', 'role' => 'ROLE_ALLOWED_TO_SWITCH'), - ); + 'switch_user' => ['provider' => null, 'parameter' => '_switch_user', 'role' => 'ROLE_ALLOWED_TO_SWITCH'], + ]; $config = new FirewallConfig( 'foo_firewall', diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,12 +25,12 @@ $config = new FirewallConfig('main', 'user_checker', 'request_matcher'); $exceptionListener = $this->getExceptionListenerMock(); $logoutListener = $this->getLogoutListenerMock(); - $listeners = array( + $listeners = [ $this ->getMockBuilder(ListenerInterface::class) ->disableOriginalConstructor() ->getMock(), - ); + ]; $context = new FirewallContext($listeners, $exceptionListener, $logoutListener, $config); @@ -48,10 +48,10 @@ { $exceptionListener = $this->getExceptionListenerMock(); $logoutListener = $this->getLogoutListenerMock(); - $context = (new FirewallContext($listeners = array(), $exceptionListener, $logoutListener, new FirewallConfig('main', 'request_matcher', 'user_checker'))) + $context = (new FirewallContext($listeners = [], $exceptionListener, $logoutListener, new FirewallConfig('main', 'request_matcher', 'user_checker'))) ->getContext(); - $this->assertEquals(array($listeners, $exceptionListener, $logoutListener), $context); + $this->assertEquals([$listeners, $exceptionListener, $logoutListener], $context); } private function getExceptionListenerMock() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,13 +31,13 @@ { $request = new Request(); - $map = array(); + $map = []; $container = $this->getMockBuilder(Container::class)->getMock(); $container->expects($this->never())->method('get'); $firewallMap = new FirewallMap($container, $map); - $this->assertEquals(array(array(), null, null), $firewallMap->getListeners($request)); + $this->assertEquals([[], null, null], $firewallMap->getListeners($request)); $this->assertNull($firewallMap->getFirewallConfig($request)); $this->assertFalse($request->attributes->has(self::ATTRIBUTE_FIREWALL_CONTEXT)); } @@ -47,13 +47,13 @@ $request = new Request(); $request->attributes->set(self::ATTRIBUTE_FIREWALL_CONTEXT, 'foo'); - $map = array(); + $map = []; $container = $this->getMockBuilder(Container::class)->getMock(); $container->expects($this->never())->method('get'); $firewallMap = new FirewallMap($container, $map); - $this->assertEquals(array(array(), null, null), $firewallMap->getListeners($request)); + $this->assertEquals([[], null, null], $firewallMap->getListeners($request)); $this->assertNull($firewallMap->getFirewallConfig($request)); $this->assertFalse($request->attributes->has(self::ATTRIBUTE_FIREWALL_CONTEXT)); } @@ -68,7 +68,7 @@ $firewallContext->expects($this->once())->method('getConfig')->willReturn($firewallConfig); $listener = $this->getMockBuilder(ListenerInterface::class)->getMock(); - $firewallContext->expects($this->once())->method('getListeners')->willReturn(array($listener)); + $firewallContext->expects($this->once())->method('getListeners')->willReturn([$listener]); $exceptionListener = $this->getMockBuilder(ExceptionListener::class)->disableOriginalConstructor()->getMock(); $firewallContext->expects($this->once())->method('getExceptionListener')->willReturn($exceptionListener); @@ -85,9 +85,9 @@ $container = $this->getMockBuilder(Container::class)->getMock(); $container->expects($this->exactly(2))->method('get')->willReturn($firewallContext); - $firewallMap = new FirewallMap($container, array('security.firewall.map.context.foo' => $matcher)); + $firewallMap = new FirewallMap($container, ['security.firewall.map.context.foo' => $matcher]); - $this->assertEquals(array(array($listener), $exceptionListener, $logoutListener), $firewallMap->getListeners($request)); + $this->assertEquals([[$listener], $exceptionListener, $logoutListener], $firewallMap->getListeners($request)); $this->assertEquals($firewallConfig, $firewallMap->getFirewallConfig($request)); $this->assertEquals('security.firewall.map.context.foo', $request->attributes->get(self::ATTRIBUTE_FIREWALL_CONTEXT)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/SecurityUserValueResolverTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/SecurityUserValueResolverTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/SecurityUserValueResolverTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/SecurityBundle/Tests/SecurityUserValueResolverTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -66,7 +66,7 @@ $metadata = new ArgumentMetadata('foo', UserInterface::class, false, false, null); $this->assertTrue($resolver->supports(Request::create('/'), $metadata)); - $this->assertSame(array($user), iterator_to_array($resolver->resolve(Request::create('/'), $metadata))); + $this->assertSame([$user], iterator_to_array($resolver->resolve(Request::create('/'), $metadata))); } public function testIntegration() @@ -77,8 +77,8 @@ $tokenStorage = new TokenStorage(); $tokenStorage->setToken($token); - $argumentResolver = new ArgumentResolver(null, array(new SecurityUserValueResolver($tokenStorage))); - $this->assertSame(array($user), $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user) {})); + $argumentResolver = new ArgumentResolver(null, [new SecurityUserValueResolver($tokenStorage)]); + $this->assertSame([$user], $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user) {})); } public function testIntegrationNoUser() @@ -87,8 +87,8 @@ $tokenStorage = new TokenStorage(); $tokenStorage->setToken($token); - $argumentResolver = new ArgumentResolver(null, array(new SecurityUserValueResolver($tokenStorage), new DefaultValueResolver())); - $this->assertSame(array(null), $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user = null) {})); + $argumentResolver = new ArgumentResolver(null, [new SecurityUserValueResolver($tokenStorage), new DefaultValueResolver()]); + $this->assertSame([null], $argumentResolver->getArguments(Request::create('/'), function (UserInterface $user = null) {})); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ /** * @param array $paths Additional twig paths to warm */ - public function __construct(ContainerInterface $container, TemplateFinderInterface $finder = null, array $paths = array()) + public function __construct(ContainerInterface $container, TemplateFinderInterface $finder = null, array $paths = []) { // We don't inject the Twig environment directly as it depends on the // template locator (via the loader) which might be a cached one. @@ -96,9 +96,9 @@ */ public static function getSubscribedServices() { - return array( + return [ 'twig' => Environment::class, - ); + ]; } /** @@ -112,10 +112,10 @@ private function findTemplatesInFolder($namespace, $dir) { if (!is_dir($dir)) { - return array(); + return []; } - $templates = array(); + $templates = []; $finder = new Finder(); foreach ($finder->files()->followLinks()->in($dir) as $file) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,8 +81,8 @@ */ public static function getSubscribedServices() { - return array( + return [ 'twig' => Environment::class, - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php 2019-02-03 12:23:08.000000000 +0000 @@ -61,14 +61,14 @@ return new Response($this->twig->render( (string) $this->findTemplate($request, $request->getRequestFormat(), $code, $showException), - array( + [ 'status_code' => $code, 'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '', 'exception' => $exception, 'logger' => $logger, 'currentContent' => $currentContent, - ) - ), 200, array('Content-Type' => $request->getMimeType($request->getRequestFormat()) ?: 'text/html')); + ] + ), 200, ['Content-Type' => $request->getMimeType($request->getRequestFormat()) ?: 'text/html']); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,13 +43,13 @@ * the additional "showException" flag. */ - $subRequest = $request->duplicate(null, null, array( + $subRequest = $request->duplicate(null, null, [ '_controller' => $this->controller, 'exception' => $exception, 'logger' => null, 'format' => $request->getRequestFormat(), 'showException' => false, - )); + ]); return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,7 +45,7 @@ $reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension'); $coreThemePath = \dirname(\dirname($reflClass->getFileName())).'/Resources/views/Form'; - $container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', array($coreThemePath)); + $container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', [$coreThemePath]); $paths = $container->getDefinition('twig.template_iterator')->getArgument(2); $paths[$coreThemePath] = null; @@ -67,9 +67,9 @@ $container->getDefinition('twig.runtime.httpkernel')->addTag('twig.runtime'); // inject Twig in the hinclude service if Twig is the only registered templating engine - if ((!$container->hasParameter('templating.engines') || array('twig') == $container->getParameter('templating.engines')) && $container->hasDefinition('fragment.renderer.hinclude')) { + if ((!$container->hasParameter('templating.engines') || ['twig'] == $container->getParameter('templating.engines')) && $container->hasDefinition('fragment.renderer.hinclude')) { $container->getDefinition('fragment.renderer.hinclude') - ->addTag('kernel.fragment_renderer', array('alias' => 'hinclude')) + ->addTag('kernel.fragment_renderer', ['alias' => 'hinclude']) ->replaceArgument(0, new Reference('twig')) ; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ } $definition = $container->getDefinition('twig.runtime_loader'); - $mapping = array(); + $mapping = []; foreach ($container->findTaggedServiceIds('twig.runtime', true) as $id => $attributes) { $def = $container->getDefinition($id); $mapping[$def->getClass()] = new Reference($id); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,10 +35,10 @@ // afterward. If not, the globals from the extensions will never // be registered. $currentMethodCalls = $definition->getMethodCalls(); - $twigBridgeExtensionsMethodCalls = array(); - $othersExtensionsMethodCalls = array(); + $twigBridgeExtensionsMethodCalls = []; + $othersExtensionsMethodCalls = []; foreach ($container->findTaggedServiceIds('twig.extension', true) as $id => $attributes) { - $methodCall = array('addExtension', array(new Reference($id))); + $methodCall = ['addExtension', [new Reference($id)]]; $extensionClass = $container->getDefinition($id)->getClass(); if (\is_string($extensionClass) && 0 === strpos($extensionClass, 'Symfony\Bridge\Twig\Extension')) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ return; } - $prioritizedLoaders = array(); + $prioritizedLoaders = []; $found = 0; foreach ($container->findTaggedServiceIds('twig.loader', true) as $id => $attributes) { @@ -50,7 +50,7 @@ foreach ($prioritizedLoaders as $loaders) { foreach ($loaders as $loader) { - $chainLoader->addMethodCall('addLoader', array(new Reference($loader))); + $chainLoader->addMethodCall('addLoader', [new Reference($loader)]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php 2019-02-03 12:23:08.000000000 +0000 @@ -54,11 +54,11 @@ ->arrayNode('form_themes') ->addDefaultChildrenIfNoneSet() ->prototype('scalar')->defaultValue('form_div_layout.html.twig')->end() - ->example(array('MyBundle::form.html.twig')) + ->example(['MyBundle::form.html.twig']) ->validate() ->ifTrue(function ($v) { return !\in_array('form_div_layout.html.twig', $v); }) ->then(function ($v) { - return array_merge(array('form_div_layout.html.twig'), $v); + return array_merge(['form_div_layout.html.twig'], $v); }) ->end() ->end() @@ -74,7 +74,7 @@ ->arrayNode('globals') ->normalizeKeys(false) ->useAttributeAsKey('key') - ->example(array('foo' => '"@bar"', 'pi' => 3.14)) + ->example(['foo' => '"@bar"', 'pi' => 3.14]) ->prototype('array') ->beforeNormalization() ->ifTrue(function ($v) { return \is_string($v) && 0 === strpos($v, '@'); }) @@ -83,7 +83,7 @@ return substr($v, 1); } - return array('id' => substr($v, 1), 'type' => 'service'); + return ['id' => substr($v, 1), 'type' => 'service']; }) ->end() ->beforeNormalization() @@ -92,18 +92,18 @@ $keys = array_keys($v); sort($keys); - return $keys !== array('id', 'type') && $keys !== array('value'); + return $keys !== ['id', 'type'] && $keys !== ['value']; } return true; }) - ->then(function ($v) { return array('value' => $v); }) + ->then(function ($v) { return ['value' => $v]; }) ->end() ->children() ->scalarNode('id')->end() ->scalarNode('type') ->validate() - ->ifNotInArray(array('service')) + ->ifNotInArray(['service']) ->thenInvalid('The %s type is not supported') ->end() ->end() @@ -140,7 +140,7 @@ ->beforeNormalization() ->always() ->then(function ($paths) { - $normalized = array(); + $normalized = []; foreach ($paths as $path => $namespace) { if (\is_array($namespace)) { // xml diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,10 +65,10 @@ if (isset($config['globals'])) { foreach ($config['globals'] as $name => $value) { if (\is_array($value) && isset($value['key'])) { - $configs[$key]['globals'][$name] = array( + $configs[$key]['globals'][$name] = [ 'key' => $name, 'value' => $value, - ); + ]; } } } @@ -96,9 +96,9 @@ // register user-configured paths foreach ($config['paths'] as $path => $namespace) { if (!$namespace) { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$path]); } else { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$path, $namespace]); } } @@ -113,29 +113,29 @@ foreach ($bundle['children'] as $child) { foreach ($bundleHierarchy[$child]['paths'] as $path) { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$path, $namespace]); } } foreach ($bundle['paths'] as $path) { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$path, $namespace]); } // add exclusive namespace for root bundles only // to override a bundle template that also extends itself if (\count($bundle['paths']) > 0 && 0 === \count($bundle['parents'])) { // the last path must be the bundle views directory - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array(end($bundle['paths']), '!'.$namespace)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [end($bundle['paths']), '!'.$namespace]); } } if (file_exists($dir = $container->getParameter('kernel.root_dir').'/Resources/views')) { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$dir]); } $container->addResource(new FileExistenceResource($dir)); if (file_exists($dir = $container->getParameterBag()->resolveValue($config['default_path']))) { - $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir)); + $twigFilesystemLoaderDefinition->addMethodCall('addPath', [$dir]); } $container->addResource(new FileExistenceResource($dir)); @@ -143,9 +143,9 @@ $def = $container->getDefinition('twig'); foreach ($config['globals'] as $key => $global) { if (isset($global['type']) && 'service' === $global['type']) { - $def->addMethodCall('addGlobal', array($key, new Reference($global['id']))); + $def->addMethodCall('addGlobal', [$key, new Reference($global['id'])]); } else { - $def->addMethodCall('addGlobal', array($key, $global['value'])); + $def->addMethodCall('addGlobal', [$key, $global['value']]); } } } @@ -157,7 +157,7 @@ ); if (isset($config['autoescape_service']) && isset($config['autoescape_service_method'])) { - $config['autoescape'] = array(new Reference($config['autoescape_service']), $config['autoescape_service_method']); + $config['autoescape'] = [new Reference($config['autoescape_service']), $config['autoescape_service_method']]; } unset($config['autoescape_service'], $config['autoescape_service_method']); @@ -175,7 +175,7 @@ } if (\PHP_VERSION_ID < 70000) { - $this->addClassesToCompile(array( + $this->addClassesToCompile([ 'Twig_Environment', 'Twig_Extension', 'Twig_Extension_Core', @@ -184,21 +184,21 @@ 'Twig_LoaderInterface', 'Twig_Markup', 'Twig_Template', - )); + ]); } } private function getBundleHierarchy(ContainerBuilder $container, array $config) { - $bundleHierarchy = array(); + $bundleHierarchy = []; foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) { if (!array_key_exists($name, $bundleHierarchy)) { - $bundleHierarchy[$name] = array( - 'paths' => array(), - 'parents' => array(), - 'children' => array(), - ); + $bundleHierarchy[$name] = [ + 'paths' => [], + 'parents' => [], + 'children' => [], + ]; } if (file_exists($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$name.'/views')) { @@ -223,18 +223,18 @@ $bundleHierarchy[$name]['parents'][] = $bundle['parent']; if (!array_key_exists($bundle['parent'], $bundleHierarchy)) { - $bundleHierarchy[$bundle['parent']] = array( - 'paths' => array(), - 'parents' => array(), - 'children' => array(), - ); + $bundleHierarchy[$bundle['parent']] = [ + 'paths' => [], + 'parents' => [], + 'children' => [], + ]; } - $bundleHierarchy[$bundle['parent']]['children'] = array_merge($bundleHierarchy[$name]['children'], array($name), $bundleHierarchy[$bundle['parent']]['children']); + $bundleHierarchy[$bundle['parent']]['children'] = array_merge($bundleHierarchy[$name]['children'], [$name], $bundleHierarchy[$bundle['parent']]['children']); foreach ($bundleHierarchy[$bundle['parent']]['parents'] as $parent) { $bundleHierarchy[$name]['parents'][] = $parent; - $bundleHierarchy[$parent]['children'] = array_merge($bundleHierarchy[$name]['children'], array($name), $bundleHierarchy[$parent]['children']); + $bundleHierarchy[$parent]['children'] = array_merge($bundleHierarchy[$name]['children'], [$name], $bundleHierarchy[$parent]['children']); } foreach ($bundleHierarchy[$name]['children'] as $child) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ */ public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser, $rootPath = null) { - parent::__construct(array(), $rootPath); + parent::__construct([], $rootPath); $this->locator = $locator; $this->parser = $parser; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/TemplateIterator.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/TemplateIterator.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/TemplateIterator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/TemplateIterator.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ * @param array $paths Additional Twig paths to warm * @param string $defaultPath The directory where global templates can be stored */ - public function __construct(KernelInterface $kernel, $rootDir, array $paths = array(), $defaultPath = null) + public function __construct(KernelInterface $kernel, $rootDir, array $paths = [], $defaultPath = null) { $this->kernel = $kernel; $this->rootDir = $rootDir; @@ -52,7 +52,7 @@ $this->templates = array_merge( $this->findTemplatesInDirectory($this->rootDir.'/Resources/views'), - $this->findTemplatesInDirectory($this->defaultPath, null, array('bundles')) + $this->findTemplatesInDirectory($this->defaultPath, null, ['bundles']) ); foreach ($this->kernel->getBundles() as $bundle) { $name = $bundle->getName(); @@ -83,13 +83,13 @@ * * @return array */ - private function findTemplatesInDirectory($dir, $namespace = null, array $excludeDirs = array()) + private function findTemplatesInDirectory($dir, $namespace = null, array $excludeDirs = []) { if (!is_dir($dir)) { - return array(); + return []; } - $templates = array(); + $templates = []; foreach (Finder::create()->files()->followLinks()->in($dir)->exclude($excludeDirs) as $file) { $templates[] = (null !== $namespace ? '@'.$namespace.'/' : '').str_replace('\\', '/', $file->getRelativePathname()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/ContainerAwareRuntimeLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/ContainerAwareRuntimeLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/ContainerAwareRuntimeLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/ContainerAwareRuntimeLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,9 +25,9 @@ $container = $this->getMockBuilder(ContainerInterface::class)->getMock(); $container->expects($this->once())->method('get')->with('foo'); - $loader = new ContainerAwareRuntimeLoader($container, array( + $loader = new ContainerAwareRuntimeLoader($container, [ 'FooClass' => 'foo', - )); + ]); $loader->load('FooClass'); } @@ -35,7 +35,7 @@ { $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $logger->expects($this->once())->method('warning')->with('Class "BarClass" is not configured as a Twig runtime. Add the "twig.runtime" tag to the related service in the container.'); - $loader = new ContainerAwareRuntimeLoader($this->getMockBuilder(ContainerInterface::class)->getMock(), array(), $logger); + $loader = new ContainerAwareRuntimeLoader($this->getMockBuilder(ContainerInterface::class)->getMock(), [], $logger); $this->assertNull($loader->load('BarClass')); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { public function testShowActionCanBeForcedToShowErrorPage() { - $twig = $this->createTwigEnv(array('@Twig/Exception/error404.html.twig' => 'not found')); + $twig = $this->createTwigEnv(['@Twig/Exception/error404.html.twig' => 'not found']); $request = $this->createRequest('html'); $request->attributes->set('showException', false); @@ -37,7 +37,7 @@ public function testFallbackToHtmlIfNoTemplateForRequestedFormat() { - $twig = $this->createTwigEnv(array('@Twig/Exception/error.html.twig' => '')); + $twig = $this->createTwigEnv(['@Twig/Exception/error.html.twig' => '']); $request = $this->createRequest('txt'); $exception = FlattenException::create(new \Exception()); @@ -50,7 +50,7 @@ public function testFallbackToHtmlWithFullExceptionIfNoTemplateForRequestedFormatAndExceptionsShouldBeShown() { - $twig = $this->createTwigEnv(array('@Twig/Exception/exception_full.html.twig' => '')); + $twig = $this->createTwigEnv(['@Twig/Exception/exception_full.html.twig' => '']); $request = $this->createRequest('txt'); $request->attributes->set('showException', true); @@ -64,7 +64,7 @@ public function testResponseHasRequestedMimeType() { - $twig = $this->createTwigEnv(array('@Twig/Exception/error.json.twig' => '{}')); + $twig = $this->createTwigEnv(['@Twig/Exception/error.json.twig' => '{}']); $request = $this->createRequest('json'); $exception = FlattenException::create(new \Exception()); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,12 +30,12 @@ $container->register('twig.extension.expression'); $nativeTwigLoader = new Definition('\Twig\Loader\FilesystemLoader'); - $nativeTwigLoader->addMethodCall('addPath', array()); + $nativeTwigLoader->addMethodCall('addPath', []); $container->setDefinition('twig.loader.native_filesystem', $nativeTwigLoader); $filesystemLoader = new Definition('\Symfony\Bundle\TwigBundle\Loader\FilesystemLoader'); - $filesystemLoader->setArguments(array(null, null, null)); - $filesystemLoader->addMethodCall('addPath', array()); + $filesystemLoader->setArguments([null, null, null]); + $filesystemLoader->addMethodCall('addPath', []); $container->setDefinition('twig.loader.filesystem', $filesystemLoader); $extensionPass = new ExtensionPass(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -72,9 +72,9 @@ { $this->builder->setDefinition('twig.loader.chain', $this->chainLoader); $this->builder->register('test_loader_1') - ->addTag('twig.loader', array('priority' => 100)); + ->addTag('twig.loader', ['priority' => 100]); $this->builder->register('test_loader_2') - ->addTag('twig.loader', array('priority' => 200)); + ->addTag('twig.loader', ['priority' => 200]); $this->pass->process($this->builder); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/ConfigurationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/ConfigurationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,13 +19,13 @@ { public function testDoNoDuplicateDefaultFormResources() { - $input = array( - 'form_themes' => array('form_div_layout.html.twig'), - ); + $input = [ + 'form_themes' => ['form_div_layout.html.twig'], + ]; $processor = new Processor(); - $config = $processor->processConfiguration(new Configuration(), array($input)); + $config = $processor->processConfiguration(new Configuration(), [$input]); - $this->assertEquals(array('form_div_layout.html.twig'), $config['form_themes']); + $this->assertEquals(['form_div_layout.html.twig'], $config['form_themes']); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/customTemplateEscapingGuesser.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/customTemplateEscapingGuesser.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/customTemplateEscapingGuesser.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/customTemplateEscapingGuesser.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,6 +1,6 @@ loadFromExtension('twig', array( +$container->loadFromExtension('twig', [ 'autoescape_service' => 'my_project.some_bundle.template_escaping_guesser', 'autoescape_service_method' => 'guess', -)); +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/empty.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/empty.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/empty.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/empty.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,3 +1,3 @@ loadFromExtension('twig', array()); +$container->loadFromExtension('twig', []); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/extra.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/extra.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/extra.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/extra.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,7 +1,7 @@ loadFromExtension('twig', array( - 'paths' => array( +$container->loadFromExtension('twig', [ + 'paths' => [ 'namespaced_path3' => 'namespace3', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/formats.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/formats.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/formats.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/formats.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,14 +1,14 @@ loadFromExtension('twig', array( - 'date' => array( +$container->loadFromExtension('twig', [ + 'date' => [ 'format' => 'Y-m-d', 'interval_format' => '%d', 'timezone' => 'Europe/Berlin', - ), - 'number_format' => array( + ], + 'number_format' => [ 'decimals' => 2, 'decimal_point' => ',', 'thousands_separator' => '.', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php 2019-02-03 12:23:08.000000000 +0000 @@ -1,15 +1,15 @@ loadFromExtension('twig', array( - 'form_themes' => array( +$container->loadFromExtension('twig', [ + 'form_themes' => [ 'MyBundle::form.html.twig', - ), - 'globals' => array( + ], + 'globals' => [ 'foo' => '@bar', 'baz' => '@@qux', 'pi' => 3.14, - 'bad' => array('key' => 'foo'), - ), + 'bad' => ['key' => 'foo'], + ], 'auto_reload' => true, 'autoescape' => true, 'base_template_class' => 'stdClass', @@ -18,10 +18,10 @@ 'debug' => true, 'strict_variables' => true, 'default_path' => '%kernel.project_dir%/Fixtures/templates', - 'paths' => array( + 'paths' => [ 'path1', 'path2', 'namespaced_path1' => 'namespace1', 'namespaced_path2' => 'namespace2', - ), -)); + ], +]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ { $container = $this->createContainer(); $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array()); + $container->loadFromExtension('twig', []); $this->compileContainer($container); $this->assertEquals('Twig\Environment', $container->getDefinition('twig')->getClass(), '->load() loads the twig.xml file'); @@ -72,9 +72,9 @@ $this->assertEquals(3.14, $calls[4][1][1], '->load() registers variables as Twig globals'); // Yaml and Php specific configs - if (\in_array($format, array('yml', 'php'))) { + if (\in_array($format, ['yml', 'php'])) { $this->assertEquals('bad', $calls[5][1][0], '->load() registers variables as Twig globals'); - $this->assertEquals(array('key' => 'foo'), $calls[5][1][1], '->load() registers variables as Twig globals'); + $this->assertEquals(['key' => 'foo'], $calls[5][1][1], '->load() registers variables as Twig globals'); } // Twig options @@ -99,7 +99,7 @@ $this->compileContainer($container); $options = $container->getDefinition('twig')->getArgument(1); - $this->assertEquals(array(new Reference('my_project.some_bundle.template_escaping_guesser'), 'guess'), $options['autoescape']); + $this->assertEquals([new Reference('my_project.some_bundle.template_escaping_guesser'), 'guess'], $options['autoescape']); } /** @@ -138,8 +138,8 @@ public function testGlobalsWithDifferentTypesAndValues() { - $globals = array( - 'array' => array(), + $globals = [ + 'array' => [], 'false' => false, 'float' => 2.0, 'integer' => 3, @@ -147,11 +147,11 @@ 'object' => new \stdClass(), 'string' => 'foo', 'true' => true, - ); + ]; $container = $this->createContainer(); $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array('globals' => $globals)); + $container->loadFromExtension('twig', ['globals' => $globals]); $this->compileContainer($container); $calls = $container->getDefinition('twig')->getMethodCalls(); @@ -175,49 +175,49 @@ $this->compileContainer($container); $def = $container->getDefinition('twig.loader.native_filesystem'); - $paths = array(); + $paths = []; foreach ($def->getMethodCalls() as $call) { if ('addPath' === $call[0] && false === strpos($call[1][0], 'Form')) { $paths[] = $call[1]; } } - $this->assertEquals(array( - array('path1'), - array('path2'), - array('namespaced_path1', 'namespace1'), - array('namespaced_path2', 'namespace2'), - array('namespaced_path3', 'namespace3'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildChildChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildChildChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'Twig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'Twig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'Twig'), - array(__DIR__.'/Fixtures/Bundle/ChildTwigBundle/Resources/views', 'Twig'), - array(__DIR__.'/Fixtures/Resources/TwigBundle/views', 'Twig'), - array(__DIR__.'/Fixtures/templates/bundles/TwigBundle', 'Twig'), - array(realpath(__DIR__.'/../..').'/Resources/views', 'Twig'), - array(realpath(__DIR__.'/../..').'/Resources/views', '!Twig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'ChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildTwigBundle/Resources/views', 'ChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildChildTwig'), - array(__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'ChildChildTwig'), - array(__DIR__.'/Fixtures/Resources/views'), - array(__DIR__.'/Fixtures/templates'), - ), $paths); + $this->assertEquals([ + ['path1'], + ['path2'], + ['namespaced_path1', 'namespace1'], + ['namespaced_path2', 'namespace2'], + ['namespaced_path3', 'namespace3'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildChildChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildChildChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'Twig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'Twig'], + [__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'Twig'], + [__DIR__.'/Fixtures/Bundle/ChildTwigBundle/Resources/views', 'Twig'], + [__DIR__.'/Fixtures/Resources/TwigBundle/views', 'Twig'], + [__DIR__.'/Fixtures/templates/bundles/TwigBundle', 'Twig'], + [realpath(__DIR__.'/../..').'/Resources/views', 'Twig'], + [realpath(__DIR__.'/../..').'/Resources/views', '!Twig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'ChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildTwigBundle/Resources/views', 'ChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle/Resources/views', 'ChildChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle/Resources/views', 'ChildChildTwig'], + [__DIR__.'/Fixtures/Bundle/ChildChildTwigBundle/Resources/views', 'ChildChildTwig'], + [__DIR__.'/Fixtures/Resources/views'], + [__DIR__.'/Fixtures/templates'], + ], $paths); } public function getFormats() { - return array( - array('php'), - array('yml'), - array('xml'), - ); + return [ + ['php'], + ['yml'], + ['xml'], + ]; } /** @@ -231,7 +231,7 @@ $container->register('debug.stopwatch', 'Symfony\Component\Stopwatch\Stopwatch'); } $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array()); + $container->loadFromExtension('twig', []); $container->setAlias('test.twig.extension.debug.stopwatch', 'twig.extension.debug.stopwatch')->setPublic(true); $this->compileContainer($container); @@ -244,19 +244,19 @@ public function stopwatchExtensionAvailabilityProvider() { - return array( - 'debug-and-stopwatch-enabled' => array(true, true, true), - 'only-stopwatch-enabled' => array(false, true, false), - 'only-debug-enabled' => array(true, false, false), - 'debug-and-stopwatch-disabled' => array(false, false, false), - ); + return [ + 'debug-and-stopwatch-enabled' => [true, true, true], + 'only-stopwatch-enabled' => [false, true, false], + 'only-debug-enabled' => [true, false, false], + 'debug-and-stopwatch-disabled' => [false, false, false], + ]; } public function testRuntimeLoader() { $container = $this->createContainer(); $container->registerExtension(new TwigExtension()); - $container->loadFromExtension('twig', array()); + $container->loadFromExtension('twig', []); $container->setParameter('kernel.environment', 'test'); $container->setParameter('debug.file_link_format', 'test'); $container->setParameter('foo', 'FooClass'); @@ -265,7 +265,7 @@ $container->register('templating.name_parser', 'FooClass'); $container->register('foo', '%foo%')->addTag('twig.runtime'); $container->addCompilerPass(new RuntimeLoaderPass(), PassConfig::TYPE_BEFORE_REMOVING); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); $loader = $container->getDefinition('twig.runtime_loader'); @@ -278,55 +278,55 @@ private function createContainer() { - $container = new ContainerBuilder(new ParameterBag(array( + $container = new ContainerBuilder(new ParameterBag([ 'kernel.cache_dir' => __DIR__, 'kernel.root_dir' => __DIR__.'/Fixtures', 'kernel.project_dir' => __DIR__, 'kernel.charset' => 'UTF-8', 'kernel.debug' => false, - 'kernel.bundles' => array( + 'kernel.bundles' => [ 'TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle', 'ChildTwigBundle' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildTwigBundle\\ChildTwigBundle', 'ChildChildTwigBundle' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildTwigBundle\\ChildChildTwigBundle', 'ChildChildChildTwigBundle' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildChildTwigBundle\\ChildChildChildTwigBundle', 'ChildChildChildChildTwigBundle' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildChildChildTwigBundle\\ChildChildChildChildTwigBundle', - ), - 'kernel.bundles_metadata' => array( - 'ChildChildChildChildTwigBundle' => array( + ], + 'kernel.bundles_metadata' => [ + 'ChildChildChildChildTwigBundle' => [ 'namespace' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildChildChildTwigBundle\\ChildChildChildChildTwigBundle', 'parent' => 'ChildChildChildTwigBundle', 'path' => __DIR__.'/Fixtures/Bundle/ChildChildChildChildTwigBundle', - ), - 'TwigBundle' => array( + ], + 'TwigBundle' => [ 'namespace' => 'Symfony\\Bundle\\TwigBundle', 'parent' => null, 'path' => realpath(__DIR__.'/../..'), - ), - 'ChildTwigBundle' => array( + ], + 'ChildTwigBundle' => [ 'namespace' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildTwigBundle\\ChildTwigBundle', 'parent' => 'TwigBundle', 'path' => __DIR__.'/Fixtures/Bundle/ChildTwigBundle', - ), - 'ChildChildChildTwigBundle' => array( + ], + 'ChildChildChildTwigBundle' => [ 'namespace' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildChildTwigBundle\\ChildChildChildTwigBundle', 'parent' => 'ChildChildTwigBundle', 'path' => __DIR__.'/Fixtures/Bundle/ChildChildChildTwigBundle', - ), - 'ChildChildTwigBundle' => array( + ], + 'ChildChildTwigBundle' => [ 'namespace' => 'Symfony\\Bundle\\TwigBundle\\Tests\\DependencyInjection\\Fixtures\\Bundle\\ChildChildTwigBundle\\ChildChildTwigBundle', 'parent' => 'ChildTwigBundle', 'path' => __DIR__.'/Fixtures/Bundle/ChildChildTwigBundle', - ), - ), - ))); + ], + ], + ])); return $container; } private function compileContainer(ContainerBuilder $container) { - $container->getCompilerPassConfig()->setOptimizationPasses(array()); - $container->getCompilerPassConfig()->setRemovingPasses(array()); + $container->getCompilerPassConfig()->setOptimizationPasses([]); + $container->getCompilerPassConfig()->setRemovingPasses([]); $container->compile(); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -83,26 +83,26 @@ public function registerBundles() { - return array(new FrameworkBundle(), new TwigBundle()); + return [new FrameworkBundle(), new TwigBundle()]; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(function ($container) { - $container->loadFromExtension('framework', array( + $container->loadFromExtension('framework', [ 'secret' => '$ecret', - 'form' => array('enabled' => false), - )); + 'form' => ['enabled' => false], + ]); }); if ($this->withTemplating) { $loader->load(function ($container) { - $container->loadFromExtension('framework', array( + $container->loadFromExtension('framework', [ 'secret' => '$ecret', - 'templating' => array('engines' => array('twig')), - 'router' => array('resource' => '%kernel.project_dir%/Resources/config/empty_routing.yml'), - 'form' => array('enabled' => false), - )); + 'templating' => ['engines' => ['twig']], + 'router' => ['resource' => '%kernel.project_dir%/Resources/config/empty_routing.yml'], + 'form' => ['enabled' => false], + ]); }); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ { public function registerBundles() { - return array(new TwigBundle()); + return [new TwigBundle()]; } public function registerContainerConfiguration(LoaderInterface $loader) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -55,16 +55,16 @@ { public function registerBundles() { - return array(new FrameworkBundle(), new TwigBundle()); + return [new FrameworkBundle(), new TwigBundle()]; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(function ($container) { - $container->loadFromExtension('framework', array( + $container->loadFromExtension('framework', [ 'secret' => '$ecret', - 'form' => array('enabled' => false), - )); + 'form' => ['enabled' => false], + ]); }); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/TemplateIteratorTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/TemplateIteratorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/Tests/TemplateIteratorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/Tests/TemplateIteratorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,22 +22,22 @@ $bundle->expects($this->any())->method('getPath')->will($this->returnValue(__DIR__.'/Fixtures/templates/BarBundle')); $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Kernel')->disableOriginalConstructor()->getMock(); - $kernel->expects($this->any())->method('getBundles')->will($this->returnValue(array( + $kernel->expects($this->any())->method('getBundles')->will($this->returnValue([ $bundle, - ))); - $iterator = new TemplateIterator($kernel, __DIR__.'/Fixtures/templates', array(__DIR__.'/Fixtures/templates/Foo' => 'Foo'), __DIR__.'/DependencyInjection/Fixtures/templates'); + ])); + $iterator = new TemplateIterator($kernel, __DIR__.'/Fixtures/templates', [__DIR__.'/Fixtures/templates/Foo' => 'Foo'], __DIR__.'/DependencyInjection/Fixtures/templates'); $sorted = iterator_to_array($iterator); sort($sorted); $this->assertEquals( - array( + [ '@Bar/base.html.twig', '@Bar/index.html.twig', '@Bar/layout.html.twig', '@Foo/index.html.twig', 'layout.html.twig', 'sub/sub.html.twig', - ), + ], $sorted ); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/TwigEngine.php symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/TwigEngine.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/TwigBundle/TwigEngine.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/TwigBundle/TwigEngine.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,7 +39,7 @@ /** * {@inheritdoc} */ - public function render($name, array $parameters = array()) + public function render($name, array $parameters = []) { try { return parent::render($name, $parameters); @@ -63,7 +63,7 @@ * * @throws Error if something went wrong like a thrown exception while rendering the template */ - public function renderResponse($view, array $parameters = array(), Response $response = null) + public function renderResponse($view, array $parameters = [], Response $response = null) { if (null === $response) { $response = new Response(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php 2019-02-03 12:23:08.000000000 +0000 @@ -63,21 +63,21 @@ if (!$this->twig->getLoader()->exists($template)) { $handler = new ExceptionHandler($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); - return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html')); + return new Response($handler->getContent($exception), 200, ['Content-Type' => 'text/html']); } $code = $exception->getStatusCode(); return new Response($this->twig->render( $template, - array( + [ 'status_code' => $code, 'status_text' => Response::$statusTexts[$code], 'exception' => $exception, 'logger' => null, 'currentContent' => '', - ) - ), 200, array('Content-Type' => 'text/html')); + ] + ), 200, ['Content-Type' => 'text/html']); } /** @@ -103,10 +103,10 @@ if (!$this->templateExists($template)) { $handler = new ExceptionHandler($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); - return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css')); + return new Response($handler->getStylesheet($exception), 200, ['Content-Type' => 'text/css']); } - return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css')); + return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, ['Content-Type' => 'text/css']); } protected function getTemplate() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php 2019-02-03 12:23:08.000000000 +0000 @@ -71,7 +71,7 @@ $this->profiler->disable(); - return new RedirectResponse($this->generator->generate('_profiler_search_results', array('token' => 'empty', 'limit' => 10)), 302, array('Content-Type' => 'text/html')); + return new RedirectResponse($this->generator->generate('_profiler_search_results', ['token' => 'empty', 'limit' => 10]), 302, ['Content-Type' => 'text/html']); } /** @@ -104,14 +104,14 @@ } if (!$profile = $this->profiler->loadProfile($token)) { - return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token, 'request' => $request)), 200, array('Content-Type' => 'text/html')); + return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', ['about' => 'no_token', 'token' => $token, 'request' => $request]), 200, ['Content-Type' => 'text/html']); } if (!$profile->hasCollector($panel)) { throw new NotFoundHttpException(sprintf('Panel "%s" is not available for token "%s".', $panel, $token)); } - return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), array( + return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), [ 'token' => $token, 'profile' => $profile, 'collector' => $profile->getCollector($panel), @@ -121,7 +121,7 @@ 'templates' => $this->getTemplateManager()->getNames($profile), 'is_ajax' => $request->isXmlHttpRequest(), 'profiler_markup_version' => 2, // 1 = original profiler, 2 = Symfony 2.8+ profiler - )), 200, array('Content-Type' => 'text/html')); + ]), 200, ['Content-Type' => 'text/html']); } /** @@ -148,13 +148,13 @@ } if ('empty' === $token || null === $token) { - return new Response('', 200, array('Content-Type' => 'text/html')); + return new Response('', 200, ['Content-Type' => 'text/html']); } $this->profiler->disable(); if (!$profile = $this->profiler->loadProfile($token)) { - return new Response('', 404, array('Content-Type' => 'text/html')); + return new Response('', 404, ['Content-Type' => 'text/html']); } // the toolbar position (top, bottom, normal, or null -- use the configuration) @@ -164,12 +164,12 @@ $url = null; try { - $url = $this->generator->generate('_profiler', array('token' => $token)); + $url = $this->generator->generate('_profiler', ['token' => $token]); } catch (\Exception $e) { // the profiler is not enabled } - return $this->renderWithCspNonces($request, '@WebProfiler/Profiler/toolbar.html.twig', array( + return $this->renderWithCspNonces($request, '@WebProfiler/Profiler/toolbar.html.twig', [ 'request' => $request, 'position' => $position, 'profile' => $profile, @@ -177,7 +177,7 @@ 'profiler_url' => $url, 'token' => $token, 'profiler_markup_version' => 2, // 1 = original toolbar, 2 = Symfony 2.8+ toolbar - )); + ]); } /** @@ -220,7 +220,7 @@ } return new Response( - $this->twig->render('@WebProfiler/Profiler/search.html.twig', array( + $this->twig->render('@WebProfiler/Profiler/search.html.twig', [ 'token' => $token, 'ip' => $ip, 'method' => $method, @@ -230,9 +230,9 @@ 'end' => $end, 'limit' => $limit, 'request' => $request, - )), + ]), 200, - array('Content-Type' => 'text/html') + ['Content-Type' => 'text/html'] ); } @@ -268,7 +268,7 @@ $end = $request->query->get('end', null); $limit = $request->query->get('limit'); - return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array( + return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', [ 'request' => $request, 'token' => $token, 'profile' => $profile, @@ -281,7 +281,7 @@ 'end' => $end, 'limit' => $limit, 'panel' => null, - )), 200, array('Content-Type' => 'text/html')); + ]), 200, ['Content-Type' => 'text/html']); } /** @@ -320,12 +320,12 @@ } if (!empty($token)) { - return new RedirectResponse($this->generator->generate('_profiler', array('token' => $token)), 302, array('Content-Type' => 'text/html')); + return new RedirectResponse($this->generator->generate('_profiler', ['token' => $token]), 302, ['Content-Type' => 'text/html']); } $tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end, $statusCode); - return new RedirectResponse($this->generator->generate('_profiler_search_results', array( + return new RedirectResponse($this->generator->generate('_profiler_search_results', [ 'token' => $tokens ? $tokens[0]['token'] : 'empty', 'ip' => $ip, 'method' => $method, @@ -334,7 +334,7 @@ 'start' => $start, 'end' => $end, 'limit' => $limit, - )), 302, array('Content-Type' => 'text/html')); + ]), 302, ['Content-Type' => 'text/html']); } /** @@ -360,7 +360,7 @@ phpinfo(); $phpinfo = ob_get_clean(); - return new Response($phpinfo, 200, array('Content-Type' => 'text/html')); + return new Response($phpinfo, 200, ['Content-Type' => 'text/html']); } /** @@ -389,11 +389,11 @@ throw new NotFoundHttpException(sprintf('The file "%s" cannot be opened.', $file)); } - return new Response($this->twig->render('@WebProfiler/Profiler/open.html.twig', array( + return new Response($this->twig->render('@WebProfiler/Profiler/open.html.twig', [ 'filename' => $filename, 'file' => $file, 'line' => $line, - )), 200, array('Content-Type' => 'text/html')); + ]), 200, ['Content-Type' => 'text/html']); } /** @@ -410,11 +410,11 @@ return $this->templateManager; } - private function renderWithCspNonces(Request $request, $template, $variables, $code = 200, $headers = array('Content-Type' => 'text/html')) + private function renderWithCspNonces(Request $request, $template, $variables, $code = 200, $headers = ['Content-Type' => 'text/html']) { $response = new Response('', $code, $headers); - $nonces = $this->cspHandler ? $this->cspHandler->getNonces($request, $response) : array(); + $nonces = $this->cspHandler ? $this->cspHandler->getNonces($request, $response) : []; $variables['csp_script_nonce'] = isset($nonces['csp_script_nonce']) ? $nonces['csp_script_nonce'] : null; $variables['csp_style_nonce'] = isset($nonces['csp_style_nonce']) ? $nonces['csp_style_nonce'] : null; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,7 +60,7 @@ $this->profiler->disable(); if (null === $this->matcher || null === $this->routes) { - return new Response('The Router is not enabled.', 200, array('Content-Type' => 'text/html')); + return new Response('The Router is not enabled.', 200, ['Content-Type' => 'text/html']); } $profile = $this->profiler->loadProfile($token); @@ -68,11 +68,11 @@ /** @var RequestDataCollector $request */ $request = $profile->getCollector('request'); - return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', array( + return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', [ 'request' => $request, 'router' => $profile->getCollector('router'), 'traces' => $this->getTraces($request, $profile->getMethod()), - )), 200, array('Content-Type' => 'text/html')); + ]), 200, ['Content-Type' => 'text/html']); } /** @@ -88,9 +88,9 @@ $traceRequest = Request::create( $request->getPathInfo(), $request->getRequestServer(true)->get('REQUEST_METHOD'), - array(), + [], $request->getRequestCookies(true)->all(), - array(), + [], $request->getRequestServer(true)->all() ); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php 2019-02-03 12:23:08.000000000 +0000 @@ -44,23 +44,23 @@ public function getNonces(Request $request, Response $response) { if ($request->headers->has('X-SymfonyProfiler-Script-Nonce') && $request->headers->has('X-SymfonyProfiler-Style-Nonce')) { - return array( + return [ 'csp_script_nonce' => $request->headers->get('X-SymfonyProfiler-Script-Nonce'), 'csp_style_nonce' => $request->headers->get('X-SymfonyProfiler-Style-Nonce'), - ); + ]; } if ($response->headers->has('X-SymfonyProfiler-Script-Nonce') && $response->headers->has('X-SymfonyProfiler-Style-Nonce')) { - return array( + return [ 'csp_script_nonce' => $response->headers->get('X-SymfonyProfiler-Script-Nonce'), 'csp_style_nonce' => $response->headers->get('X-SymfonyProfiler-Style-Nonce'), - ); + ]; } - $nonces = array( + $nonces = [ 'csp_script_nonce' => $this->generateNonce(), 'csp_style_nonce' => $this->generateNonce(), - ); + ]; $response->headers->set('X-SymfonyProfiler-Script-Nonce', $nonces['csp_script_nonce']); $response->headers->set('X-SymfonyProfiler-Style-Nonce', $nonces['csp_style_nonce']); @@ -88,7 +88,7 @@ if ($this->cspDisabled) { $this->removeCspHeaders($response); - return array(); + return []; } $nonces = $this->getNonces($request, $response); @@ -116,19 +116,19 @@ * * @return array */ - private function updateCspHeaders(Response $response, array $nonces = array()) + private function updateCspHeaders(Response $response, array $nonces = []) { - $nonces = array_replace(array( + $nonces = array_replace([ 'csp_script_nonce' => $this->generateNonce(), 'csp_style_nonce' => $this->generateNonce(), - ), $nonces); + ], $nonces); $ruleIsSet = false; $headers = $this->getCspHeaders($response); foreach ($headers as $header => $directives) { - foreach (array('script-src' => 'csp_script_nonce', 'style-src' => 'csp_style_nonce') as $type => $tokenName) { + foreach (['script-src' => 'csp_script_nonce', 'style-src' => 'csp_style_nonce'] as $type => $tokenName) { if ($this->authorizesInline($directives, $type)) { continue; } @@ -192,7 +192,7 @@ */ private function parseDirectives($header) { - $directives = array(); + $directives = []; foreach (explode(';', $header) as $directive) { $parts = explode(' ', trim($directive)); @@ -236,7 +236,7 @@ if ('\'nonce-' === substr($directive, 0, 7)) { return true; } - if (\in_array(substr($directive, 0, 8), array('\'sha256-', '\'sha384-', '\'sha512-'), true)) { + if (\in_array(substr($directive, 0, 8), ['\'sha256-', '\'sha384-', '\'sha512-'], true)) { return true; } } @@ -252,7 +252,7 @@ */ private function getCspHeaders(Response $response) { - $headers = array(); + $headers = []; if ($response->headers->has('Content-Security-Policy')) { $headers['Content-Security-Policy'] = $this->parseDirectives($response->headers->get('Content-Security-Policy')); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,7 +41,7 @@ ->defaultValue('bottom') ->setDeprecated('The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.') ->validate() - ->ifNotInArray(array('bottom', 'top')) + ->ifNotInArray(['bottom', 'top']) ->thenInvalid('The CSS position %s is not supported') ->end() ->end() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php 2019-02-03 12:23:08.000000000 +0000 @@ -69,7 +69,7 @@ try { $response->headers->set( 'X-Debug-Token-Link', - $this->urlGenerator->generate('_profiler', array('token' => $response->headers->get('X-Debug-Token')), UrlGeneratorInterface::ABSOLUTE_URL) + $this->urlGenerator->generate('_profiler', ['token' => $response->headers->get('X-Debug-Token')], UrlGeneratorInterface::ABSOLUTE_URL) ); } catch (\Exception $e) { $response->headers->set('X-Debug-Error', \get_class($e).': '.preg_replace('/\s+/', ' ', $e->getMessage())); @@ -80,7 +80,7 @@ return; } - $nonces = $this->cspHandler ? $this->cspHandler->updateResponseHeaders($request, $response) : array(); + $nonces = $this->cspHandler ? $this->cspHandler->updateResponseHeaders($request, $response) : []; // do not capture redirects or modify XML HTTP Requests if ($request->isXmlHttpRequest()) { @@ -94,7 +94,7 @@ $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); } - $response->setContent($this->twig->render('@WebProfiler/Profiler/toolbar_redirect.html.twig', array('location' => $response->headers->get('Location')))); + $response->setContent($this->twig->render('@WebProfiler/Profiler/toolbar_redirect.html.twig', ['location' => $response->headers->get('Location')])); $response->setStatusCode(200); $response->headers->remove('Location'); } @@ -123,14 +123,14 @@ if (false !== $pos) { $toolbar = "\n".str_replace("\n", '', $this->twig->render( '@WebProfiler/Profiler/toolbar_js.html.twig', - array( + [ 'position' => $this->position, 'excluded_ajax_paths' => $this->excludedAjaxPaths, 'token' => $response->headers->get('X-Debug-Token'), 'request' => $request, 'csp_script_nonce' => isset($nonces['csp_script_nonce']) ? $nonces['csp_script_nonce'] : null, 'csp_style_nonce' => isset($nonces['csp_style_nonce']) ? $nonces['csp_style_nonce'] : null, - ) + ] ))."\n"; $content = substr($content, 0, $pos).$toolbar.substr($content, $pos); $response->setContent($content); @@ -139,8 +139,8 @@ public static function getSubscribedEvents() { - return array( - KernelEvents::RESPONSE => array('onKernelResponse', -128), - ); + return [ + KernelEvents::RESPONSE => ['onKernelResponse', -128], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php 2019-02-03 12:23:08.000000000 +0000 @@ -87,7 +87,7 @@ */ public function getNames(Profile $profile) { - $templates = array(); + $templates = []; foreach ($this->templates as $arguments) { if (null === $arguments) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ {% endblock %} {% block menu %} - + {{ include('@WebProfiler/Icon/twig.svg') }} Twig diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ ->disableOriginalConstructor() ->getMock(); - $controller = new ProfilerController($urlGenerator, $profiler, $twig, array()); + $controller = new ProfilerController($urlGenerator, $profiler, $twig, []); $response = $controller->toolbarAction(Request::create('/_wdt/empty'), $token); $this->assertEquals(200, $response->getStatusCode()); @@ -40,11 +40,11 @@ public function getEmptyTokenCases() { - return array( - array(null), + return [ + [null], // "empty" is also a valid empty token case, see https://github.com/symfony/symfony/issues/10806 - array('empty'), - ); + ['empty'], + ]; } /** @@ -59,10 +59,10 @@ ->disableOriginalConstructor() ->getMock(); - $controller = new ProfilerController($urlGenerator, $profiler, $twig, array(), 'bottom', null, __DIR__.'/../..'); + $controller = new ProfilerController($urlGenerator, $profiler, $twig, [], 'bottom', null, __DIR__.'/../..'); try { - $response = $controller->openAction(Request::create('/_wdt/open', Request::METHOD_GET, array('file' => $path))); + $response = $controller->openAction(Request::create('/_wdt/open', Request::METHOD_GET, ['file' => $path])); $this->assertEquals(200, $response->getStatusCode()); $this->assertTrue($isAllowed); } catch (NotFoundHttpException $e) { @@ -72,15 +72,15 @@ public function getOpenFileCases() { - return array( - array('README.md', true), - array('composer.json', true), - array('Controller/ProfilerController.php', true), - array('.gitignore', false), - array('../TwigBundle/README.md', false), - array('Controller/../README.md', false), - array('Controller/./ProfilerController.php', false), - ); + return [ + ['README.md', true], + ['composer.json', true], + ['Controller/ProfilerController.php', true], + ['.gitignore', false], + ['../TwigBundle/README.md', false], + ['Controller/../README.md', false], + ['Controller/./ProfilerController.php', false], + ]; } /** @@ -126,8 +126,8 @@ $controller = $this->createController($profiler, $twig, $withCsp); - $tokens = array( - array( + $tokens = [ + [ 'token' => 'token1', 'ip' => '127.0.0.1', 'method' => 'GET', @@ -135,8 +135,8 @@ 'time' => 0, 'parent' => null, 'status_code' => 200, - ), - array( + ], + [ 'token' => 'token2', 'ip' => '127.0.0.1', 'method' => 'GET', @@ -144,23 +144,23 @@ 'time' => 0, 'parent' => null, 'status_code' => 404, - ), - ); + ], + ]; $profiler ->expects($this->once()) ->method('find') ->will($this->returnValue($tokens)); - $request = Request::create('/_profiler/empty/search/results', 'GET', array( + $request = Request::create('/_profiler/empty/search/results', 'GET', [ 'limit' => 2, 'ip' => '127.0.0.1', 'method' => 'GET', 'url' => 'http://example.com/', - )); + ]); $twig->expects($this->once()) ->method('render') - ->with($this->stringEndsWith('results.html.twig'), $this->equalTo(array( + ->with($this->stringEndsWith('results.html.twig'), $this->equalTo([ 'token' => 'empty', 'profile' => null, 'tokens' => $tokens, @@ -173,7 +173,7 @@ 'limit' => 2, 'panel' => null, 'request' => $request, - ))); + ])); $response = $controller->searchResultsAction($request, 'empty'); $this->assertEquals(200, $response->getStatusCode()); @@ -181,10 +181,10 @@ public function provideCspVariants() { - return array( - array(true), - array(false), - ); + return [ + [true], + [false], + ]; } private function createController($profiler, $twig, $withCSP) @@ -194,9 +194,9 @@ if ($withCSP) { $nonceGenerator = $this->getMockBuilder('Symfony\Bundle\WebProfilerBundle\Csp\NonceGenerator')->getMock(); - return new ProfilerController($urlGenerator, $profiler, $twig, array(), 'bottom', new ContentSecurityPolicyHandler($nonceGenerator)); + return new ProfilerController($urlGenerator, $profiler, $twig, [], 'bottom', new ContentSecurityPolicyHandler($nonceGenerator)); } - return new ProfilerController($urlGenerator, $profiler, $twig, array()); + return new ProfilerController($urlGenerator, $profiler, $twig, []); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Csp/ContentSecurityPolicyHandlerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Csp/ContentSecurityPolicyHandlerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Csp/ContentSecurityPolicyHandlerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Csp/ContentSecurityPolicyHandlerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -55,21 +55,21 @@ $responseScriptNonce = 'response-with-headers-script-nonce'; $responseStyleNonce = 'response-with-headers-style-nonce'; - $requestNonceHeaders = array( + $requestNonceHeaders = [ 'X-SymfonyProfiler-Script-Nonce' => $requestScriptNonce, 'X-SymfonyProfiler-Style-Nonce' => $requestStyleNonce, - ); - $responseNonceHeaders = array( + ]; + $responseNonceHeaders = [ 'X-SymfonyProfiler-Script-Nonce' => $responseScriptNonce, 'X-SymfonyProfiler-Style-Nonce' => $responseStyleNonce, - ); + ]; - return array( - array($nonce, array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), $this->createRequest(), $this->createResponse()), - array($nonce, array('csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce), $this->createRequest($requestNonceHeaders), $this->createResponse($responseNonceHeaders)), - array($nonce, array('csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce), $this->createRequest($requestNonceHeaders), $this->createResponse()), - array($nonce, array('csp_script_nonce' => $responseScriptNonce, 'csp_style_nonce' => $responseStyleNonce), $this->createRequest(), $this->createResponse($responseNonceHeaders)), - ); + return [ + [$nonce, ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), $this->createResponse()], + [$nonce, ['csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce], $this->createRequest($requestNonceHeaders), $this->createResponse($responseNonceHeaders)], + [$nonce, ['csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce], $this->createRequest($requestNonceHeaders), $this->createResponse()], + [$nonce, ['csp_script_nonce' => $responseScriptNonce, 'csp_style_nonce' => $responseStyleNonce], $this->createRequest(), $this->createResponse($responseNonceHeaders)], + ]; } public function provideRequestAndResponsesForOnKernelResponse() @@ -82,103 +82,103 @@ $responseScriptNonce = 'response-with-headers-script-nonce'; $responseStyleNonce = 'response-with-headers-style-nonce'; - $requestNonceHeaders = array( + $requestNonceHeaders = [ 'X-SymfonyProfiler-Script-Nonce' => $requestScriptNonce, 'X-SymfonyProfiler-Style-Nonce' => $requestStyleNonce, - ); - $responseNonceHeaders = array( + ]; + $responseNonceHeaders = [ 'X-SymfonyProfiler-Script-Nonce' => $responseScriptNonce, 'X-SymfonyProfiler-Style-Nonce' => $responseStyleNonce, - ); + ]; - return array( - array( + return [ + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), $this->createResponse(), - array('Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null), - ), - array( - $nonce, array('csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce), + ['Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null], + ], + [ + $nonce, ['csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce], $this->createRequest($requestNonceHeaders), $this->createResponse($responseNonceHeaders), - array('Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null), - ), - array( + ['Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce), + ['csp_script_nonce' => $requestScriptNonce, 'csp_style_nonce' => $requestStyleNonce], $this->createRequest($requestNonceHeaders), $this->createResponse(), - array('Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null), - ), - array( + ['Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $responseScriptNonce, 'csp_style_nonce' => $responseStyleNonce), + ['csp_script_nonce' => $responseScriptNonce, 'csp_style_nonce' => $responseStyleNonce], $this->createRequest(), $this->createResponse($responseNonceHeaders), - array('Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null), - ), - array( + ['Content-Security-Policy' => null, 'Content-Security-Policy-Report-Only' => null, 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('Content-Security-Policy' => 'frame-ancestors https: ; form-action: https:', 'Content-Security-Policy-Report-Only' => 'frame-ancestors http: ; form-action: http:')), - array('Content-Security-Policy' => 'frame-ancestors https: ; form-action: https:', 'Content-Security-Policy-Report-Only' => 'frame-ancestors http: ; form-action: http:', 'X-Content-Security-Policy' => null), - ), - array( + $this->createResponse(['Content-Security-Policy' => 'frame-ancestors https: ; form-action: https:', 'Content-Security-Policy-Report-Only' => 'frame-ancestors http: ; form-action: http:']), + ['Content-Security-Policy' => 'frame-ancestors https: ; form-action: https:', 'Content-Security-Policy-Report-Only' => 'frame-ancestors http: ; form-action: http:', 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('Content-Security-Policy' => 'default-src \'self\' domain.com; script-src \'self\' \'unsafe-inline\'', 'Content-Security-Policy-Report-Only' => 'default-src \'self\' domain-report-only.com; script-src \'self\' \'unsafe-inline\'')), - array('Content-Security-Policy' => 'default-src \'self\' domain.com; script-src \'self\' \'unsafe-inline\'; style-src \'self\' domain.com \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy-Report-Only' => 'default-src \'self\' domain-report-only.com; script-src \'self\' \'unsafe-inline\'; style-src \'self\' domain-report-only.com \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => null), - ), - array( + $this->createResponse(['Content-Security-Policy' => 'default-src \'self\' domain.com; script-src \'self\' \'unsafe-inline\'', 'Content-Security-Policy-Report-Only' => 'default-src \'self\' domain-report-only.com; script-src \'self\' \'unsafe-inline\'']), + ['Content-Security-Policy' => 'default-src \'self\' domain.com; script-src \'self\' \'unsafe-inline\'; style-src \'self\' domain.com \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy-Report-Only' => 'default-src \'self\' domain-report-only.com; script-src \'self\' \'unsafe-inline\'; style-src \'self\' domain-report-only.com \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'')), - array('Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'', 'X-Content-Security-Policy' => null), - ), - array( + $this->createResponse(['Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'']), + ['Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'', 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('Content-Security-Policy' => 'script-src \'self\'; style-src \'self\'')), - array('Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => null), - ), - array( + $this->createResponse(['Content-Security-Policy' => 'script-src \'self\'; style-src \'self\'']), + ['Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'')), - array('X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'', 'Content-Security-Policy' => null), - ), - array( + $this->createResponse(['X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'']), + ['X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'', 'Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('X-Content-Security-Policy' => 'script-src \'self\'')), - array('X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy' => null), - ), - array( + $this->createResponse(['X-Content-Security-Policy' => 'script-src \'self\'']), + ['X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'sha384-LALALALALAAL\'')), - array('X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'sha384-LALALALALAAL\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy' => null), - ), - array( + $this->createResponse(['X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'sha384-LALALALALAAL\'']), + ['X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'sha384-LALALALALAAL\' \'nonce-'.$nonce.'\'', 'Content-Security-Policy' => null], + ], + [ $nonce, - array('csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce), + ['csp_script_nonce' => $nonce, 'csp_style_nonce' => $nonce], $this->createRequest(), - $this->createResponse(array('Content-Security-Policy' => 'script-src \'self\'; style-src \'self\'', 'X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'; style-src \'self\'')), - array('Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\''), - ), - ); + $this->createResponse(['Content-Security-Policy' => 'script-src \'self\'; style-src \'self\'', 'X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'; style-src \'self\'']), + ['Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\'', 'X-Content-Security-Policy' => 'script-src \'self\' \'unsafe-inline\'; style-src \'self\' \'unsafe-inline\' \'nonce-'.$nonce.'\''], + ], + ]; } - private function createRequest(array $headers = array()) + private function createRequest(array $headers = []) { $request = new Request(); $request->headers->add($headers); @@ -186,7 +186,7 @@ return $request; } - private function createResponse(array $headers = array()) + private function createResponse(array $headers = []) { $response = new Response(); $response->headers->add($headers); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { $processor = new Processor(); $configuration = new Configuration(); - $config = $processor->processConfiguration($configuration, array($options)); + $config = $processor->processConfiguration($configuration, [$options]); $this->assertEquals($results, $config); } @@ -38,27 +38,27 @@ { $processor = new Processor(); $configuration = new Configuration(); - $config = $processor->processConfiguration($configuration, array($options)); + $config = $processor->processConfiguration($configuration, [$options]); $this->assertEquals($results, $config); } public function getDebugModes() { - return array( - array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt')), - array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt')), - array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt')), - array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt')), - array(array('excluded_ajax_paths' => 'test'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => 'test')), - ); + return [ + [[], ['intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']], + [['intercept_redirects' => true], ['intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']], + [['intercept_redirects' => false], ['intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']], + [['toolbar' => true], ['intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom', 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']], + [['excluded_ajax_paths' => 'test'], ['intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => 'test']], + ]; } public function getPositionConfig() { - return array( - array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt', 'position' => 'top')), - array(array('position' => 'bottom'), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt', 'position' => 'bottom')), - ); + return [ + [['position' => 'top'], ['intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt', 'position' => 'top']], + [['position' => 'bottom'], ['intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt', 'position' => 'bottom']], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,9 +28,9 @@ */ private $container; - public static function assertSaneContainer(Container $container, $message = '', $knownPrivates = array()) + public static function assertSaneContainer(Container $container, $message = '', $knownPrivates = []) { - $errors = array(); + $errors = []; $knownPrivates[] = 'debug.file_link_formatter.url_format'; foreach ($container->getServiceIds() as $id) { if (\in_array($id, $knownPrivates, true)) { // to be removed in 4.0 @@ -43,7 +43,7 @@ } } - self::assertEquals(array(), $errors, $message); + self::assertEquals([], $errors, $message); } protected function setUp() @@ -56,19 +56,19 @@ $this->container->register('event_dispatcher', EventDispatcher::class)->setPublic(true); $this->container->register('router', $this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))->setPublic(true); $this->container->register('twig', 'Twig\Environment')->setPublic(true); - $this->container->register('twig_loader', 'Twig\Loader\ArrayLoader')->addArgument(array())->setPublic(true); + $this->container->register('twig_loader', 'Twig\Loader\ArrayLoader')->addArgument([])->setPublic(true); $this->container->register('twig', 'Twig\Environment')->addArgument(new Reference('twig_loader'))->setPublic(true); - $this->container->setParameter('kernel.bundles', array()); + $this->container->setParameter('kernel.bundles', []); $this->container->setParameter('kernel.cache_dir', __DIR__); $this->container->setParameter('kernel.debug', false); $this->container->setParameter('kernel.project_dir', __DIR__); $this->container->setParameter('kernel.charset', 'UTF-8'); $this->container->setParameter('debug.file_link_format', null); - $this->container->setParameter('profiler.class', array('Symfony\\Component\\HttpKernel\\Profiler\\Profiler')); + $this->container->setParameter('profiler.class', ['Symfony\\Component\\HttpKernel\\Profiler\\Profiler']); $this->container->register('profiler', $this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\Profiler')) ->setPublic(true) ->addArgument(new Definition($this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface'))); - $this->container->setParameter('data_collector.templates', array()); + $this->container->setParameter('data_collector.templates', []); $this->container->set('kernel', $this->kernel); $this->container->addCompilerPass(new RegisterListenersPass()); } @@ -89,7 +89,7 @@ $this->container->setParameter('kernel.debug', $debug); $extension = new WebProfilerExtension(); - $extension->load(array(array()), $this->container); + $extension->load([[]], $this->container); $this->assertFalse($this->container->has('web_profiler.debug_toolbar')); @@ -102,11 +102,11 @@ public function testToolbarConfig($toolbarEnabled, $interceptRedirects, $listenerInjected, $listenerEnabled) { $extension = new WebProfilerExtension(); - $extension->load(array(array('toolbar' => $toolbarEnabled, 'intercept_redirects' => $interceptRedirects)), $this->container); + $extension->load([['toolbar' => $toolbarEnabled, 'intercept_redirects' => $interceptRedirects]], $this->container); $this->assertSame($listenerInjected, $this->container->has('web_profiler.debug_toolbar')); - $this->assertSaneContainer($this->getCompiledContainer(), '', array('web_profiler.csp.handler')); + $this->assertSaneContainer($this->getCompiledContainer(), '', ['web_profiler.csp.handler']); if ($listenerInjected) { $this->assertSame($listenerEnabled, $this->container->get('web_profiler.debug_toolbar')->isEnabled()); @@ -115,12 +115,12 @@ public function getDebugModes() { - return array( - array(false, false, false, false), - array(true, false, true, true), - array(false, true, true, false), - array(true, true, true, true), - ); + return [ + [false, false, false, false], + [true, false, true, true], + [false, true, true, false], + [true, true, true, true], + ]; } private function getCompiledContainer() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,15 +33,15 @@ $response = new Response($content); - $m->invoke($listener, $response, Request::create('/'), array('csp_script_nonce' => 'scripto', 'csp_style_nonce' => 'stylo')); + $m->invoke($listener, $response, Request::create('/'), ['csp_script_nonce' => 'scripto', 'csp_style_nonce' => 'stylo']); $this->assertEquals($expected, $response->getContent()); } public function getInjectToolbarTests() { - return array( - array('', "\nWDT\n"), - array(' + return [ + ['', "\nWDT\n"], + [' @@ -51,8 +51,8 @@ \nWDT\n - "), - ); + "], + ]; } /** @@ -134,12 +134,12 @@ public function provideRedirects() { - return array( - array(301, true), - array(302, true), - array(301, false), - array(302, false), - ); + return [ + [301, true], + [302, true], + [301, false], + [302, false], + ]; } /** @@ -230,7 +230,7 @@ $urlGenerator ->expects($this->once()) ->method('generate') - ->with('_profiler', array('token' => 'xxxxxxxx'), UrlGeneratorInterface::ABSOLUTE_URL) + ->with('_profiler', ['token' => 'xxxxxxxx'], UrlGeneratorInterface::ABSOLUTE_URL) ->will($this->returnValue('http://mydomain.com/_profiler/xxxxxxxx')) ; @@ -251,7 +251,7 @@ $urlGenerator ->expects($this->once()) ->method('generate') - ->with('_profiler', array('token' => 'xxxxxxxx')) + ->with('_profiler', ['token' => 'xxxxxxxx']) ->willThrowException(new \Exception('foo')) ; @@ -272,7 +272,7 @@ $urlGenerator ->expects($this->once()) ->method('generate') - ->with('_profiler', array('token' => 'xxxxxxxx')) + ->with('_profiler', ['token' => 'xxxxxxxx']) ->willThrowException(new \Exception("This\nmultiline\r\ntabbed text should\tcome out\r on\n \ta single plain\r\nline")) ; @@ -286,7 +286,7 @@ protected function getRequestMock($isXmlHttpRequest = false, $requestFormat = 'html', $hasSession = true) { - $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->setMethods(array('getSession', 'isXmlHttpRequest', 'getRequestFormat'))->disableOriginalConstructor()->getMock(); + $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->setMethods(['getSession', 'isXmlHttpRequest', 'getRequestFormat'])->disableOriginalConstructor()->getMock(); $request->expects($this->any()) ->method('isXmlHttpRequest') ->will($this->returnValue($isXmlHttpRequest)); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -13,6 +13,7 @@ use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; use Symfony\Bundle\WebProfilerBundle\Tests\TestCase; +use Symfony\Component\HttpKernel\Profiler\Profile; use Twig\Environment; /** @@ -43,11 +44,11 @@ $profiler = $this->mockProfiler(); $twigEnvironment = $this->mockTwigEnvironment(); - $templates = array( - 'data_collector.foo' => array('foo', 'FooBundle:Collector:foo'), - 'data_collector.bar' => array('bar', 'FooBundle:Collector:bar'), - 'data_collector.baz' => array('baz', 'FooBundle:Collector:baz'), - ); + $templates = [ + 'data_collector.foo' => ['foo', 'FooBundle:Collector:foo'], + 'data_collector.bar' => ['bar', 'FooBundle:Collector:bar'], + 'data_collector.baz' => ['baz', 'FooBundle:Collector:baz'], + ]; $this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates); } @@ -57,8 +58,7 @@ */ public function testGetNameOfInvalidTemplate() { - $profile = $this->mockProfile(); - $this->templateManager->getName($profile, 'notexistingpanel'); + $this->templateManager->getName(new Profile('token'), 'notexistingpanel'); } /** @@ -69,14 +69,9 @@ $this->profiler->expects($this->any()) ->method('has') ->withAnyParameters() - ->will($this->returnCallback(array($this, 'profilerHasCallback'))); + ->will($this->returnCallback([$this, 'profilerHasCallback'])); - $profile = $this->mockProfile(); - $profile->expects($this->any()) - ->method('hasCollector') - ->will($this->returnCallback(array($this, 'profileHasCollectorCallback'))); - - $this->assertEquals('FooBundle:Collector:foo.html.twig', $this->templateManager->getName($profile, 'foo')); + $this->assertEquals('FooBundle:Collector:foo.html.twig', $this->templateManager->getName(new ProfileDummy(), 'foo')); } /** @@ -85,17 +80,12 @@ */ public function testGetTemplates() { - $profile = $this->mockProfile(); - $profile->expects($this->any()) - ->method('hasCollector') - ->will($this->returnCallback(array($this, 'profilerHasCallback'))); - $this->profiler->expects($this->any()) ->method('has') ->withAnyParameters() - ->will($this->returnCallback(array($this, 'profileHasCollectorCallback'))); + ->will($this->returnCallback([$this, 'profileHasCollectorCallback'])); - $result = $this->templateManager->getTemplates($profile); + $result = $this->templateManager->getTemplates(new ProfileDummy()); $this->assertArrayHasKey('foo', $result); $this->assertArrayNotHasKey('bar', $result); $this->assertArrayNotHasKey('baz', $result); @@ -155,3 +145,22 @@ return $this->profiler; } } + +class ProfileDummy extends Profile +{ + public function __construct() + { + parent::__construct('token'); + } + + public function hasCollector($name) + { + switch ($name) { + case 'foo': + case 'bar': + return true; + default: + return false; + } + } +} diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php 2019-02-03 12:23:08.000000000 +0000 @@ -73,18 +73,18 @@ return $value instanceof Data ? $this->dumpData($env, $value, $maxDepth) : twig_escape_filter($env, $this->dumpValue($value)); }; - return array( - new TwigFunction('profiler_dump', $profilerDump, array('is_safe' => array('html'), 'needs_environment' => true)), - new TwigFunction('profiler_dump_log', array($this, 'dumpLog'), array('is_safe' => array('html'), 'needs_environment' => true)), - ); + return [ + new TwigFunction('profiler_dump', $profilerDump, ['is_safe' => ['html'], 'needs_environment' => true]), + new TwigFunction('profiler_dump_log', [$this, 'dumpLog'], ['is_safe' => ['html'], 'needs_environment' => true]), + ]; } public function dumpData(Environment $env, Data $data, $maxDepth = 0) { $this->dumper->setCharset($env->getCharset()); - $this->dumper->dump($data, null, array( + $this->dumper->dump($data, null, [ 'maxDepth' => $maxDepth, - )); + ]); $dump = stream_get_contents($this->output, -1, 0); rewind($this->output); @@ -102,7 +102,7 @@ return ''.$message.''; } - $replacements = array(); + $replacements = []; foreach ($context as $k => $v) { $k = '{'.twig_escape_filter($env, $k).'}'; $replacements['"'.$k.'"'] = $replacements['"'.$k.'"'] = $replacements[$k] = $this->dumpData($env, $v); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ */ class ServerLogCommand extends Command { - private static $bgColor = array('black', 'blue', 'cyan', 'green', 'magenta', 'red', 'white', 'yellow'); + private static $bgColor = ['black', 'blue', 'cyan', 'green', 'magenta', 'red', 'white', 'yellow']; private $el; private $handler; @@ -87,12 +87,12 @@ $this->handler = new ConsoleHandler($output); - $this->handler->setFormatter(new ConsoleFormatter(array( + $this->handler->setFormatter(new ConsoleFormatter([ 'format' => str_replace('\n', "\n", $input->getOption('format')), 'date_format' => $input->getOption('date-format'), 'colors' => $output->isDecorated(), 'multiline' => OutputInterface::VERBOSITY_DEBUG <= $output->getVerbosity(), - ))); + ])); if (false === strpos($host = $input->getOption('host'), '://')) { $host = 'tcp://'.$host; @@ -120,8 +120,8 @@ private function getLogs($socket) { - $sockets = array((int) $socket => $socket); - $write = array(); + $sockets = [(int) $socket => $socket]; + $write = []; while (true) { $read = $sockets; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -47,11 +47,11 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'), new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root, usually where your front controllers are stored'), new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'), - )) + ]) ->setDescription('Runs a local web server') ->setHelp(<<<'EOF' %command.name% runs a local web server: By default, the server diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -47,12 +47,12 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'), new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root'), new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'), new InputOption('pidfile', null, InputOption::VALUE_REQUIRED, 'PID file'), - )) + ]) ->setDescription('Starts a local web server in the background') ->setHelp(<<<'EOF' %command.name% runs a local web server: By default, the server @@ -90,10 +90,10 @@ $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); if (!\extension_loaded('pcntl')) { - $io->error(array( + $io->error([ 'This command needs the pcntl extension to run.', 'You can either install it or use the "server:run" command instead.', - )); + ]); if ($io->confirm('Do you want to execute server:run immediately?', false)) { return $this->getApplication()->find('server:run')->run($input, $output); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,10 +35,10 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputOption('pidfile', null, InputOption::VALUE_REQUIRED, 'PID file'), new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'The value to display (one of port, host, or address)'), - )) + ]) ->setDescription('Outputs the status of the local web server') ->setHelp(<<<'EOF' %command.name% shows the details of the given local web diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,9 +33,9 @@ protected function configure() { $this - ->setDefinition(array( + ->setDefinition([ new InputOption('pidfile', null, InputOption::VALUE_REQUIRED, 'PID file'), - )) + ]) ->setDescription('Stops the local web server that was started with the server:start command') ->setHelp(<<<'EOF' %command.name% stops the local web server: diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { $container = new ContainerBuilder(); $container->setParameter('kernel.project_dir', __DIR__); - (new WebServerExtension())->load(array(), $container); + (new WebServerExtension())->load([], $container); $this->assertSame( __DIR__.'/test', diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php 2019-02-03 12:23:08.000000000 +0000 @@ -114,7 +114,7 @@ private function getFrontControllerFileNames($env) { - return array('app_'.$env.'.php', 'app.php', 'index_'.$env.'.php', 'index.php'); + return ['app_'.$env.'.php', 'app.php', 'index_'.$env.'.php', 'index.php']; } private function findBestPort() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/WebServer.php symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/WebServer.php --- symfony-3.4.21+dfsg/src/Symfony/Bundle/WebServerBundle/WebServer.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Bundle/WebServerBundle/WebServer.php 2019-02-03 12:23:08.000000000 +0000 @@ -150,12 +150,12 @@ throw new \RuntimeException('Unable to find the PHP binary.'); } - $process = new Process(array_merge(array($binary), $finder->findArguments(), array('-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter()))); + $process = new Process(array_merge([$binary], $finder->findArguments(), ['-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter()])); $process->setWorkingDirectory($config->getDocumentRoot()); $process->setTimeout(null); if (\in_array('APP_ENV', explode(',', getenv('SYMFONY_DOTENV_VARS')))) { - $process->setEnv(array('APP_ENV' => false)); + $process->setEnv(['APP_ENV' => false]); $process->inheritEnvironmentVariables(); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Packages.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Packages.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Packages.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Packages.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,13 +23,13 @@ class Packages { private $defaultPackage; - private $packages = array(); + private $packages = []; /** * @param PackageInterface $defaultPackage The default package * @param PackageInterface[] $packages Additional packages indexed by name */ - public function __construct(PackageInterface $defaultPackage = null, array $packages = array()) + public function __construct(PackageInterface $defaultPackage = null, array $packages = []) { $this->defaultPackage = $defaultPackage; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PackagesTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PackagesTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PackagesTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PackagesTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ $this->assertEquals($default, $packages->getPackage()); $this->assertEquals($a, $packages->getPackage('a')); - $packages = new Packages($default, array('a' => $a)); + $packages = new Packages($default, ['a' => $a]); $this->assertEquals($default, $packages->getPackage()); $this->assertEquals($a, $packages->getPackage('a')); @@ -37,7 +37,7 @@ { $packages = new Packages( new Package(new StaticVersionStrategy('default')), - array('a' => new Package(new StaticVersionStrategy('a'))) + ['a' => new Package(new StaticVersionStrategy('a'))] ); $this->assertEquals('default', $packages->getVersion('/foo')); @@ -48,7 +48,7 @@ { $packages = new Packages( new Package(new StaticVersionStrategy('default')), - array('a' => new Package(new StaticVersionStrategy('a'))) + ['a' => new Package(new StaticVersionStrategy('a'))] ); $this->assertEquals('/foo?default', $packages->getUrl('/foo')); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PackageTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PackageTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PackageTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PackageTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,22 +29,22 @@ public function getConfigs() { - return array( - array('v1', '', 'http://example.com/foo', 'http://example.com/foo'), - array('v1', '', 'https://example.com/foo', 'https://example.com/foo'), - array('v1', '', '//example.com/foo', '//example.com/foo'), + return [ + ['v1', '', 'http://example.com/foo', 'http://example.com/foo'], + ['v1', '', 'https://example.com/foo', 'https://example.com/foo'], + ['v1', '', '//example.com/foo', '//example.com/foo'], - array('v1', '', '/foo', '/foo?v1'), - array('v1', '', 'foo', 'foo?v1'), + ['v1', '', '/foo', '/foo?v1'], + ['v1', '', 'foo', 'foo?v1'], - array(null, '', '/foo', '/foo'), - array(null, '', 'foo', 'foo'), + [null, '', '/foo', '/foo'], + [null, '', 'foo', 'foo'], - array('v1', 'version-%2$s/%1$s', '/foo', '/version-v1/foo'), - array('v1', 'version-%2$s/%1$s', 'foo', 'version-v1/foo'), - array('v1', 'version-%2$s/%1$s', 'foo/', 'version-v1/foo/'), - array('v1', 'version-%2$s/%1$s', '/foo/', '/version-v1/foo/'), - ); + ['v1', 'version-%2$s/%1$s', '/foo', '/version-v1/foo'], + ['v1', 'version-%2$s/%1$s', 'foo', 'version-v1/foo'], + ['v1', 'version-%2$s/%1$s', 'foo/', 'version-v1/foo/'], + ['v1', 'version-%2$s/%1$s', '/foo/', '/version-v1/foo/'], + ]; } public function testGetVersion() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PathPackageTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PathPackageTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/PathPackageTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/PathPackageTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,24 +28,24 @@ public function getConfigs() { - return array( - array('/foo', '', 'http://example.com/foo', 'http://example.com/foo'), - array('/foo', '', 'https://example.com/foo', 'https://example.com/foo'), - array('/foo', '', '//example.com/foo', '//example.com/foo'), - - array('', '', '/foo', '/foo?v1'), - - array('/foo', '', '/bar', '/bar?v1'), - array('/foo', '', 'bar', '/foo/bar?v1'), - array('foo', '', 'bar', '/foo/bar?v1'), - array('foo/', '', 'bar', '/foo/bar?v1'), - array('/foo/', '', 'bar', '/foo/bar?v1'), - - array('/foo', 'version-%2$s/%1$s', '/bar', '/version-v1/bar'), - array('/foo', 'version-%2$s/%1$s', 'bar', '/foo/version-v1/bar'), - array('/foo', 'version-%2$s/%1$s', 'bar/', '/foo/version-v1/bar/'), - array('/foo', 'version-%2$s/%1$s', '/bar/', '/version-v1/bar/'), - ); + return [ + ['/foo', '', 'http://example.com/foo', 'http://example.com/foo'], + ['/foo', '', 'https://example.com/foo', 'https://example.com/foo'], + ['/foo', '', '//example.com/foo', '//example.com/foo'], + + ['', '', '/foo', '/foo?v1'], + + ['/foo', '', '/bar', '/bar?v1'], + ['/foo', '', 'bar', '/foo/bar?v1'], + ['foo', '', 'bar', '/foo/bar?v1'], + ['foo/', '', 'bar', '/foo/bar?v1'], + ['/foo/', '', 'bar', '/foo/bar?v1'], + + ['/foo', 'version-%2$s/%1$s', '/bar', '/version-v1/bar'], + ['/foo', 'version-%2$s/%1$s', 'bar', '/foo/version-v1/bar'], + ['/foo', 'version-%2$s/%1$s', 'bar/', '/foo/version-v1/bar/'], + ['/foo', 'version-%2$s/%1$s', '/bar/', '/version-v1/bar/'], + ]; } /** @@ -60,19 +60,19 @@ public function getContextConfigs() { - return array( - array('', '/foo', '', '/baz', '/baz?v1'), - array('', '/foo', '', 'baz', '/foo/baz?v1'), - array('', 'foo', '', 'baz', '/foo/baz?v1'), - array('', 'foo/', '', 'baz', '/foo/baz?v1'), - array('', '/foo/', '', 'baz', '/foo/baz?v1'), - - array('/bar', '/foo', '', '/baz', '/baz?v1'), - array('/bar', '/foo', '', 'baz', '/bar/foo/baz?v1'), - array('/bar', 'foo', '', 'baz', '/bar/foo/baz?v1'), - array('/bar', 'foo/', '', 'baz', '/bar/foo/baz?v1'), - array('/bar', '/foo/', '', 'baz', '/bar/foo/baz?v1'), - ); + return [ + ['', '/foo', '', '/baz', '/baz?v1'], + ['', '/foo', '', 'baz', '/foo/baz?v1'], + ['', 'foo', '', 'baz', '/foo/baz?v1'], + ['', 'foo/', '', 'baz', '/foo/baz?v1'], + ['', '/foo/', '', 'baz', '/foo/baz?v1'], + + ['/bar', '/foo', '', '/baz', '/baz?v1'], + ['/bar', '/foo', '', 'baz', '/bar/foo/baz?v1'], + ['/bar', 'foo', '', 'baz', '/bar/foo/baz?v1'], + ['/bar', 'foo/', '', 'baz', '/bar/foo/baz?v1'], + ['/bar', '/foo/', '', 'baz', '/bar/foo/baz?v1'], + ]; } public function testVersionStrategyGivesAbsoluteURL() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/UrlPackageTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/UrlPackageTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/UrlPackageTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/UrlPackageTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,26 +29,26 @@ public function getConfigs() { - return array( - array('http://example.net', '', 'http://example.com/foo', 'http://example.com/foo'), - array('http://example.net', '', 'https://example.com/foo', 'https://example.com/foo'), - array('http://example.net', '', '//example.com/foo', '//example.com/foo'), - - array('http://example.com', '', '/foo', 'http://example.com/foo?v1'), - array('http://example.com', '', 'foo', 'http://example.com/foo?v1'), - array('http://example.com/', '', 'foo', 'http://example.com/foo?v1'), - array('http://example.com/foo', '', 'foo', 'http://example.com/foo/foo?v1'), - array('http://example.com/foo/', '', 'foo', 'http://example.com/foo/foo?v1'), - - array(array('http://example.com'), '', '/foo', 'http://example.com/foo?v1'), - array(array('http://example.com', 'http://example.net'), '', '/foo', 'http://example.com/foo?v1'), - array(array('http://example.com', 'http://example.net'), '', '/fooa', 'http://example.net/fooa?v1'), - - array('http://example.com', 'version-%2$s/%1$s', '/foo', 'http://example.com/version-v1/foo'), - array('http://example.com', 'version-%2$s/%1$s', 'foo', 'http://example.com/version-v1/foo'), - array('http://example.com', 'version-%2$s/%1$s', 'foo/', 'http://example.com/version-v1/foo/'), - array('http://example.com', 'version-%2$s/%1$s', '/foo/', 'http://example.com/version-v1/foo/'), - ); + return [ + ['http://example.net', '', 'http://example.com/foo', 'http://example.com/foo'], + ['http://example.net', '', 'https://example.com/foo', 'https://example.com/foo'], + ['http://example.net', '', '//example.com/foo', '//example.com/foo'], + + ['http://example.com', '', '/foo', 'http://example.com/foo?v1'], + ['http://example.com', '', 'foo', 'http://example.com/foo?v1'], + ['http://example.com/', '', 'foo', 'http://example.com/foo?v1'], + ['http://example.com/foo', '', 'foo', 'http://example.com/foo/foo?v1'], + ['http://example.com/foo/', '', 'foo', 'http://example.com/foo/foo?v1'], + + [['http://example.com'], '', '/foo', 'http://example.com/foo?v1'], + [['http://example.com', 'http://example.net'], '', '/foo', 'http://example.com/foo?v1'], + [['http://example.com', 'http://example.net'], '', '/fooa', 'http://example.net/fooa?v1'], + + ['http://example.com', 'version-%2$s/%1$s', '/foo', 'http://example.com/version-v1/foo'], + ['http://example.com', 'version-%2$s/%1$s', 'foo', 'http://example.com/version-v1/foo'], + ['http://example.com', 'version-%2$s/%1$s', 'foo/', 'http://example.com/version-v1/foo/'], + ['http://example.com', 'version-%2$s/%1$s', '/foo/', 'http://example.com/version-v1/foo/'], + ]; } /** @@ -63,18 +63,18 @@ public function getContextConfigs() { - return array( - array(false, 'http://example.com', '', 'foo', 'http://example.com/foo?v1'), - array(false, array('http://example.com'), '', 'foo', 'http://example.com/foo?v1'), - array(false, array('http://example.com', 'https://example.com'), '', 'foo', 'http://example.com/foo?v1'), - array(false, array('http://example.com', 'https://example.com'), '', 'fooa', 'https://example.com/fooa?v1'), - array(false, array('http://example.com/bar'), '', 'foo', 'http://example.com/bar/foo?v1'), - array(false, array('http://example.com/bar/'), '', 'foo', 'http://example.com/bar/foo?v1'), - array(false, array('//example.com/bar/'), '', 'foo', '//example.com/bar/foo?v1'), - - array(true, array('http://example.com'), '', 'foo', 'http://example.com/foo?v1'), - array(true, array('http://example.com', 'https://example.com'), '', 'foo', 'https://example.com/foo?v1'), - ); + return [ + [false, 'http://example.com', '', 'foo', 'http://example.com/foo?v1'], + [false, ['http://example.com'], '', 'foo', 'http://example.com/foo?v1'], + [false, ['http://example.com', 'https://example.com'], '', 'foo', 'http://example.com/foo?v1'], + [false, ['http://example.com', 'https://example.com'], '', 'fooa', 'https://example.com/fooa?v1'], + [false, ['http://example.com/bar'], '', 'foo', 'http://example.com/bar/foo?v1'], + [false, ['http://example.com/bar/'], '', 'foo', 'http://example.com/bar/foo?v1'], + [false, ['//example.com/bar/'], '', 'foo', '//example.com/bar/foo?v1'], + + [true, ['http://example.com'], '', 'foo', 'http://example.com/foo?v1'], + [true, ['http://example.com', 'https://example.com'], '', 'foo', 'https://example.com/foo?v1'], + ]; } public function testVersionStrategyGivesAbsoluteURL() @@ -93,7 +93,7 @@ */ public function testNoBaseUrls() { - new UrlPackage(array(), new EmptyVersionStrategy()); + new UrlPackage([], new EmptyVersionStrategy()); } /** @@ -101,7 +101,7 @@ */ public function testWrongBaseUrl() { - new UrlPackage(array('not-a-url'), new EmptyVersionStrategy()); + new UrlPackage(['not-a-url'], new EmptyVersionStrategy()); } private function getContext($secure) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/VersionStrategy/StaticVersionStrategyTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/VersionStrategy/StaticVersionStrategyTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/Tests/VersionStrategy/StaticVersionStrategyTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/Tests/VersionStrategy/StaticVersionStrategyTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,9 +36,9 @@ public function getConfigs() { - return array( - array('test-path', 'v1', null), - array('test-path', 'v2', '%s?test%s'), - ); + return [ + ['test-path', 'v1', null], + ['test-path', 'v2', '%s?test%s'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Asset/UrlPackage.php symfony-3.4.22+dfsg/src/Symfony/Component/Asset/UrlPackage.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Asset/UrlPackage.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Asset/UrlPackage.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,7 +35,7 @@ */ class UrlPackage extends Package { - private $baseUrls = array(); + private $baseUrls = []; private $sslPackage; /** @@ -125,7 +125,7 @@ private function getSslUrls($urls) { - $sslUrls = array(); + $sslUrls = []; foreach ($urls as $url) { if ('https://' === substr($url, 0, 8) || '//' === substr($url, 0, 2)) { $sslUrls[] = $url; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Client.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Client.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Client.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Client.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ { protected $history; protected $cookieJar; - protected $server = array(); + protected $server = []; protected $internalRequest; protected $request; protected $internalResponse; @@ -42,7 +42,7 @@ private $maxRedirects = -1; private $redirectCount = 0; - private $redirects = array(); + private $redirects = []; private $isMainRequest = true; /** @@ -50,7 +50,7 @@ * @param History $history A History instance to store the browser history * @param CookieJar $cookieJar A CookieJar instance to store the cookies */ - public function __construct(array $server = array(), History $history = null, CookieJar $cookieJar = null) + public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null) { $this->setServerParameters($server); $this->history = $history ?: new History(); @@ -121,9 +121,9 @@ */ public function setServerParameters(array $server) { - $this->server = array_merge(array( + $this->server = array_merge([ 'HTTP_USER_AGENT' => 'Symfony BrowserKit', - ), $server); + ], $server); } /** @@ -252,7 +252,7 @@ * * @return Crawler */ - public function submit(Form $form, array $values = array()) + public function submit(Form $form, array $values = []) { $form->setValues($values); @@ -272,7 +272,7 @@ * * @return Crawler */ - public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true) + public function request($method, $uri, array $parameters = [], array $files = [], array $server = [], $content = null, $changeHistory = true) { if ($this->isMainRequest) { $this->redirectCount = 0; @@ -359,7 +359,7 @@ if (file_exists($deprecationsFile)) { $deprecations = file_get_contents($deprecationsFile); unlink($deprecationsFile); - foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) { + foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) { if ($deprecation[0]) { @trigger_error($deprecation[1], E_USER_DEPRECATED); } else { @@ -503,9 +503,9 @@ $request = $this->internalRequest; - if (\in_array($this->internalResponse->getStatus(), array(301, 302, 303))) { + if (\in_array($this->internalResponse->getStatus(), [301, 302, 303])) { $method = 'GET'; - $files = array(); + $files = []; $content = null; } else { $method = $request->getMethod(); @@ -515,7 +515,7 @@ if ('GET' === strtoupper($method)) { // Don't forward parameters for GET request as it should reach the redirection URI - $parameters = array(); + $parameters = []; } else { $parameters = $request->getParameters(); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/CookieJar.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/CookieJar.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/CookieJar.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/CookieJar.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ class CookieJar { - protected $cookieJar = array(); + protected $cookieJar = []; public function set(Cookie $cookie) { @@ -84,7 +84,7 @@ // this should never happen but it allows for a better BC $domains = array_keys($this->cookieJar); } else { - $domains = array($domain); + $domains = [$domain]; } foreach ($domains as $domain) { @@ -105,7 +105,7 @@ */ public function clear() { - $this->cookieJar = array(); + $this->cookieJar = []; } /** @@ -116,7 +116,7 @@ */ public function updateFromSetCookie(array $setCookies, $uri = null) { - $cookies = array(); + $cookies = []; foreach ($setCookies as $cookie) { foreach (explode(',', $cookie) as $i => $part) { @@ -157,7 +157,7 @@ { $this->flushExpiredCookies(); - $flattenedCookies = array(); + $flattenedCookies = []; foreach ($this->cookieJar as $path) { foreach ($path as $cookies) { foreach ($cookies as $cookie) { @@ -181,8 +181,8 @@ { $this->flushExpiredCookies(); - $parts = array_replace(array('path' => '/'), parse_url($uri)); - $cookies = array(); + $parts = array_replace(['path' => '/'], parse_url($uri)); + $cookies = []; foreach ($this->cookieJar as $domain => $pathCookies) { if ($domain) { $domain = '.'.ltrim($domain, '.'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Cookie.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Cookie.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Cookie.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Cookie.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ * Handles dates as defined by RFC 2616 section 3.3.1, and also some other * non-standard, but common formats. */ - private static $dateFormats = array( + private static $dateFormats = [ 'D, d M Y H:i:s T', 'D, d-M-y H:i:s T', 'D, d-M-Y H:i:s T', @@ -30,7 +30,7 @@ 'D, d-m-Y H:i:s T', 'D M j G:i:s Y', 'D M d H:i:s Y T', - ); + ]; protected $name; protected $value; @@ -129,7 +129,7 @@ list($name, $value) = explode('=', array_shift($parts), 2); - $values = array( + $values = [ 'name' => trim($name), 'value' => trim($value), 'expires' => null, @@ -138,7 +138,7 @@ 'secure' => false, 'httponly' => false, 'passedRawValue' => true, - ); + ]; if (null !== $url) { if ((false === $urlParts = parse_url($url)) || !isset($urlParts['host'])) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/History.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/History.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/History.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/History.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ class History { - protected $stack = array(); + protected $stack = []; protected $position = -1; /** @@ -26,7 +26,7 @@ */ public function clear() { - $this->stack = array(); + $this->stack = []; $this->position = -1; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Request.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Request.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Request.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Request.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ * @param array $server An array of server parameters * @param string $content The raw body data */ - public function __construct($uri, $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), $content = null) + public function __construct($uri, $method, array $parameters = [], array $files = [], array $cookies = [], array $server = [], $content = null) { $this->uri = $uri; $this->method = $method; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Response.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Response.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Response.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Response.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ * @param int $status The response status code * @param array $headers An array of headers */ - public function __construct($content = '', $status = 200, array $headers = array()) + public function __construct($content = '', $status = 200, array $headers = []) { $this->content = $content; $this->status = $status; @@ -116,10 +116,10 @@ return \is_array($value) ? (\count($value) ? $value[0] : '') : $value; } - return \is_array($value) ? $value : array($value); + return \is_array($value) ? $value : [$value]; } } - return $first ? null : array(); + return $first ? null : []; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/ClientTest.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/ClientTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/ClientTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/ClientTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -76,13 +76,13 @@ { public function testGetHistory() { - $client = new TestClient(array(), $history = new History()); + $client = new TestClient([], $history = new History()); $this->assertSame($history, $client->getHistory(), '->getHistory() returns the History'); } public function testGetCookieJar() { - $client = new TestClient(array(), null, $cookieJar = new CookieJar()); + $client = new TestClient([], null, $cookieJar = new CookieJar()); $this->assertSame($cookieJar, $client->getCookieJar(), '->getCookieJar() returns the CookieJar'); } @@ -97,7 +97,7 @@ public function testGetRequestWithIpAsHttpHost() { $client = new TestClient(); - $client->request('GET', 'https://example.com/foo', array(), array(), array('HTTP_HOST' => '127.0.0.1')); + $client->request('GET', 'https://example.com/foo', [], [], ['HTTP_HOST' => '127.0.0.1']); $this->assertEquals('https://example.com/foo', $client->getRequest()->getUri()); $headers = $client->getRequest()->getServer(); @@ -130,7 +130,7 @@ $json = '{"jsonrpc":"2.0","method":"echo","id":7,"params":["Hello World"]}'; $client = new TestClient(); - $client->request('POST', 'http://example.com/jsonrpc', array(), array(), array(), $json); + $client->request('POST', 'http://example.com/jsonrpc', [], [], [], $json); $this->assertEquals($json, $client->getRequest()->getContent()); } @@ -246,18 +246,18 @@ public function testRequestCookies() { $client = new TestClient(); - $client->setNextResponse(new Response('foo', 200, array('Set-Cookie' => 'foo=bar'))); + $client->setNextResponse(new Response('foo', 200, ['Set-Cookie' => 'foo=bar'])); $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); + $this->assertEquals(['foo' => 'bar'], $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); $client->request('GET', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); + $this->assertEquals(['foo' => 'bar'], $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); } public function testRequestSecureCookies() { $client = new TestClient(); - $client->setNextResponse(new Response('foo', 200, array('Set-Cookie' => 'foo=bar; path=/; secure'))); + $client->setNextResponse(new Response('foo', 200, ['Set-Cookie' => 'foo=bar; path=/; secure'])); $client->request('GET', 'https://www.example.com/foo/foobar'); $this->assertTrue($client->getCookieJar()->get('foo', '/', 'www.example.com')->isSecure()); @@ -298,7 +298,7 @@ public function testSubmitPreserveAuth() { - $client = new TestClient(array('PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar')); + $client = new TestClient(['PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar']); $client->setNextResponse(new Response('')); $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -332,26 +332,26 @@ $this->assertInstanceOf('LogicException', $e, '->followRedirect() throws a \LogicException if the request was not redirected'); } - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $client->followRedirect(); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() automatically follows redirects if followRedirects is true'); $client = new TestClient(); - $client->setNextResponse(new Response('', 201, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 201, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->followRedirect() does not follow redirect if HTTP Code is not 30x'); $client = new TestClient(); - $client->setNextResponse(new Response('', 201, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 201, ['Location' => 'http://www.example.com/redirected'])); $client->followRedirects(false); $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -366,12 +366,12 @@ public function testFollowRelativeRedirect() { $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => '/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected:1234'))); + $client->setNextResponse(new Response('', 302, ['Location' => '/redirected:1234'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected:1234', $client->getRequest()->getUri(), '->followRedirect() follows relative urls'); } @@ -380,11 +380,11 @@ { $client = new TestClient(); $client->setMaxRedirects(1); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected2'))); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected2'])); try { $client->followRedirect(); $this->fail('->followRedirect() throws a \LogicException if the request was redirected and limit of redirections was reached'); @@ -392,60 +392,60 @@ $this->assertInstanceOf('LogicException', $e, '->followRedirect() throws a \LogicException if the request was redirected and limit of redirections was reached'); } - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected'))); + $client->setNextResponse(new Response('', 302, ['Location' => '/redirected'])); $client->request('GET', 'http://www.example.com/foo/foobar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows relative URLs'); $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '//www.example.org/'))); + $client->setNextResponse(new Response('', 302, ['Location' => '//www.example.org/'])); $client->request('GET', 'https://www.example.com/'); $this->assertEquals('https://www.example.org/', $client->getRequest()->getUri(), '->followRedirect() follows protocol-relative URLs'); $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('POST', 'http://www.example.com/foo/foobar', array('name' => 'bar')); + $client->setNextResponse(new Response('', 302, ['Location' => 'http://www.example.com/redirected'])); + $client->request('POST', 'http://www.example.com/foo/foobar', ['name' => 'bar']); $this->assertEquals('GET', $client->getRequest()->getMethod(), '->followRedirect() uses a GET for 302'); - $this->assertEquals(array(), $client->getRequest()->getParameters(), '->followRedirect() does not submit parameters when changing the method'); + $this->assertEquals([], $client->getRequest()->getParameters(), '->followRedirect() does not submit parameters when changing the method'); } public function testFollowRedirectWithCookies() { $client = new TestClient(); $client->followRedirects(false); - $client->setNextResponse(new Response('', 302, array( + $client->setNextResponse(new Response('', 302, [ 'Location' => 'http://www.example.com/redirected', 'Set-Cookie' => 'foo=bar', - ))); + ])); $client->request('GET', 'http://www.example.com/'); - $this->assertEquals(array(), $client->getRequest()->getCookies()); + $this->assertEquals([], $client->getRequest()->getCookies()); $client->followRedirect(); - $this->assertEquals(array('foo' => 'bar'), $client->getRequest()->getCookies()); + $this->assertEquals(['foo' => 'bar'], $client->getRequest()->getCookies()); } public function testFollowRedirectWithHeaders() { - $headers = array( + $headers = [ 'HTTP_HOST' => 'www.example.com', 'HTTP_USER_AGENT' => 'Symfony BrowserKit', 'CONTENT_TYPE' => 'application/vnd.custom+xml', 'HTTPS' => false, - ); + ]; $client = new TestClient(); $client->followRedirects(false); - $client->setNextResponse(new Response('', 302, array( + $client->setNextResponse(new Response('', 302, [ 'Location' => 'http://www.example.com/redirected', - ))); - $client->request('GET', 'http://www.example.com/', array(), array(), array( + ])); + $client->request('GET', 'http://www.example.com/', [], [], [ 'CONTENT_TYPE' => 'application/vnd.custom+xml', - )); + ]); $this->assertEquals($headers, $client->getRequest()->getServer()); @@ -458,17 +458,17 @@ public function testFollowRedirectWithPort() { - $headers = array( + $headers = [ 'HTTP_HOST' => 'www.example.com:8080', 'HTTP_USER_AGENT' => 'Symfony BrowserKit', 'HTTPS' => false, 'HTTP_REFERER' => 'http://www.example.com:8080/', - ); + ]; $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array( + $client->setNextResponse(new Response('', 302, [ 'Location' => 'http://www.example.com:8080/redirected', - ))); + ])); $client->request('GET', 'http://www.example.com:8080/'); $this->assertEquals($headers, $client->getRequest()->getServer()); @@ -492,14 +492,14 @@ public function testFollowRedirectWithPostMethod() { - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); + $parameters = ['foo' => 'bar']; + $files = ['myfile.foo' => 'baz']; + $server = ['X_TEST_FOO' => 'bazbar']; $content = 'foobarbaz'; $client = new TestClient(); - $client->setNextResponse(new Response('', 307, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 307, ['Location' => 'http://www.example.com/redirected'])); $client->request('POST', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect with POST method'); @@ -512,15 +512,15 @@ public function testFollowRedirectDropPostMethod() { - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); + $parameters = ['foo' => 'bar']; + $files = ['myfile.foo' => 'baz']; + $server = ['X_TEST_FOO' => 'bazbar']; $content = 'foobarbaz'; $client = new TestClient(); - foreach (array(301, 302, 303) as $code) { - $client->setNextResponse(new Response('', $code, array('Location' => 'http://www.example.com/redirected'))); + foreach ([301, 302, 303] as $code) { + $client->setNextResponse(new Response('', $code, ['Location' => 'http://www.example.com/redirected'])); $client->request('POST', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect with POST method on response code: '.$code.'.'); @@ -536,9 +536,9 @@ { $client = new TestClient(); - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); + $parameters = ['foo' => 'bar']; + $files = ['myfile.foo' => 'baz']; + $server = ['X_TEST_FOO' => 'bazbar']; $content = 'foobarbaz'; $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); @@ -556,9 +556,9 @@ { $client = new TestClient(); - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); + $parameters = ['foo' => 'bar']; + $files = ['myfile.foo' => 'baz']; + $server = ['X_TEST_FOO' => 'bazbar']; $content = 'foobarbaz'; $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -578,7 +578,7 @@ $client = new TestClient(); $client->request('GET', 'http://www.example.com/foo'); - $client->setNextResponse(new Response('', 301, array('Location' => 'http://www.example.com/redirected'))); + $client->setNextResponse(new Response('', 301, ['Location' => 'http://www.example.com/redirected'])); $client->request('GET', 'http://www.example.com/bar'); $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), 'client followed redirect'); @@ -596,9 +596,9 @@ { $client = new TestClient(); - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); + $parameters = ['foo' => 'bar']; + $files = ['myfile.foo' => 'baz']; + $server = ['X_TEST_FOO' => 'bazbar']; $content = 'foobarbaz'; $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); @@ -618,7 +618,7 @@ $client->restart(); $this->assertTrue($client->getHistory()->isEmpty(), '->restart() clears the history'); - $this->assertEquals(array(), $client->getCookieJar()->all(), '->restart() clears the cookies'); + $this->assertEquals([], $client->getCookieJar()->all(), '->restart() clears the cookies'); } public function testInsulatedRequests() @@ -669,12 +669,12 @@ $this->assertEquals('', $client->getServerParameter('HTTP_HOST')); $this->assertEquals('Symfony BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - $client->request('GET', 'https://www.example.com/https/www.example.com', array(), array(), array( + $client->request('GET', 'https://www.example.com/https/www.example.com', [], [], [ 'HTTP_HOST' => 'testhost', 'HTTP_USER_AGENT' => 'testua', 'HTTPS' => false, 'NEW_SERVER_KEY' => 'new-server-key-value', - )); + ]); $this->assertEquals('', $client->getServerParameter('HTTP_HOST')); $this->assertEquals('Symfony BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); @@ -700,16 +700,16 @@ { $client = new TestClient(); - $client->request('GET', '/', array(), array(), array( + $client->request('GET', '/', [], [], [ 'HTTP_HOST' => 'testhost', 'HTTPS' => true, - )); + ]); $this->assertEquals('https://testhost/', $client->getRequest()->getUri()); - $client->request('GET', 'https://www.example.com/', array(), array(), array( + $client->request('GET', 'https://www.example.com/', [], [], [ 'HTTP_HOST' => 'testhost', 'HTTPS' => false, - )); + ]); $this->assertEquals('https://www.example.com/', $client->getRequest()->getUri()); } @@ -717,12 +717,12 @@ { $client = new TestClient(); - $client->request('GET', 'https://www.example.com/https/www.example.com', array(), array(), array( + $client->request('GET', 'https://www.example.com/https/www.example.com', [], [], [ 'HTTP_HOST' => 'testhost', 'HTTP_USER_AGENT' => 'testua', 'HTTPS' => false, 'NEW_SERVER_KEY' => 'new-server-key-value', - )); + ]); $this->assertInstanceOf('Symfony\Component\BrowserKit\Request', $client->getInternalRequest()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,7 +45,7 @@ $cookieJar->set($cookie1 = new Cookie('foo', 'bar')); $cookieJar->set($cookie2 = new Cookie('bar', 'foo')); - $this->assertEquals(array($cookie1, $cookie2), $cookieJar->all(), '->all() returns all cookies in the jar'); + $this->assertEquals([$cookie1, $cookie2], $cookieJar->all(), '->all() returns all cookies in the jar'); } public function testClear() @@ -56,12 +56,12 @@ $cookieJar->clear(); - $this->assertEquals(array(), $cookieJar->all(), '->clear() expires all cookies'); + $this->assertEquals([], $cookieJar->all(), '->clear() expires all cookies'); } public function testUpdateFromResponse() { - $response = new Response('', 200, array('Set-Cookie' => 'foo=foo')); + $response = new Response('', 200, ['Set-Cookie' => 'foo=foo']); $cookieJar = new CookieJar(); $cookieJar->updateFromResponse($response); @@ -71,7 +71,7 @@ public function testUpdateFromSetCookie() { - $setCookies = array('foo=foo'); + $setCookies = ['foo=foo']; $cookieJar = new CookieJar(); $cookieJar->set(new Cookie('bar', 'bar')); @@ -86,15 +86,15 @@ public function testUpdateFromEmptySetCookie() { $cookieJar = new CookieJar(); - $cookieJar->updateFromSetCookie(array('')); - $this->assertEquals(array(), $cookieJar->all()); + $cookieJar->updateFromSetCookie(['']); + $this->assertEquals([], $cookieJar->all()); } public function testUpdateFromSetCookieWithMultipleCookies() { $timestamp = time() + 3600; $date = gmdate('D, d M Y H:i:s \G\M\T', $timestamp); - $setCookies = array(sprintf('foo=foo; expires=%s; domain=.symfony.com; path=/, bar=bar; domain=.blog.symfony.com, PHPSESSID=id; expires=%1$s', $date)); + $setCookies = [sprintf('foo=foo; expires=%s; domain=.symfony.com; path=/, bar=bar; domain=.blog.symfony.com, PHPSESSID=id; expires=%1$s', $date)]; $cookieJar = new CookieJar(); $cookieJar->updateFromSetCookie($setCookies); @@ -132,15 +132,15 @@ public function provideAllValuesValues() { - return array( - array('http://www.example.com', array('foo_nothing', 'foo_domain')), - array('http://www.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example1.com/', array('foo_nothing')), - array('https://foo.example.com/', array('foo_nothing', 'foo_secure', 'foo_domain')), - array('http://www.example.com/foo/bar', array('foo_nothing', 'foo_path', 'foo_domain')), - array('http://www4.example.com/', array('foo_nothing', 'foo_domain', 'foo_strict_domain')), - ); + return [ + ['http://www.example.com', ['foo_nothing', 'foo_domain']], + ['http://www.example.com/', ['foo_nothing', 'foo_domain']], + ['http://foo.example.com/', ['foo_nothing', 'foo_domain']], + ['http://foo.example1.com/', ['foo_nothing']], + ['https://foo.example.com/', ['foo_nothing', 'foo_secure', 'foo_domain']], + ['http://www.example.com/foo/bar', ['foo_nothing', 'foo_path', 'foo_domain']], + ['http://www4.example.com/', ['foo_nothing', 'foo_domain', 'foo_strict_domain']], + ]; } public function testEncodedValues() @@ -148,8 +148,8 @@ $cookieJar = new CookieJar(); $cookieJar->set($cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true)); - $this->assertEquals(array('foo' => 'bar=baz'), $cookieJar->allValues('/')); - $this->assertEquals(array('foo' => 'bar%3Dbaz'), $cookieJar->allRawValues('/')); + $this->assertEquals(['foo' => 'bar=baz'], $cookieJar->allValues('/')); + $this->assertEquals(['foo' => 'bar%3Dbaz'], $cookieJar->allRawValues('/')); } public function testCookieExpireWithSameNameButDifferentPaths() @@ -160,9 +160,9 @@ $cookieJar->expire('foo', '/foo'); $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array(), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); + $this->assertEquals([], array_keys($cookieJar->allValues('http://example.com/'))); + $this->assertEquals([], $cookieJar->allValues('http://example.com/foo')); + $this->assertEquals(['foo' => 'bar2'], $cookieJar->allValues('http://example.com/bar')); } public function testCookieExpireWithNullPaths() @@ -172,7 +172,7 @@ $cookieJar->expire('foo', null); $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); + $this->assertEquals([], array_keys($cookieJar->allValues('http://example.com/'))); } public function testCookieExpireWithDomain() @@ -182,7 +182,7 @@ $cookieJar->expire('foo', '/foo', 'http://example2.com/'); $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example2.com/'))); + $this->assertEquals([], array_keys($cookieJar->allValues('http://example2.com/'))); } public function testCookieWithSameNameButDifferentPaths() @@ -191,9 +191,9 @@ $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo')); $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar')); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); + $this->assertEquals([], array_keys($cookieJar->allValues('http://example.com/'))); + $this->assertEquals(['foo' => 'bar1'], $cookieJar->allValues('http://example.com/foo')); + $this->assertEquals(['foo' => 'bar2'], $cookieJar->allValues('http://example.com/bar')); } public function testCookieWithSameNameButDifferentDomains() @@ -202,9 +202,9 @@ $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/', 'foo.example.com')); $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/', 'bar.example.com')); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://foo.example.com/')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://bar.example.com/')); + $this->assertEquals([], array_keys($cookieJar->allValues('http://example.com/'))); + $this->assertEquals(['foo' => 'bar1'], $cookieJar->allValues('http://foo.example.com/')); + $this->assertEquals(['foo' => 'bar2'], $cookieJar->allValues('http://bar.example.com/')); } public function testCookieGetWithSubdomain() @@ -246,7 +246,7 @@ $cookieJar = new CookieJar(); $cookieJar->set(new Cookie('foo', 'bar', null, '/', '.example.com')); - $this->assertEquals(array('foo' => 'bar'), $cookieJar->allValues('http://www.example.com')); + $this->assertEquals(['foo' => 'bar'], $cookieJar->allValues('http://www.example.com')); $this->assertEmpty($cookieJar->allValues('http://wwwexample.com')); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieTest.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/CookieTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -41,16 +41,16 @@ public function getTestsForToFromString() { - return array( - array('foo=bar; path=/'), - array('foo=bar; path=/foo'), - array('foo=bar; domain=google.com; path=/'), - array('foo=bar; domain=example.com; path=/; secure', 'https://example.com/'), - array('foo=bar; path=/; httponly'), - array('foo=bar; domain=google.com; path=/foo; secure; httponly', 'https://google.com/'), - array('foo=bar=baz; path=/'), - array('foo=bar%3Dbaz; path=/'), - ); + return [ + ['foo=bar; path=/'], + ['foo=bar; path=/foo'], + ['foo=bar; domain=google.com; path=/'], + ['foo=bar; domain=example.com; path=/; secure', 'https://example.com/'], + ['foo=bar; path=/; httponly'], + ['foo=bar; domain=google.com; path=/foo; secure; httponly', 'https://google.com/'], + ['foo=bar=baz; path=/'], + ['foo=bar%3Dbaz; path=/'], + ]; } public function testFromStringIgnoreSecureFlag() @@ -69,16 +69,16 @@ public function getExpireCookieStrings() { - return array( - array('foo=bar; expires=Fri, 31-Jul-2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31-07-2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31-07-20 08:49:37 GMT'), - array('foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'), - array('foo=bar; expires=Fri Jul 31 08:49:37 2020'), - array('foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''), - array('foo=bar; expires=Friday July 31st 2020, 08:49:37 GMT'), - ); + return [ + ['foo=bar; expires=Fri, 31-Jul-2020 08:49:37 GMT'], + ['foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'], + ['foo=bar; expires=Fri, 31-07-2020 08:49:37 GMT'], + ['foo=bar; expires=Fri, 31-07-20 08:49:37 GMT'], + ['foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'], + ['foo=bar; expires=Fri Jul 31 08:49:37 2020'], + ['foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''], + ['foo=bar; expires=Friday July 31st 2020, 08:49:37 GMT'], + ]; } public function testFromStringWithCapitalization() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/RequestTest.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/RequestTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/RequestTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/RequestTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,25 +30,25 @@ public function testGetParameters() { - $request = new Request('http://www.example.com/', 'get', array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getParameters(), '->getParameters() returns the parameters of the request'); + $request = new Request('http://www.example.com/', 'get', ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $request->getParameters(), '->getParameters() returns the parameters of the request'); } public function testGetFiles() { - $request = new Request('http://www.example.com/', 'get', array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getFiles(), '->getFiles() returns the uploaded files of the request'); + $request = new Request('http://www.example.com/', 'get', [], ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $request->getFiles(), '->getFiles() returns the uploaded files of the request'); } public function testGetCookies() { - $request = new Request('http://www.example.com/', 'get', array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getCookies(), '->getCookies() returns the cookies of the request'); + $request = new Request('http://www.example.com/', 'get', [], [], ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $request->getCookies(), '->getCookies() returns the cookies of the request'); } public function testGetServer() { - $request = new Request('http://www.example.com/', 'get', array(), array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getServer(), '->getServer() returns the server parameters of the request'); + $request = new Request('http://www.example.com/', 'get', [], [], [], ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $request->getServer(), '->getServer() returns the server parameters of the request'); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,40 +30,40 @@ public function testGetHeaders() { - $response = new Response('foo', 200, array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $response->getHeaders(), '->getHeaders() returns the headers of the response'); + $response = new Response('foo', 200, ['foo' => 'bar']); + $this->assertEquals(['foo' => 'bar'], $response->getHeaders(), '->getHeaders() returns the headers of the response'); } public function testGetHeader() { - $response = new Response('foo', 200, array( + $response = new Response('foo', 200, [ 'Content-Type' => 'text/html', - 'Set-Cookie' => array('foo=bar', 'bar=foo'), - )); + 'Set-Cookie' => ['foo=bar', 'bar=foo'], + ]); $this->assertEquals('text/html', $response->getHeader('Content-Type'), '->getHeader() returns a header of the response'); $this->assertEquals('text/html', $response->getHeader('content-type'), '->getHeader() returns a header of the response'); $this->assertEquals('text/html', $response->getHeader('content_type'), '->getHeader() returns a header of the response'); $this->assertEquals('foo=bar', $response->getHeader('Set-Cookie'), '->getHeader() returns the first header value'); - $this->assertEquals(array('foo=bar', 'bar=foo'), $response->getHeader('Set-Cookie', false), '->getHeader() returns all header values if first is false'); + $this->assertEquals(['foo=bar', 'bar=foo'], $response->getHeader('Set-Cookie', false), '->getHeader() returns all header values if first is false'); $this->assertNull($response->getHeader('foo'), '->getHeader() returns null if the header is not defined'); - $this->assertEquals(array(), $response->getHeader('foo', false), '->getHeader() returns an empty array if the header is not defined and first is set to false'); + $this->assertEquals([], $response->getHeader('foo', false), '->getHeader() returns an empty array if the header is not defined and first is set to false'); } public function testMagicToString() { - $response = new Response('foo', 304, array('foo' => 'bar')); + $response = new Response('foo', 304, ['foo' => 'bar']); $this->assertEquals("foo: bar\n\nfoo", $response->__toString(), '->__toString() returns the headers and the content as a string'); } public function testMagicToStringWithMultipleSetCookieHeader() { - $headers = array( + $headers = [ 'content-type' => 'text/html; charset=utf-8', - 'set-cookie' => array('foo=bar', 'bar=foo'), - ); + 'set-cookie' => ['foo=bar', 'bar=foo'], + ]; $expected = 'content-type: text/html; charset=utf-8'."\n"; $expected .= 'set-cookie: foo=bar'."\n"; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -59,9 +59,9 @@ $getId = function ($key) { return $this->getId((string) $key); }; $this->mergeByLifetime = \Closure::bind( function ($deferred, $namespace, &$expiredIds) use ($getId) { - $byLifetime = array(); + $byLifetime = []; $now = time(); - $expiredIds = array(); + $expiredIds = []; foreach ($deferred as $key => $item) { if (null === $item->expiry) { @@ -123,10 +123,10 @@ $apcu->setLogger($logger); } - return new ChainAdapter(array($apcu, $fs)); + return new ChainAdapter([$apcu, $fs]); } - public static function createConnection($dsn, array $options = array()) + public static function createConnection($dsn, array $options = []) { if (!\is_string($dsn)) { throw new InvalidArgumentException(sprintf('The %s() method expect argument #1 to be string, %s given.', __METHOD__, \gettype($dsn))); @@ -156,11 +156,11 @@ $value = null; try { - foreach ($this->doFetch(array($id)) as $value) { + foreach ($this->doFetch([$id]) as $value) { $isHit = true; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch key "{key}"', ['key' => $key, 'exception' => $e]); } return $f($key, $value, $isHit); @@ -169,12 +169,12 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { if ($this->deferred) { $this->commit(); } - $ids = array(); + $ids = []; foreach ($keys as $key) { $ids[] = $this->getId($key); @@ -182,8 +182,8 @@ try { $items = $this->doFetch($ids); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested items', array('keys' => $keys, 'exception' => $e)); - $items = array(); + CacheItem::log($this->logger, 'Failed to fetch requested items', ['keys' => $keys, 'exception' => $e]); + $items = []; } $ids = array_combine($ids, $keys); @@ -224,7 +224,7 @@ $ok = true; $byLifetime = $this->mergeByLifetime; $byLifetime = $byLifetime($this->deferred, $this->namespace, $expiredIds); - $retry = $this->deferred = array(); + $retry = $this->deferred = []; if ($expiredIds) { $this->doDelete($expiredIds); @@ -234,7 +234,7 @@ $e = $this->doSave($values, $lifetime); } catch (\Exception $e) { } - if (true === $e || array() === $e) { + if (true === $e || [] === $e) { continue; } if (\is_array($e) || 1 === \count($values)) { @@ -242,7 +242,7 @@ $ok = false; $v = $values[$id]; $type = \is_object($v) ? \get_class($v) : \gettype($v); - CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', array('key' => substr($id, \strlen($this->namespace)), 'type' => $type, 'exception' => $e instanceof \Exception ? $e : null)); + CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', ['key' => substr($id, \strlen($this->namespace)), 'type' => $type, 'exception' => $e instanceof \Exception ? $e : null]); } } else { foreach ($values as $id => $v) { @@ -256,15 +256,15 @@ foreach ($ids as $id) { try { $v = $byLifetime[$lifetime][$id]; - $e = $this->doSave(array($id => $v), $lifetime); + $e = $this->doSave([$id => $v], $lifetime); } catch (\Exception $e) { } - if (true === $e || array() === $e) { + if (true === $e || [] === $e) { continue; } $ok = false; $type = \is_object($v) ? \get_class($v) : \gettype($v); - CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', array('key' => substr($id, \strlen($this->namespace)), 'type' => $type, 'exception' => $e instanceof \Exception ? $e : null)); + CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', ['key' => substr($id, \strlen($this->namespace)), 'type' => $type, 'exception' => $e instanceof \Exception ? $e : null]); } } @@ -292,7 +292,7 @@ yield $key => $f($key, $value, true); } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested items', array('keys' => array_values($keys), 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch requested items', ['keys' => array_values($keys), 'exception' => $e]); } foreach ($keys as $key) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/AdapterInterface.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/AdapterInterface.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/AdapterInterface.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/AdapterInterface.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,5 +33,5 @@ * * @return \Traversable|CacheItem[] */ - public function getItems(array $keys = array()); + public function getItems(array $keys = []); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -66,7 +66,7 @@ $isHit = false; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to unserialize key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to unserialize key "{key}"', ['key' => $key, 'exception' => $e]); $this->values[$key] = $value = null; $isHit = false; } @@ -78,7 +78,7 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { foreach ($keys as $key) { CacheItem::validateKey($key); @@ -122,7 +122,7 @@ $value = serialize($value); } catch (\Exception $e) { $type = \is_object($value) ? \get_class($value) : \gettype($value); - CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', array('key' => $key, 'type' => $type, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', ['key' => $key, 'type' => $type, 'exception' => $e]); return false; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ChainAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ChainAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ChainAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ChainAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ */ class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableInterface { - private $adapters = array(); + private $adapters = []; private $adapterCount; private $syncItem; @@ -81,7 +81,7 @@ public function getItem($key) { $syncItem = $this->syncItem; - $misses = array(); + $misses = []; foreach ($this->adapters as $i => $adapter) { $item = $adapter->getItem($key); @@ -103,15 +103,15 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { return $this->generateItems($this->adapters[0]->getItems($keys), 0); } private function generateItems($items, $adapterIndex) { - $missing = array(); - $misses = array(); + $missing = []; + $misses = []; $nextAdapterIndex = $adapterIndex + 1; $nextAdapter = isset($this->adapters[$nextAdapterIndex]) ? $this->adapters[$nextAdapterIndex] : null; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/NullAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/NullAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/NullAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/NullAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -49,7 +49,7 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { return $this->generateItems($keys); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/PdoAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/PdoAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/PdoAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/PdoAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,7 +35,7 @@ * * db_time_col: The column where to store the timestamp [default: item_time] * * db_username: The username when lazy-connect [default: ''] * * db_password: The password when lazy-connect [default: ''] - * * db_connection_options: An array of driver-specific connection options [default: array()] + * * db_connection_options: An array of driver-specific connection options [default: []] * * @param \PDO|Connection|string $connOrDsn A \PDO or Connection instance or DSN string or null * @param string $namespace @@ -46,7 +46,7 @@ * @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION * @throws InvalidArgumentException When namespace contains invalid characters */ - public function __construct($connOrDsn, $namespace = '', $defaultLifetime = 0, array $options = array()) + public function __construct($connOrDsn, $namespace = '', $defaultLifetime = 0, array $options = []) { $this->init($connOrDsn, $namespace, $defaultLifetime, $options); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -120,7 +120,7 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { foreach ($keys as $key) { if (!\is_string($key)) { @@ -170,7 +170,7 @@ public function deleteItems(array $keys) { $deleted = true; - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (!\is_string($key)) { @@ -232,7 +232,7 @@ private function generateItems(array $keys) { $f = $this->createCacheItem; - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (isset($this->values[$key])) { @@ -272,10 +272,10 @@ { $e = new \ReflectionException("Class $class does not exist"); $trace = $e->getTrace(); - $autoloadFrame = array( + $autoloadFrame = [ 'function' => 'spl_autoload_call', - 'args' => array($class), - ); + 'args' => [$class], + ]; $i = 1 + array_search($autoloadFrame, $trace, true); if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -73,7 +73,7 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { if ($this->namespaceLen) { foreach ($keys as $i => $key) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,13 +27,13 @@ use ProxyTrait; - private $deferred = array(); + private $deferred = []; private $createCacheItem; private $setCacheItemTags; private $getTagsByKey; private $invalidateTags; private $tags; - private $knownTagVersions = array(); + private $knownTagVersions = []; private $knownTagVersionsTtl; public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, $knownTagVersionsTtl = 0.15) @@ -78,7 +78,7 @@ ); $this->getTagsByKey = \Closure::bind( function ($deferred) { - $tagsByKey = array(); + $tagsByKey = []; foreach ($deferred as $key => $item) { $tagsByKey[$key] = $item->tags; } @@ -109,8 +109,8 @@ public function invalidateTags(array $tags) { $ok = true; - $tagsByKey = array(); - $invalidatedTags = array(); + $tagsByKey = []; + $invalidatedTags = []; foreach ($tags as $tag) { CacheItem::validateKey($tag); $invalidatedTags[$tag] = 0; @@ -127,7 +127,7 @@ $f = $this->getTagsByKey; $tagsByKey = $f($items); - $this->deferred = array(); + $this->deferred = []; } $tagVersions = $this->getTagVersions($tagsByKey, $invalidatedTags); @@ -161,7 +161,7 @@ return true; } - foreach ($this->getTagVersions(array($itemTags)) as $tag => $version) { + foreach ($this->getTagVersions([$itemTags]) as $tag => $version) { if ($itemTags[$tag] !== $version && 1 !== $itemTags[$tag] - $version) { return false; } @@ -175,7 +175,7 @@ */ public function getItem($key) { - foreach ($this->getItems(array($key)) as $item) { + foreach ($this->getItems([$key]) as $item) { return $item; } } @@ -183,12 +183,12 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { if ($this->deferred) { $this->commit(); } - $tagKeys = array(); + $tagKeys = []; foreach ($keys as $key) { if ('' !== $key && \is_string($key)) { @@ -213,7 +213,7 @@ */ public function clear() { - $this->deferred = array(); + $this->deferred = []; return $this->pool->clear(); } @@ -223,7 +223,7 @@ */ public function deleteItem($key) { - return $this->deleteItems(array($key)); + return $this->deleteItems([$key]); } /** @@ -271,7 +271,7 @@ */ public function commit() { - return $this->invalidateTags(array()); + return $this->invalidateTags([]); } public function __destruct() @@ -281,7 +281,7 @@ private function generateItems($items, array $tagKeys) { - $bufferedItems = $itemTags = array(); + $bufferedItems = $itemTags = []; $f = $this->setCacheItemTags; foreach ($items as $key => $item) { @@ -295,7 +295,7 @@ } unset($tagKeys[$key]); - $itemTags[$key] = $item->get() ?: array(); + $itemTags[$key] = $item->get() ?: []; if (!$tagKeys) { $tagVersions = $this->getTagVersions($itemTags); @@ -318,7 +318,7 @@ } } - private function getTagVersions(array $tagsByKey, array &$invalidatedTags = array()) + private function getTagVersions(array $tagsByKey, array &$invalidatedTags = []) { $tagVersions = $invalidatedTags; @@ -327,7 +327,7 @@ } if (!$tagVersions) { - return array(); + return []; } if (!$fetchTagVersions = 1 !== \func_num_args()) { @@ -341,7 +341,7 @@ } $now = microtime(true); - $tags = array(); + $tags = []; foreach ($tagVersions as $tag => $version) { $tags[$tag.static::TAGS_PREFIX] = $tag; if ($fetchTagVersions || !isset($this->knownTagVersions[$tag])) { @@ -366,7 +366,7 @@ if (isset($invalidatedTags[$tag])) { $invalidatedTags[$tag] = $version->set(++$tagVersions[$tag]); } - $this->knownTagVersions[$tag] = array($now, $tagVersions[$tag]); + $this->knownTagVersions[$tag] = [$now, $tagVersions[$tag]]; } return $tagVersions; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/TraceableAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/TraceableAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Adapter/TraceableAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Adapter/TraceableAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ class TraceableAdapter implements AdapterInterface, PruneableInterface, ResettableInterface { protected $pool; - private $calls = array(); + private $calls = []; public function __construct(AdapterInterface $pool) { @@ -107,7 +107,7 @@ /** * {@inheritdoc} */ - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { $event = $this->start(__FUNCTION__); try { @@ -116,7 +116,7 @@ $event->end = microtime(true); } $f = function () use ($result, $event) { - $event->result = array(); + $event->result = []; foreach ($result as $key => $item) { if ($event->result[$key] = $item->isHit()) { ++$event->hits; @@ -209,7 +209,7 @@ public function clearCalls() { - $this->calls = array(); + $this->calls = []; } protected function start($name) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/CacheItem.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/CacheItem.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/CacheItem.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/CacheItem.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,8 +25,8 @@ protected $isHit = false; protected $expiry; protected $defaultLifetime; - protected $tags = array(); - protected $prevTags = array(); + protected $tags = []; + protected $prevTags = []; protected $innerItem; protected $poolHash; @@ -110,7 +110,7 @@ public function tag($tags) { if (!\is_array($tags)) { - $tags = array($tags); + $tags = [$tags]; } foreach ($tags as $tag) { if (!\is_string($tag)) { @@ -170,12 +170,12 @@ * * @internal */ - public static function log(LoggerInterface $logger = null, $message, $context = array()) + public static function log(LoggerInterface $logger = null, $message, $context = []) { if ($logger) { $logger->warning($message, $context); } else { - $replace = array(); + $replace = []; foreach ($context as $k => $v) { if (is_scalar($v)) { $replace['{'.$k.'}'] = $v; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ /** * @var TraceableAdapter[] */ - private $instances = array(); + private $instances = []; /** * @param string $name @@ -43,8 +43,8 @@ */ public function collect(Request $request, Response $response, \Exception $exception = null) { - $empty = array('calls' => array(), 'config' => array(), 'options' => array(), 'statistics' => array()); - $this->data = array('instances' => $empty, 'total' => $empty); + $empty = ['calls' => [], 'config' => [], 'options' => [], 'statistics' => []]; + $this->data = ['instances' => $empty, 'total' => $empty]; foreach ($this->instances as $name => $instance) { $this->data['instances']['calls'][$name] = $instance->getCalls(); } @@ -55,7 +55,7 @@ public function reset() { - $this->data = array(); + $this->data = []; foreach ($this->instances as $instance) { $instance->clearCalls(); } @@ -109,9 +109,9 @@ */ private function calculateStatistics() { - $statistics = array(); + $statistics = []; foreach ($this->data['instances']['calls'] as $name => $calls) { - $statistics[$name] = array( + $statistics[$name] = [ 'calls' => 0, 'time' => 0, 'reads' => 0, @@ -119,7 +119,7 @@ 'deletes' => 0, 'hits' => 0, 'misses' => 0, - ); + ]; /** @var TraceableAdapterEvent $call */ foreach ($calls as $call) { ++$statistics[$name]['calls']; @@ -164,7 +164,7 @@ private function calculateTotalStatistics() { $statistics = $this->getStatistics(); - $totals = array( + $totals = [ 'calls' => 0, 'time' => 0, 'reads' => 0, @@ -172,7 +172,7 @@ 'deletes' => 0, 'hits' => 0, 'misses' => 0, - ); + ]; foreach ($statistics as $name => $values) { foreach ($totals as $key => $value) { $totals[$key] += $statistics[$name][$key]; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/AbstractCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/AbstractCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/AbstractCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/AbstractCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -52,11 +52,11 @@ $id = $this->getId($key); try { - foreach ($this->doFetch(array($id)) as $value) { + foreach ($this->doFetch([$id]) as $value) { return $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch key "{key}"', ['key' => $key, 'exception' => $e]); } return $default; @@ -69,7 +69,7 @@ { CacheItem::validateKey($key); - return $this->setMultiple(array($key => $value), $ttl); + return $this->setMultiple([$key => $value], $ttl); } /** @@ -82,7 +82,7 @@ } elseif (!\is_array($keys)) { throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys))); } - $ids = array(); + $ids = []; foreach ($keys as $key) { $ids[] = $this->getId($key); @@ -90,8 +90,8 @@ try { $values = $this->doFetch($ids); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', array('keys' => $keys, 'exception' => $e)); - $values = array(); + CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => $keys, 'exception' => $e]); + $values = []; } $ids = array_combine($ids, $keys); @@ -106,7 +106,7 @@ if (!\is_array($values) && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $valuesById = array(); + $valuesById = []; foreach ($values as $key => $value) { if (\is_int($key)) { @@ -122,14 +122,14 @@ $e = $this->doSave($valuesById, $ttl); } catch (\Exception $e) { } - if (true === $e || array() === $e) { + if (true === $e || [] === $e) { return true; } - $keys = array(); + $keys = []; foreach (\is_array($e) ? $e : array_keys($valuesById) as $id) { $keys[] = substr($id, \strlen($this->namespace)); } - CacheItem::log($this->logger, 'Failed to save values', array('keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null)); + CacheItem::log($this->logger, 'Failed to save values', ['keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null]); return false; } @@ -175,7 +175,7 @@ yield $key => $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', array('keys' => array_values($keys), 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => array_values($keys), 'exception' => $e]); } foreach ($keys as $key) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/ArrayCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/ArrayCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/ArrayCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/ArrayCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -45,7 +45,7 @@ */ public function get($key, $default = null) { - foreach ($this->getMultiple(array($key), $default) as $v) { + foreach ($this->getMultiple([$key], $default) as $v) { return $v; } } @@ -89,7 +89,7 @@ { CacheItem::validateKey($key); - return $this->setMultiple(array($key => $value), $ttl); + return $this->setMultiple([$key => $value], $ttl); } /** @@ -100,7 +100,7 @@ if (!\is_array($values) && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $valuesArray = array(); + $valuesArray = []; foreach ($values as $key => $value) { \is_int($key) || CacheItem::validateKey($key); @@ -115,7 +115,7 @@ $valuesArray[$key] = serialize($value); } catch (\Exception $e) { $type = \is_object($value) ? \get_class($value) : \gettype($value); - CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', array('key' => $key, 'type' => $type, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', ['key' => $key, 'type' => $type, 'exception' => $e]); return false; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/ChainCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/ChainCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/ChainCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/ChainCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ class ChainCache implements CacheInterface, PruneableInterface, ResettableInterface { private $miss; - private $caches = array(); + private $caches = []; private $defaultLifetime; private $cacheCount; @@ -87,7 +87,7 @@ private function generateItems($values, $cacheIndex, $miss, $default) { - $missing = array(); + $missing = []; $nextCacheIndex = $cacheIndex + 1; $nextCache = isset($this->caches[$nextCacheIndex]) ? $this->caches[$nextCacheIndex] : null; @@ -201,7 +201,7 @@ if ($values instanceof \Traversable) { $valuesIterator = $values; $values = function () use ($valuesIterator, &$values) { - $generatedValues = array(); + $generatedValues = []; foreach ($valuesIterator as $key => $value) { yield $key => $value; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/PdoCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/PdoCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/PdoCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/PdoCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ * * db_time_col: The column where to store the timestamp [default: item_time] * * db_username: The username when lazy-connect [default: ''] * * db_password: The password when lazy-connect [default: ''] - * * db_connection_options: An array of driver-specific connection options [default: array()] + * * db_connection_options: An array of driver-specific connection options [default: []] * * @param \PDO|Connection|string $connOrDsn A \PDO or Connection instance or DSN string or null * @param string $namespace @@ -44,7 +44,7 @@ * @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION * @throws InvalidArgumentException When namespace contains invalid characters */ - public function __construct($connOrDsn, $namespace = '', $defaultLifetime = 0, array $options = array()) + public function __construct($connOrDsn, $namespace = '', $defaultLifetime = 0, array $options = []) { $this->init($connOrDsn, $namespace, $defaultLifetime, $options); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/PhpArrayCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/PhpArrayCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/PhpArrayCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/PhpArrayCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -154,7 +154,7 @@ } $deleted = true; - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (!\is_string($key)) { @@ -203,7 +203,7 @@ } $saved = true; - $fallbackValues = array(); + $fallbackValues = []; foreach ($values as $key => $value) { if (!\is_string($key) && !\is_int($key)) { @@ -226,7 +226,7 @@ private function generateItems(array $keys, $default) { - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (isset($this->values[$key])) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/Psr6Cache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/Psr6Cache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/Psr6Cache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/Psr6Cache.php 2019-02-03 12:23:08.000000000 +0000 @@ -145,7 +145,7 @@ } catch (Psr6CacheException $e) { throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } - $values = array(); + $values = []; foreach ($items as $key => $item) { $values[$key] = $item->isHit() ? $item->get() : $default; @@ -163,7 +163,7 @@ if (!$valuesIsArray && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $items = array(); + $items = []; try { if (null !== $f = $this->createCacheItem) { @@ -172,7 +172,7 @@ $items[$key] = $f($key, $value, true); } } elseif ($valuesIsArray) { - $items = array(); + $items = []; foreach ($values as $key => $value) { $items[] = (string) $key; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/TraceableCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/TraceableCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Simple/TraceableCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Simple/TraceableCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { private $pool; private $miss; - private $calls = array(); + private $calls = []; public function __construct(CacheInterface $pool) { @@ -99,7 +99,7 @@ public function setMultiple($values, $ttl = null) { $event = $this->start(__FUNCTION__); - $event->result['keys'] = array(); + $event->result['keys'] = []; if ($values instanceof \Traversable) { $values = function () use ($values, $event) { @@ -133,7 +133,7 @@ $event->end = microtime(true); } $f = function () use ($result, $event, $miss, $default) { - $event->result = array(); + $event->result = []; foreach ($result as $key => $value) { if ($event->result[$key] = $miss !== $value) { ++$event->hits; @@ -216,7 +216,7 @@ try { return $this->calls; } finally { - $this->calls = array(); + $this->calls = []; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,11 +15,11 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testExpiration' => 'Testing expiration slows down the test suite', 'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; protected static $redis; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -85,11 +85,11 @@ $item = $cache->getItem('foo'); $this->assertFalse($item->isHit()); - foreach ($cache->getItems(array('foo')) as $item) { + foreach ($cache->getItems(['foo']) as $item) { } $cache->save($item->set(new NotUnserializable())); - foreach ($cache->getItems(array('foo')) as $item) { + foreach ($cache->getItems(['foo']) as $item) { } $this->assertFalse($item->isHit()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,11 +16,11 @@ class ApcuAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testExpiration' => 'Testing expiration slows down the test suite', 'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; public function createCachePool($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ArrayAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ArrayAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ArrayAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ArrayAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,10 +18,10 @@ */ class ArrayAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testDeferredSaveWithoutCommit' => 'Assumes a shared cache which ArrayAdapter is not.', 'testSaveWithoutExpire' => 'Assumes a shared cache which ArrayAdapter is not.', - ); + ]; public function createCachePool($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ { public function createCachePool($defaultLifetime = 0) { - return new ChainAdapter(array(new ArrayAdapter($defaultLifetime), new ExternalAdapter(), new FilesystemAdapter('', $defaultLifetime)), $defaultLifetime); + return new ChainAdapter([new ArrayAdapter($defaultLifetime), new ExternalAdapter(), new FilesystemAdapter('', $defaultLifetime)], $defaultLifetime); } /** @@ -35,7 +35,7 @@ */ public function testEmptyAdaptersException() { - new ChainAdapter(array()); + new ChainAdapter([]); } /** @@ -44,7 +44,7 @@ */ public function testInvalidAdapterException() { - new ChainAdapter(array(new \stdClass())); + new ChainAdapter([new \stdClass()]); } public function testPrune() @@ -53,18 +53,18 @@ $this->markTestSkipped($this->skippedTests[__FUNCTION__]); } - $cache = new ChainAdapter(array( + $cache = new ChainAdapter([ $this->getPruneableMock(), $this->getNonPruneableMock(), $this->getPruneableMock(), - )); + ]); $this->assertTrue($cache->prune()); - $cache = new ChainAdapter(array( + $cache = new ChainAdapter([ $this->getPruneableMock(), $this->getFailingPruneableMock(), $this->getPruneableMock(), - )); + ]); $this->assertFalse($cache->prune()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/DoctrineAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/DoctrineAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/DoctrineAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/DoctrineAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,11 +19,11 @@ */ class DoctrineAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testDeferredSaveWithoutCommit' => 'Assumes a shared cache which ArrayCache is not.', 'testSaveWithoutExpire' => 'Assumes a shared cache which ArrayCache is not.', 'testNotUnserializable' => 'ArrayCache does not use serialize/unserialize', - ); + ]; public function createCachePool($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MaxIdLengthAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,15 +19,15 @@ public function testLongKey() { $cache = $this->getMockBuilder(MaxIdLengthAdapter::class) - ->setConstructorArgs(array(str_repeat('-', 10))) - ->setMethods(array('doHave', 'doFetch', 'doDelete', 'doSave', 'doClear')) + ->setConstructorArgs([str_repeat('-', 10)]) + ->setMethods(['doHave', 'doFetch', 'doDelete', 'doSave', 'doClear']) ->getMock(); $cache->expects($this->exactly(2)) ->method('doHave') ->withConsecutive( - array($this->equalTo('----------:0GTYWa9n4ed8vqNlOT2iEr:')), - array($this->equalTo('----------:---------------------------------------')) + [$this->equalTo('----------:0GTYWa9n4ed8vqNlOT2iEr:')], + [$this->equalTo('----------:---------------------------------------')] ); $cache->hasItem(str_repeat('-', 40)); @@ -37,7 +37,7 @@ public function testLongKeyVersioning() { $cache = $this->getMockBuilder(MaxIdLengthAdapter::class) - ->setConstructorArgs(array(str_repeat('-', 26))) + ->setConstructorArgs([str_repeat('-', 26)]) ->getMock(); $reflectionClass = new \ReflectionClass(AbstractAdapter::class); @@ -46,20 +46,20 @@ $reflectionMethod->setAccessible(true); // No versioning enabled - $this->assertEquals('--------------------------:------------', $reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12)))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12))))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 23))))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 40))))); + $this->assertEquals('--------------------------:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)])); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]))); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 23)]))); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 40)]))); $reflectionProperty = $reflectionClass->getProperty('versioningIsEnabled'); $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($cache, true); // Versioning enabled - $this->assertEquals('--------------------------:1:------------', $reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12)))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 12))))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 23))))); - $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, array(str_repeat('-', 40))))); + $this->assertEquals('--------------------------:1:------------', $reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)])); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 12)]))); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 23)]))); + $this->assertLessThanOrEqual(50, \strlen($reflectionMethod->invokeArgs($cache, [str_repeat('-', 40)]))); } /** @@ -69,7 +69,7 @@ public function testTooLongNamespace() { $cache = $this->getMockBuilder(MaxIdLengthAdapter::class) - ->setConstructorArgs(array(str_repeat('-', 40))) + ->setConstructorArgs([str_repeat('-', 40)]) ->getMock(); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,10 +16,10 @@ class MemcachedAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; protected static $client; @@ -28,7 +28,7 @@ if (!MemcachedAdapter::isSupported()) { self::markTestSkipped('Extension memcached >=2.2.0 required.'); } - self::$client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), array('binary_protocol' => false)); + self::$client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['binary_protocol' => false]); self::$client->get('foo'); $code = self::$client->getResultCode(); @@ -46,13 +46,13 @@ public function testOptions() { - $client = MemcachedAdapter::createConnection(array(), array( + $client = MemcachedAdapter::createConnection([], [ 'libketama_compatible' => false, 'distribution' => 'modula', 'compression' => true, 'serializer' => 'php', 'hash' => 'md5', - )); + ]); $this->assertSame(\Memcached::SERIALIZER_PHP, $client->getOption(\Memcached::OPT_SERIALIZER)); $this->assertSame(\Memcached::HASH_MD5, $client->getOption(\Memcached::OPT_HASH)); @@ -68,24 +68,24 @@ */ public function testBadOptions($name, $value) { - MemcachedAdapter::createConnection(array(), array($name => $value)); + MemcachedAdapter::createConnection([], [$name => $value]); } public function provideBadOptions() { - return array( - array('foo', 'bar'), - array('hash', 'zyx'), - array('serializer', 'zyx'), - array('distribution', 'zyx'), - ); + return [ + ['foo', 'bar'], + ['hash', 'zyx'], + ['serializer', 'zyx'], + ['distribution', 'zyx'], + ]; } public function testDefaultOptions() { $this->assertTrue(MemcachedAdapter::isSupported()); - $client = MemcachedAdapter::createConnection(array()); + $client = MemcachedAdapter::createConnection([]); $this->assertTrue($client->getOption(\Memcached::OPT_COMPRESSION)); $this->assertSame(1, $client->getOption(\Memcached::OPT_BINARY_PROTOCOL)); @@ -103,7 +103,7 @@ $this->markTestSkipped('Memcached::HAVE_JSON required'); } - new MemcachedAdapter(MemcachedAdapter::createConnection(array(), array('serializer' => 'json'))); + new MemcachedAdapter(MemcachedAdapter::createConnection([], ['serializer' => 'json'])); } /** @@ -112,54 +112,54 @@ public function testServersSetting($dsn, $host, $port) { $client1 = MemcachedAdapter::createConnection($dsn); - $client2 = MemcachedAdapter::createConnection(array($dsn)); - $client3 = MemcachedAdapter::createConnection(array(array($host, $port))); - $expect = array( + $client2 = MemcachedAdapter::createConnection([$dsn]); + $client3 = MemcachedAdapter::createConnection([[$host, $port]]); + $expect = [ 'host' => $host, 'port' => $port, - ); + ]; - $f = function ($s) { return array('host' => $s['host'], 'port' => $s['port']); }; - $this->assertSame(array($expect), array_map($f, $client1->getServerList())); - $this->assertSame(array($expect), array_map($f, $client2->getServerList())); - $this->assertSame(array($expect), array_map($f, $client3->getServerList())); + $f = function ($s) { return ['host' => $s['host'], 'port' => $s['port']]; }; + $this->assertSame([$expect], array_map($f, $client1->getServerList())); + $this->assertSame([$expect], array_map($f, $client2->getServerList())); + $this->assertSame([$expect], array_map($f, $client3->getServerList())); } public function provideServersSetting() { - yield array( + yield [ 'memcached://127.0.0.1/50', '127.0.0.1', 11211, - ); - yield array( + ]; + yield [ 'memcached://localhost:11222?weight=25', 'localhost', 11222, - ); + ]; if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) { - yield array( + yield [ 'memcached://user:password@127.0.0.1?weight=50', '127.0.0.1', 11211, - ); + ]; } - yield array( + yield [ 'memcached:///var/run/memcached.sock?weight=25', '/var/run/memcached.sock', 0, - ); - yield array( + ]; + yield [ 'memcached:///var/local/run/memcached.socket?weight=25', '/var/local/run/memcached.socket', 0, - ); + ]; if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) { - yield array( + yield [ 'memcached://user:password@/var/local/run/memcached.socket?weight=25', '/var/local/run/memcached.socket', 0, - ); + ]; } } @@ -181,16 +181,16 @@ self::markTestSkipped('Extension memcached required.'); } - yield array( + yield [ 'memcached://localhost:11222?retry_timeout=10', - array(\Memcached::OPT_RETRY_TIMEOUT => 8), - array(\Memcached::OPT_RETRY_TIMEOUT => 10), - ); - yield array( + [\Memcached::OPT_RETRY_TIMEOUT => 8], + [\Memcached::OPT_RETRY_TIMEOUT => 10], + ]; + yield [ 'memcached://localhost:11222?socket_recv_size=1&socket_send_size=2', - array(\Memcached::OPT_RETRY_TIMEOUT => 8), - array(\Memcached::OPT_SOCKET_RECV_SIZE => 1, \Memcached::OPT_SOCKET_SEND_SIZE => 2, \Memcached::OPT_RETRY_TIMEOUT => 8), - ); + [\Memcached::OPT_RETRY_TIMEOUT => 8], + [\Memcached::OPT_SOCKET_RECV_SIZE => 1, \Memcached::OPT_SOCKET_SEND_SIZE => 2, \Memcached::OPT_RETRY_TIMEOUT => 8], + ]; } public function testClear() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,7 +43,7 @@ { $adapter = $this->createCachePool(); - $keys = array('foo', 'bar', 'baz', 'biz'); + $keys = ['foo', 'bar', 'baz', 'biz']; /** @var CacheItemInterface[] $items */ $items = $adapter->getItems($keys); @@ -89,7 +89,7 @@ public function testDeleteItems() { - $this->assertTrue($this->createCachePool()->deleteItems(array('key', 'foo', 'bar'))); + $this->assertTrue($this->createCachePool()->deleteItems(['key', 'foo', 'bar'])); } public function testSave() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); - $pool = new PdoAdapter(DriverManager::getConnection(array('driver' => 'pdo_sqlite', 'path' => self::$dbFile))); + $pool = new PdoAdapter(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile])); $pool->createTable(); } @@ -43,6 +43,6 @@ public function createCachePool($defaultLifetime = 0) { - return new PdoAdapter(DriverManager::getConnection(array('driver' => 'pdo_sqlite', 'path' => self::$dbFile)), '', $defaultLifetime); + return new PdoAdapter(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]), '', $defaultLifetime); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ */ class PhpArrayAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testBasicUsage' => 'PhpArrayAdapter is read-only.', 'testBasicUsageWithLongKey' => 'PhpArrayAdapter is read-only.', 'testClear' => 'PhpArrayAdapter is read-only.', @@ -51,7 +51,7 @@ 'testDefaultLifeTime' => 'PhpArrayAdapter does not allow configuring a default lifetime.', 'testPrune' => 'PhpArrayAdapter just proxies', - ); + ]; protected static $file; @@ -74,22 +74,22 @@ public function testStore() { - $arrayWithRefs = array(); + $arrayWithRefs = []; $arrayWithRefs[0] = 123; $arrayWithRefs[1] = &$arrayWithRefs[0]; - $object = (object) array( + $object = (object) [ 'foo' => 'bar', 'foo2' => 'bar2', - ); + ]; - $expected = array( + $expected = [ 'null' => null, 'serializedString' => serialize($object), 'arrayWithRefs' => $arrayWithRefs, 'object' => $object, - 'arrayWithObject' => array('bar' => $object), - ); + 'arrayWithObject' => ['bar' => $object], + ]; $adapter = $this->createCachePool(); $adapter->warmUp($expected); @@ -101,13 +101,13 @@ public function testStoredFile() { - $expected = array( + $expected = [ 'integer' => 42, 'float' => 42.42, 'boolean' => true, - 'array_simple' => array('foo', 'bar'), - 'array_associative' => array('foo' => 'bar', 'foo2' => 'bar2'), - ); + 'array_simple' => ['foo', 'bar'], + 'array_associative' => ['foo' => 'bar', 'foo2' => 'bar2'], + ]; $adapter = $this->createCachePool(); $adapter->warmUp($expected); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterWithFallbackTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterWithFallbackTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterWithFallbackTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterWithFallbackTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,14 +19,14 @@ */ class PhpArrayAdapterWithFallbackTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testGetItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.', 'testGetItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.', 'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.', 'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.', 'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.', 'testPrune' => 'PhpArrayAdapter just proxies', - ); + ]; protected static $file; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpFilesAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpFilesAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpFilesAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PhpFilesAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class PhpFilesAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testDefaultLifeTime' => 'PhpFilesAdapter does not allow configuring a default lifetime.', - ); + ]; public function createCachePool() { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,20 +19,20 @@ public static function setupBeforeClass() { parent::setupBeforeClass(); - self::$redis = new \Predis\Client(array('host' => getenv('REDIS_HOST'))); + self::$redis = new \Predis\Client(['host' => getenv('REDIS_HOST')]); } public function testCreateConnection() { $redisHost = getenv('REDIS_HOST'); - $redis = RedisAdapter::createConnection('redis://'.$redisHost.'/1', array('class' => \Predis\Client::class, 'timeout' => 3)); + $redis = RedisAdapter::createConnection('redis://'.$redisHost.'/1', ['class' => \Predis\Client::class, 'timeout' => 3]); $this->assertInstanceOf(\Predis\Client::class, $redis); $connection = $redis->getConnection(); $this->assertInstanceOf(StreamConnection::class, $connection); - $params = array( + $params = [ 'scheme' => 'tcp', 'host' => $redisHost, 'path' => '', @@ -47,7 +47,7 @@ 'lazy' => false, 'database' => '1', 'password' => null, - ); + ]; $this->assertSame($params, $connection->getParameters()->toArray()); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisClusterAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisClusterAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisClusterAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/PredisClusterAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,7 +16,7 @@ public static function setupBeforeClass() { parent::setupBeforeClass(); - self::$redis = new \Predis\Client(array(array('host' => getenv('REDIS_HOST')))); + self::$redis = new \Predis\Client([['host' => getenv('REDIS_HOST')]]); } public static function tearDownAfterClass() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,11 +21,11 @@ */ class ProxyAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testDeferredSaveWithoutCommit' => 'Assumes a shared cache which ArrayAdapter is not.', 'testSaveWithoutExpire' => 'Assumes a shared cache which ArrayAdapter is not.', 'testPrune' => 'ProxyAdapter just proxies', - ); + ]; public function createCachePool($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ public static function setupBeforeClass() { parent::setupBeforeClass(); - self::$redis = AbstractAdapter::createConnection('redis://'.getenv('REDIS_HOST'), array('lazy' => true)); + self::$redis = AbstractAdapter::createConnection('redis://'.getenv('REDIS_HOST'), ['lazy' => true]); } public function createCachePool($defaultLifetime = 0) @@ -43,13 +43,13 @@ $redis = RedisAdapter::createConnection('redis://'.$redisHost.'/2'); $this->assertSame(2, $redis->getDbNum()); - $redis = RedisAdapter::createConnection('redis://'.$redisHost, array('timeout' => 3)); + $redis = RedisAdapter::createConnection('redis://'.$redisHost, ['timeout' => 3]); $this->assertEquals(3, $redis->getTimeout()); $redis = RedisAdapter::createConnection('redis://'.$redisHost.'?timeout=4'); $this->assertEquals(4, $redis->getTimeout()); - $redis = RedisAdapter::createConnection('redis://'.$redisHost, array('read_timeout' => 5)); + $redis = RedisAdapter::createConnection('redis://'.$redisHost, ['read_timeout' => 5]); $this->assertEquals(5, $redis->getReadTimeout()); } @@ -65,11 +65,11 @@ public function provideFailedCreateConnection() { - return array( - array('redis://localhost:1234'), - array('redis://foo@localhost'), - array('redis://localhost/123'), - ); + return [ + ['redis://localhost:1234'], + ['redis://foo@localhost'], + ['redis://localhost/123'], + ]; } /** @@ -84,9 +84,9 @@ public function provideInvalidCreateConnection() { - return array( - array('foo://localhost'), - array('redis://'), - ); + return [ + ['foo://localhost'], + ['redis://'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,6 +19,6 @@ if (!class_exists('RedisArray')) { self::markTestSkipped('The RedisArray class is required.'); } - self::$redis = new \RedisArray(array(getenv('REDIS_HOST')), array('lazy_connect' => true)); + self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/SimpleCacheAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/SimpleCacheAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/SimpleCacheAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/SimpleCacheAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class SimpleCacheAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testPrune' => 'SimpleCache just proxies', - ); + ]; public function createCachePool($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -56,7 +56,7 @@ $pool->save($i3->tag('foo')->tag('baz')); $pool->save($foo); - $pool->invalidateTags(array('bar')); + $pool->invalidateTags(['bar']); $this->assertFalse($pool->getItem('i0')->isHit()); $this->assertTrue($pool->getItem('i1')->isHit()); @@ -64,7 +64,7 @@ $this->assertTrue($pool->getItem('i3')->isHit()); $this->assertTrue($pool->getItem('foo')->isHit()); - $pool->invalidateTags(array('foo')); + $pool->invalidateTags(['foo']); $this->assertFalse($pool->getItem('i1')->isHit()); $this->assertFalse($pool->getItem('i3')->isHit()); @@ -85,7 +85,7 @@ $foo->tag('tag'); $pool1->saveDeferred($foo->set('foo')); - $pool1->invalidateTags(array('tag')); + $pool1->invalidateTags(['tag']); $pool2 = $this->createCachePool(); $foo = $pool2->getItem('foo'); @@ -103,7 +103,7 @@ $i = $pool->getItem('k'); $pool->save($i->tag('bar')); - $pool->invalidateTags(array('foo')); + $pool->invalidateTags(['foo']); $this->assertTrue($pool->getItem('k')->isHit()); } @@ -116,7 +116,7 @@ $pool->deleteItem('k'); $pool->save($pool->getItem('k')); - $pool->invalidateTags(array('foo')); + $pool->invalidateTags(['foo']); $this->assertTrue($pool->getItem('k')->isHit()); } @@ -126,11 +126,11 @@ $pool = $this->createCachePool(10); $item = $pool->getItem('foo'); - $item->tag(array('baz')); + $item->tag(['baz']); $item->expiresAfter(100); $pool->save($item); - $pool->invalidateTags(array('baz')); + $pool->invalidateTags(['baz']); $this->assertFalse($pool->getItem('foo')->isHit()); sleep(20); @@ -146,7 +146,7 @@ $pool->save($i->tag('foo')); $i = $pool->getItem('k'); - $this->assertSame(array('foo' => 'foo'), $i->getPreviousTags()); + $this->assertSame(['foo' => 'foo'], $i->getPreviousTags()); } public function testPrune() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class TraceableAdapterTest extends AdapterTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testPrune' => 'TraceableAdapter just proxies', - ); + ]; public function createCachePool($defaultLifetime = 0) { @@ -37,7 +37,7 @@ $call = $calls[0]; $this->assertSame('getItem', $call->name); - $this->assertSame(array('k' => false), $call->result); + $this->assertSame(['k' => false], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(1, $call->misses); $this->assertNotEmpty($call->start); @@ -61,7 +61,7 @@ public function testGetItemsMissTrace() { $pool = $this->createCachePool(); - $arg = array('k0', 'k1'); + $arg = ['k0', 'k1']; $items = $pool->getItems($arg); foreach ($items as $item) { } @@ -70,7 +70,7 @@ $call = $calls[0]; $this->assertSame('getItems', $call->name); - $this->assertSame(array('k0' => false, 'k1' => false), $call->result); + $this->assertSame(['k0' => false, 'k1' => false], $call->result); $this->assertSame(2, $call->misses); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); @@ -85,7 +85,7 @@ $call = $calls[0]; $this->assertSame('hasItem', $call->name); - $this->assertSame(array('k' => false), $call->result); + $this->assertSame(['k' => false], $call->result); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); } @@ -101,7 +101,7 @@ $call = $calls[2]; $this->assertSame('hasItem', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); } @@ -115,7 +115,7 @@ $call = $calls[0]; $this->assertSame('deleteItem', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -125,14 +125,14 @@ public function testDeleteItemsTrace() { $pool = $this->createCachePool(); - $arg = array('k0', 'k1'); + $arg = ['k0', 'k1']; $pool->deleteItems($arg); $calls = $pool->getCalls(); $this->assertCount(1, $calls); $call = $calls[0]; $this->assertSame('deleteItems', $call->name); - $this->assertSame(array('keys' => $arg, 'result' => true), $call->result); + $this->assertSame(['keys' => $arg, 'result' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -149,7 +149,7 @@ $call = $calls[1]; $this->assertSame('save', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -166,7 +166,7 @@ $call = $calls[1]; $this->assertSame('saveDeferred', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableTagAwareAdapterTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableTagAwareAdapterTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableTagAwareAdapterTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Adapter/TraceableTagAwareAdapterTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,7 +23,7 @@ public function testInvalidateTags() { $pool = new TraceableTagAwareAdapter(new TagAwareAdapter(new FilesystemAdapter())); - $pool->invalidateTags(array('foo')); + $pool->invalidateTags(['foo']); $calls = $pool->getCalls(); $this->assertCount(1, $calls); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/CacheItemTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/CacheItemTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/CacheItemTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/CacheItemTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,23 +33,23 @@ public function provideInvalidKey() { - return array( - array(''), - array('{'), - array('}'), - array('('), - array(')'), - array('/'), - array('\\'), - array('@'), - array(':'), - array(true), - array(null), - array(1), - array(1.1), - array(array(array())), - array(new \Exception('foo')), - ); + return [ + [''], + ['{'], + ['}'], + ['('], + [')'], + ['/'], + ['\\'], + ['@'], + [':'], + [true], + [null], + [1], + [1.1], + [[[]]], + [new \Exception('foo')], + ]; } public function testTag() @@ -57,10 +57,10 @@ $item = new CacheItem(); $this->assertSame($item, $item->tag('foo')); - $this->assertSame($item, $item->tag(array('bar', 'baz'))); + $this->assertSame($item, $item->tag(['bar', 'baz'])); \call_user_func(\Closure::bind(function () use ($item) { - $this->assertSame(array('foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz'), $item->tags); + $this->assertSame(['foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz'], $item->tags); }, $this, CacheItem::class)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ArrayCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ArrayCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ArrayCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ArrayCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -6,7 +6,7 @@ class ArrayCache extends CacheProvider { - private $data = array(); + private $data = []; protected function doFetch($id) { @@ -26,7 +26,7 @@ protected function doSave($id, $data, $lifeTime = 0) { - $this->data[$id] = array($data, $lifeTime ? time() + $lifeTime : false); + $this->data[$id] = [$data, $lifeTime ? time() + $lifeTime : false]; return true; } @@ -40,7 +40,7 @@ protected function doFlush() { - $this->data = array(); + $this->data = []; return true; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Fixtures/ExternalAdapter.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ return $this->cache->getItem($key); } - public function getItems(array $keys = array()) + public function getItems(array $keys = []) { return $this->cache->getItems($keys); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,11 +15,11 @@ abstract class AbstractRedisCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testSetTtl' => 'Testing expiration slows down the test suite', 'testSetMultipleTtl' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; protected static $redis; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/ApcuCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/ApcuCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/ApcuCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/ApcuCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -15,11 +15,11 @@ class ApcuCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testSetTtl' => 'Testing expiration slows down the test suite', 'testSetMultipleTtl' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; public function createSimpleCache($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ return parent::validKeys(); } - return array_merge(parent::validKeys(), array(array("a\0b"))); + return array_merge(parent::validKeys(), [["a\0b"]]); } public function testDefaultLifeTime() @@ -68,9 +68,9 @@ $this->assertNull($cache->get('foo')); - $cache->setMultiple(array('foo' => new NotUnserializable())); + $cache->setMultiple(['foo' => new NotUnserializable()]); - foreach ($cache->getMultiple(array('foo')) as $value) { + foreach ($cache->getMultiple(['foo']) as $value) { } $this->assertNull($value); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ { public function createSimpleCache($defaultLifetime = 0) { - return new ChainCache(array(new ArrayCache($defaultLifetime), new FilesystemCache('', $defaultLifetime)), $defaultLifetime); + return new ChainCache([new ArrayCache($defaultLifetime), new FilesystemCache('', $defaultLifetime)], $defaultLifetime); } /** @@ -33,7 +33,7 @@ */ public function testEmptyCachesException() { - new ChainCache(array()); + new ChainCache([]); } /** @@ -42,7 +42,7 @@ */ public function testInvalidCacheException() { - new ChainCache(array(new \stdClass())); + new ChainCache([new \stdClass()]); } public function testPrune() @@ -51,18 +51,18 @@ $this->markTestSkipped($this->skippedTests[__FUNCTION__]); } - $cache = new ChainCache(array( + $cache = new ChainCache([ $this->getPruneableMock(), $this->getNonPruneableMock(), $this->getPruneableMock(), - )); + ]); $this->assertTrue($cache->prune()); - $cache = new ChainCache(array( + $cache = new ChainCache([ $this->getPruneableMock(), $this->getFailingPruneableMock(), $this->getPruneableMock(), - )); + ]); $this->assertFalse($cache->prune()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/DoctrineCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/DoctrineCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/DoctrineCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/DoctrineCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,10 +19,10 @@ */ class DoctrineCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testObjectDoesNotChangeInCache' => 'ArrayCache does not use serialize/unserialize', 'testNotUnserializable' => 'ArrayCache does not use serialize/unserialize', - ); + ]; public function createSimpleCache($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -16,11 +16,11 @@ class MemcachedCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testSetTtl' => 'Testing expiration slows down the test suite', 'testSetMultipleTtl' => 'Testing expiration slows down the test suite', 'testDefaultLifeTime' => 'Testing expiration slows down the test suite', - ); + ]; protected static $client; @@ -40,29 +40,29 @@ public function createSimpleCache($defaultLifetime = 0) { - $client = $defaultLifetime ? AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), array('binary_protocol' => false)) : self::$client; + $client = $defaultLifetime ? AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['binary_protocol' => false]) : self::$client; return new MemcachedCache($client, str_replace('\\', '.', __CLASS__), $defaultLifetime); } public function testCreatePersistentConnectionShouldNotDupServerList() { - $instance = MemcachedCache::createConnection('memcached://'.getenv('MEMCACHED_HOST'), array('persistent_id' => 'persistent')); + $instance = MemcachedCache::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['persistent_id' => 'persistent']); $this->assertCount(1, $instance->getServerList()); - $instance = MemcachedCache::createConnection('memcached://'.getenv('MEMCACHED_HOST'), array('persistent_id' => 'persistent')); + $instance = MemcachedCache::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['persistent_id' => 'persistent']); $this->assertCount(1, $instance->getServerList()); } public function testOptions() { - $client = MemcachedCache::createConnection(array(), array( + $client = MemcachedCache::createConnection([], [ 'libketama_compatible' => false, 'distribution' => 'modula', 'compression' => true, 'serializer' => 'php', 'hash' => 'md5', - )); + ]); $this->assertSame(\Memcached::SERIALIZER_PHP, $client->getOption(\Memcached::OPT_SERIALIZER)); $this->assertSame(\Memcached::HASH_MD5, $client->getOption(\Memcached::OPT_HASH)); @@ -78,24 +78,24 @@ */ public function testBadOptions($name, $value) { - MemcachedCache::createConnection(array(), array($name => $value)); + MemcachedCache::createConnection([], [$name => $value]); } public function provideBadOptions() { - return array( - array('foo', 'bar'), - array('hash', 'zyx'), - array('serializer', 'zyx'), - array('distribution', 'zyx'), - ); + return [ + ['foo', 'bar'], + ['hash', 'zyx'], + ['serializer', 'zyx'], + ['distribution', 'zyx'], + ]; } public function testDefaultOptions() { $this->assertTrue(MemcachedCache::isSupported()); - $client = MemcachedCache::createConnection(array()); + $client = MemcachedCache::createConnection([]); $this->assertTrue($client->getOption(\Memcached::OPT_COMPRESSION)); $this->assertSame(1, $client->getOption(\Memcached::OPT_BINARY_PROTOCOL)); @@ -112,7 +112,7 @@ $this->markTestSkipped('Memcached::HAVE_JSON required'); } - new MemcachedCache(MemcachedCache::createConnection(array(), array('serializer' => 'json'))); + new MemcachedCache(MemcachedCache::createConnection([], ['serializer' => 'json'])); } /** @@ -121,54 +121,54 @@ public function testServersSetting($dsn, $host, $port) { $client1 = MemcachedCache::createConnection($dsn); - $client2 = MemcachedCache::createConnection(array($dsn)); - $client3 = MemcachedCache::createConnection(array(array($host, $port))); - $expect = array( + $client2 = MemcachedCache::createConnection([$dsn]); + $client3 = MemcachedCache::createConnection([[$host, $port]]); + $expect = [ 'host' => $host, 'port' => $port, - ); + ]; - $f = function ($s) { return array('host' => $s['host'], 'port' => $s['port']); }; - $this->assertSame(array($expect), array_map($f, $client1->getServerList())); - $this->assertSame(array($expect), array_map($f, $client2->getServerList())); - $this->assertSame(array($expect), array_map($f, $client3->getServerList())); + $f = function ($s) { return ['host' => $s['host'], 'port' => $s['port']]; }; + $this->assertSame([$expect], array_map($f, $client1->getServerList())); + $this->assertSame([$expect], array_map($f, $client2->getServerList())); + $this->assertSame([$expect], array_map($f, $client3->getServerList())); } public function provideServersSetting() { - yield array( + yield [ 'memcached://127.0.0.1/50', '127.0.0.1', 11211, - ); - yield array( + ]; + yield [ 'memcached://localhost:11222?weight=25', 'localhost', 11222, - ); + ]; if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) { - yield array( + yield [ 'memcached://user:password@127.0.0.1?weight=50', '127.0.0.1', 11211, - ); + ]; } - yield array( + yield [ 'memcached:///var/run/memcached.sock?weight=25', '/var/run/memcached.sock', 0, - ); - yield array( + ]; + yield [ 'memcached:///var/local/run/memcached.socket?weight=25', '/var/local/run/memcached.socket', 0, - ); + ]; if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) { - yield array( + yield [ 'memcached://user:password@/var/local/run/memcached.socket?weight=25', '/var/local/run/memcached.socket', 0, - ); + ]; } } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTextModeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTextModeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTextModeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTextModeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ { public function createSimpleCache($defaultLifetime = 0) { - $client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), array('binary_protocol' => false)); + $client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['binary_protocol' => false]); return new MemcachedCache($client, str_replace('\\', '.', __CLASS__), $defaultLifetime); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/NullCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/NullCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/NullCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/NullCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,7 +40,7 @@ { $cache = $this->createCachePool(); - $keys = array('foo', 'bar', 'baz', 'biz'); + $keys = ['foo', 'bar', 'baz', 'biz']; $default = new \stdClass(); $items = $cache->getMultiple($keys, $default); @@ -75,7 +75,7 @@ public function testDeleteMultiple() { - $this->assertTrue($this->createCachePool()->deleteMultiple(array('key', 'foo', 'bar'))); + $this->assertTrue($this->createCachePool()->deleteMultiple(['key', 'foo', 'bar'])); } public function testSet() @@ -90,7 +90,7 @@ { $cache = $this->createCachePool(); - $this->assertFalse($cache->setMultiple(array('key' => 'val'))); + $this->assertFalse($cache->setMultiple(['key' => 'val'])); $this->assertNull($cache->get('key')); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); - $pool = new PdoCache(DriverManager::getConnection(array('driver' => 'pdo_sqlite', 'path' => self::$dbFile))); + $pool = new PdoCache(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile])); $pool->createTable(); } @@ -43,6 +43,6 @@ public function createSimpleCache($defaultLifetime = 0) { - return new PdoCache(DriverManager::getConnection(array('driver' => 'pdo_sqlite', 'path' => self::$dbFile)), '', $defaultLifetime); + return new PdoCache(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]), '', $defaultLifetime); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ */ class PhpArrayCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testBasicUsageWithLongKey' => 'PhpArrayCache does no writes', 'testDelete' => 'PhpArrayCache does no writes', @@ -45,7 +45,7 @@ 'testDefaultLifeTime' => 'PhpArrayCache does not allow configuring a default lifetime.', 'testPrune' => 'PhpArrayCache just proxies', - ); + ]; protected static $file; @@ -68,22 +68,22 @@ public function testStore() { - $arrayWithRefs = array(); + $arrayWithRefs = []; $arrayWithRefs[0] = 123; $arrayWithRefs[1] = &$arrayWithRefs[0]; - $object = (object) array( + $object = (object) [ 'foo' => 'bar', 'foo2' => 'bar2', - ); + ]; - $expected = array( + $expected = [ 'null' => null, 'serializedString' => serialize($object), 'arrayWithRefs' => $arrayWithRefs, 'object' => $object, - 'arrayWithObject' => array('bar' => $object), - ); + 'arrayWithObject' => ['bar' => $object], + ]; $cache = new PhpArrayCache(self::$file, new NullCache()); $cache->warmUp($expected); @@ -95,13 +95,13 @@ public function testStoredFile() { - $expected = array( + $expected = [ 'integer' => 42, 'float' => 42.42, 'boolean' => true, - 'array_simple' => array('foo', 'bar'), - 'array_associative' => array('foo' => 'bar', 'foo2' => 'bar2'), - ); + 'array_simple' => ['foo', 'bar'], + 'array_associative' => ['foo' => 'bar', 'foo2' => 'bar2'], + ]; $cache = new PhpArrayCache(self::$file, new NullCache()); $cache->warmUp($expected); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheWithFallbackTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheWithFallbackTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheWithFallbackTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpArrayCacheWithFallbackTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ */ class PhpArrayCacheWithFallbackTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testGetInvalidKeys' => 'PhpArrayCache does no validation', 'testGetMultipleInvalidKeys' => 'PhpArrayCache does no validation', 'testDeleteInvalidKeys' => 'PhpArrayCache does no validation', @@ -32,7 +32,7 @@ 'testSetMultipleInvalidTtl' => 'PhpArrayCache does no validation', 'testHasInvalidKeys' => 'PhpArrayCache does no validation', 'testPrune' => 'PhpArrayCache just proxies', - ); + ]; protected static $file; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpFilesCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpFilesCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpFilesCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/PhpFilesCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class PhpFilesCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testDefaultLifeTime' => 'PhpFilesCache does not allow configuring a default lifetime.', - ); + ]; public function createSimpleCache() { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/Psr6CacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class Psr6CacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testPrune' => 'Psr6Cache just proxies', - ); + ]; public function createSimpleCache($defaultLifetime = 0) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,6 +19,6 @@ if (!class_exists('RedisArray')) { self::markTestSkipped('The RedisArray class is required.'); } - self::$redis = new \RedisArray(array(getenv('REDIS_HOST')), array('lazy_connect' => true)); + self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/RedisCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,13 +33,13 @@ $redis = RedisCache::createConnection('redis://'.$redisHost.'/2'); $this->assertSame(2, $redis->getDbNum()); - $redis = RedisCache::createConnection('redis://'.$redisHost, array('timeout' => 3)); + $redis = RedisCache::createConnection('redis://'.$redisHost, ['timeout' => 3]); $this->assertEquals(3, $redis->getTimeout()); $redis = RedisCache::createConnection('redis://'.$redisHost.'?timeout=4'); $this->assertEquals(4, $redis->getTimeout()); - $redis = RedisCache::createConnection('redis://'.$redisHost, array('read_timeout' => 5)); + $redis = RedisCache::createConnection('redis://'.$redisHost, ['read_timeout' => 5]); $this->assertEquals(5, $redis->getReadTimeout()); } @@ -55,11 +55,11 @@ public function provideFailedCreateConnection() { - return array( - array('redis://localhost:1234'), - array('redis://foo@localhost'), - array('redis://localhost/123'), - ); + return [ + ['redis://localhost:1234'], + ['redis://foo@localhost'], + ['redis://localhost/123'], + ]; } /** @@ -74,9 +74,9 @@ public function provideInvalidCreateConnection() { - return array( - array('foo://localhost'), - array('redis://'), - ); + return [ + ['foo://localhost'], + ['redis://'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/TraceableCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/TraceableCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Tests/Simple/TraceableCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Tests/Simple/TraceableCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,9 +19,9 @@ */ class TraceableCacheTest extends CacheTestCase { - protected $skippedTests = array( + protected $skippedTests = [ 'testPrune' => 'TraceableCache just proxies', - ); + ]; public function createSimpleCache($defaultLifetime = 0) { @@ -37,7 +37,7 @@ $call = $calls[0]; $this->assertSame('get', $call->name); - $this->assertSame(array('k' => false), $call->result); + $this->assertSame(['k' => false], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(1, $call->misses); $this->assertNotEmpty($call->start); @@ -61,7 +61,7 @@ { $pool = $this->createSimpleCache(); $pool->set('k1', 123); - $values = $pool->getMultiple(array('k0', 'k1')); + $values = $pool->getMultiple(['k0', 'k1']); foreach ($values as $value) { } $calls = $pool->getCalls(); @@ -69,7 +69,7 @@ $call = $calls[1]; $this->assertSame('getMultiple', $call->name); - $this->assertSame(array('k1' => true, 'k0' => false), $call->result); + $this->assertSame(['k1' => true, 'k0' => false], $call->result); $this->assertSame(1, $call->misses); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); @@ -84,7 +84,7 @@ $call = $calls[0]; $this->assertSame('has', $call->name); - $this->assertSame(array('k' => false), $call->result); + $this->assertSame(['k' => false], $call->result); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); } @@ -99,7 +99,7 @@ $call = $calls[1]; $this->assertSame('has', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertNotEmpty($call->start); $this->assertNotEmpty($call->end); } @@ -113,7 +113,7 @@ $call = $calls[0]; $this->assertSame('delete', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -123,14 +123,14 @@ public function testDeleteMultipleTrace() { $pool = $this->createSimpleCache(); - $arg = array('k0', 'k1'); + $arg = ['k0', 'k1']; $pool->deleteMultiple($arg); $calls = $pool->getCalls(); $this->assertCount(1, $calls); $call = $calls[0]; $this->assertSame('deleteMultiple', $call->name); - $this->assertSame(array('keys' => $arg, 'result' => true), $call->result); + $this->assertSame(['keys' => $arg, 'result' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -146,7 +146,7 @@ $call = $calls[0]; $this->assertSame('set', $call->name); - $this->assertSame(array('k' => true), $call->result); + $this->assertSame(['k' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); @@ -156,13 +156,13 @@ public function testSetMultipleTrace() { $pool = $this->createSimpleCache(); - $pool->setMultiple(array('k' => 'foo')); + $pool->setMultiple(['k' => 'foo']); $calls = $pool->getCalls(); $this->assertCount(1, $calls); $call = $calls[0]; $this->assertSame('setMultiple', $call->name); - $this->assertSame(array('keys' => array('k'), 'result' => true), $call->result); + $this->assertSame(['keys' => ['k'], 'result' => true], $call->result); $this->assertSame(0, $call->hits); $this->assertSame(0, $call->misses); $this->assertNotEmpty($call->start); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/AbstractTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/AbstractTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/AbstractTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/AbstractTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ private $namespace; private $namespaceVersion = ''; private $versioningIsEnabled = false; - private $deferred = array(); + private $deferred = []; /** * @var int|null The maximum length to enforce for identifiers or null when no limit applies @@ -93,7 +93,7 @@ try { return $this->doHave($id); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to check if key "{key}" is cached', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to check if key "{key}" is cached', ['key' => $key, 'exception' => $e]); return false; } @@ -104,15 +104,15 @@ */ public function clear() { - $this->deferred = array(); + $this->deferred = []; if ($cleared = $this->versioningIsEnabled) { $namespaceVersion = substr_replace(base64_encode(pack('V', mt_rand())), ':', 5); try { - $cleared = $this->doSave(array('@'.$this->namespace => $namespaceVersion), 0); + $cleared = $this->doSave(['@'.$this->namespace => $namespaceVersion], 0); } catch (\Exception $e) { $cleared = false; } - if ($cleared = true === $cleared || array() === $cleared) { + if ($cleared = true === $cleared || [] === $cleared) { $this->namespaceVersion = $namespaceVersion; } } @@ -120,7 +120,7 @@ try { return $this->doClear($this->namespace) || $cleared; } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to clear the cache', array('exception' => $e)); + CacheItem::log($this->logger, 'Failed to clear the cache', ['exception' => $e]); return false; } @@ -131,7 +131,7 @@ */ public function deleteItem($key) { - return $this->deleteItems(array($key)); + return $this->deleteItems([$key]); } /** @@ -139,7 +139,7 @@ */ public function deleteItems(array $keys) { - $ids = array(); + $ids = []; foreach ($keys as $key) { $ids[$key] = $this->getId($key); @@ -159,12 +159,12 @@ foreach ($ids as $key => $id) { try { $e = null; - if ($this->doDelete(array($id))) { + if ($this->doDelete([$id])) { continue; } } catch (\Exception $e) { } - CacheItem::log($this->logger, 'Failed to delete key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to delete key "{key}"', ['key' => $key, 'exception' => $e]); $ok = false; } @@ -237,12 +237,12 @@ if ($this->versioningIsEnabled && '' === $this->namespaceVersion) { $this->namespaceVersion = '1:'; try { - foreach ($this->doFetch(array('@'.$this->namespace)) as $v) { + foreach ($this->doFetch(['@'.$this->namespace]) as $v) { $this->namespaceVersion = $v; } if ('1:' === $this->namespaceVersion) { $this->namespaceVersion = substr_replace(base64_encode(pack('V', time())), ':', 5); - $this->doSave(array('@'.$this->namespace => $this->namespaceVersion), 0); + $this->doSave(['@'.$this->namespace => $this->namespaceVersion], 0); } } catch (\Exception $e) { } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/ApcuTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/ApcuTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/ApcuTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/ApcuTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -52,7 +52,7 @@ protected function doFetch(array $ids) { try { - foreach (apcu_fetch($ids, $ok) ?: array() as $k => $v) { + foreach (apcu_fetch($ids, $ok) ?: [] as $k => $v) { if (null !== $v || $ok) { yield $k => $v; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/ArrayTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/ArrayTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/ArrayTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/ArrayTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,8 +24,8 @@ use LoggerAwareTrait; private $storeSerialized; - private $values = array(); - private $expiries = array(); + private $values = []; + private $expiries = []; /** * Returns all cached values, with cache miss as null. @@ -52,7 +52,7 @@ */ public function clear() { - $this->values = $this->expiries = array(); + $this->values = $this->expiries = []; return true; } @@ -92,7 +92,7 @@ $isHit = false; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to unserialize key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to unserialize key "{key}"', ['key' => $key, 'exception' => $e]); $this->values[$key] = $value = null; $isHit = false; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/FilesystemTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/FilesystemTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/FilesystemTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/FilesystemTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -52,7 +52,7 @@ */ protected function doFetch(array $ids) { - $values = array(); + $values = []; $now = time(); foreach ($ids as $id) { @@ -83,7 +83,7 @@ { $file = $this->getFile($id); - return file_exists($file) && (@filemtime($file) > time() || $this->doFetch(array($id))); + return file_exists($file) && (@filemtime($file) > time() || $this->doFetch([$id])); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/MemcachedTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/MemcachedTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/MemcachedTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/MemcachedTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,12 +22,12 @@ */ trait MemcachedTrait { - private static $defaultClientOptions = array( + private static $defaultClientOptions = [ 'persistent_id' => null, 'username' => null, 'password' => null, 'serializer' => 'php', - ); + ]; private $client; private $lazyClient; @@ -64,7 +64,7 @@ * * Examples for servers: * - 'memcached://user:pass@localhost?weight=33' - * - array(array('localhost', 11211, 33)) + * - [['localhost', 11211, 33]] * * @param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs * @param array $options An array of options @@ -73,10 +73,10 @@ * * @throws \ErrorException When invalid options or servers are provided */ - public static function createConnection($servers, array $options = array()) + public static function createConnection($servers, array $options = []) { if (\is_string($servers)) { - $servers = array($servers); + $servers = [$servers]; } elseif (!\is_array($servers)) { throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument, %s given.', \gettype($servers))); } @@ -100,7 +100,7 @@ } $params = preg_replace_callback('#^memcached://(?:([^@]*+)@)?#', function ($m) use (&$username, &$password) { if (!empty($m[1])) { - list($username, $password) = explode(':', $m[1], 2) + array(1 => null); + list($username, $password) = explode(':', $m[1], 2) + [1 => null]; } return 'file://'; @@ -115,18 +115,18 @@ $params['weight'] = $m[1]; $params['path'] = substr($params['path'], 0, -\strlen($m[0])); } - $params += array( + $params += [ 'host' => isset($params['host']) ? $params['host'] : $params['path'], 'port' => isset($params['host']) ? 11211 : null, 'weight' => 0, - ); + ]; if (isset($params['query'])) { parse_str($params['query'], $query); $params += $query; $options = $query + $options; } - $servers[$i] = array($params['host'], $params['port'], $params['weight']); + $servers[$i] = [$params['host'], $params['port'], $params['weight']]; } // set client's options @@ -154,12 +154,12 @@ // set client's servers, taking care of persistent connections if (!$client->isPristine()) { - $oldServers = array(); + $oldServers = []; foreach ($client->getServerList() as $server) { - $oldServers[] = array($server['host'], $server['port']); + $oldServers[] = [$server['host'], $server['port']]; } - $newServers = array(); + $newServers = []; foreach ($servers as $server) { if (1 < \count($server)) { $server = array_values($server); @@ -199,7 +199,7 @@ $lifetime += time(); } - $encodedValues = array(); + $encodedValues = []; foreach ($values as $key => $value) { $encodedValues[rawurlencode($key)] = $value; } @@ -218,7 +218,7 @@ $encodedResult = $this->checkResultCode($this->getClient()->getMulti($encodedIds)); - $result = array(); + $result = []; foreach ($encodedResult as $key => $value) { $result[rawurldecode($key)] = $value; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PdoTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PdoTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PdoTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PdoTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ private $timeCol = 'item_time'; private $username = ''; private $password = ''; - private $connectionOptions = array(); + private $connectionOptions = []; private $namespace; private function init($connOrDsn, $namespace, $defaultLifetime, array $options) @@ -85,24 +85,24 @@ $conn = $this->getConnection(); if ($conn instanceof Connection) { - $types = array( + $types = [ 'mysql' => 'binary', 'sqlite' => 'text', 'pgsql' => 'string', 'oci' => 'string', 'sqlsrv' => 'string', - ); + ]; if (!isset($types[$this->driver])) { throw new \DomainException(sprintf('Creating the cache table is currently not implemented for PDO driver "%s".', $this->driver)); } $schema = new Schema(); $table = $schema->createTable($this->table); - $table->addColumn($this->idCol, $types[$this->driver], array('length' => 255)); - $table->addColumn($this->dataCol, 'blob', array('length' => 16777215)); - $table->addColumn($this->lifetimeCol, 'integer', array('unsigned' => true, 'notnull' => false)); - $table->addColumn($this->timeCol, 'integer', array('unsigned' => true)); - $table->setPrimaryKey(array($this->idCol)); + $table->addColumn($this->idCol, $types[$this->driver], ['length' => 255]); + $table->addColumn($this->dataCol, 'blob', ['length' => 16777215]); + $table->addColumn($this->lifetimeCol, 'integer', ['unsigned' => true, 'notnull' => false]); + $table->addColumn($this->timeCol, 'integer', ['unsigned' => true]); + $table->setPrimaryKey([$this->idCol]); foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { $conn->exec($sql); @@ -166,7 +166,7 @@ protected function doFetch(array $ids) { $now = time(); - $expired = array(); + $expired = []; $sql = str_pad('', (\count($ids) << 1) - 1, '?,'); $sql = "SELECT $this->idCol, CASE WHEN $this->lifetimeCol IS NULL OR $this->lifetimeCol + $this->timeCol > ? THEN $this->dataCol ELSE NULL END FROM $this->table WHERE $this->idCol IN ($sql)"; @@ -252,8 +252,8 @@ */ protected function doSave(array $values, $lifetime) { - $serialized = array(); - $failed = array(); + $serialized = []; + $failed = []; foreach ($values as $id => $value) { try { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PhpArrayTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PhpArrayTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PhpArrayTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PhpArrayTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -60,7 +60,7 @@ // This file has been auto-generated by the Symfony Cache Component. -return array( +return [ EOF; @@ -97,7 +97,7 @@ $dump .= var_export($key, true).' => '.var_export($value, true).",\n"; } - $dump .= "\n);\n"; + $dump .= "\n];\n"; $dump = str_replace("' . \"\\0\" . '", "\0", $dump); $tmpFile = uniqid($this->file, true); @@ -116,7 +116,7 @@ */ public function clear() { - $this->values = array(); + $this->values = []; $cleared = @unlink($this->file) || !file_exists($this->file); @@ -132,7 +132,7 @@ $zmb = ini_set('zend.detect_unicode', 0); } try { - $this->values = file_exists($this->file) ? (include $this->file ?: array()) : array(); + $this->values = file_exists($this->file) ? (include $this->file ?: []) : []; } finally { if ($this->zendDetectUnicode) { ini_set('zend.detect_unicode', $zmb); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -67,7 +67,7 @@ */ protected function doFetch(array $ids) { - $values = array(); + $values = []; $now = time(); if ($this->zendDetectUnicode) { @@ -109,7 +109,7 @@ */ protected function doHave($id) { - return (bool) $this->doFetch(array($id)); + return (bool) $this->doFetch([$id]); } /** @@ -118,7 +118,7 @@ protected function doSave(array $values, $lifetime) { $ok = true; - $data = array($lifetime ? time() + $lifetime : PHP_INT_MAX, ''); + $data = [$lifetime ? time() + $lifetime : PHP_INT_MAX, '']; $allowCompile = 'cli' !== \PHP_SAPI || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN); foreach ($values as $key => $value) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/RedisProxy.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/RedisProxy.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/RedisProxy.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/RedisProxy.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ { $this->ready ?: $this->ready = $this->initializer->__invoke($this->redis); - return \call_user_func_array(array($this->redis, $method), $args); + return \call_user_func_array([$this->redis, $method], $args); } public function hscan($strKey, &$iIterator, $strPattern = null, $iCount = null) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/RedisTrait.php symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/RedisTrait.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Cache/Traits/RedisTrait.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Cache/Traits/RedisTrait.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ */ trait RedisTrait { - private static $defaultConnectionOptions = array( + private static $defaultConnectionOptions = [ 'class' => null, 'persistent' => 0, 'persistent_id' => null, @@ -35,7 +35,7 @@ 'read_timeout' => 0, 'retry_interval' => 0, 'lazy' => false, - ); + ]; private $redis; /** @@ -73,7 +73,7 @@ * * @return \Redis|\Predis\Client According to the "class" option */ - public static function createConnection($dsn, array $options = array()) + public static function createConnection($dsn, array $options = []) { if (0 !== strpos($dsn, 'redis://')) { throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s does not start with "redis://"', $dsn)); @@ -100,11 +100,11 @@ } else { $scheme = 'unix'; } - $params += array( + $params += [ 'host' => isset($params['host']) ? $params['host'] : $params['path'], 'port' => isset($params['host']) ? 6379 : null, 'dbindex' => 0, - ); + ]; if (isset($params['query'])) { parse_str($params['query'], $query); $params += $query; @@ -172,7 +172,7 @@ if ($ids) { $values = $this->pipeline(function () use ($ids) { foreach ($ids as $id) { - yield 'get' => array($id); + yield 'get' => [$id]; } }); foreach ($values as $id => $v) { @@ -200,15 +200,15 @@ // This means old keys are not really removed until they expire and may need garbage collection. $cleared = true; - $hosts = array($this->redis); - $evalArgs = array(array($namespace), 0); + $hosts = [$this->redis]; + $evalArgs = [[$namespace], 0]; if ($this->redis instanceof \Predis\Client) { - $evalArgs = array(0, $namespace); + $evalArgs = [0, $namespace]; $connection = $this->redis->getConnection(); if ($connection instanceof PredisCluster) { - $hosts = array(); + $hosts = []; foreach ($connection as $c) { $hosts[] = new \Predis\Client($c); } @@ -216,7 +216,7 @@ return false; } } elseif ($this->redis instanceof \RedisArray) { - $hosts = array(); + $hosts = []; foreach ($this->redis->_hosts() as $host) { $hosts[] = $this->redis->_instance($host); } @@ -273,8 +273,8 @@ */ protected function doSave(array $values, $lifetime) { - $serialized = array(); - $failed = array(); + $serialized = []; + $failed = []; foreach ($values as $id => $value) { try { @@ -291,9 +291,9 @@ $results = $this->pipeline(function () use ($serialized, $lifetime) { foreach ($serialized as $id => $value) { if (0 >= $lifetime) { - yield 'set' => array($id, $value); + yield 'set' => [$id, $value]; } else { - yield 'setEx' => array($id, $lifetime, $value); + yield 'setEx' => [$id, $lifetime, $value]; } } }); @@ -308,24 +308,24 @@ private function pipeline(\Closure $generator) { - $ids = array(); + $ids = []; if ($this->redis instanceof \Predis\Client && !$this->redis->getConnection() instanceof ClusterInterface) { $results = $this->redis->pipeline(function ($redis) use ($generator, &$ids) { foreach ($generator() as $command => $args) { - \call_user_func_array(array($redis, $command), $args); + \call_user_func_array([$redis, $command], $args); $ids[] = $args[0]; } }); } elseif ($this->redis instanceof \RedisArray) { - $connections = $results = $ids = array(); + $connections = $results = $ids = []; foreach ($generator() as $command => $args) { if (!isset($connections[$h = $this->redis->_target($args[0])])) { - $connections[$h] = array($this->redis->_instance($h), -1); + $connections[$h] = [$this->redis->_instance($h), -1]; $connections[$h][0]->multi(\Redis::PIPELINE); } - \call_user_func_array(array($connections[$h][0], $command), $args); - $results[] = array($h, ++$connections[$h][1]); + \call_user_func_array([$connections[$h][0], $command], $args); + $results[] = [$h, ++$connections[$h][1]]; $ids[] = $args[0]; } foreach ($connections as $h => $c) { @@ -338,15 +338,15 @@ // phpredis & predis don't support pipelining with RedisCluster // see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining // see https://github.com/nrk/predis/issues/267#issuecomment-123781423 - $results = array(); + $results = []; foreach ($generator() as $command => $args) { - $results[] = \call_user_func_array(array($this->redis, $command), $args); + $results[] = \call_user_func_array([$this->redis, $command], $args); $ids[] = $args[0]; } } else { $this->redis->multi(\Redis::PIPELINE); foreach ($generator() as $command => $args) { - \call_user_func_array(array($this->redis, $command), $args); + \call_user_func_array([$this->redis, $command], $args); $ids[] = $args[0]; } $results = $this->redis->exec(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ApcClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ApcClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ApcClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ApcClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -88,7 +88,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** @@ -96,7 +96,7 @@ */ public function unregister() { - spl_autoload_unregister(array($this, 'loadClass')); + spl_autoload_unregister([$this, 'loadClass']); } /** @@ -138,6 +138,6 @@ */ public function __call($method, $args) { - return \call_user_func_array(array($this->decorated, $method), $args); + return \call_user_func_array([$this->decorated, $method], $args); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -108,7 +108,7 @@ if ($autoReload) { // save the resources - self::writeCacheFile($metadata, serialize(array(array_values($files), $classes))); + self::writeCacheFile($metadata, serialize([array_values($files), $classes])); } } @@ -125,7 +125,7 @@ */ public static function inline($classes, $cache, array $excluded) { - $declared = array(); + $declared = []; foreach (self::getOrderedClasses($excluded) as $class) { $declared[$class->getName()] = true; } @@ -147,7 +147,7 @@ $dontInlineRegex = str_replace('.', $spacesRegex, $dontInlineRegex); $cacheDir = explode('/', str_replace(\DIRECTORY_SEPARATOR, '/', $cacheDir)); - $files = array(); + $files = []; $content = ''; foreach (self::getOrderedClasses($classes) as $class) { if (isset($declared[$class->getName()])) { @@ -176,7 +176,7 @@ $c = "\nnamespace {require $file;}"; } else { - $c = preg_replace(array('/^\s*<\?php/', '/\?>\s*$/'), '', $c); + $c = preg_replace(['/^\s*<\?php/', '/\?>\s*$/'], '', $c); // fakes namespace declaration for global code if (!$class->inNamespace()) { @@ -220,7 +220,7 @@ $token = $tokens[$i]; if (!isset($token[1]) || 'b"' === $token) { $rawChunk .= $token; - } elseif (\in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { + } elseif (\in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) { // strip comments continue; } elseif (T_NAMESPACE === $token[0]) { @@ -230,7 +230,7 @@ $rawChunk .= $token[1]; // namespace name and whitespaces - while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) { + while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], [T_WHITESPACE, T_NS_SEPARATOR, T_STRING])) { $rawChunk .= $tokens[$i][1]; } if ('{' === $tokens[$i]) { @@ -289,8 +289,8 @@ private static function compressCode($code) { return preg_replace( - array('/^\s+/m', '/\s+$/m', '/([\n\r]+ *[\n\r]+)+/', '/[ \t]+/'), - array('', '', "\n", ' '), + ['/^\s+/m', '/\s+$/m', '/([\n\r]+ *[\n\r]+)+/', '/[ \t]+/'], + ['', '', "\n", ' '], $code ); } @@ -330,8 +330,8 @@ */ private static function getOrderedClasses(array $classes) { - $map = array(); - self::$seen = array(); + $map = []; + self::$seen = []; foreach ($classes as $class) { try { $reflectionClass = new \ReflectionClass($class); @@ -348,12 +348,12 @@ private static function getClassHierarchy(\ReflectionClass $class) { if (isset(self::$seen[$class->getName()])) { - return array(); + return []; } self::$seen[$class->getName()] = true; - $classes = array($class); + $classes = [$class]; $parent = $class; while (($parent = $parent->getParentClass()) && $parent->isUserDefined() && !isset(self::$seen[$parent->getName()])) { self::$seen[$parent->getName()] = true; @@ -361,7 +361,7 @@ array_unshift($classes, $parent); } - $traits = array(); + $traits = []; foreach ($classes as $c) { foreach (self::resolveDependencies(self::computeTraitDeps($c), $c) as $trait) { @@ -376,7 +376,7 @@ private static function getInterfaces(\ReflectionClass $class) { - $classes = array(); + $classes = []; foreach ($class->getInterfaces() as $interface) { $classes = array_merge($classes, self::getInterfaces($interface)); @@ -394,7 +394,7 @@ private static function computeTraitDeps(\ReflectionClass $class) { $traits = $class->getTraits(); - $deps = array($class->getName() => $traits); + $deps = [$class->getName() => $traits]; while ($trait = array_pop($traits)) { if ($trait->isUserDefined() && !isset(self::$seen[$trait->getName()])) { self::$seen[$trait->getName()] = true; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,8 +43,8 @@ */ class ClassLoader { - private $prefixes = array(); - private $fallbackDirs = array(); + private $prefixes = []; + private $fallbackDirs = []; private $useIncludePath = false; /** @@ -136,7 +136,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** @@ -144,7 +144,7 @@ */ public function unregister() { - spl_autoload_unregister(array($this, 'loadClass')); + spl_autoload_unregister([$this, 'loadClass']); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassMapGenerator.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassMapGenerator.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/ClassMapGenerator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/ClassMapGenerator.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ public static function dump($dirs, $file) { $dirs = (array) $dirs; - $maps = array(); + $maps = []; foreach ($dirs as $dir) { $maps = array_merge($maps, static::createMap($dir)); @@ -53,7 +53,7 @@ $dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)); } - $map = array(); + $map = []; foreach ($dir as $file) { if (!$file->isFile()) { @@ -93,7 +93,7 @@ $contents = file_get_contents($path); $tokens = token_get_all($contents); - $classes = array(); + $classes = []; $namespace = ''; for ($i = 0; isset($tokens[$i]); ++$i) { @@ -110,7 +110,7 @@ $namespace = ''; // If there is a namespace, extract it while (isset($tokens[++$i][1])) { - if (\in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) { + if (\in_array($tokens[$i][0], [T_STRING, T_NS_SEPARATOR])) { $namespace .= $tokens[$i][1]; } } @@ -129,7 +129,7 @@ if (T_DOUBLE_COLON === $tokens[$j][0]) { $isClassConstant = true; break; - } elseif (!\in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) { + } elseif (!\in_array($tokens[$j][0], [T_WHITESPACE, T_DOC_COMMENT, T_COMMENT])) { break; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/MapClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/MapClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/MapClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/MapClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ */ class MapClassLoader { - private $map = array(); + private $map = []; /** * @param array $map A map where keys are classes and values the absolute file path @@ -39,7 +39,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Psr4ClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Psr4ClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Psr4ClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Psr4ClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ */ class Psr4ClassLoader { - private $prefixes = array(); + private $prefixes = []; /** * @param string $prefix @@ -34,7 +34,7 @@ { $prefix = trim($prefix, '\\').'\\'; $baseDir = rtrim($baseDir, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR; - $this->prefixes[] = array($prefix, $baseDir); + $this->prefixes[] = [$prefix, $baseDir]; } /** @@ -81,7 +81,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** @@ -89,6 +89,6 @@ */ public function unregister() { - spl_autoload_unregister(array($this, 'loadClass')); + spl_autoload_unregister([$this, 'loadClass']); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -62,10 +62,10 @@ public function getLoadClassTests() { - return array( - array('\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'), - array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'), - ); + return [ + ['\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'], + ['Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'], + ]; } /** @@ -76,7 +76,7 @@ $loader = new ClassLoader(); $loader->addPrefix('Apc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'); $loader->addPrefix('Apc_Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('', array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback')); + $loader->addPrefix('', [__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback']); $loader = new ApcClassLoader('test.prefix.fallback', $loader); $loader->loadClass($testClassName); @@ -86,12 +86,12 @@ public function getLoadClassFromFallbackTests() { - return array( - array('\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'), - array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'), - array('\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'), - array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'), - ); + return [ + ['\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'], + ['Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'], + ['\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'], + ['Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'], + ]; } /** @@ -110,40 +110,40 @@ public function getLoadClassNamespaceCollisionTests() { - return array( - array( - array( + return [ + [ + [ 'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', 'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), + ], 'Apc\NamespaceCollision\A\Foo', '->loadClass() loads NamespaceCollision\A\Foo from alpha.', - ), - array( - array( + ], + [ + [ 'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', 'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), + ], 'Apc\NamespaceCollision\A\Bar', '->loadClass() loads NamespaceCollision\A\Bar from alpha.', - ), - array( - array( + ], + [ + [ 'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', 'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), + ], 'Apc\NamespaceCollision\A\B\Foo', '->loadClass() loads NamespaceCollision\A\B\Foo from beta.', - ), - array( - array( + ], + [ + [ 'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', 'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), + ], 'Apc\NamespaceCollision\A\B\Bar', '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', - ), - ); + ], + ]; } /** @@ -162,39 +162,39 @@ public function getLoadClassPrefixCollisionTests() { - return array( - array( - array( + return [ + [ + [ 'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', 'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), + ], 'ApcPrefixCollision_A_Foo', '->loadClass() loads ApcPrefixCollision_A_Foo from alpha.', - ), - array( - array( + ], + [ + [ 'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', 'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), + ], 'ApcPrefixCollision_A_Bar', '->loadClass() loads ApcPrefixCollision_A_Bar from alpha.', - ), - array( - array( + ], + [ + [ 'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', 'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), + ], 'ApcPrefixCollision_A_B_Foo', '->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.', - ), - array( - array( + ], + [ + [ 'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', 'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), + ], 'ApcPrefixCollision_A_B_Bar', '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.', - ), - ); + ], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,17 +34,17 @@ $m = $r->getMethod('getOrderedClasses'); $m->setAccessible(true); - $ordered = $m->invoke(null, array('CTFoo')); + $ordered = $m->invoke(null, ['CTFoo']); $this->assertEquals( - array('TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'), + ['TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'], array_map(function ($class) { return $class->getName(); }, $ordered) ); - $ordered = $m->invoke(null, array('CTBar')); + $ordered = $m->invoke(null, ['CTBar']); $this->assertEquals( - array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'), + ['TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'], array_map(function ($class) { return $class->getName(); }, $ordered) ); } @@ -54,12 +54,12 @@ */ public function testClassReordering(array $classes) { - $expected = array( + $expected = [ 'ClassesWithParents\\GInterface', 'ClassesWithParents\\CInterface', 'ClassesWithParents\\B', 'ClassesWithParents\\A', - ); + ]; $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); $m = $r->getMethod('getOrderedClasses'); @@ -72,27 +72,27 @@ public function getDifferentOrders() { - return array( - array(array( + return [ + [[ 'ClassesWithParents\\A', 'ClassesWithParents\\CInterface', 'ClassesWithParents\\GInterface', 'ClassesWithParents\\B', - )), - array(array( + ]], + [[ 'ClassesWithParents\\B', 'ClassesWithParents\\A', 'ClassesWithParents\\CInterface', - )), - array(array( + ]], + [[ 'ClassesWithParents\\CInterface', 'ClassesWithParents\\B', 'ClassesWithParents\\A', - )), - array(array( + ]], + [[ 'ClassesWithParents\\A', - )), - ); + ]], + ]; } /** @@ -106,7 +106,7 @@ require_once __DIR__.'/Fixtures/ClassesWithParents/D.php'; require_once __DIR__.'/Fixtures/ClassesWithParents/E.php'; - $expected = array( + $expected = [ 'ClassesWithParents\\GInterface', 'ClassesWithParents\\CInterface', 'ClassesWithParents\\ATrait', @@ -116,7 +116,7 @@ 'ClassesWithParents\\A', 'ClassesWithParents\\D', 'ClassesWithParents\\E', - ); + ]; $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); $m = $r->getMethod('getOrderedClasses'); @@ -129,15 +129,15 @@ public function getDifferentOrdersForTraits() { - return array( - array(array( + return [ + [[ 'ClassesWithParents\\E', 'ClassesWithParents\\ATrait', - )), - array(array( + ]], + [[ 'ClassesWithParents\\E', - )), - ); + ]], + ]; } public function testFixClassWithTraitsOrdering() @@ -146,16 +146,16 @@ require_once __DIR__.'/Fixtures/ClassesWithParents/F.php'; require_once __DIR__.'/Fixtures/ClassesWithParents/G.php'; - $classes = array( + $classes = [ 'ClassesWithParents\\F', 'ClassesWithParents\\G', - ); + ]; - $expected = array( + $expected = [ 'ClassesWithParents\\CTrait', 'ClassesWithParents\\F', 'ClassesWithParents\\G', - ); + ]; $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); $m = $r->getMethod('getOrderedClasses'); @@ -176,14 +176,14 @@ public function getFixNamespaceDeclarationsData() { - return array( - array("namespace;\nclass Foo {}\n", "namespace\n{\nclass Foo {}\n}"), - array("namespace Foo;\nclass Foo {}\n", "namespace Foo\n{\nclass Foo {}\n}"), - array("namespace Bar ;\nclass Foo {}\n", "namespace Bar\n{\nclass Foo {}\n}"), - array("namespace Foo\Bar;\nclass Foo {}\n", "namespace Foo\Bar\n{\nclass Foo {}\n}"), - array("namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n", "namespace Foo\Bar\Bar\n{\nclass Foo {}\n}"), - array("namespace\n{\nclass Foo {}\n}\n", "namespace\n{\nclass Foo {}\n}"), - ); + return [ + ["namespace;\nclass Foo {}\n", "namespace\n{\nclass Foo {}\n}"], + ["namespace Foo;\nclass Foo {}\n", "namespace Foo\n{\nclass Foo {}\n}"], + ["namespace Bar ;\nclass Foo {}\n", "namespace Bar\n{\nclass Foo {}\n}"], + ["namespace Foo\Bar;\nclass Foo {}\n", "namespace Foo\Bar\n{\nclass Foo {}\n}"], + ["namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n", "namespace Foo\Bar\Bar\n{\nclass Foo {}\n}"], + ["namespace\n{\nclass Foo {}\n}\n", "namespace\n{\nclass Foo {}\n}"], + ]; } /** @@ -198,14 +198,14 @@ public function getFixNamespaceDeclarationsDataWithoutTokenizer() { - return array( - array("namespace;\nclass Foo {}\n", "namespace\n{\nclass Foo {}\n}\n"), - array("namespace Foo;\nclass Foo {}\n", "namespace Foo\n{\nclass Foo {}\n}\n"), - array("namespace Bar ;\nclass Foo {}\n", "namespace Bar\n{\nclass Foo {}\n}\n"), - array("namespace Foo\Bar;\nclass Foo {}\n", "namespace Foo\Bar\n{\nclass Foo {}\n}\n"), - array("namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n", "namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n"), - array("\nnamespace\n{\nclass Foo {}\n\$namespace=123;}\n", "\nnamespace\n{\nclass Foo {}\n\$namespace=123;}\n"), - ); + return [ + ["namespace;\nclass Foo {}\n", "namespace\n{\nclass Foo {}\n}\n"], + ["namespace Foo;\nclass Foo {}\n", "namespace Foo\n{\nclass Foo {}\n}\n"], + ["namespace Bar ;\nclass Foo {}\n", "namespace Bar\n{\nclass Foo {}\n}\n"], + ["namespace Foo\Bar;\nclass Foo {}\n", "namespace Foo\Bar\n{\nclass Foo {}\n}\n"], + ["namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n", "namespace Foo\Bar\Bar\n{\nclass Foo {}\n}\n"], + ["\nnamespace\n{\nclass Foo {}\n\$namespace=123;}\n", "\nnamespace\n{\nclass Foo {}\n\$namespace=123;}\n"], + ]; } /** @@ -217,7 +217,7 @@ unlink($file); } - ClassCollectionLoader::load(array('SomeNotExistingClass'), sys_get_temp_dir(), 'foo', false); + ClassCollectionLoader::load(['SomeNotExistingClass'], sys_get_temp_dir(), 'foo', false); } public function testCommentStripping() @@ -227,14 +227,14 @@ } spl_autoload_register($r = function ($class) { if (0 === strpos($class, 'Namespaced') || 0 === strpos($class, 'Pearlike_')) { - @require_once __DIR__.'/Fixtures/'.str_replace(array('\\', '_'), '/', $class).'.php'; + @require_once __DIR__.'/Fixtures/'.str_replace(['\\', '_'], '/', $class).'.php'; } }); $strictTypes = \defined('HHVM_VERSION') ? '' : "\nnamespace {require __DIR__.'/Fixtures/Namespaced/WithStrictTypes.php';}"; ClassCollectionLoader::load( - array('Namespaced\\WithComments', 'Pearlike_WithComments', 'Namespaced\\WithDirMagic', 'Namespaced\\WithFileMagic', 'Namespaced\\WithHaltCompiler', $strictTypes ? 'Namespaced\\WithStrictTypes' : 'Namespaced\\WithComments'), + ['Namespaced\\WithComments', 'Pearlike_WithComments', 'Namespaced\\WithDirMagic', 'Namespaced\\WithFileMagic', 'Namespaced\\WithHaltCompiler', $strictTypes ? 'Namespaced\\WithStrictTypes' : 'Namespaced\\WithComments'], __DIR__, 'bar', false @@ -279,7 +279,7 @@ namespace {require __DIR__.'/Fixtures/Namespaced/WithHaltCompiler.php';} EOF .$strictTypes, - str_replace(array("loadClass() loads Namespaced2\Foo class'), - array('\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'), - ); + return [ + ['\\Namespaced2\\Foo', 'Namespaced2\\Foo', '->loadClass() loads Namespaced2\Foo class'], + ['\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'], + ]; } /** @@ -75,9 +75,9 @@ public function getLoadNonexistentClassTests() { - return array( - array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'), - ); + return [ + ['\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'], + ]; } public function testAddPrefixSingle() @@ -93,8 +93,8 @@ public function testAddPrefixesSingle() { $loader = new ClassLoader(); - $loader->addPrefixes(array('Foo' => array('foo', 'foo'))); - $loader->addPrefixes(array('Foo' => array('foo'))); + $loader->addPrefixes(['Foo' => ['foo', 'foo']]); + $loader->addPrefixes(['Foo' => ['foo']]); $prefixes = $loader->getPrefixes(); $this->assertArrayHasKey('Foo', $prefixes); $this->assertCount(1, $prefixes['Foo'], print_r($prefixes, true)); @@ -139,19 +139,19 @@ $loader = new ClassLoader(); $loader->addPrefix('Namespaced2\\', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'); $loader->addPrefix('Pearlike2_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('', array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback')); + $loader->addPrefix('', [__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback']); $loader->loadClass($testClassName); $this->assertTrue(class_exists($className), $message); } public function getLoadClassFromFallbackTests() { - return array( - array('\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'), - array('\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'), - array('\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'), - array('\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'), - ); + return [ + ['\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'], + ['\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'], + ['\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'], + ['\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'], + ]; } /** @@ -168,71 +168,71 @@ public function getLoadClassNamespaceCollisionTests() { - return array( - array( - array( + return [ + [ + [ 'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', 'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', - ), + ], 'NamespaceCollision\C\Foo', '->loadClass() loads NamespaceCollision\C\Foo from alpha.', - ), - array( - array( + ], + [ + [ 'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', 'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), + ], 'NamespaceCollision\C\Bar', '->loadClass() loads NamespaceCollision\C\Bar from alpha.', - ), - array( - array( + ], + [ + [ 'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', 'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', - ), + ], 'NamespaceCollision\C\B\Foo', '->loadClass() loads NamespaceCollision\C\B\Foo from beta.', - ), - array( - array( + ], + [ + [ 'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', 'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), + ], 'NamespaceCollision\C\B\Bar', '->loadClass() loads NamespaceCollision\C\B\Bar from beta.', - ), - array( - array( + ], + [ + [ 'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', 'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', - ), + ], 'PrefixCollision_C_Foo', '->loadClass() loads PrefixCollision_C_Foo from alpha.', - ), - array( - array( + ], + [ + [ 'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', 'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), + ], 'PrefixCollision_C_Bar', '->loadClass() loads PrefixCollision_C_Bar from alpha.', - ), - array( - array( + ], + [ + [ 'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', 'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', - ), + ], 'PrefixCollision_C_B_Foo', '->loadClass() loads PrefixCollision_C_B_Foo from beta.', - ), - array( - array( + ], + [ + [ 'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta', 'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), + ], 'PrefixCollision_C_B_Bar', '->loadClass() loads PrefixCollision_C_B_Bar from beta.', - ), - ); + ], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -74,8 +74,8 @@ public function getTestCreateMapTests() { - $data = array( - array(__DIR__.'/Fixtures/Namespaced', array( + $data = [ + [__DIR__.'/Fixtures/Namespaced', [ 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php', 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php', 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php', @@ -84,20 +84,20 @@ 'Namespaced\\WithHaltCompiler' => realpath(__DIR__).'/Fixtures/Namespaced/WithHaltCompiler.php', 'Namespaced\\WithDirMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithDirMagic.php', 'Namespaced\\WithFileMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithFileMagic.php', - )), - array(__DIR__.'/Fixtures/beta/NamespaceCollision', array( + ]], + [__DIR__.'/Fixtures/beta/NamespaceCollision', [ 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - )), - array(__DIR__.'/Fixtures/Pearlike', array( + ]], + [__DIR__.'/Fixtures/Pearlike', [ 'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php', 'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php', 'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php', 'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php', - )), - array(__DIR__.'/Fixtures/classmap', array( + ]], + [__DIR__.'/Fixtures/classmap', [ 'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', 'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', 'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', @@ -108,19 +108,19 @@ 'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php', 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php', 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php', - )), - array(__DIR__.'/Fixtures/php5.4', array( + ]], + [__DIR__.'/Fixtures/php5.4', [ 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php', 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php', - )), - array(__DIR__.'/Fixtures/php5.5', array( + ]], + [__DIR__.'/Fixtures/php5.5', [ 'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php', - )), - ); + ]], + ]; return $data; } @@ -130,12 +130,12 @@ $finder = new \Symfony\Component\Finder\Finder(); $finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision'); - $this->assertEqualsNormalized(array( + $this->assertEqualsNormalized([ 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - ), ClassMapGenerator::createMap($finder)); + ], ClassMapGenerator::createMap($finder)); } protected function assertEqualsNormalized($expected, $actual, $message = '') diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/Psr4ClassLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/Psr4ClassLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/Tests/Psr4ClassLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/Tests/Psr4ClassLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -39,12 +39,12 @@ */ public function getLoadClassTests() { - return array( - array('Acme\\DemoLib\\Foo'), - array('Acme\\DemoLib\\Class_With_Underscores'), - array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'), - array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'), - ); + return [ + ['Acme\\DemoLib\\Foo'], + ['Acme\\DemoLib\\Class_With_Underscores'], + ['Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'], + ['Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'], + ]; } /** @@ -67,9 +67,9 @@ */ public function getLoadNonexistentClassTests() { - return array( - array('Acme\\DemoLib\\I_Do_Not_Exist'), - array('UnknownVendor\\SomeLib\\I_Do_Not_Exist'), - ); + return [ + ['Acme\\DemoLib\\I_Do_Not_Exist'], + ['UnknownVendor\\SomeLib\\I_Do_Not_Exist'], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -87,7 +87,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** @@ -95,7 +95,7 @@ */ public function unregister() { - spl_autoload_unregister(array($this, 'loadClass')); + spl_autoload_unregister([$this, 'loadClass']); } /** @@ -137,6 +137,6 @@ */ public function __call($method, $args) { - return \call_user_func_array(array($this->decorated, $method), $args); + return \call_user_func_array([$this->decorated, $method], $args); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/XcacheClassLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/XcacheClassLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/ClassLoader/XcacheClassLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/ClassLoader/XcacheClassLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -81,7 +81,7 @@ */ public function register($prepend = false) { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + spl_autoload_register([$this, 'loadClass'], true, $prepend); } /** @@ -89,7 +89,7 @@ */ public function unregister() { - spl_autoload_unregister(array($this, 'loadClass')); + spl_autoload_unregister([$this, 'loadClass']); } /** @@ -132,6 +132,6 @@ */ public function __call($method, $args) { - return \call_user_func_array(array($this->decorated, $method), $args); + return \call_user_func_array([$this->decorated, $method], $args); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/CHANGELOG.md symfony-3.4.22+dfsg/src/Symfony/Component/Config/CHANGELOG.md --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/CHANGELOG.md 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/CHANGELOG.md 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ $rootNode ->children() ->enumNode('variable') - ->values(array('value')) + ->values(['value']) ->end() ->end() ; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/ConfigCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/ConfigCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/ConfigCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/ConfigCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,9 +35,9 @@ { $this->debug = (bool) $debug; - $checkers = array(); + $checkers = []; if (true === $this->debug) { - $checkers = array(new SelfCheckingResourceChecker()); + $checkers = [new SelfCheckingResourceChecker()]; } parent::__construct($file, $checkers); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/ArrayNode.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/ArrayNode.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/ArrayNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/ArrayNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,8 +22,8 @@ */ class ArrayNode extends BaseNode implements PrototypeNodeInterface { - protected $xmlRemappings = array(); - protected $children = array(); + protected $xmlRemappings = []; + protected $children = []; protected $allowFalse = false; protected $allowNewKeys = true; protected $addIfNotSet = false; @@ -56,7 +56,7 @@ return $value; } - $normalized = array(); + $normalized = []; foreach ($value as $k => $v) { if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) { @@ -82,7 +82,7 @@ /** * Sets the xml remappings that should be performed. * - * @param array $remappings An array of the form array(array(string, string)) + * @param array $remappings An array of the form [[string, string]] */ public function setXmlRemappings(array $remappings) { @@ -92,7 +92,7 @@ /** * Gets the xml remappings that should be performed. * - * @return array an array of the form array(array(string, string)) + * @return array an array of the form [[string, string]] */ public function getXmlRemappings() { @@ -177,7 +177,7 @@ throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath())); } - $defaults = array(); + $defaults = []; foreach ($this->children as $name => $child) { if ($child->hasDefaultValue()) { $defaults[$name] = $child->getDefaultValue(); @@ -289,7 +289,7 @@ $value = $this->remapXml($value); - $normalized = array(); + $normalized = []; foreach ($value as $name => $val) { if (isset($this->children[$name])) { try { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/BaseNode.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/BaseNode.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/BaseNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/BaseNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,13 +25,13 @@ { protected $name; protected $parent; - protected $normalizationClosures = array(); - protected $finalValidationClosures = array(); + protected $normalizationClosures = []; + protected $finalValidationClosures = []; protected $allowOverwrite = true; protected $required = false; protected $deprecationMessage = null; - protected $equivalentValues = array(); - protected $attributes = array(); + protected $equivalentValues = []; + protected $attributes = []; /** * @param string|null $name The name of the node @@ -127,7 +127,7 @@ */ public function addEquivalentValue($originalValue, $equivalentValue) { - $this->equivalentValues[] = array($originalValue, $equivalentValue); + $this->equivalentValues[] = [$originalValue, $equivalentValue]; } /** @@ -211,7 +211,7 @@ */ public function getDeprecationMessage($node, $path) { - return strtr($this->deprecationMessage, array('%node%' => $node, '%path%' => $path)); + return strtr($this->deprecationMessage, ['%node%' => $node, '%path%' => $path]); } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ protected $performDeepMerging = true; protected $ignoreExtraKeys = false; protected $removeExtraKeys = true; - protected $children = array(); + protected $children = []; protected $prototype; protected $atLeastOne = false; protected $allowNewKeys = true; @@ -43,8 +43,8 @@ { parent::__construct($name, $parent); - $this->nullEquivalent = array(); - $this->trueEquivalent = array(); + $this->nullEquivalent = []; + $this->trueEquivalent = []; } /** @@ -214,15 +214,15 @@ * to be the key of the particular item. For example, if "id" is the * "key", then: * - * array( - * array('id' => 'my_name', 'foo' => 'bar'), - * ); + * [ + * ['id' => 'my_name', 'foo' => 'bar'], + * ]; * * becomes * - * array( - * 'my_name' => array('foo' => 'bar'), - * ); + * [ + * 'my_name' => ['foo' => 'bar'], + * ]; * * If you'd like "'id' => 'my_name'" to still be present in the resulting * array, then you can set the second argument of this method to false. @@ -275,9 +275,9 @@ { $this ->addDefaultsIfNotSet() - ->treatFalseLike(array('enabled' => false)) - ->treatTrueLike(array('enabled' => true)) - ->treatNullLike(array('enabled' => true)) + ->treatFalseLike(['enabled' => false]) + ->treatTrueLike(['enabled' => true]) + ->treatNullLike(['enabled' => true]) ->beforeNormalization() ->ifArray() ->then(function ($v) { @@ -305,9 +305,9 @@ { $this ->addDefaultsIfNotSet() - ->treatFalseLike(array('enabled' => false)) - ->treatTrueLike(array('enabled' => true)) - ->treatNullLike(array('enabled' => true)) + ->treatFalseLike(['enabled' => false]) + ->treatTrueLike(['enabled' => true]) + ->treatNullLike(['enabled' => true]) ->children() ->booleanNode('enabled') ->defaultTrue() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php 2019-02-03 12:23:08.000000000 +0000 @@ -144,7 +144,7 @@ public function castToArray() { $this->ifPart = function ($v) { return !\is_array($v); }; - $this->thenPart = function ($v) { return array($v); }; + $this->thenPart = function ($v) { return [$v]; }; return $this; } @@ -168,7 +168,7 @@ */ public function thenEmptyArray() { - $this->thenPart = function ($v) { return array(); }; + $this->thenPart = function ($v) { return []; }; return $this; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php 2019-02-03 12:23:08.000000000 +0000 @@ -23,7 +23,7 @@ public function __construct() { - $this->nodeMapping = array( + $this->nodeMapping = [ 'variable' => __NAMESPACE__.'\\VariableNodeDefinition', 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition', 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition', @@ -31,7 +31,7 @@ 'float' => __NAMESPACE__.'\\FloatNodeDefinition', 'array' => __NAMESPACE__.'\\ArrayNodeDefinition', 'enum' => __NAMESPACE__.'\\EnumNodeDefinition', - ); + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ protected $trueEquivalent = true; protected $falseEquivalent = false; protected $parent; - protected $attributes = array(); + protected $attributes = []; /** * @param string|null $name The name of the node diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,8 +19,8 @@ class NormalizationBuilder { protected $node; - public $before = array(); - public $remappings = array(); + public $before = []; + public $remappings = []; public function __construct(NodeDefinition $node) { @@ -37,7 +37,7 @@ */ public function remap($key, $plural = null) { - $this->remappings[] = array($key, null === $plural ? $key.'s' : $plural); + $this->remappings[] = [$key, null === $plural ? $key.'s' : $plural]; return $this; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,7 +19,7 @@ class ValidationBuilder { protected $node; - public $rules = array(); + public $rules = []; public function __construct(NodeDefinition $node) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php 2019-02-03 12:23:08.000000000 +0000 @@ -65,10 +65,10 @@ } $rootName = str_replace('_', '-', $rootName); - $rootAttributes = array(); - $rootAttributeComments = array(); - $rootChildren = array(); - $rootComments = array(); + $rootAttributes = []; + $rootAttributeComments = []; + $rootChildren = []; + $rootComments = []; if ($node instanceof ArrayNode) { $children = $node->getChildren(); @@ -98,7 +98,7 @@ if ($prototype instanceof PrototypedArrayNode) { $prototype->setName($key); - $children = array($key => $prototype); + $children = [$key => $prototype]; } elseif ($prototype instanceof ArrayNode) { $children = $prototype->getChildren(); } else { @@ -140,7 +140,7 @@ $value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world // comments - $comments = array(); + $comments = []; if ($info = $child->getInfo()) { $comments[] = $info; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php 2019-02-03 12:23:08.000000000 +0000 @@ -77,7 +77,7 @@ */ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, $depth = 0, $prototypedArray = false) { - $comments = array(); + $comments = []; $default = ''; $defaultArray = null; $children = null; @@ -251,6 +251,6 @@ } $keyNode->setInfo($info); - return array($key => $keyNode); + return [$key => $keyNode]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/EnumNode.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/EnumNode.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/EnumNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/EnumNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -22,7 +22,7 @@ { private $values; - public function __construct($name, NodeInterface $parent = null, array $values = array()) + public function __construct($name, NodeInterface $parent = null, array $values = []) { $values = array_unique($values); if (empty($values)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Processor.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Processor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/Processor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/Processor.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ */ public function process(NodeInterface $configTree, array $configs) { - $currentConfig = array(); + $currentConfig = []; foreach ($configs as $config) { $config = $configTree->normalize($config); $currentConfig = $configTree->merge($currentConfig, $config); @@ -86,12 +86,12 @@ if (isset($config[$key])) { if (\is_string($config[$key]) || !\is_int(key($config[$key]))) { // only one - return array($config[$key]); + return [$config[$key]]; } return $config[$key]; } - return array(); + return []; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,12 +27,12 @@ protected $keyAttribute; protected $removeKeyAttribute = false; protected $minNumberOfElements = 0; - protected $defaultValue = array(); + protected $defaultValue = []; protected $defaultChildren; /** * @var NodeInterface[] An array of the prototypes of the simplified value children */ - private $valuePrototypes = array(); + private $valuePrototypes = []; /** * Sets the minimum number of elements that a prototype based node must @@ -53,15 +53,15 @@ * to be the key of the particular item. For example, if "id" is the * "key", then: * - * array( - * array('id' => 'my_name', 'foo' => 'bar'), - * ); + * [ + * ['id' => 'my_name', 'foo' => 'bar'], + * ]; * * becomes * - * array( - * 'my_name' => array('foo' => 'bar'), - * ); + * [ + * 'my_name' => ['foo' => 'bar'], + * ]; * * If you'd like "'id' => 'my_name'" to still be present in the resulting * array, then you can set the second argument of this method to false. @@ -114,10 +114,10 @@ * * @param int|string|array|null $children The number of children|The child name|The children names to be added */ - public function setAddChildrenIfNoneSet($children = array('defaults')) + public function setAddChildrenIfNoneSet($children = ['defaults']) { if (null === $children) { - $this->defaultChildren = array('defaults'); + $this->defaultChildren = ['defaults']; } else { $this->defaultChildren = \is_int($children) && $children > 0 ? range(1, $children) : (array) $children; } @@ -132,8 +132,8 @@ public function getDefaultValue() { if (null !== $this->defaultChildren) { - $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : array(); - $defaults = array(); + $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : []; + $defaults = []; foreach (array_values($this->defaultChildren) as $i => $name) { $defaults[null === $this->keyAttribute ? $i : $name] = $default; } @@ -226,7 +226,7 @@ $value = $this->remapXml($value); $isAssoc = array_keys($value) !== range(0, \count($value) - 1); - $normalized = array(); + $normalized = []; foreach ($value as $k => $v) { if (null !== $this->keyAttribute && \is_array($v)) { if (!isset($v[$this->keyAttribute]) && \is_int($k) && !$isAssoc) { @@ -243,7 +243,7 @@ } // if only "value" is left - if (array_keys($v) === array('value')) { + if (array_keys($v) === ['value']) { $v = $v['value']; if ($this->prototype instanceof ArrayNode && ($children = $this->prototype->getChildren()) && array_key_exists('value', $children)) { $valuePrototype = current($this->valuePrototypes) ?: clone $children['value']; @@ -335,30 +335,30 @@ * * For example, assume $this->keyAttribute is 'name' and the value array is as follows: * - * array( - * array( + * [ + * [ * 'name' => 'name001', * 'value' => 'value001' - * ) - * ) + * ] + * ] * * Now, the key is 0 and the child node is: * - * array( + * [ * 'name' => 'name001', * 'value' => 'value001' - * ) + * ] * * When normalizing the value array, the 'name' element will removed from the child node * and its value becomes the new key of the child node: * - * array( - * 'name001' => array('value' => 'value001') - * ) + * [ + * 'name001' => ['value' => 'value001'] + * ] * * Now only 'value' element is left in the child node which can be further simplified into a string: * - * array('name001' => 'value001') + * ['name001' => 'value001'] * * Now, the key becomes 'name001' and the child node becomes 'value001' and * the prototype of child node 'name001' should be a ScalarNode instead of an ArrayNode instance. diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php 2019-02-03 12:23:08.000000000 +0000 @@ -80,7 +80,7 @@ } if (\is_array($var)) { - $a = array(); + $a = []; foreach ($var as $k => $v) { $a[] = sprintf('%s => %s', $k, $this->varToString($v)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,7 +20,7 @@ { private $paths; - public function __construct($message = '', $code = 0, $previous = null, array $paths = array()) + public function __construct($message = '', $code = 0, $previous = null, array $paths = []) { parent::__construct($message, $code, $previous); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/FileLocator.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/FileLocator.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/FileLocator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/FileLocator.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ /** * @param string|array $paths A path or an array of paths where to look for resources */ - public function __construct($paths = array()) + public function __construct($paths = []) { $this->paths = (array) $paths; } @@ -41,7 +41,7 @@ if ($this->isAbsolutePath($name)) { if (!file_exists($name)) { - throw new FileLocatorFileNotFoundException(sprintf('The file "%s" does not exist.', $name), 0, null, array($name)); + throw new FileLocatorFileNotFoundException(sprintf('The file "%s" does not exist.', $name), 0, null, [$name]); } return $name; @@ -54,7 +54,7 @@ } $paths = array_unique($paths); - $filepaths = $notfound = array(); + $filepaths = $notfound = []; foreach ($paths as $path) { if (@file_exists($file = $path.\DIRECTORY_SEPARATOR.$name)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Loader/FileLoader.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Loader/FileLoader.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Loader/FileLoader.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Loader/FileLoader.php 2019-02-03 12:23:08.000000000 +0000 @@ -25,7 +25,7 @@ */ abstract class FileLoader extends Loader { - protected static $loading = array(); + protected static $loading = []; protected $locator; @@ -73,7 +73,7 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null) { if (\is_string($resource) && \strlen($resource) !== $i = strcspn($resource, '*?{[')) { - $ret = array(); + $ret = []; $isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/'); foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath) as $path => $info) { if (null !== $res = $this->doImport($path, $type, $ignoreErrors, $sourceResource)) { @@ -113,7 +113,7 @@ throw $e; } - $resource = array(); + $resource = []; foreach ($e->getPaths() as $path) { $resource[] = new FileExistenceResource($path); } @@ -136,7 +136,7 @@ $resource = $loader->getLocator()->locate($resource, $this->currentDir, false); } - $resources = \is_array($resource) ? $resource : array($resource); + $resources = \is_array($resource) ? $resource : [$resource]; for ($i = 0; $i < $resourcesCount = \count($resources); ++$i) { if (isset(self::$loading[$resources[$i]])) { if ($i == $resourcesCount - 1) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Loader/LoaderResolver.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Loader/LoaderResolver.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Loader/LoaderResolver.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Loader/LoaderResolver.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,12 +24,12 @@ /** * @var LoaderInterface[] An array of LoaderInterface objects */ - private $loaders = array(); + private $loaders = []; /** * @param LoaderInterface[] $loaders An array of loaders */ - public function __construct(array $loaders = array()) + public function __construct(array $loaders = []) { foreach ($loaders as $loader) { $this->addLoader($loader); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ClassExistenceResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ClassExistenceResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ClassExistenceResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ClassExistenceResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ private static $autoloadLevel = 0; private static $autoloadedClass; - private static $existsCache = array(); + private static $existsCache = []; /** * @param string $resource The fully-qualified class name @@ -97,7 +97,7 @@ } /** - * {@inheritdoc} + * @internal */ public function serialize() { @@ -105,11 +105,11 @@ $this->isFresh(0); } - return serialize(array($this->resource, $this->exists)); + return serialize([$this->resource, $this->exists]); } /** - * {@inheritdoc} + * @internal */ public function unserialize($serialized) { @@ -118,18 +118,20 @@ /** * @throws \ReflectionException When $class is not found and is required + * + * @internal */ - private static function throwOnRequiredClass($class) + public static function throwOnRequiredClass($class) { if (self::$autoloadedClass === $class) { return; } $e = new \ReflectionException("Class $class not found"); $trace = $e->getTrace(); - $autoloadFrame = array( + $autoloadFrame = [ 'function' => 'spl_autoload_call', - 'args' => array($class), - ); + 'args' => [$class], + ]; $i = 1 + array_search($autoloadFrame, $trace, true); if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { @@ -151,11 +153,11 @@ return; } - $props = array( + $props = [ 'file' => $trace[$i]['file'], 'line' => $trace[$i]['line'], 'trace' => \array_slice($trace, 1 + $i), - ); + ]; foreach ($props as $p => $v) { $r = new \ReflectionProperty('Exception', $p); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ComposerResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ComposerResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ComposerResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ComposerResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -51,11 +51,17 @@ return self::$runtimeVendors === $this->vendors; } + /** + * @internal + */ public function serialize() { return serialize($this->vendors); } + /** + * @internal + */ public function unserialize($serialized) { $this->vendors = unserialize($serialized); @@ -63,7 +69,7 @@ private static function refresh() { - self::$runtimeVendors = array(); + self::$runtimeVendors = []; foreach (get_declared_classes() as $class) { if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/DirectoryResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/DirectoryResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/DirectoryResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/DirectoryResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,7 +42,7 @@ */ public function __toString() { - return md5(serialize(array($this->resource, $this->pattern))); + return md5(serialize([$this->resource, $this->pattern])); } /** @@ -104,11 +104,17 @@ return true; } + /** + * @internal + */ public function serialize() { - return serialize(array($this->resource, $this->pattern)); + return serialize([$this->resource, $this->pattern]); } + /** + * @internal + */ public function unserialize($serialized) { list($this->resource, $this->pattern) = unserialize($serialized); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/FileExistenceResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/FileExistenceResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/FileExistenceResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/FileExistenceResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -59,15 +59,15 @@ } /** - * {@inheritdoc} + * @internal */ public function serialize() { - return serialize(array($this->resource, $this->exists)); + return serialize([$this->resource, $this->exists]); } /** - * {@inheritdoc} + * @internal */ public function unserialize($serialized) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/FileResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/FileResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/FileResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/FileResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -63,11 +63,17 @@ return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp; } + /** + * @internal + */ public function serialize() { return serialize($this->resource); } + /** + * @internal + */ public function unserialize($serialized) { $this->resource = unserialize($serialized); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/GlobResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/GlobResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/GlobResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/GlobResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -73,15 +73,21 @@ return $this->hash === $hash; } + /** + * @internal + */ public function serialize() { if (null === $this->hash) { $this->hash = $this->computeHash(); } - return serialize(array($this->prefix, $this->pattern, $this->recursive, $this->hash)); + return serialize([$this->prefix, $this->pattern, $this->recursive, $this->hash]); } + /** + * @internal + */ public function unserialize($serialized) { list($this->prefix, $this->pattern, $this->recursive, $this->hash) = unserialize($serialized); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ReflectionClassResource.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ReflectionClassResource.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Resource/ReflectionClassResource.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Resource/ReflectionClassResource.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,13 +19,13 @@ */ class ReflectionClassResource implements SelfCheckingResourceInterface, \Serializable { - private $files = array(); + private $files = []; private $className; private $classReflector; - private $excludedVendors = array(); + private $excludedVendors = []; private $hash; - public function __construct(\ReflectionClass $classReflector, $excludedVendors = array()) + public function __construct(\ReflectionClass $classReflector, $excludedVendors = []) { $this->className = $classReflector->name; $this->classReflector = $classReflector; @@ -57,6 +57,9 @@ return 'reflection.'.$this->className; } + /** + * @internal + */ public function serialize() { if (null === $this->hash) { @@ -64,9 +67,12 @@ $this->loadFiles($this->classReflector); } - return serialize(array($this->files, $this->className, $this->hash)); + return serialize([$this->files, $this->className, $this->hash]); } + /** + * @internal + */ public function unserialize($serialized) { list($this->files, $this->className, $this->hash) = unserialize($serialized); @@ -147,7 +153,7 @@ foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) { yield preg_replace('/^ @@.*/m', '', $m); - $defaults = array(); + $defaults = []; foreach ($m->getParameters() as $p) { $defaults[$p->name] = $p->isDefaultValueAvailable() ? $p->getDefaultValue() : null; } @@ -161,12 +167,12 @@ if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) { yield EventSubscriberInterface::class; - yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true); + yield print_r(\call_user_func([$class->name, 'getSubscribedEvents']), true); } if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) { yield ServiceSubscriberInterface::class; - yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true); + yield print_r(\call_user_func([$class->name, 'getSubscribedServices']), true); } } } @@ -178,10 +184,10 @@ { public function getParameters() { - $params = array(); + $params = []; foreach (parent::getParameters() as $i => $p) { - $params[] = new ReflectionParameterHhvmWrapper(array($this->class, $this->name), $i); + $params[] = new ReflectionParameterHhvmWrapper([$this->class, $this->name], $i); } return $params; @@ -195,6 +201,6 @@ { public function getDefaultValue() { - return array($this->isVariadic(), $this->isDefaultValueAvailable() ? parent::getDefaultValue() : null); + return [$this->isVariadic(), $this->isDefaultValueAvailable() ? parent::getDefaultValue() : null]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,12 +19,12 @@ */ class ResourceCheckerConfigCacheFactory implements ConfigCacheFactoryInterface { - private $resourceCheckers = array(); + private $resourceCheckers = []; /** * @param iterable|ResourceCheckerInterface[] $resourceCheckers */ - public function __construct($resourceCheckers = array()) + public function __construct($resourceCheckers = []) { $this->resourceCheckers = $resourceCheckers; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCache.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCache.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCache.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/ResourceCheckerConfigCache.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ * @param string $file The absolute cache path * @param iterable|ResourceCheckerInterface[] $resourceCheckers The ResourceCheckers to use for the freshness check */ - public function __construct($file, $resourceCheckers = array()) + public function __construct($file, $resourceCheckers = []) { $this->file = $file; $this->resourceCheckers = $resourceCheckers; @@ -156,10 +156,11 @@ { $e = null; $meta = false; + $content = file_get_contents($file); $signalingException = new \UnexpectedValueException(); $prevUnserializeHandler = ini_set('unserialize_callback_func', ''); - $prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$prevErrorHandler, $signalingException) { - if (E_WARNING === $type && 'Class __PHP_Incomplete_Class has no unserializer' === $msg) { + $prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) { + if (__FILE__ === $file) { throw $signalingException; } @@ -167,7 +168,7 @@ }); try { - $meta = unserialize(file_get_contents($file)); + $meta = unserialize($content); } catch (\Error $e) { } catch (\Exception $e) { } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/ConfigCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/ConfigCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/ConfigCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/ConfigCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ protected function tearDown() { - $files = array($this->cacheFile, $this->cacheFile.'.meta'); + $files = [$this->cacheFile, $this->cacheFile.'.meta']; foreach ($files as $file) { if (file_exists($file)) { @@ -52,7 +52,7 @@ $staleResource->setFresh(false); $cache = new ConfigCache($this->cacheFile, false); - $cache->write('', array($staleResource)); + $cache->write('', [$staleResource]); $this->assertTrue($cache->isFresh()); } @@ -63,7 +63,7 @@ public function testIsFreshWhenNoResourceProvided($debug) { $cache = new ConfigCache($this->cacheFile, $debug); - $cache->write('', array()); + $cache->write('', []); $this->assertTrue($cache->isFresh()); } @@ -73,7 +73,7 @@ $freshResource->setFresh(true); $cache = new ConfigCache($this->cacheFile, true); - $cache->write('', array($freshResource)); + $cache->write('', [$freshResource]); $this->assertTrue($cache->isFresh()); } @@ -84,16 +84,16 @@ $staleResource->setFresh(false); $cache = new ConfigCache($this->cacheFile, true); - $cache->write('', array($staleResource)); + $cache->write('', [$staleResource]); $this->assertFalse($cache->isFresh()); } public function debugModes() { - return array( - array(true), - array(false), - ); + return [ + [true], + [false], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,19 +34,19 @@ public function testExceptionThrownOnUnrecognizedChild() { $node = new ArrayNode('root'); - $node->normalize(array('foo' => 'bar')); + $node->normalize(['foo' => 'bar']); } public function ignoreAndRemoveMatrixProvider() { $unrecognizedOptionException = new InvalidConfigurationException('Unrecognized option "foo" under "root"'); - return array( - array(true, true, array(), 'no exception is thrown for an unrecognized child if the ignoreExtraKeys option is set to true'), - array(true, false, array('foo' => 'bar'), 'extra keys are not removed when ignoreExtraKeys second option is set to false'), - array(false, true, $unrecognizedOptionException), - array(false, false, $unrecognizedOptionException), - ); + return [ + [true, true, [], 'no exception is thrown for an unrecognized child if the ignoreExtraKeys option is set to true'], + [true, false, ['foo' => 'bar'], 'extra keys are not removed when ignoreExtraKeys second option is set to false'], + [false, true, $unrecognizedOptionException], + [false, false, $unrecognizedOptionException], + ]; } /** @@ -64,7 +64,7 @@ } $node = new ArrayNode('root'); $node->setIgnoreExtraKeys($ignore, $remove); - $result = $node->normalize(array('foo' => 'bar')); + $result = $node->normalize(['foo' => 'bar']); $this->assertSame($expected, $result, $message); } @@ -83,24 +83,24 @@ public function getPreNormalizationTests() { - return array( - array( - array('foo-bar' => 'foo'), - array('foo_bar' => 'foo'), - ), - array( - array('foo-bar_moo' => 'foo'), - array('foo-bar_moo' => 'foo'), - ), - array( - array('anything-with-dash-and-no-underscore' => 'first', 'no_dash' => 'second'), - array('anything_with_dash_and_no_underscore' => 'first', 'no_dash' => 'second'), - ), - array( - array('foo-bar' => null, 'foo_bar' => 'foo'), - array('foo-bar' => null, 'foo_bar' => 'foo'), - ), - ); + return [ + [ + ['foo-bar' => 'foo'], + ['foo_bar' => 'foo'], + ], + [ + ['foo-bar_moo' => 'foo'], + ['foo-bar_moo' => 'foo'], + ], + [ + ['anything-with-dash-and-no-underscore' => 'first', 'no_dash' => 'second'], + ['anything_with_dash_and_no_underscore' => 'first', 'no_dash' => 'second'], + ], + [ + ['foo-bar' => null, 'foo_bar' => 'foo'], + ['foo-bar' => null, 'foo_bar' => 'foo'], + ], + ]; } /** @@ -125,30 +125,30 @@ public function getZeroNamedNodeExamplesData() { - return array( - array( - array( - 0 => array( + return [ + [ + [ + 0 => [ 'name' => 'something', - ), - 5 => array( + ], + 5 => [ 0 => 'this won\'t work too', 'new_key' => 'some other value', - ), + ], 'string_key' => 'just value', - ), - array( - 0 => array( + ], + [ + 0 => [ 'name' => 'something', - ), - 5 => array( + ], + 5 => [ 0 => 'this won\'t work too', 'new_key' => 'some other value', - ), + ], 'string_key' => 'just value', - ), - ), - ); + ], + ], + ]; } /** @@ -172,12 +172,12 @@ public function getPreNormalizedNormalizedOrderedData() { - return array( - array( - array('2' => 'two', '1' => 'one', '3' => 'three'), - array('2' => 'two', '1' => 'one', '3' => 'three'), - ), - ); + return [ + [ + ['2' => 'two', '1' => 'one', '3' => 'three'], + ['2' => 'two', '1' => 'one', '3' => 'three'], + ], + ]; } /** @@ -238,13 +238,13 @@ }; $prevErrorHandler = set_error_handler($deprecationHandler); - $node->finalize(array()); + $node->finalize([]); restore_error_handler(); $this->assertFalse($deprecationTriggered, '->finalize() should not trigger if the deprecated node is not set'); $prevErrorHandler = set_error_handler($deprecationHandler); - $node->finalize(array('foo' => array())); + $node->finalize(['foo' => []]); restore_error_handler(); $this->assertTrue($deprecationTriggered, '->finalize() should trigger if the deprecated node is set'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,10 +40,10 @@ public function getValidValues() { - return array( - array(false), - array(true), - ); + return [ + [false], + [true], + ]; } /** @@ -58,17 +58,17 @@ public function getInvalidValues() { - return array( - array(null), - array(''), - array('foo'), - array(0), - array(1), - array(0.0), - array(0.1), - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); + return [ + [null], + [''], + ['foo'], + [0], + [1], + [0.0], + [0.1], + [[]], + [['foo' => 'bar']], + [new \stdClass()], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -43,19 +43,19 @@ { $node = new ArrayNodeDefinition('root'); - \call_user_func_array(array($node, $method), $args); + \call_user_func_array([$node, $method], $args); $node->getNode(); } public function providePrototypeNodeSpecificCalls() { - return array( - array('defaultValue', array(array())), - array('addDefaultChildrenIfNoneSet', array()), - array('requiresAtLeastOneElement', array()), - array('useAttributeAsKey', array('foo')), - ); + return [ + ['defaultValue', [[]]], + ['addDefaultChildrenIfNoneSet', []], + ['requiresAtLeastOneElement', []], + ['useAttributeAsKey', ['foo']], + ]; } /** @@ -78,7 +78,7 @@ { $node = new ArrayNodeDefinition('root'); $node - ->defaultValue(array()) + ->defaultValue([]) ->addDefaultChildrenIfNoneSet('foo') ->prototype('array') ; @@ -93,7 +93,7 @@ ->prototype('array') ; $tree = $node->getNode(); - $this->assertEquals(array(array()), $tree->getDefaultValue()); + $this->assertEquals([[]], $tree->getDefaultValue()); } /** @@ -133,14 +133,14 @@ public function providePrototypedArrayNodeDefaults() { - return array( - array(null, true, false, array(array())), - array(2, true, false, array(array(), array())), - array('2', false, true, array('2' => array())), - array('foo', false, true, array('foo' => array())), - array(array('foo'), false, true, array('foo' => array())), - array(array('foo', 'bar'), false, true, array('foo' => array(), 'bar' => array())), - ); + return [ + [null, true, false, [[]]], + [2, true, false, [[], []]], + ['2', false, true, ['2' => []]], + ['foo', false, true, ['foo' => []]], + [['foo'], false, true, ['foo' => []]], + [['foo', 'bar'], false, true, ['foo' => [], 'bar' => []]], + ]; } public function testNestedPrototypedArrayNodes() @@ -166,7 +166,7 @@ ->scalarNode('foo')->defaultValue('bar')->end() ; - $this->assertEquals(array('enabled' => false, 'foo' => 'bar'), $node->getNode()->getDefaultValue()); + $this->assertEquals(['enabled' => false, 'foo' => 'bar'], $node->getNode()->getDefaultValue()); } /** @@ -195,9 +195,9 @@ $node->canBeDisabled(); $this->assertTrue($this->getField($node, 'addDefaults')); - $this->assertEquals(array('enabled' => false), $this->getField($node, 'falseEquivalent')); - $this->assertEquals(array('enabled' => true), $this->getField($node, 'trueEquivalent')); - $this->assertEquals(array('enabled' => true), $this->getField($node, 'nullEquivalent')); + $this->assertEquals(['enabled' => false], $this->getField($node, 'falseEquivalent')); + $this->assertEquals(['enabled' => true], $this->getField($node, 'trueEquivalent')); + $this->assertEquals(['enabled' => true], $this->getField($node, 'nullEquivalent')); $nodeChildren = $this->getField($node, 'children'); $this->assertArrayHasKey('enabled', $nodeChildren); @@ -247,7 +247,7 @@ ->end() ; - $this->assertSame(array(), $node->getNode()->normalize(array('value' => null))); + $this->assertSame([], $node->getNode()->normalize(['value' => null])); } public function testPrototypeVariable() @@ -294,14 +294,14 @@ public function getEnableableNodeFixtures() { - return array( - array(array('enabled' => true, 'foo' => 'bar'), array(true), 'true enables an enableable node'), - array(array('enabled' => true, 'foo' => 'bar'), array(null), 'null enables an enableable node'), - array(array('enabled' => true, 'foo' => 'bar'), array(array('enabled' => true)), 'An enableable node can be enabled'), - array(array('enabled' => true, 'foo' => 'baz'), array(array('foo' => 'baz')), 'any configuration enables an enableable node'), - array(array('enabled' => false, 'foo' => 'baz'), array(array('foo' => 'baz', 'enabled' => false)), 'An enableable node can be disabled'), - array(array('enabled' => false, 'foo' => 'bar'), array(false), 'false disables an enableable node'), - ); + return [ + [['enabled' => true, 'foo' => 'bar'], [true], 'true enables an enableable node'], + [['enabled' => true, 'foo' => 'bar'], [null], 'null enables an enableable node'], + [['enabled' => true, 'foo' => 'bar'], [['enabled' => true]], 'An enableable node can be enabled'], + [['enabled' => true, 'foo' => 'baz'], [['foo' => 'baz']], 'any configuration enables an enableable node'], + [['enabled' => false, 'foo' => 'baz'], [['foo' => 'baz', 'enabled' => false]], 'An enableable node can be disabled'], + [['enabled' => false, 'foo' => 'bar'], [false], 'false disables an enableable node'], + ]; } public function testRequiresAtLeastOneElement() @@ -311,7 +311,7 @@ ->requiresAtLeastOneElement() ->integerPrototype(); - $node->getNode()->finalize(array(1)); + $node->getNode()->finalize([1]); $this->addToAssertionCount(1); } @@ -327,7 +327,7 @@ ->cannotBeEmpty() ->integerPrototype(); - $node->getNode()->finalize(array()); + $node->getNode()->finalize([]); } public function testSetDeprecated() @@ -353,7 +353,7 @@ $node = new ArrayNodeDefinition('root'); $node->cannotBeEmpty(); - $node->getNode()->finalize(array()); + $node->getNode()->finalize([]); } protected function getField($object, $field) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,19 +19,19 @@ public function testWithOneValue() { $def = new EnumNodeDefinition('foo'); - $def->values(array('foo')); + $def->values(['foo']); $node = $def->getNode(); - $this->assertEquals(array('foo'), $node->getValues()); + $this->assertEquals(['foo'], $node->getValues()); } public function testWithOneDistinctValue() { $def = new EnumNodeDefinition('foo'); - $def->values(array('foo', 'foo')); + $def->values(['foo', 'foo']); $node = $def->getNode(); - $this->assertEquals(array('foo'), $node->getValues()); + $this->assertEquals(['foo'], $node->getValues()); } /** @@ -51,22 +51,22 @@ public function testWithNoValues() { $def = new EnumNodeDefinition('foo'); - $def->values(array()); + $def->values([]); } public function testGetNode() { $def = new EnumNodeDefinition('foo'); - $def->values(array('foo', 'bar')); + $def->values(['foo', 'bar']); $node = $def->getNode(); - $this->assertEquals(array('foo', 'bar'), $node->getValues()); + $this->assertEquals(['foo', 'bar'], $node->getValues()); } public function testSetDeprecated() { $def = new EnumNodeDefinition('foo'); - $def->values(array('foo', 'bar')); + $def->values(['foo', 'bar']); $def->setDeprecated('The "%path%" node is deprecated.'); $node = $def->getNode(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ ->ifTrue() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key' => true)); + $this->assertFinalizedValueIs('new_value', $test, ['key' => true]); $test = $this->getTestBuilder() ->ifTrue(function ($v) { return true; }) @@ -58,7 +58,7 @@ ->ifString() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs(45, $test, array('key' => 45)); + $this->assertFinalizedValueIs(45, $test, ['key' => 45]); } public function testIfNullExpression() @@ -67,7 +67,7 @@ ->ifNull() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key' => null)); + $this->assertFinalizedValueIs('new_value', $test, ['key' => null]); $test = $this->getTestBuilder() ->ifNull() @@ -82,7 +82,7 @@ ->ifEmpty() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key' => array())); + $this->assertFinalizedValueIs('new_value', $test, ['key' => []]); $test = $this->getTestBuilder() ->ifEmpty() @@ -97,7 +97,7 @@ ->ifArray() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key' => array())); + $this->assertFinalizedValueIs('new_value', $test, ['key' => []]); $test = $this->getTestBuilder() ->ifArray() @@ -109,13 +109,13 @@ public function testIfInArrayExpression() { $test = $this->getTestBuilder() - ->ifInArray(array('foo', 'bar', 'value')) + ->ifInArray(['foo', 'bar', 'value']) ->then($this->returnClosure('new_value')) ->end(); $this->assertFinalizedValueIs('new_value', $test); $test = $this->getTestBuilder() - ->ifInArray(array('foo', 'bar')) + ->ifInArray(['foo', 'bar']) ->then($this->returnClosure('new_value')) ->end(); $this->assertFinalizedValueIs('value', $test); @@ -124,13 +124,13 @@ public function testIfNotInArrayExpression() { $test = $this->getTestBuilder() - ->ifNotInArray(array('foo', 'bar')) + ->ifNotInArray(['foo', 'bar']) ->then($this->returnClosure('new_value')) ->end(); $this->assertFinalizedValueIs('new_value', $test); $test = $this->getTestBuilder() - ->ifNotInArray(array('foo', 'bar', 'value_from_config')) + ->ifNotInArray(['foo', 'bar', 'value_from_config']) ->then($this->returnClosure('new_value')) ->end(); $this->assertFinalizedValueIs('new_value', $test); @@ -142,7 +142,7 @@ ->ifString() ->thenEmptyArray() ->end(); - $this->assertFinalizedValueIs(array(), $test); + $this->assertFinalizedValueIs([], $test); } /** @@ -153,15 +153,15 @@ $test = $this->getTestBuilder() ->castToArray() ->end(); - $this->assertFinalizedValueIs($expectedValue, $test, array('key' => $configValue)); + $this->assertFinalizedValueIs($expectedValue, $test, ['key' => $configValue]); } public function castToArrayValues() { - yield array('value', array('value')); - yield array(-3.14, array(-3.14)); - yield array(null, array(null)); - yield array(array('value'), array('value')); + yield ['value', ['value']]; + yield [-3.14, [-3.14]]; + yield [null, [null]]; + yield [['value'], ['value']]; } /** @@ -182,7 +182,7 @@ ->ifString() ->thenUnset() ->end(); - $this->assertEquals(array(), $this->finalizeTestBuilder($test)); + $this->assertEquals([], $this->finalizeTestBuilder($test)); } /** @@ -227,7 +227,7 @@ * * @param TreeBuilder $testBuilder The tree builder to finalize * @param array $config The config you want to use for the finalization, if nothing provided - * a simple array('key'=>'value') will be used + * a simple ['key'=>'value'] will be used * * @return array The finalized config values */ @@ -238,7 +238,7 @@ ->end() ->end() ->buildTree() - ->finalize(null === $config ? array('key' => 'value') : $config) + ->finalize(null === $config ? ['key' => 'value'] : $config) ; } @@ -265,6 +265,6 @@ */ protected function assertFinalizedValueIs($value, $treeBuilder, $config = null) { - $this->assertEquals(array('key' => $value), $this->finalizeTestBuilder($treeBuilder, $config)); + $this->assertEquals(['key' => $value], $this->finalizeTestBuilder($treeBuilder, $config)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -119,7 +119,7 @@ $builder = new TreeBuilder(); $builder->root('test') - ->example(array('key' => 'value')) + ->example(['key' => 'value']) ->children() ->node('child', 'variable')->info('child info')->defaultValue('default')->example('example') ->end() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,12 +28,12 @@ public function provideDumpAtPath() { - return array( - 'Regular node' => array('scalar_true', << ['scalar_true', << array('array', << ['array', << array('array.child2', << ['array.child2', << array('cms_pages.page', << ['cms_pages.page', << array('cms_pages.page.locale', << ['cms_pages.page.locale', <<assertSame('foo', $node->finalize('foo')); } @@ -28,18 +28,18 @@ */ public function testConstructionWithNoValues() { - new EnumNode('foo', null, array()); + new EnumNode('foo', null, []); } public function testConstructionWithOneValue() { - $node = new EnumNode('foo', null, array('foo')); + $node = new EnumNode('foo', null, ['foo']); $this->assertSame('foo', $node->finalize('foo')); } public function testConstructionWithOneDistinctValue() { - $node = new EnumNode('foo', null, array('foo', 'foo')); + $node = new EnumNode('foo', null, ['foo', 'foo']); $this->assertSame('foo', $node->finalize('foo')); } @@ -49,7 +49,7 @@ */ public function testFinalizeWithInvalidValue() { - $node = new EnumNode('foo', null, array('foo', 'bar')); + $node = new EnumNode('foo', null, ['foo', 'bar']); $node->finalize('foobar'); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/FinalizationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -42,27 +42,27 @@ ->buildTree() ; - $a = array( - 'level1' => array( - 'level2' => array( + $a = [ + 'level1' => [ + 'level2' => [ 'somevalue' => 'foo', 'anothervalue' => 'bar', - ), + ], 'level1_scalar' => 'foo', - ), - ); + ], + ]; - $b = array( - 'level1' => array( + $b = [ + 'level1' => [ 'level2' => false, - ), - ); + ], + ]; - $this->assertEquals(array( - 'level1' => array( + $this->assertEquals([ + 'level1' => [ 'level1_scalar' => 'foo', - ), - ), $this->process($tree, array($a, $b))); + ], + ], $this->process($tree, [$a, $b])); } protected function process(NodeInterface $tree, array $configs) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,16 +40,16 @@ public function getValidValues() { - return array( - array(1798.0), - array(-678.987), - array(12.56E45), - array(0.0), + return [ + [1798.0], + [-678.987], + [12.56E45], + [0.0], // Integer are accepted too, they will be cast - array(17), - array(-10), - array(0), - ); + [17], + [-10], + [0], + ]; } /** @@ -64,15 +64,15 @@ public function getInvalidValues() { - return array( - array(null), - array(''), - array('foo'), - array(true), - array(false), - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); + return [ + [null], + [''], + ['foo'], + [true], + [false], + [[]], + [['foo' => 'bar']], + [new \stdClass()], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,11 +40,11 @@ public function getValidValues() { - return array( - array(1798), - array(-678), - array(0), - ); + return [ + [1798], + [-678], + [0], + ]; } /** @@ -59,17 +59,17 @@ public function getInvalidValues() { - return array( - array(null), - array(''), - array('foo'), - array(true), - array(false), - array(0.0), - array(0.1), - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); + return [ + [null], + [''], + ['foo'], + [true], + [false], + [0.0], + [0.1], + [[]], + [['foo' => 'bar']], + [new \stdClass()], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/MergeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/MergeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/MergeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/MergeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,13 +33,13 @@ ->buildTree() ; - $a = array( + $a = [ 'foo' => 'bar', - ); + ]; - $b = array( + $b = [ 'foo' => 'moo', - ); + ]; $tree->merge($a, $b); } @@ -68,28 +68,28 @@ ->buildTree() ; - $a = array( + $a = [ 'foo' => 'bar', - 'unsettable' => array( + 'unsettable' => [ 'foo' => 'a', 'bar' => 'b', - ), + ], 'unsetted' => false, - ); + ]; - $b = array( + $b = [ 'foo' => 'moo', 'bar' => 'b', 'unsettable' => false, - 'unsetted' => array('a', 'b'), - ); + 'unsetted' => ['a', 'b'], + ]; - $this->assertEquals(array( + $this->assertEquals([ 'foo' => 'moo', 'bar' => 'b', 'unsettable' => false, - 'unsetted' => array('a', 'b'), - ), $tree->merge($a, $b)); + 'unsetted' => ['a', 'b'], + ], $tree->merge($a, $b)); } /** @@ -114,17 +114,17 @@ ->end() ->buildTree(); - $a = array( - 'test' => array( - 'a' => array('value' => 'foo'), - ), - ); - - $b = array( - 'test' => array( - 'b' => array('value' => 'foo'), - ), - ); + $a = [ + 'test' => [ + 'a' => ['value' => 'foo'], + ], + ]; + + $b = [ + 'test' => [ + 'b' => ['value' => 'foo'], + ], + ]; $tree->merge($a, $b); } @@ -148,24 +148,24 @@ ->buildTree() ; - $a = array( - 'no_deep_merging' => array( + $a = [ + 'no_deep_merging' => [ 'foo' => 'a', 'bar' => 'b', - ), - ); + ], + ]; - $b = array( - 'no_deep_merging' => array( + $b = [ + 'no_deep_merging' => [ 'c' => 'd', - ), - ); + ], + ]; - $this->assertEquals(array( - 'no_deep_merging' => array( + $this->assertEquals([ + 'no_deep_merging' => [ 'c' => 'd', - ), - ), $tree->merge($a, $b)); + ], + ], $tree->merge($a, $b)); } public function testPrototypeWithoutAKeyAttribute() @@ -183,14 +183,14 @@ ->buildTree() ; - $a = array( - 'append_elements' => array('a', 'b'), - ); - - $b = array( - 'append_elements' => array('c', 'd'), - ); + $a = [ + 'append_elements' => ['a', 'b'], + ]; + + $b = [ + 'append_elements' => ['c', 'd'], + ]; - $this->assertEquals(array('append_elements' => array('a', 'b', 'c', 'd')), $tree->merge($a, $b)); + $this->assertEquals(['append_elements' => ['a', 'b', 'c', 'd']], $tree->merge($a, $b)); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ ->node('encoders', 'array') ->useAttributeAsKey('class') ->prototype('array') - ->beforeNormalization()->ifString()->then(function ($v) { return array('algorithm' => $v); })->end() + ->beforeNormalization()->ifString()->then(function ($v) { return ['algorithm' => $v]; })->end() ->children() ->node('algorithm', 'scalar')->end() ->end() @@ -41,54 +41,54 @@ ->buildTree() ; - $normalized = array( - 'encoders' => array( - 'foo' => array('algorithm' => 'plaintext'), - ), - ); + $normalized = [ + 'encoders' => [ + 'foo' => ['algorithm' => 'plaintext'], + ], + ]; $this->assertNormalized($tree, $denormalized, $normalized); } public function getEncoderTests() { - $configs = array(); + $configs = []; // XML - $configs[] = array( - 'encoder' => array( - array('class' => 'foo', 'algorithm' => 'plaintext'), - ), - ); + $configs[] = [ + 'encoder' => [ + ['class' => 'foo', 'algorithm' => 'plaintext'], + ], + ]; // XML when only one element of this type - $configs[] = array( - 'encoder' => array('class' => 'foo', 'algorithm' => 'plaintext'), - ); + $configs[] = [ + 'encoder' => ['class' => 'foo', 'algorithm' => 'plaintext'], + ]; // YAML/PHP - $configs[] = array( - 'encoders' => array( - array('class' => 'foo', 'algorithm' => 'plaintext'), - ), - ); + $configs[] = [ + 'encoders' => [ + ['class' => 'foo', 'algorithm' => 'plaintext'], + ], + ]; // YAML/PHP - $configs[] = array( - 'encoders' => array( + $configs[] = [ + 'encoders' => [ 'foo' => 'plaintext', - ), - ); + ], + ]; // YAML/PHP - $configs[] = array( - 'encoders' => array( - 'foo' => array('algorithm' => 'plaintext'), - ), - ); + $configs[] = [ + 'encoders' => [ + 'foo' => ['algorithm' => 'plaintext'], + ], + ]; return array_map(function ($v) { - return array($v); + return [$v]; }, $configs); } @@ -114,28 +114,28 @@ ->buildTree() ; - $normalized = array('logout' => array('handlers' => array('a', 'b', 'c'))); + $normalized = ['logout' => ['handlers' => ['a', 'b', 'c']]]; $this->assertNormalized($tree, $denormalized, $normalized); } public function getAnonymousKeysTests() { - $configs = array(); + $configs = []; - $configs[] = array( - 'logout' => array( - 'handlers' => array('a', 'b', 'c'), - ), - ); - - $configs[] = array( - 'logout' => array( - 'handler' => array('a', 'b', 'c'), - ), - ); + $configs[] = [ + 'logout' => [ + 'handlers' => ['a', 'b', 'c'], + ], + ]; + + $configs[] = [ + 'logout' => [ + 'handler' => ['a', 'b', 'c'], + ], + ]; - return array_map(function ($v) { return array($v); }, $configs); + return array_map(function ($v) { return [$v]; }, $configs); } /** @@ -143,30 +143,30 @@ */ public function testNumericKeysAsAttributes($denormalized) { - $normalized = array( - 'thing' => array(42 => array('foo', 'bar'), 1337 => array('baz', 'qux')), - ); + $normalized = [ + 'thing' => [42 => ['foo', 'bar'], 1337 => ['baz', 'qux']], + ]; $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, $normalized); } public function getNumericKeysTests() { - $configs = array(); + $configs = []; - $configs[] = array( - 'thing' => array( - 42 => array('foo', 'bar'), 1337 => array('baz', 'qux'), - ), - ); - - $configs[] = array( - 'thing' => array( - array('foo', 'bar', 'id' => 42), array('baz', 'qux', 'id' => 1337), - ), - ); + $configs[] = [ + 'thing' => [ + 42 => ['foo', 'bar'], 1337 => ['baz', 'qux'], + ], + ]; + + $configs[] = [ + 'thing' => [ + ['foo', 'bar', 'id' => 42], ['baz', 'qux', 'id' => 1337], + ], + ]; - return array_map(function ($v) { return array($v); }, $configs); + return array_map(function ($v) { return [$v]; }, $configs); } /** @@ -175,13 +175,13 @@ */ public function testNonAssociativeArrayThrowsExceptionIfAttributeNotSet() { - $denormalized = array( - 'thing' => array( - array('foo', 'bar'), array('baz', 'qux'), - ), - ); + $denormalized = [ + 'thing' => [ + ['foo', 'bar'], ['baz', 'qux'], + ], + ]; - $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array()); + $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, []); } public function testAssociativeArrayPreserveKeys() @@ -198,7 +198,7 @@ ->buildTree() ; - $data = array('first' => array('foo' => 'bar')); + $data = ['first' => ['foo' => 'bar']]; $this->assertNormalized($tree, $data, $data); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,8 +32,8 @@ $node = new PrototypedArrayNode('root'); $prototype = new ArrayNode(null, $node); $node->setPrototype($prototype); - $node->setDefaultValue(array('test')); - $this->assertEquals(array('test'), $node->getDefaultValue()); + $node->setDefaultValue(['test']); + $this->assertEquals(['test'], $node->getDefaultValue()); } // a remapped key (e.g. "mapping" -> "mappings") should be unset after being used @@ -47,12 +47,12 @@ $prototype = new ScalarNode(null, $mappingsNode); $mappingsNode->setPrototype($prototype); - $remappings = array(); - $remappings[] = array('mapping', 'mappings'); + $remappings = []; + $remappings[] = ['mapping', 'mappings']; $node->setXmlRemappings($remappings); - $normalized = $node->normalize(array('mapping' => array('foo', 'bar'))); - $this->assertEquals(array('mappings' => array('foo', 'bar')), $normalized); + $normalized = $node->normalize(['mapping' => ['foo', 'bar']]); + $this->assertEquals(['mappings' => ['foo', 'bar']], $normalized); } /** @@ -66,12 +66,12 @@ * The above should finally be mapped to an array that looks like this * (because "id" is the key attribute). * - * array( - * 'things' => array( + * [ + * 'things' => [ * 'option1' => 'foo', * 'option2' => 'bar', - * ) - * ) + * ] + * ] */ public function testMappedAttributeKeyIsRemoved() { @@ -83,12 +83,12 @@ $prototype->addChild(new ScalarNode('foo')); $node->setPrototype($prototype); - $children = array(); - $children[] = array('id' => 'item_name', 'foo' => 'bar'); + $children = []; + $children[] = ['id' => 'item_name', 'foo' => 'bar']; $normalized = $node->normalize($children); - $expected = array(); - $expected['item_name'] = array('foo' => 'bar'); + $expected = []; + $expected['item_name'] = ['foo' => 'bar']; $this->assertEquals($expected, $normalized); } @@ -107,12 +107,12 @@ $prototype->addChild(new ScalarNode('id')); // the key attribute will remain $node->setPrototype($prototype); - $children = array(); - $children[] = array('id' => 'item_name', 'foo' => 'bar'); + $children = []; + $children[] = ['id' => 'item_name', 'foo' => 'bar']; $normalized = $node->normalize($children); - $expected = array(); - $expected['item_name'] = array('id' => 'item_name', 'foo' => 'bar'); + $expected = []; + $expected['item_name'] = ['id' => 'item_name', 'foo' => 'bar']; $this->assertEquals($expected, $normalized); } @@ -121,50 +121,50 @@ $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setAddChildrenIfNoneSet(); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals([['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setKeyAttribute('foobar'); $node->setAddChildrenIfNoneSet(); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaults' => array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals(['defaults' => ['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setKeyAttribute('foobar'); $node->setAddChildrenIfNoneSet('defaultkey'); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals(['defaultkey' => ['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet(array('defaultkey')); + $node->setAddChildrenIfNoneSet(['defaultkey']); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('defaultkey' => array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals(['defaultkey' => ['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setKeyAttribute('foobar'); - $node->setAddChildrenIfNoneSet(array('dk1', 'dk2')); + $node->setAddChildrenIfNoneSet(['dk1', 'dk2']); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array('dk1' => array('foo' => 'bar'), 'dk2' => array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals(['dk1' => ['foo' => 'bar'], 'dk2' => ['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); - $node->setAddChildrenIfNoneSet(array(5, 6)); + $node->setAddChildrenIfNoneSet([5, 6]); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(0 => array('foo' => 'bar'), 1 => array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals([0 => ['foo' => 'bar'], 1 => ['foo' => 'bar']], $node->getDefaultValue()); $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setAddChildrenIfNoneSet(2); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar'), array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals([['foo' => 'bar'], ['foo' => 'bar']], $node->getDefaultValue()); } public function testDefaultChildrenWinsOverDefaultValue() { $node = $this->getPrototypeNodeWithDefaultChildren(); $node->setAddChildrenIfNoneSet(); - $node->setDefaultValue(array('bar' => 'foo')); + $node->setDefaultValue(['bar' => 'foo']); $this->assertTrue($node->hasDefaultValue()); - $this->assertEquals(array(array('foo' => 'bar')), $node->getDefaultValue()); + $this->assertEquals([['foo' => 'bar']], $node->getDefaultValue()); } protected function getPrototypeNodeWithDefaultChildren() @@ -191,11 +191,11 @@ * The above should finally be mapped to an array that looks like this * (because "id" is the key attribute). * - * array( - * 'things' => array( + * [ + * 'things' => [ * 'option1' => 'value1' - * ) - * ) + * ] + * ] * * It's also possible to mix 'value-only' and 'non-value-only' elements in the array. * @@ -206,15 +206,15 @@ * * The above should finally be mapped to an array as follows * - * array( - * 'things' => array( + * [ + * 'things' => [ * 'option1' => 'value1', - * 'option2' => array( + * 'option2' => [ * 'value' => 'value2', * 'foo' => 'foo2' - * ) - * ) - * ) + * ] + * ] + * ] * * The 'value' element can also be ArrayNode: * @@ -229,14 +229,14 @@ * * The above should be finally be mapped to an array as follows * - * array( - * 'things' => array( - * 'option1' => array( + * [ + * 'things' => [ + * 'option1' => [ * 'foo' => 'foo1', * 'bar' => 'bar1' - * ) - * ) - * ) + * ] + * ] + * ] * * If using VariableNode for value node, it's also possible to mix different types of value nodes: * @@ -252,15 +252,15 @@ * * The above should be finally mapped to an array as follows * - * array( - * 'things' => array( - * 'option1' => array( + * [ + * 'things' => [ + * 'option1' => [ * 'foo' => 'foo1', * 'bar' => 'bar1' - * ), + * ], * 'option2' => 'value2' - * ) - * ) + * ] + * ] * * * @dataProvider getDataForKeyRemovedLeftValueOnly @@ -291,52 +291,52 @@ $variableValue = new VariableNode('value'); - return array( - array( + return [ + [ $scalarValue, - array( - array('id' => 'option1', 'value' => 'value1'), - ), - array('option1' => 'value1'), - ), + [ + ['id' => 'option1', 'value' => 'value1'], + ], + ['option1' => 'value1'], + ], - array( + [ $scalarValue, - array( - array('id' => 'option1', 'value' => 'value1'), - array('id' => 'option2', 'value' => 'value2', 'foo' => 'foo2'), - ), - array( + [ + ['id' => 'option1', 'value' => 'value1'], + ['id' => 'option2', 'value' => 'value2', 'foo' => 'foo2'], + ], + [ 'option1' => 'value1', - 'option2' => array('value' => 'value2', 'foo' => 'foo2'), - ), - ), + 'option2' => ['value' => 'value2', 'foo' => 'foo2'], + ], + ], - array( + [ $arrayValue, - array( - array( + [ + [ 'id' => 'option1', - 'value' => array('foo' => 'foo1', 'bar' => 'bar1'), - ), - ), - array( - 'option1' => array('foo' => 'foo1', 'bar' => 'bar1'), - ), - ), - - array($variableValue, - array( - array( - 'id' => 'option1', 'value' => array('foo' => 'foo1', 'bar' => 'bar1'), - ), - array('id' => 'option2', 'value' => 'value2'), - ), - array( - 'option1' => array('foo' => 'foo1', 'bar' => 'bar1'), + 'value' => ['foo' => 'foo1', 'bar' => 'bar1'], + ], + ], + [ + 'option1' => ['foo' => 'foo1', 'bar' => 'bar1'], + ], + ], + + [$variableValue, + [ + [ + 'id' => 'option1', 'value' => ['foo' => 'foo1', 'bar' => 'bar1'], + ], + ['id' => 'option2', 'value' => 'value2'], + ], + [ + 'option1' => ['foo' => 'foo1', 'bar' => 'bar1'], 'option2' => 'value2', - ), - ), - ); + ], + ], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,17 +28,17 @@ public function getValidValues() { - return array( - array(false), - array(true), - array(null), - array(''), - array('foo'), - array(0), - array(1), - array(0.0), - array(0.1), - ); + return [ + [false], + [true], + [null], + [''], + ['foo'], + [0], + [1], + [0.0], + [0.1], + ]; } public function testSetDeprecated() @@ -62,12 +62,12 @@ }; $prevErrorHandler = set_error_handler($deprecationHandler); - $node->finalize(array()); + $node->finalize([]); restore_error_handler(); $this->assertSame(0, $deprecationTriggered, '->finalize() should not trigger if the deprecated node is not set'); $prevErrorHandler = set_error_handler($deprecationHandler); - $node->finalize(array('foo' => '')); + $node->finalize(['foo' => '']); restore_error_handler(); $this->assertSame(1, $deprecationTriggered, '->finalize() should trigger if the deprecated node is set'); } @@ -84,11 +84,11 @@ public function getInvalidValues() { - return array( - array(array()), - array(array('foo' => 'bar')), - array(new \stdClass()), - ); + return [ + [[]], + [['foo' => 'bar']], + [new \stdClass()], + ]; } public function testNormalizeThrowsExceptionWithoutHint() @@ -102,7 +102,7 @@ $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException', 'Invalid type for path "test". Expected scalar, but got array.'); } - $node->normalize(array()); + $node->normalize([]); } public function testNormalizeThrowsExceptionWithErrorMessage() @@ -117,7 +117,7 @@ $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException', "Invalid type for path \"test\". Expected scalar, but got array.\nHint: \"the test value\""); } - $node->normalize(array()); + $node->normalize([]); } /** @@ -135,15 +135,15 @@ public function getValidNonEmptyValues() { - return array( - array(false), - array(true), - array('foo'), - array(0), - array(1), - array(0.0), - array(0.1), - ); + return [ + [false], + [true], + ['foo'], + [0], + [1], + [0.0], + [0.1], + ]; } /** @@ -161,9 +161,9 @@ public function getEmptyValues() { - return array( - array(null), - array(''), - ); + return [ + [null], + [''], + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/DependencyInjection/ConfigCachePassTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/DependencyInjection/ConfigCachePassTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/DependencyInjection/ConfigCachePassTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/DependencyInjection/ConfigCachePassTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,18 +27,18 @@ $container = new ContainerBuilder(); $definition = $container->register('config_cache_factory')->addArgument(null); - $container->register('checker_2')->addTag('config_cache.resource_checker', array('priority' => 100)); - $container->register('checker_1')->addTag('config_cache.resource_checker', array('priority' => 200)); + $container->register('checker_2')->addTag('config_cache.resource_checker', ['priority' => 100]); + $container->register('checker_1')->addTag('config_cache.resource_checker', ['priority' => 200]); $container->register('checker_3')->addTag('config_cache.resource_checker'); $pass = new ConfigCachePass(); $pass->process($container); - $expected = new IteratorArgument(array( + $expected = new IteratorArgument([ new Reference('checker_1'), new Reference('checker_2'), new Reference('checker_3'), - )); + ]); $this->assertEquals($expected, $definition->getArgument(0)); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/FileLocatorTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/FileLocatorTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/FileLocatorTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/FileLocatorTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ */ public function testIsAbsolutePath($path) { - $loader = new FileLocator(array()); + $loader = new FileLocator([]); $r = new \ReflectionObject($loader); $m = $r->getMethod('isAbsolutePath'); $m->setAccessible(true); @@ -31,14 +31,14 @@ public function getIsAbsolutePathTests() { - return array( - array('/foo.xml'), - array('c:\\\\foo.xml'), - array('c:/foo.xml'), - array('\\server\\foo.xml'), - array('https://server/foo.xml'), - array('phar://server/foo.xml'), - ); + return [ + ['/foo.xml'], + ['c:\\\\foo.xml'], + ['c:/foo.xml'], + ['\\server\\foo.xml'], + ['https://server/foo.xml'], + ['phar://server/foo.xml'], + ]; } public function testLocate() @@ -63,16 +63,16 @@ '->locate() returns the absolute filename if the file exists in one of the paths given in the constructor' ); - $loader = new FileLocator(array(__DIR__.'/Fixtures', __DIR__.'/Fixtures/Again')); + $loader = new FileLocator([__DIR__.'/Fixtures', __DIR__.'/Fixtures/Again']); $this->assertEquals( - array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'), + [__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'], $loader->locate('foo.xml', __DIR__, false), '->locate() returns an array of absolute filenames' ); $this->assertEquals( - array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'), + [__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'], $loader->locate('foo.xml', __DIR__.'/Fixtures', false), '->locate() returns an array of absolute filenames' ); @@ -80,7 +80,7 @@ $loader = new FileLocator(__DIR__.'/Fixtures/Again'); $this->assertEquals( - array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'), + [__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'], $loader->locate('foo.xml', __DIR__.'/Fixtures', false), '->locate() returns an array of absolute filenames' ); @@ -92,7 +92,7 @@ */ public function testLocateThrowsAnExceptionIfTheFileDoesNotExists() { - $loader = new FileLocator(array(__DIR__.'/Fixtures')); + $loader = new FileLocator([__DIR__.'/Fixtures']); $loader->locate('foobar.xml', __DIR__); } @@ -102,7 +102,7 @@ */ public function testLocateThrowsAnExceptionIfTheFileDoesNotExistsInAbsolutePath() { - $loader = new FileLocator(array(__DIR__.'/Fixtures')); + $loader = new FileLocator([__DIR__.'/Fixtures']); $loader->locate(__DIR__.'/Fixtures/foobar.xml', __DIR__); } @@ -113,7 +113,7 @@ */ public function testLocateEmpty() { - $loader = new FileLocator(array(__DIR__.'/Fixtures')); + $loader = new FileLocator([__DIR__.'/Fixtures']); $loader->locate(null, __DIR__); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,14 +32,14 @@ ->scalarNode('scalar_true')->defaultTrue()->end() ->scalarNode('scalar_false')->defaultFalse()->end() ->scalarNode('scalar_default')->defaultValue('default')->end() - ->scalarNode('scalar_array_empty')->defaultValue(array())->end() - ->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end() + ->scalarNode('scalar_array_empty')->defaultValue([])->end() + ->scalarNode('scalar_array_defaults')->defaultValue(['elem1', 'elem2'])->end() ->scalarNode('scalar_required')->isRequired()->end() ->scalarNode('scalar_deprecated')->setDeprecated()->end() ->scalarNode('scalar_deprecated_with_message')->setDeprecated('Deprecation custom message for "%node%" at "%path%"')->end() ->scalarNode('node_with_a_looong_name')->end() - ->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end() - ->enumNode('enum')->values(array('this', 'that'))->end() + ->enumNode('enum_with_default')->values(['this', 'that'])->defaultValue('this')->end() + ->enumNode('enum')->values(['this', 'that'])->end() ->arrayNode('array') ->info('some info') ->canBeUnset() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,12 +36,12 @@ { $loader1 = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader1->expects($this->once())->method('supports')->will($this->returnValue(true)); - $loader = new DelegatingLoader(new LoaderResolver(array($loader1))); + $loader = new DelegatingLoader(new LoaderResolver([$loader1])); $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); $loader1 = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader1->expects($this->once())->method('supports')->will($this->returnValue(false)); - $loader = new DelegatingLoader(new LoaderResolver(array($loader1))); + $loader = new DelegatingLoader(new LoaderResolver([$loader1])); $this->assertFalse($loader->supports('foo.foo'), '->supports() returns false if the resource is not loadable'); } @@ -50,7 +50,7 @@ $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader->expects($this->once())->method('supports')->will($this->returnValue(true)); $loader->expects($this->once())->method('load'); - $resolver = new LoaderResolver(array($loader)); + $resolver = new LoaderResolver([$loader]); $loader = new DelegatingLoader($resolver); $loader->load('foo'); @@ -63,7 +63,7 @@ { $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader->expects($this->once())->method('supports')->will($this->returnValue(false)); - $resolver = new LoaderResolver(array($loader)); + $resolver = new LoaderResolver([$loader]); $loader = new DelegatingLoader($resolver); $loader->load('foo'); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/FileLoaderTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/FileLoaderTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/FileLoaderTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/FileLoaderTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,11 +24,11 @@ $locatorMockForAdditionalLoader = $this->getMockBuilder('Symfony\Component\Config\FileLocatorInterface')->getMock(); $locatorMockForAdditionalLoader->expects($this->any())->method('locate')->will($this->onConsecutiveCalls( - array('path/to/file1'), // Default - array('path/to/file1', 'path/to/file2'), // First is imported - array('path/to/file1', 'path/to/file2'), // Second is imported - array('path/to/file1'), // Exception - array('path/to/file1', 'path/to/file2') // Exception + ['path/to/file1'], // Default + ['path/to/file1', 'path/to/file2'], // First is imported + ['path/to/file1', 'path/to/file2'], // Second is imported + ['path/to/file1'], // Exception + ['path/to/file1', 'path/to/file2'] // Exception )); $fileLoader = new TestFileLoader($locatorMock); @@ -38,7 +38,7 @@ $additionalLoader = new TestFileLoader($locatorMockForAdditionalLoader); $additionalLoader->setCurrentDir('.'); - $fileLoader->setResolver($loaderResolver = new LoaderResolver(array($fileLoader, $additionalLoader))); + $fileLoader->setResolver($loaderResolver = new LoaderResolver([$fileLoader, $additionalLoader])); // Default case $this->assertSame('path/to/file1', $fileLoader->import('my_resource')); @@ -118,7 +118,7 @@ public function clearLoading() { - self::$loading = array(); + self::$loading = []; } public function setSupports($supports) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,22 +18,22 @@ { public function testConstructor() { - $resolver = new LoaderResolver(array( + $resolver = new LoaderResolver([ $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(), - )); + ]); - $this->assertEquals(array($loader), $resolver->getLoaders(), '__construct() takes an array of loaders as its first argument'); + $this->assertEquals([$loader], $resolver->getLoaders(), '__construct() takes an array of loaders as its first argument'); } public function testResolve() { $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); - $resolver = new LoaderResolver(array($loader)); + $resolver = new LoaderResolver([$loader]); $this->assertFalse($resolver->resolve('foo.foo'), '->resolve() returns false if no loader is able to load the resource'); $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader->expects($this->once())->method('supports')->will($this->returnValue(true)); - $resolver = new LoaderResolver(array($loader)); + $resolver = new LoaderResolver([$loader]); $this->assertEquals($loader, $resolver->resolve(function () {}), '->resolve() returns the loader for the given resource'); } @@ -42,6 +42,6 @@ $resolver = new LoaderResolver(); $resolver->addLoader($loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock()); - $this->assertEquals(array($loader), $resolver->getLoaders(), 'addLoader() adds a loader'); + $this->assertEquals([$loader], $resolver->getLoaders(), 'addLoader() adds a loader'); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -178,6 +178,6 @@ $resourceA = new DirectoryResource($this->directory, '/.xml$/'); $resourceB = new DirectoryResource($this->directory, '/.yaml$/'); - $this->assertCount(2, array_unique(array($resourceA, $resourceB))); + $this->assertCount(2, array_unique([$resourceA, $resourceB])); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/GlobResourceTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/GlobResourceTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/GlobResourceTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/GlobResourceTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -33,7 +33,7 @@ $paths = iterator_to_array($resource); $file = $dir.'/Resource'.\DIRECTORY_SEPARATOR.'ConditionalClass.php'; - $this->assertEquals(array($file => new \SplFileInfo($file)), $paths); + $this->assertEquals([$file => new \SplFileInfo($file)], $paths); $this->assertInstanceOf('SplFileInfo', current($paths)); $this->assertSame($dir, $resource->getPrefix()); @@ -42,7 +42,7 @@ $paths = iterator_to_array($resource); $file = $dir.\DIRECTORY_SEPARATOR.'Resource'.\DIRECTORY_SEPARATOR.'ConditionalClass.php'; - $this->assertEquals(array($file => $file), $paths); + $this->assertEquals([$file => $file], $paths); $this->assertInstanceOf('SplFileInfo', current($paths)); $this->assertSame($dir, $resource->getPrefix()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -71,7 +71,7 @@ /* 2*/ { /* 3*/ const FOO = 123; /* 4*/ -/* 5*/ public $pub = array(); +/* 5*/ public $pub = []; /* 6*/ /* 7*/ protected $prot; /* 8*/ @@ -79,7 +79,7 @@ /*10*/ /*11*/ public function pub($arg = null) {} /*12*/ -/*13*/ protected function prot($a = array()) {} +/*13*/ protected function prot($a = []) {} /*14*/ /*15*/ private function priv() {} /*16*/ } @@ -110,33 +110,33 @@ public function provideHashedSignature() { - yield array(0, 0, "// line change\n\n"); - yield array(1, 0, '/** class docblock */'); - yield array(1, 1, 'abstract class %s'); - yield array(1, 1, 'final class %s'); - yield array(1, 1, 'class %s extends Exception'); - yield array(1, 1, 'class %s implements '.DummyInterface::class); - yield array(1, 3, 'const FOO = 456;'); - yield array(1, 3, 'const BAR = 123;'); - yield array(1, 4, '/** pub docblock */'); - yield array(1, 5, 'protected $pub = array();'); - yield array(1, 5, 'public $pub = array(123);'); - yield array(1, 6, '/** prot docblock */'); - yield array(1, 7, 'private $prot;'); - yield array(0, 8, '/** priv docblock */'); - yield array(0, 9, 'private $priv = 123;'); - yield array(1, 10, '/** pub docblock */'); + yield [0, 0, "// line change\n\n"]; + yield [1, 0, '/** class docblock */']; + yield [1, 1, 'abstract class %s']; + yield [1, 1, 'final class %s']; + yield [1, 1, 'class %s extends Exception']; + yield [1, 1, 'class %s implements '.DummyInterface::class]; + yield [1, 3, 'const FOO = 456;']; + yield [1, 3, 'const BAR = 123;']; + yield [1, 4, '/** pub docblock */']; + yield [1, 5, 'protected $pub = [];']; + yield [1, 5, 'public $pub = [123];']; + yield [1, 6, '/** prot docblock */']; + yield [1, 7, 'private $prot;']; + yield [0, 8, '/** priv docblock */']; + yield [0, 9, 'private $priv = 123;']; + yield [1, 10, '/** pub docblock */']; if (\PHP_VERSION_ID >= 50600) { - yield array(1, 11, 'public function pub(...$arg) {}'); + yield [1, 11, 'public function pub(...$arg) {}']; } if (\PHP_VERSION_ID >= 70000) { - yield array(1, 11, 'public function pub($arg = null): Foo {}'); + yield [1, 11, 'public function pub($arg = null): Foo {}']; } - yield array(0, 11, "public function pub(\$arg = null) {\nreturn 123;\n}"); - yield array(1, 12, '/** prot docblock */'); - yield array(1, 13, 'protected function prot($a = array(123)) {}'); - yield array(0, 14, '/** priv docblock */'); - yield array(0, 15, ''); + yield [0, 11, "public function pub(\$arg = null) {\nreturn 123;\n}"]; + yield [1, 12, '/** prot docblock */']; + yield [1, 13, 'protected function prot($a = [123]) {}']; + yield [0, 14, '/** priv docblock */']; + yield [0, 15, '']; } public function testEventSubscriber() @@ -144,7 +144,7 @@ $res = new ReflectionClassResource(new \ReflectionClass(TestEventSubscriber::class)); $this->assertTrue($res->isFresh(0)); - TestEventSubscriber::$subscribedEvents = array(123); + TestEventSubscriber::$subscribedEvents = [123]; $this->assertFalse($res->isFresh(0)); $res = new ReflectionClassResource(new \ReflectionClass(TestEventSubscriber::class)); @@ -156,7 +156,7 @@ $res = new ReflectionClassResource(new \ReflectionClass(TestServiceSubscriber::class)); $this->assertTrue($res->isFresh(0)); - TestServiceSubscriber::$subscribedServices = array(123); + TestServiceSubscriber::$subscribedServices = [123]; $this->assertFalse($res->isFresh(0)); $res = new ReflectionClassResource(new \ReflectionClass(TestServiceSubscriber::class)); @@ -170,7 +170,7 @@ class TestEventSubscriber implements EventSubscriberInterface { - public static $subscribedEvents = array(); + public static $subscribedEvents = []; public static function getSubscribedEvents() { @@ -180,7 +180,7 @@ class TestServiceSubscriber implements ServiceSubscriberInterface { - public static $subscribedServices = array(); + public static $subscribedServices = []; public static function getSubscribedServices() { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,7 +27,7 @@ protected function tearDown() { - $files = array($this->cacheFile, "{$this->cacheFile}.meta"); + $files = [$this->cacheFile, "{$this->cacheFile}.meta"]; foreach ($files as $file) { if (file_exists($file)) { @@ -52,7 +52,7 @@ It does not matter if you provide checkers or not. */ unlink($this->cacheFile); // remove tempnam() side effect - $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker)); + $cache = new ResourceCheckerConfigCache($this->cacheFile, [$checker]); $this->assertFalse($cache->isFresh()); } @@ -67,7 +67,7 @@ public function testCacheIsFreshIfEmptyCheckerIteratorProvided() { - $cache = new ResourceCheckerConfigCache($this->cacheFile, new \ArrayIterator(array())); + $cache = new ResourceCheckerConfigCache($this->cacheFile, new \ArrayIterator([])); $this->assertTrue($cache->isFresh()); } @@ -75,7 +75,7 @@ { /* As in the previous test, but this time we have a resource. */ $cache = new ResourceCheckerConfigCache($this->cacheFile); - $cache->write('', array(new ResourceStub())); + $cache->write('', [new ResourceStub()]); $this->assertTrue($cache->isFresh()); // no (matching) ResourceChecker passed } @@ -92,8 +92,8 @@ ->method('isFresh') ->willReturn(true); - $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker)); - $cache->write('', array(new ResourceStub())); + $cache = new ResourceCheckerConfigCache($this->cacheFile, [$checker]); + $cache->write('', [new ResourceStub()]); $this->assertTrue($cache->isFresh()); } @@ -110,8 +110,8 @@ ->method('isFresh') ->willReturn(false); - $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker)); - $cache->write('', array(new ResourceStub())); + $cache = new ResourceCheckerConfigCache($this->cacheFile, [$checker]); + $cache->write('', [new ResourceStub()]); $this->assertFalse($cache->isFresh()); } @@ -119,8 +119,8 @@ public function testCacheIsNotFreshWhenUnserializeFails() { $checker = $this->getMockBuilder('\Symfony\Component\Config\ResourceCheckerInterface')->getMock(); - $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker)); - $cache->write('foo', array(new FileResource(__FILE__))); + $cache = new ResourceCheckerConfigCache($this->cacheFile, [$checker]); + $cache->write('foo', [new FileResource(__FILE__)]); $metaFile = "{$this->cacheFile}.meta"; file_put_contents($metaFile, str_replace('FileResource', 'ClassNotHere', file_get_contents($metaFile))); @@ -139,8 +139,8 @@ public function testCacheIsNotFreshIfNotExistsMetaFile() { $checker = $this->getMockBuilder('\Symfony\Component\Config\ResourceCheckerInterface')->getMock(); - $cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker)); - $cache->write('foo', array(new FileResource(__FILE__))); + $cache = new ResourceCheckerConfigCache($this->cacheFile, [$checker]); + $cache->write('foo', [new FileResource(__FILE__)]); $metaFile = "{$this->cacheFile}.meta"; unlink($metaFile); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -52,14 +52,14 @@ $mock->expects($this->exactly(2))->method('validate')->will($this->onConsecutiveCalls(false, true)); try { - XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')); + XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate']); $this->fail(); } catch (\InvalidArgumentException $e) { $this->assertRegExp('/The XML file ".+" is not valid\./', $e->getMessage()); } - $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'))); - $this->assertSame(array(), libxml_get_errors()); + $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate'])); + $this->assertSame([], libxml_get_errors()); } /** @@ -73,16 +73,16 @@ $mock = $this->getMockBuilder(__NAMESPACE__.'\Validator')->getMock(); $mock->expects($this->once())->method('validate')->willReturn(false); - XmlUtils::parse(file_get_contents($fixtures.'valid.xml'), array($mock, 'validate')); + XmlUtils::parse(file_get_contents($fixtures.'valid.xml'), [$mock, 'validate']); } public function testLoadFileWithInternalErrorsEnabled() { $internalErrors = libxml_use_internal_errors(true); - $this->assertSame(array(), libxml_get_errors()); + $this->assertSame([], libxml_get_errors()); $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml')); - $this->assertSame(array(), libxml_get_errors()); + $this->assertSame([], libxml_get_errors()); libxml_clear_errors(); libxml_use_internal_errors($internalErrors); @@ -101,25 +101,25 @@ public function getDataForConvertDomToArray() { - return array( - array(null, ''), - array('bar', 'bar'), - array(array('bar' => 'foobar'), '', true), - array(array('foo' => null), ''), - array(array('foo' => 'bar'), 'bar'), - array(array('foo' => array('foo' => 'bar')), ''), - array(array('foo' => array('foo' => 0)), '0'), - array(array('foo' => array('foo' => 'bar')), 'bar'), - array(array('foo' => array('foo' => 'bar', 'value' => 'text')), 'text'), - array(array('foo' => array('attr' => 'bar', 'foo' => 'text')), 'text'), - array(array('foo' => array('bar', 'text')), 'bartext'), - array(array('foo' => array(array('foo' => 'bar'), array('foo' => 'text'))), ''), - array(array('foo' => array('foo' => array('bar', 'text'))), 'text'), - array(array('foo' => 'bar'), 'bar'), - array(array('foo' => 'text'), 'text'), - array(array('foo' => array('bar' => 'bar', 'value' => 'text')), 'text', false, false), - array(array('attr' => 1, 'b' => 'hello'), 'hello2', true), - ); + return [ + [null, ''], + ['bar', 'bar'], + [['bar' => 'foobar'], '', true], + [['foo' => null], ''], + [['foo' => 'bar'], 'bar'], + [['foo' => ['foo' => 'bar']], ''], + [['foo' => ['foo' => 0]], '0'], + [['foo' => ['foo' => 'bar']], 'bar'], + [['foo' => ['foo' => 'bar', 'value' => 'text']], 'text'], + [['foo' => ['attr' => 'bar', 'foo' => 'text']], 'text'], + [['foo' => ['bar', 'text']], 'bartext'], + [['foo' => [['foo' => 'bar'], ['foo' => 'text']]], ''], + [['foo' => ['foo' => ['bar', 'text']]], 'text'], + [['foo' => 'bar'], 'bar'], + [['foo' => 'text'], 'text'], + [['foo' => ['bar' => 'bar', 'value' => 'text']], 'text', false, false], + [['attr' => 1, 'b' => 'hello'], 'hello2', true], + ]; } /** @@ -132,34 +132,34 @@ public function getDataForPhpize() { - return array( - array('', ''), - array(null, 'null'), - array(true, 'true'), - array(false, 'false'), - array(null, 'Null'), - array(true, 'True'), - array(false, 'False'), - array(0, '0'), - array(1, '1'), - array(-1, '-1'), - array(0777, '0777'), - array(255, '0xFF'), - array(100.0, '1e2'), - array(-120.0, '-1.2E2'), - array(-10100.1, '-10100.1'), - array('-10,100.1', '-10,100.1'), - array('1234 5678 9101 1121 3141', '1234 5678 9101 1121 3141'), - array('1,2,3,4', '1,2,3,4'), - array('11,22,33,44', '11,22,33,44'), - array('11,222,333,4', '11,222,333,4'), - array('1,222,333,444', '1,222,333,444'), - array('11,222,333,444', '11,222,333,444'), - array('111,222,333,444', '111,222,333,444'), - array('1111,2222,3333,4444,5555', '1111,2222,3333,4444,5555'), - array('foo', 'foo'), - array(6, '0b0110'), - ); + return [ + ['', ''], + [null, 'null'], + [true, 'true'], + [false, 'false'], + [null, 'Null'], + [true, 'True'], + [false, 'False'], + [0, '0'], + [1, '1'], + [-1, '-1'], + [0777, '0777'], + [255, '0xFF'], + [100.0, '1e2'], + [-120.0, '-1.2E2'], + [-10100.1, '-10100.1'], + ['-10,100.1', '-10,100.1'], + ['1234 5678 9101 1121 3141', '1234 5678 9101 1121 3141'], + ['1,2,3,4', '1,2,3,4'], + ['11,22,33,44', '11,22,33,44'], + ['11,222,333,4', '11,222,333,4'], + ['1,222,333,444', '1,222,333,444'], + ['11,222,333,444', '11,222,333,444'], + ['111,222,333,444', '111,222,333,444'], + ['1111,2222,3333,4444,5555', '1111,2222,3333,4444,5555'], + ['foo', 'foo'], + [6, '0b0110'], + ]; } public function testLoadEmptyXmlFile() diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Config/Util/XmlUtils.php symfony-3.4.22+dfsg/src/Symfony/Component/Config/Util/XmlUtils.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Config/Util/XmlUtils.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Config/Util/XmlUtils.php 2019-02-03 12:23:08.000000000 +0000 @@ -158,9 +158,9 @@ { $prefix = (string) $element->prefix; $empty = true; - $config = array(); + $config = []; foreach ($element->attributes as $name => $node) { - if ($checkPrefix && !\in_array((string) $node->prefix, array('', $prefix), true)) { + if ($checkPrefix && !\in_array((string) $node->prefix, ['', $prefix], true)) { continue; } $config[$name] = static::phpize($node->value); @@ -182,7 +182,7 @@ $key = $node->localName; if (isset($config[$key])) { if (!\is_array($config[$key]) || !\is_int(key($config[$key]))) { - $config[$key] = array($config[$key]); + $config[$key] = [$config[$key]]; } $config[$key][] = $value; } else { @@ -249,7 +249,7 @@ protected static function getXmlErrors($internalErrors) { - $errors = array(); + $errors = []; foreach (libxml_get_errors() as $error) { $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Application.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Application.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Application.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Application.php 2019-02-03 12:23:08.000000000 +0000 @@ -61,7 +61,7 @@ */ class Application { - private $commands = array(); + private $commands = []; private $wantHelps = false; private $runningCommand; private $name; @@ -196,17 +196,17 @@ */ public function doRun(InputInterface $input, OutputInterface $output) { - if (true === $input->hasParameterOption(array('--version', '-V'), true)) { + if (true === $input->hasParameterOption(['--version', '-V'], true)) { $output->writeln($this->getLongVersion()); return 0; } $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(array('--help', '-h'), true)) { + if (true === $input->hasParameterOption(['--help', '-h'], true)) { if (!$name) { $name = 'help'; - $input = new ArrayInput(array('command_name' => $this->defaultCommand)); + $input = new ArrayInput(['command_name' => $this->defaultCommand]); } else { $this->wantHelps = true; } @@ -217,9 +217,9 @@ $definition = $this->getDefinition(); $definition->setArguments(array_merge( $definition->getArguments(), - array( + [ 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ) + ] )); } @@ -521,7 +521,7 @@ */ public function getNamespaces() { - $namespaces = array(); + $namespaces = []; foreach ($this->all() as $command) { $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); @@ -588,7 +588,7 @@ { $this->init(); - $aliases = array(); + $aliases = []; $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); $commands = preg_grep('{^'.$expr.'}', $allCommands); @@ -681,7 +681,7 @@ return $commands; } - $commands = array(); + $commands = []; foreach ($this->commands as $name => $command) { if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { $commands[$name] = $command; @@ -708,7 +708,7 @@ */ public static function getAbbreviations($names) { - $abbrevs = array(); + $abbrevs = []; foreach ($names as $name) { for ($len = \strlen($name); $len > 0; --$len) { $abbrev = substr($name, 0, $len); @@ -750,18 +750,18 @@ if (\defined('HHVM_VERSION') && $width > 1 << 31) { $width = 1 << 31; } - $lines = array(); - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : array() as $line) { + $lines = []; + foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { foreach ($this->splitStringByWidth($line, $width - 4) as $line) { // pre-format lines to get the right string length $lineLength = Helper::strlen($line) + 4; - $lines[] = array($line, $lineLength); + $lines[] = [$line, $lineLength]; $len = max($lineLength, $len); } } - $messages = array(); + $messages = []; if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); } @@ -783,12 +783,12 @@ // exception related properties $trace = $e->getTrace(); - array_unshift($trace, array( + array_unshift($trace, [ 'function' => '', 'file' => $e->getFile() ?: 'n/a', 'line' => $e->getLine() ?: 'n/a', - 'args' => array(), - )); + 'args' => [], + ]); for ($i = 0, $count = \count($trace); $i < $count; ++$i) { $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; @@ -844,7 +844,7 @@ { @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), E_USER_DEPRECATED); - return array($this->terminal->getWidth(), $this->terminal->getHeight()); + return [$this->terminal->getWidth(), $this->terminal->getHeight()]; } /** @@ -874,13 +874,13 @@ */ protected function configureIO(InputInterface $input, OutputInterface $output) { - if (true === $input->hasParameterOption(array('--ansi'), true)) { + if (true === $input->hasParameterOption(['--ansi'], true)) { $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(array('--no-ansi'), true)) { + } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { $output->setDecorated(false); } - if (true === $input->hasParameterOption(array('--no-interaction', '-n'), true)) { + if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { $input->setInteractive(false); } elseif (\function_exists('posix_isatty')) { $inputStream = null; @@ -908,7 +908,7 @@ default: $shellVerbosity = 0; break; } - if (true === $input->hasParameterOption(array('--quiet', '-q'), true)) { + if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); $shellVerbosity = -1; } else { @@ -1021,7 +1021,7 @@ */ protected function getDefaultInputDefinition() { - return new InputDefinition(array( + return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), @@ -1031,7 +1031,7 @@ new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - )); + ]); } /** @@ -1041,7 +1041,7 @@ */ protected function getDefaultCommands() { - return array(new HelpCommand(), new ListCommand()); + return [new HelpCommand(), new ListCommand()]; } /** @@ -1051,12 +1051,12 @@ */ protected function getDefaultHelperSet() { - return new HelperSet(array( + return new HelperSet([ new FormatterHelper(), new DebugFormatterHelper(), new ProcessHelper(), new QuestionHelper(), - )); + ]); } /** @@ -1101,9 +1101,9 @@ private function findAlternatives($name, $collection) { $threshold = 1e3; - $alternatives = array(); + $alternatives = []; - $collectionParts = array(); + $collectionParts = []; foreach ($collection as $item) { $collectionParts[$item] = explode(':', $item); } @@ -1180,7 +1180,7 @@ } $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = array(); + $lines = []; $line = ''; foreach (preg_split('//u', $utf8String) as $char) { // test if $char could be appended to current line @@ -1211,7 +1211,7 @@ { // -1 as third argument is needed to skip the command short name when exploding $parts = explode(':', $name, -1); - $namespaces = array(); + $namespaces = []; foreach ($parts as $part) { if (\count($namespaces)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/Command.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/Command.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/Command.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/Command.php 2019-02-03 12:23:08.000000000 +0000 @@ -37,7 +37,7 @@ private $application; private $name; private $processTitle; - private $aliases = array(); + private $aliases = []; private $definition; private $hidden = false; private $help; @@ -46,8 +46,8 @@ private $applicationDefinitionMerged = false; private $applicationDefinitionMergedWithArgs = false; private $code; - private $synopsis = array(); - private $usages = array(); + private $synopsis = []; + private $usages = []; private $helperSet; /** @@ -388,7 +388,7 @@ * Adds an option. * * @param string $name The option name - * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants * @param string $description A description text * @param string|string[]|int|bool|null $default The default value (must be null for InputOption::VALUE_NONE) @@ -535,14 +535,14 @@ $name = $this->name; $isSingleCommand = $this->application && $this->application->isSingleCommand(); - $placeholders = array( + $placeholders = [ '%command.name%', '%command.full_name%', - ); - $replacements = array( + ]; + $replacements = [ $name, $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ); + ]; return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/HelpCommand.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/HelpCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/HelpCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/HelpCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -35,11 +35,11 @@ $this ->setName('help') - ->setDefinition(array( + ->setDefinition([ new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - )) + ]) ->setDescription('Displays help for a command') ->setHelp(<<<'EOF' The %command.name% command displays help for a given command: @@ -71,10 +71,10 @@ } $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, array( + $helper->describe($output, $this->command, [ 'format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), - )); + ]); $this->command = null; } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/ListCommand.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/ListCommand.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Command/ListCommand.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Command/ListCommand.php 2019-02-03 12:23:08.000000000 +0000 @@ -69,11 +69,11 @@ protected function execute(InputInterface $input, OutputInterface $output) { $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), array( + $helper->describe($output, $this->getApplication(), [ 'format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace'), - )); + ]); } /** @@ -81,10 +81,10 @@ */ private function createDefinition() { - return new InputDefinition(array( + return new InputDefinition([ new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - )); + ]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/composer.json symfony-3.4.22+dfsg/src/Symfony/Component/Console/composer.json --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/composer.json 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/composer.json 2019-02-03 12:23:08.000000000 +0000 @@ -28,11 +28,14 @@ "symfony/process": "~3.3|~4.0", "psr/log": "~1.0" }, + "provide": { + "psr/log-implementation": "1.0" + }, "suggest": { "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "", - "psr/log-implementation": "For using the console logger" + "psr/log": "For using the console logger" }, "conflict": { "symfony/dependency-injection": "<3.4", diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,10 +38,10 @@ public function process(ContainerBuilder $container) { $commandServices = $container->findTaggedServiceIds($this->commandTag, true); - $lazyCommandMap = array(); - $lazyCommandRefs = array(); - $serviceIds = array(); - $lazyServiceIds = array(); + $lazyCommandMap = []; + $lazyCommandRefs = []; + $serviceIds = []; + $lazyServiceIds = []; foreach ($commandServices as $id => $tags) { $definition = $container->getDefinition($id); @@ -79,7 +79,7 @@ unset($tags[0]); $lazyCommandMap[$commandName] = $id; $lazyCommandRefs[$id] = new TypedReference($id, $class); - $aliases = array(); + $aliases = []; foreach ($tags as $tag) { if (isset($tag['command'])) { @@ -88,17 +88,17 @@ } } - $definition->addMethodCall('setName', array($commandName)); + $definition->addMethodCall('setName', [$commandName]); if ($aliases) { - $definition->addMethodCall('setAliases', array($aliases)); + $definition->addMethodCall('setAliases', [$aliases]); } } $container ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) ->setPublic(true) - ->setArguments(array(ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap)); + ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); $container->setParameter('console.command.ids', $serviceIds); $container->setParameter('console.lazy_command.ids', $lazyServiceIds); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php 2019-02-03 12:23:08.000000000 +0000 @@ -97,12 +97,12 @@ private function inspectApplication() { - $this->commands = array(); - $this->namespaces = array(); + $this->commands = []; + $this->namespaces = []; $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = array(); + $names = []; /** @var Command $command */ foreach ($commands as $name => $command) { @@ -119,7 +119,7 @@ $names[] = $name; } - $this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names); + $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; } } @@ -128,8 +128,8 @@ */ private function sortCommands(array $commands) { - $namespacedCommands = array(); - $globalCommands = array(); + $namespacedCommands = []; + $globalCommands = []; foreach ($commands as $name => $command) { $key = $this->application->extractNamespace($name, 1); if (!$key) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/DescriptorInterface.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/DescriptorInterface.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/DescriptorInterface.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/DescriptorInterface.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,5 +27,5 @@ * @param object $object * @param array $options */ - public function describe(OutputInterface $output, $object, array $options = array()); + public function describe(OutputInterface $output, $object, array $options = []); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/Descriptor.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/Descriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/Descriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/Descriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ /** * {@inheritdoc} */ - public function describe(OutputInterface $output, $object, array $options = array()) + public function describe(OutputInterface $output, $object, array $options = []) { $this->output = $output; @@ -75,33 +75,33 @@ * * @return string|mixed */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = array()); + abstract protected function describeInputArgument(InputArgument $argument, array $options = []); /** * Describes an InputOption instance. * * @return string|mixed */ - abstract protected function describeInputOption(InputOption $option, array $options = array()); + abstract protected function describeInputOption(InputOption $option, array $options = []); /** * Describes an InputDefinition instance. * * @return string|mixed */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array()); + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); /** * Describes a Command instance. * * @return string|mixed */ - abstract protected function describeCommand(Command $command, array $options = array()); + abstract protected function describeCommand(Command $command, array $options = []); /** * Describes an Application instance. * * @return string|mixed */ - abstract protected function describeApplication(Application $application, array $options = array()); + abstract protected function describeApplication(Application $application, array $options = []); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ /** * {@inheritdoc} */ - protected function describeInputArgument(InputArgument $argument, array $options = array()) + protected function describeInputArgument(InputArgument $argument, array $options = []) { $this->writeData($this->getInputArgumentData($argument), $options); } @@ -37,7 +37,7 @@ /** * {@inheritdoc} */ - protected function describeInputOption(InputOption $option, array $options = array()) + protected function describeInputOption(InputOption $option, array $options = []) { $this->writeData($this->getInputOptionData($option), $options); } @@ -45,7 +45,7 @@ /** * {@inheritdoc} */ - protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + protected function describeInputDefinition(InputDefinition $definition, array $options = []) { $this->writeData($this->getInputDefinitionData($definition), $options); } @@ -53,7 +53,7 @@ /** * {@inheritdoc} */ - protected function describeCommand(Command $command, array $options = array()) + protected function describeCommand(Command $command, array $options = []) { $this->writeData($this->getCommandData($command), $options); } @@ -61,17 +61,17 @@ /** * {@inheritdoc} */ - protected function describeApplication(Application $application, array $options = array()) + protected function describeApplication(Application $application, array $options = []) { $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = array(); + $commands = []; foreach ($description->getCommands() as $command) { $commands[] = $this->getCommandData($command); } - $data = array(); + $data = []; if ('UNKNOWN' !== $application->getName()) { $data['application']['name'] = $application->getName(); if ('UNKNOWN' !== $application->getVersion()) { @@ -105,13 +105,13 @@ */ private function getInputArgumentData(InputArgument $argument) { - return array( + return [ 'name' => $argument->getName(), 'is_required' => $argument->isRequired(), 'is_array' => $argument->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), 'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ); + ]; } /** @@ -119,7 +119,7 @@ */ private function getInputOptionData(InputOption $option) { - return array( + return [ 'name' => '--'.$option->getName(), 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', 'accept_value' => $option->acceptValue(), @@ -127,7 +127,7 @@ 'is_multiple' => $option->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), 'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ); + ]; } /** @@ -135,17 +135,17 @@ */ private function getInputDefinitionData(InputDefinition $definition) { - $inputArguments = array(); + $inputArguments = []; foreach ($definition->getArguments() as $name => $argument) { $inputArguments[$name] = $this->getInputArgumentData($argument); } - $inputOptions = array(); + $inputOptions = []; foreach ($definition->getOptions() as $name => $option) { $inputOptions[$name] = $this->getInputOptionData($option); } - return array('arguments' => $inputArguments, 'options' => $inputOptions); + return ['arguments' => $inputArguments, 'options' => $inputOptions]; } /** @@ -156,13 +156,13 @@ $command->getSynopsis(); $command->mergeApplicationDefinition(false); - return array( + return [ 'name' => $command->getName(), - 'usage' => array_merge(array($command->getSynopsis()), $command->getUsages(), $command->getAliases()), + 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), 'description' => $command->getDescription(), 'help' => $command->getProcessedHelp(), 'definition' => $this->getInputDefinitionData($command->getNativeDefinition()), 'hidden' => $command->isHidden(), - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ /** * {@inheritdoc} */ - public function describe(OutputInterface $output, $object, array $options = array()) + public function describe(OutputInterface $output, $object, array $options = []) { $decorated = $output->isDecorated(); $output->setDecorated(false); @@ -52,7 +52,7 @@ /** * {@inheritdoc} */ - protected function describeInputArgument(InputArgument $argument, array $options = array()) + protected function describeInputArgument(InputArgument $argument, array $options = []) { $this->write( '#### `'.($argument->getName() ?: '')."`\n\n" @@ -66,7 +66,7 @@ /** * {@inheritdoc} */ - protected function describeInputOption(InputOption $option, array $options = array()) + protected function describeInputOption(InputOption $option, array $options = []) { $name = '--'.$option->getName(); if ($option->getShortcut()) { @@ -86,7 +86,7 @@ /** * {@inheritdoc} */ - protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + protected function describeInputDefinition(InputDefinition $definition, array $options = []) { if ($showArguments = \count($definition->getArguments()) > 0) { $this->write('### Arguments'); @@ -112,7 +112,7 @@ /** * {@inheritdoc} */ - protected function describeCommand(Command $command, array $options = array()) + protected function describeCommand(Command $command, array $options = []) { $command->getSynopsis(); $command->mergeApplicationDefinition(false); @@ -122,7 +122,7 @@ .str_repeat('-', Helper::strlen($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) { + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { return $carry.'* `'.$usage.'`'."\n"; }) ); @@ -141,7 +141,7 @@ /** * {@inheritdoc} */ - protected function describeApplication(Application $application, array $options = array()) + protected function describeApplication(Application $application, array $options = []) { $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/TextDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/TextDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/TextDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/TextDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -31,7 +31,7 @@ /** * {@inheritdoc} */ - protected function describeInputArgument(InputArgument $argument, array $options = array()) + protected function describeInputArgument(InputArgument $argument, array $options = []) { if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); @@ -54,7 +54,7 @@ /** * {@inheritdoc} */ - protected function describeInputOption(InputOption $option, array $options = array()) + protected function describeInputOption(InputOption $option, array $options = []) { if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); @@ -71,7 +71,7 @@ } } - $totalWidth = isset($options['total_width']) ? $options['total_width'] : $this->calculateTotalWidthForOptions(array($option)); + $totalWidth = isset($options['total_width']) ? $options['total_width'] : $this->calculateTotalWidthForOptions([$option]); $synopsis = sprintf('%s%s', $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', sprintf('--%s%s', $option->getName(), $value) @@ -92,7 +92,7 @@ /** * {@inheritdoc} */ - protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + protected function describeInputDefinition(InputDefinition $definition, array $options = []) { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { @@ -103,7 +103,7 @@ $this->writeText('Arguments:', $options); $this->writeText("\n"); foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, array('total_width' => $totalWidth))); + $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); $this->writeText("\n"); } } @@ -113,7 +113,7 @@ } if ($definition->getOptions()) { - $laterOptions = array(); + $laterOptions = []; $this->writeText('Options:', $options); foreach ($definition->getOptions() as $option) { @@ -122,11 +122,11 @@ continue; } $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth))); + $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); } foreach ($laterOptions as $option) { $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth))); + $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); } } } @@ -134,14 +134,14 @@ /** * {@inheritdoc} */ - protected function describeCommand(Command $command, array $options = array()) + protected function describeCommand(Command $command, array $options = []) { $command->getSynopsis(true); $command->getSynopsis(false); $command->mergeApplicationDefinition(false); $this->writeText('Usage:', $options); - foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) { + foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { $this->writeText("\n"); $this->writeText(' '.OutputFormatter::escape($usage), $options); } @@ -166,7 +166,7 @@ /** * {@inheritdoc} */ - protected function describeApplication(Application $application, array $options = array()) + protected function describeApplication(Application $application, array $options = []) { $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace); @@ -242,7 +242,7 @@ /** * {@inheritdoc} */ - private function writeText($content, array $options = array()) + private function writeText($content, array $options = []) { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, @@ -300,7 +300,7 @@ */ private function getColumnWidth(array $commands) { - $widths = array(); + $widths = []; foreach ($commands as $command) { if ($command instanceof Command) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php 2019-02-03 12:23:08.000000000 +0000 @@ -64,7 +64,7 @@ $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - foreach (array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()) as $usage) { + foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { $usagesXML->appendChild($dom->createElement('usage', $usage)); } @@ -130,7 +130,7 @@ /** * {@inheritdoc} */ - protected function describeInputArgument(InputArgument $argument, array $options = array()) + protected function describeInputArgument(InputArgument $argument, array $options = []) { $this->writeDocument($this->getInputArgumentDocument($argument)); } @@ -138,7 +138,7 @@ /** * {@inheritdoc} */ - protected function describeInputOption(InputOption $option, array $options = array()) + protected function describeInputOption(InputOption $option, array $options = []) { $this->writeDocument($this->getInputOptionDocument($option)); } @@ -146,7 +146,7 @@ /** * {@inheritdoc} */ - protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + protected function describeInputDefinition(InputDefinition $definition, array $options = []) { $this->writeDocument($this->getInputDefinitionDocument($definition)); } @@ -154,7 +154,7 @@ /** * {@inheritdoc} */ - protected function describeCommand(Command $command, array $options = array()) + protected function describeCommand(Command $command, array $options = []) { $this->writeDocument($this->getCommandDocument($command)); } @@ -162,7 +162,7 @@ /** * {@inheritdoc} */ - protected function describeApplication(Application $application, array $options = array()) + protected function describeApplication(Application $application, array $options = []) { $this->writeDocument($this->getApplicationDocument($application, isset($options['namespace']) ? $options['namespace'] : null)); } @@ -203,7 +203,7 @@ $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array())); + $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); foreach ($defaults as $default) { $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); $defaultXML->appendChild($dom->createTextNode($default)); @@ -235,7 +235,7 @@ $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array())); + $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); if (!empty($defaults)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/EventListener/ErrorListener.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/EventListener/ErrorListener.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/EventListener/ErrorListener.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/EventListener/ErrorListener.php 2019-02-03 12:23:08.000000000 +0000 @@ -40,10 +40,10 @@ $error = $event->getError(); if (!$inputString = $this->getInputString($event)) { - return $this->logger->error('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => $error->getMessage())); + return $this->logger->error('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); } - $this->logger->error('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => $inputString, 'message' => $error->getMessage())); + $this->logger->error('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); } public function onConsoleTerminate(ConsoleTerminateEvent $event) @@ -59,18 +59,18 @@ } if (!$inputString = $this->getInputString($event)) { - return $this->logger->debug('The console exited with code "{code}"', array('code' => $exitCode)); + return $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); } - $this->logger->debug('Command "{command}" exited with code "{code}"', array('command' => $inputString, 'code' => $exitCode)); + $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); } public static function getSubscribedEvents() { - return array( - ConsoleEvents::ERROR => array('onConsoleError', -128), - ConsoleEvents::TERMINATE => array('onConsoleTerminate', -128), - ); + return [ + ConsoleEvents::ERROR => ['onConsoleError', -128], + ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], + ]; } private static function getInputString(ConsoleEvent $event) @@ -80,7 +80,7 @@ if (method_exists($input, '__toString')) { if ($commandName) { - return str_replace(array("'$commandName'", "\"$commandName\""), $commandName, (string) $input); + return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); } return (string) $input; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Exception/CommandNotFoundException.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Exception/CommandNotFoundException.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Exception/CommandNotFoundException.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Exception/CommandNotFoundException.php 2019-02-03 12:23:08.000000000 +0000 @@ -26,7 +26,7 @@ * @param int $code Exception code * @param \Exception $previous Previous exception used for the exception chaining */ - public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null) + public function __construct($message, array $alternatives = [], $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatter.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatter.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatter.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatter.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ class OutputFormatter implements OutputFormatterInterface { private $decorated; - private $styles = array(); + private $styles = []; private $styleStack; /** @@ -65,7 +65,7 @@ * @param bool $decorated Whether this formatter should actually decorate strings * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances */ - public function __construct($decorated = false, array $styles = array()) + public function __construct($decorated = false, array $styles = []) { $this->decorated = (bool) $decorated; @@ -169,7 +169,7 @@ $output .= $this->applyCurrentStyle(substr($message, $offset)); if (false !== strpos($output, "\0")) { - return strtr($output, array("\0" => '\\', '\\<' => '<')); + return strtr($output, ["\0" => '\\', '\\<' => '<']); } return str_replace('\\<', '<', $output); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,39 +20,39 @@ */ class OutputFormatterStyle implements OutputFormatterStyleInterface { - private static $availableForegroundColors = array( - 'black' => array('set' => 30, 'unset' => 39), - 'red' => array('set' => 31, 'unset' => 39), - 'green' => array('set' => 32, 'unset' => 39), - 'yellow' => array('set' => 33, 'unset' => 39), - 'blue' => array('set' => 34, 'unset' => 39), - 'magenta' => array('set' => 35, 'unset' => 39), - 'cyan' => array('set' => 36, 'unset' => 39), - 'white' => array('set' => 37, 'unset' => 39), - 'default' => array('set' => 39, 'unset' => 39), - ); - private static $availableBackgroundColors = array( - 'black' => array('set' => 40, 'unset' => 49), - 'red' => array('set' => 41, 'unset' => 49), - 'green' => array('set' => 42, 'unset' => 49), - 'yellow' => array('set' => 43, 'unset' => 49), - 'blue' => array('set' => 44, 'unset' => 49), - 'magenta' => array('set' => 45, 'unset' => 49), - 'cyan' => array('set' => 46, 'unset' => 49), - 'white' => array('set' => 47, 'unset' => 49), - 'default' => array('set' => 49, 'unset' => 49), - ); - private static $availableOptions = array( - 'bold' => array('set' => 1, 'unset' => 22), - 'underscore' => array('set' => 4, 'unset' => 24), - 'blink' => array('set' => 5, 'unset' => 25), - 'reverse' => array('set' => 7, 'unset' => 27), - 'conceal' => array('set' => 8, 'unset' => 28), - ); + private static $availableForegroundColors = [ + 'black' => ['set' => 30, 'unset' => 39], + 'red' => ['set' => 31, 'unset' => 39], + 'green' => ['set' => 32, 'unset' => 39], + 'yellow' => ['set' => 33, 'unset' => 39], + 'blue' => ['set' => 34, 'unset' => 39], + 'magenta' => ['set' => 35, 'unset' => 39], + 'cyan' => ['set' => 36, 'unset' => 39], + 'white' => ['set' => 37, 'unset' => 39], + 'default' => ['set' => 39, 'unset' => 39], + ]; + private static $availableBackgroundColors = [ + 'black' => ['set' => 40, 'unset' => 49], + 'red' => ['set' => 41, 'unset' => 49], + 'green' => ['set' => 42, 'unset' => 49], + 'yellow' => ['set' => 43, 'unset' => 49], + 'blue' => ['set' => 44, 'unset' => 49], + 'magenta' => ['set' => 45, 'unset' => 49], + 'cyan' => ['set' => 46, 'unset' => 49], + 'white' => ['set' => 47, 'unset' => 49], + 'default' => ['set' => 49, 'unset' => 49], + ]; + private static $availableOptions = [ + 'bold' => ['set' => 1, 'unset' => 22], + 'underscore' => ['set' => 4, 'unset' => 24], + 'blink' => ['set' => 5, 'unset' => 25], + 'reverse' => ['set' => 7, 'unset' => 27], + 'conceal' => ['set' => 8, 'unset' => 28], + ]; private $foreground; private $background; - private $options = array(); + private $options = []; /** * Initializes output formatter style. @@ -61,7 +61,7 @@ * @param string|null $background The style background color name * @param array $options The style options */ - public function __construct($foreground = null, $background = null, array $options = array()) + public function __construct($foreground = null, $background = null, array $options = []) { if (null !== $foreground) { $this->setForeground($foreground); @@ -160,7 +160,7 @@ */ public function setOptions(array $options) { - $this->options = array(); + $this->options = []; foreach ($options as $option) { $this->setOption($option); @@ -176,8 +176,8 @@ */ public function apply($text) { - $setCodes = array(); - $unsetCodes = array(); + $setCodes = []; + $unsetCodes = []; if (null !== $this->foreground) { $setCodes[] = $this->foreground['set']; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php 2019-02-03 12:23:08.000000000 +0000 @@ -36,7 +36,7 @@ */ public function reset() { - $this->styles = array(); + $this->styles = []; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/DebugFormatterHelper.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/DebugFormatterHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/DebugFormatterHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/DebugFormatterHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -20,8 +20,8 @@ */ class DebugFormatterHelper extends Helper { - private $colors = array('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'); - private $started = array(); + private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; + private $started = []; private $count = -1; /** @@ -35,7 +35,7 @@ */ public function start($id, $message, $prefix = 'RUN') { - $this->started[$id] = array('border' => ++$this->count % \count($this->colors)); + $this->started[$id] = ['border' => ++$this->count % \count($this->colors)]; return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/DescriptorHelper.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/DescriptorHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/DescriptorHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/DescriptorHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,7 +29,7 @@ /** * @var DescriptorInterface[] */ - private $descriptors = array(); + private $descriptors = []; public function __construct() { @@ -54,12 +54,12 @@ * * @throws InvalidArgumentException when the given format is not supported */ - public function describe(OutputInterface $output, $object, array $options = array()) + public function describe(OutputInterface $output, $object, array $options = []) { - $options = array_merge(array( + $options = array_merge([ 'raw_text' => false, 'format' => 'txt', - ), $options); + ], $options); if (!isset($this->descriptors[$options['format']])) { throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/FormatterHelper.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/FormatterHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/FormatterHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/FormatterHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -46,18 +46,18 @@ public function formatBlock($messages, $style, $large = false) { if (!\is_array($messages)) { - $messages = array($messages); + $messages = [$messages]; } $len = 0; - $lines = array(); + $lines = []; foreach ($messages as $message) { $message = OutputFormatter::escape($message); $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); $len = max($this->strlen($message) + ($large ? 4 : 2), $len); } - $messages = $large ? array(str_repeat(' ', $len)) : array(); + $messages = $large ? [str_repeat(' ', $len)] : []; for ($i = 0; isset($lines[$i]); ++$i) { $messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i])); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/Helper.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/Helper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/Helper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/Helper.php 2019-02-03 12:23:08.000000000 +0000 @@ -74,17 +74,17 @@ public static function formatTime($secs) { - static $timeFormats = array( - array(0, '< 1 sec'), - array(1, '1 sec'), - array(2, 'secs', 1), - array(60, '1 min'), - array(120, 'mins', 60), - array(3600, '1 hr'), - array(7200, 'hrs', 3600), - array(86400, '1 day'), - array(172800, 'days', 86400), - ); + static $timeFormats = [ + [0, '< 1 sec'], + [1, '1 sec'], + [2, 'secs', 1], + [60, '1 min'], + [120, 'mins', 60], + [3600, '1 hr'], + [7200, 'hrs', 3600], + [86400, '1 day'], + [172800, 'days', 86400], + ]; foreach ($timeFormats as $index => $format) { if ($secs >= $format[0]) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/HelperSet.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/HelperSet.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/HelperSet.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/HelperSet.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,13 +24,13 @@ /** * @var Helper[] */ - private $helpers = array(); + private $helpers = []; private $command; /** * @param Helper[] $helpers An array of helper */ - public function __construct(array $helpers = array()) + public function __construct(array $helpers = []) { foreach ($helpers as $alias => $helper) { $this->set($helper, \is_int($alias) ? null : $alias); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/ProgressBar.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/ProgressBar.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/ProgressBar.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/ProgressBar.php 2019-02-03 12:23:08.000000000 +0000 @@ -38,7 +38,7 @@ private $stepWidth; private $percent = 0.0; private $formatLineCount; - private $messages = array(); + private $messages = []; private $overwrite = true; private $terminal; private $firstRun = true; @@ -503,8 +503,8 @@ private static function initPlaceholderFormatters() { - return array( - 'bar' => function (ProgressBar $bar, OutputInterface $output) { + return [ + 'bar' => function (self $bar, OutputInterface $output) { $completeBars = floor($bar->getMaxSteps() > 0 ? $bar->getProgressPercent() * $bar->getBarWidth() : $bar->getProgress() % $bar->getBarWidth()); $display = str_repeat($bar->getBarCharacter(), $completeBars); if ($completeBars < $bar->getBarWidth()) { @@ -514,10 +514,10 @@ return $display; }, - 'elapsed' => function (ProgressBar $bar) { + 'elapsed' => function (self $bar) { return Helper::formatTime(time() - $bar->getStartTime()); }, - 'remaining' => function (ProgressBar $bar) { + 'remaining' => function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); } @@ -530,7 +530,7 @@ return Helper::formatTime($remaining); }, - 'estimated' => function (ProgressBar $bar) { + 'estimated' => function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); } @@ -543,24 +543,24 @@ return Helper::formatTime($estimated); }, - 'memory' => function (ProgressBar $bar) { + 'memory' => function (self $bar) { return Helper::formatMemory(memory_get_usage(true)); }, - 'current' => function (ProgressBar $bar) { + 'current' => function (self $bar) { return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT); }, - 'max' => function (ProgressBar $bar) { + 'max' => function (self $bar) { return $bar->getMaxSteps(); }, - 'percent' => function (ProgressBar $bar) { + 'percent' => function (self $bar) { return floor($bar->getProgressPercent() * 100); }, - ); + ]; } private static function initFormats() { - return array( + return [ 'normal' => ' %current%/%max% [%bar%] %percent:3s%%', 'normal_nomax' => ' %current% [%bar%]', @@ -572,7 +572,7 @@ 'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', 'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ); + ]; } /** diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/ProgressIndicator.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/ProgressIndicator.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/ProgressIndicator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/ProgressIndicator.php 2019-02-03 12:23:08.000000000 +0000 @@ -48,7 +48,7 @@ } if (null === $indicatorValues) { - $indicatorValues = array('-', '\\', '|', '/'); + $indicatorValues = ['-', '\\', '|', '/']; } $indicatorValues = array_values($indicatorValues); @@ -239,25 +239,25 @@ private static function initPlaceholderFormatters() { - return array( - 'indicator' => function (ProgressIndicator $indicator) { + return [ + 'indicator' => function (self $indicator) { return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; }, - 'message' => function (ProgressIndicator $indicator) { + 'message' => function (self $indicator) { return $indicator->message; }, - 'elapsed' => function (ProgressIndicator $indicator) { + 'elapsed' => function (self $indicator) { return Helper::formatTime(time() - $indicator->startTime); }, 'memory' => function () { return Helper::formatMemory(memory_get_usage(true)); }, - ); + ]; } private static function initFormats() { - return array( + return [ 'normal' => ' %indicator% %message%', 'normal_no_ansi' => ' %message%', @@ -266,6 +266,6 @@ 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ); + ]; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/QuestionHelper.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/QuestionHelper.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/QuestionHelper.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/QuestionHelper.php 2019-02-03 12:23:08.000000000 +0000 @@ -191,7 +191,7 @@ $message = $question->getQuestion(); if ($question instanceof ChoiceQuestion) { - $maxWidth = max(array_map(array($this, 'strlen'), array_keys($question->getChoices()))); + $maxWidth = max(array_map([$this, 'strlen'], array_keys($question->getChoices()))); $messages = (array) $question->getQuestion(); foreach ($question->getChoices() as $key => $value) { @@ -448,7 +448,7 @@ if (file_exists('/usr/bin/env')) { // handle other OSs with bash/zsh/ksh/csh if available to hide the answer $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null"; - foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) { + foreach (['bash', 'zsh', 'ksh', 'csh'] as $sh) { if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) { self::$shell = $sh; break; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableCell.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableCell.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableCell.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableCell.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,16 +19,16 @@ class TableCell { private $value; - private $options = array( + private $options = [ 'rowspan' => 1, 'colspan' => 1, - ); + ]; /** * @param string $value * @param array $options */ - public function __construct($value = '', array $options = array()) + public function __construct($value = '', array $options = []) { if (is_numeric($value) && !\is_string($value)) { $value = (string) $value; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/Table.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/Table.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/Table.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/Table.php 2019-02-03 12:23:08.000000000 +0000 @@ -27,17 +27,17 @@ /** * Table headers. */ - private $headers = array(); + private $headers = []; /** * Table rows. */ - private $rows = array(); + private $rows = []; /** * Column widths cache. */ - private $effectiveColumnWidths = array(); + private $effectiveColumnWidths = []; /** * Number of columns cache. @@ -59,14 +59,14 @@ /** * @var array */ - private $columnStyles = array(); + private $columnStyles = []; /** * User set column widths. * * @var array */ - private $columnWidths = array(); + private $columnWidths = []; private static $styles; @@ -199,7 +199,7 @@ */ public function setColumnWidths(array $widths) { - $this->columnWidths = array(); + $this->columnWidths = []; foreach ($widths as $index => $width) { $this->setColumnWidth($index, $width); } @@ -211,7 +211,7 @@ { $headers = array_values($headers); if (!empty($headers) && !\is_array($headers[0])) { - $headers = array($headers); + $headers = [$headers]; } $this->headers = $headers; @@ -221,7 +221,7 @@ public function setRows(array $rows) { - $this->rows = array(); + $this->rows = []; return $this->addRows($rows); } @@ -402,7 +402,7 @@ return; } - $columns = array(0); + $columns = [0]; foreach (array_merge($this->headers, $this->rows) as $row) { if ($row instanceof TableSeparator) { continue; @@ -416,7 +416,7 @@ private function buildTableRows($rows) { - $unmergedRows = array(); + $unmergedRows = []; for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { $rows = $this->fillNextRows($rows, $rowKey); @@ -428,7 +428,7 @@ $lines = explode("\n", str_replace("\n", "\n", $cell)); foreach ($lines as $lineKey => $line) { if ($cell instanceof TableCell) { - $line = new TableCell($line, array('colspan' => $cell->getColspan())); + $line = new TableCell($line, ['colspan' => $cell->getColspan()]); } if (0 === $lineKey) { $rows[$rowKey][$column] = $line; @@ -439,7 +439,7 @@ } } - $tableRows = array(); + $tableRows = []; foreach ($rows as $rowKey => $row) { $tableRows[] = $this->fillCells($row); if (isset($unmergedRows[$rowKey])) { @@ -462,27 +462,27 @@ */ private function fillNextRows(array $rows, $line) { - $unmergedRows = array(); + $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing __toString, %s given.', \gettype($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { $nbLines = $cell->getRowspan() - 1; - $lines = array($cell); + $lines = [$cell]; if (strstr($cell, "\n")) { $lines = explode("\n", str_replace("\n", "\n", $cell)); $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; - $rows[$line][$column] = new TableCell($lines[0], array('colspan' => $cell->getColspan())); + $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan()]); unset($lines[0]); } // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, array()), $unmergedRows); + $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan())); + $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]); if ($nbLines === $unmergedRowKey - $line) { break; } @@ -495,7 +495,7 @@ if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { foreach ($unmergedRow as $cellKey => $cell) { // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, array($cell)); + array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); } } else { $row = $this->copyRow($rows, $unmergedRowKey - 1); @@ -504,7 +504,7 @@ $row[$column] = $unmergedRow[$column]; } } - array_splice($rows, $unmergedRowKey, 0, array($row)); + array_splice($rows, $unmergedRowKey, 0, [$row]); } } @@ -518,7 +518,7 @@ */ private function fillCells($row) { - $newRow = array(); + $newRow = []; foreach ($row as $column => $cell) { $newRow[] = $cell; if ($cell instanceof TableCell && $cell->getColspan() > 1) { @@ -544,7 +544,7 @@ foreach ($row as $cellKey => $cellValue) { $row[$cellKey] = ''; if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', array('colspan' => $cellValue->getColspan())); + $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); } } @@ -590,7 +590,7 @@ private function calculateColumnsWidth(array $rows) { for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = array(); + $lengths = []; foreach ($rows as $row) { if ($row instanceof TableSeparator) { continue; @@ -653,7 +653,7 @@ */ private function cleanup() { - $this->effectiveColumnWidths = array(); + $this->effectiveColumnWidths = []; $this->numberOfColumns = null; } @@ -682,12 +682,12 @@ ->setCellHeaderFormat('%s') ; - return array( + return [ 'default' => new TableStyle(), 'borderless' => $borderless, 'compact' => $compact, 'symfony-style-guide' => $styleGuide, - ); + ]; } private function resolveStyle($name) diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableSeparator.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableSeparator.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableSeparator.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableSeparator.php 2019-02-03 12:23:08.000000000 +0000 @@ -18,7 +18,7 @@ */ class TableSeparator extends TableCell { - public function __construct(array $options = array()) + public function __construct(array $options = []) { parent::__construct('', $options); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableStyle.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableStyle.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Helper/TableStyle.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Helper/TableStyle.php 2019-02-03 12:23:08.000000000 +0000 @@ -237,7 +237,7 @@ */ public function setPadType($padType) { - if (!\in_array($padType, array(STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH), true)) { + if (!\in_array($padType, [STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH], true)) { throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/ArgvInput.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/ArgvInput.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/ArgvInput.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/ArgvInput.php 2019-02-03 12:23:08.000000000 +0000 @@ -174,7 +174,7 @@ // if input is expecting another argument, add it if ($this->definition->hasArgument($c)) { $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token; + $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; // if last argument isArray(), append token to last argument } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { @@ -229,11 +229,11 @@ throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); } - if (\in_array($value, array('', null), true) && $option->acceptValue() && \count($this->parsed)) { + if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { // if option accepts an optional or mandatory argument // let's see if there is one provided $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, array('', null), true)) { + if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { $value = $next; } else { array_unshift($this->parsed, $next); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/ArrayInput.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/ArrayInput.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/ArrayInput.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/ArrayInput.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,7 +19,7 @@ * * Usage: * - * $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar')); + * $input = new ArrayInput(['name' => 'foo', '--bar' => 'foobar']); * * @author Fabien Potencier */ @@ -103,7 +103,7 @@ */ public function __toString() { - $params = array(); + $params = []; foreach ($this->parameters as $param => $val) { if ($param && '-' === $param[0]) { if (\is_array($val)) { @@ -114,7 +114,7 @@ $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); } } else { - $params[] = \is_array($val) ? implode(' ', array_map(array($this, 'escapeToken'), $val)) : $this->escapeToken($val); + $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputArgument.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputArgument.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputArgument.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputArgument.php 2019-02-03 12:23:08.000000000 +0000 @@ -98,7 +98,7 @@ if ($this->isArray()) { if (null === $default) { - $default = array(); + $default = []; } elseif (!\is_array($default)) { throw new LogicException('A default value for an array argument must be an array.'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputDefinition.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputDefinition.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputDefinition.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputDefinition.php 2019-02-03 12:23:08.000000000 +0000 @@ -19,10 +19,10 @@ * * Usage: * - * $definition = new InputDefinition(array( + * $definition = new InputDefinition([ * new InputArgument('name', InputArgument::REQUIRED), * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * )); + * ]); * * @author Fabien Potencier */ @@ -38,7 +38,7 @@ /** * @param array $definition An array of InputArgument and InputOption instance */ - public function __construct(array $definition = array()) + public function __construct(array $definition = []) { $this->setDefinition($definition); } @@ -48,8 +48,8 @@ */ public function setDefinition(array $definition) { - $arguments = array(); - $options = array(); + $arguments = []; + $options = []; foreach ($definition as $item) { if ($item instanceof InputOption) { $options[] = $item; @@ -67,9 +67,9 @@ * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function setArguments($arguments = array()) + public function setArguments($arguments = []) { - $this->arguments = array(); + $this->arguments = []; $this->requiredCount = 0; $this->hasOptional = false; $this->hasAnArrayArgument = false; @@ -81,7 +81,7 @@ * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function addArguments($arguments = array()) + public function addArguments($arguments = []) { if (null !== $arguments) { foreach ($arguments as $argument) { @@ -191,7 +191,7 @@ */ public function getArgumentDefaults() { - $values = array(); + $values = []; foreach ($this->arguments as $argument) { $values[$argument->getName()] = $argument->getDefault(); } @@ -204,10 +204,10 @@ * * @param InputOption[] $options An array of InputOption objects */ - public function setOptions($options = array()) + public function setOptions($options = []) { - $this->options = array(); - $this->shortcuts = array(); + $this->options = []; + $this->shortcuts = []; $this->addOptions($options); } @@ -216,7 +216,7 @@ * * @param InputOption[] $options An array of InputOption objects */ - public function addOptions($options = array()) + public function addOptions($options = []) { foreach ($options as $option) { $this->addOption($option); @@ -322,7 +322,7 @@ */ public function getOptionDefaults() { - $values = array(); + $values = []; foreach ($this->options as $option) { $values[$option->getName()] = $option->getDefault(); } @@ -357,7 +357,7 @@ */ public function getSynopsis($short = false) { - $elements = array(); + $elements = []; if ($short && $this->getOptions()) { $elements[] = '[options]'; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputOption.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputOption.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/InputOption.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/InputOption.php 2019-02-03 12:23:08.000000000 +0000 @@ -34,7 +34,7 @@ /** * @param string $name The option name - * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts * @param int|null $mode The option mode: One of the VALUE_* constants * @param string $description A description text * @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE) @@ -89,7 +89,7 @@ /** * Returns the option shortcut. * - * @return string The shortcut + * @return string|null The shortcut */ public function getShortcut() { @@ -161,7 +161,7 @@ if ($this->isArray()) { if (null === $default) { - $default = array(); + $default = []; } elseif (!\is_array($default)) { throw new LogicException('A default value for an array option must be an array.'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/Input.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/Input.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/Input.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/Input.php 2019-02-03 12:23:08.000000000 +0000 @@ -29,8 +29,8 @@ { protected $definition; protected $stream; - protected $options = array(); - protected $arguments = array(); + protected $options = []; + protected $arguments = []; protected $interactive = true; public function __construct(InputDefinition $definition = null) @@ -48,8 +48,8 @@ */ public function bind(InputDefinition $definition) { - $this->arguments = array(); - $this->options = array(); + $this->arguments = []; + $this->options = []; $this->definition = $definition; $this->parse(); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/StringInput.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/StringInput.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Input/StringInput.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Input/StringInput.php 2019-02-03 12:23:08.000000000 +0000 @@ -32,7 +32,7 @@ */ public function __construct($input) { - parent::__construct(array()); + parent::__construct([]); $this->setTokens($this->tokenize($input)); } @@ -48,13 +48,13 @@ */ private function tokenize($input) { - $tokens = array(); + $tokens = []; $length = \strlen($input); $cursor = 0; while ($cursor < $length) { if (preg_match('/\s+/A', $input, $match, null, $cursor)) { } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, \strlen($match[3]) - 2))); + $tokens[] = $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, \strlen($match[3]) - 2))); } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { $tokens[] = stripcslashes(substr($match[0], 1, \strlen($match[0]) - 2)); } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Logger/ConsoleLogger.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Logger/ConsoleLogger.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Logger/ConsoleLogger.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Logger/ConsoleLogger.php 2019-02-03 12:23:08.000000000 +0000 @@ -30,7 +30,7 @@ const ERROR = 'error'; private $output; - private $verbosityLevelMap = array( + private $verbosityLevelMap = [ LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, @@ -39,8 +39,8 @@ LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ); - private $formatLevelMap = array( + ]; + private $formatLevelMap = [ LogLevel::EMERGENCY => self::ERROR, LogLevel::ALERT => self::ERROR, LogLevel::CRITICAL => self::ERROR, @@ -49,10 +49,10 @@ LogLevel::NOTICE => self::INFO, LogLevel::INFO => self::INFO, LogLevel::DEBUG => self::INFO, - ); + ]; private $errored = false; - public function __construct(OutputInterface $output, array $verbosityLevelMap = array(), array $formatLevelMap = array()) + public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) { $this->output = $output; $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; @@ -62,7 +62,7 @@ /** * {@inheritdoc} */ - public function log($level, $message, array $context = array()) + public function log($level, $message, array $context = []) { if (!isset($this->verbosityLevelMap[$level])) { throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); @@ -111,7 +111,7 @@ return $message; } - $replacements = array(); + $replacements = []; foreach ($context as $key => $val) { if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Output/ConsoleOutput.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Output/ConsoleOutput.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Output/ConsoleOutput.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Output/ConsoleOutput.php 2019-02-03 12:23:08.000000000 +0000 @@ -121,11 +121,11 @@ */ private function isRunningOS400() { - $checks = array( + $checks = [ \function_exists('php_uname') ? php_uname('s') : '', getenv('OSTYPE'), PHP_OS, - ); + ]; return false !== stripos(implode(';', $checks), 'OS400'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Question/ChoiceQuestion.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Question/ChoiceQuestion.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Question/ChoiceQuestion.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Question/ChoiceQuestion.php 2019-02-03 12:23:08.000000000 +0000 @@ -144,12 +144,12 @@ } $selectedChoices = explode(',', $selectedChoices); } else { - $selectedChoices = array($selected); + $selectedChoices = [$selected]; } - $multiselectChoices = array(); + $multiselectChoices = []; foreach ($selectedChoices as $value) { - $results = array(); + $results = []; foreach ($choices as $key => $choice) { if ($choice === $value) { $results[] = $key; diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Question/ConfirmationQuestion.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Question/ConfirmationQuestion.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Question/ConfirmationQuestion.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Question/ConfirmationQuestion.php 2019-02-03 12:23:08.000000000 +0000 @@ -53,7 +53,7 @@ return $answer && $answerIsTrue; } - return !$answer || $answerIsTrue; + return '' === $answer || $answerIsTrue; }; } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Style/SymfonyStyle.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Style/SymfonyStyle.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Style/SymfonyStyle.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Style/SymfonyStyle.php 2019-02-03 12:23:08.000000000 +0000 @@ -63,7 +63,7 @@ */ public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true) { - $messages = \is_array($messages) ? array_values($messages) : array($messages); + $messages = \is_array($messages) ? array_values($messages) : [$messages]; $this->autoPrependBlock(); $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); @@ -76,10 +76,10 @@ public function title($message) { $this->autoPrependBlock(); - $this->writeln(array( + $this->writeln([ sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), sprintf('%s', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), - )); + ]); $this->newLine(); } @@ -89,10 +89,10 @@ public function section($message) { $this->autoPrependBlock(); - $this->writeln(array( + $this->writeln([ sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), sprintf('%s', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), - )); + ]); $this->newLine(); } @@ -117,7 +117,7 @@ { $this->autoPrependText(); - $messages = \is_array($message) ? array_values($message) : array($message); + $messages = \is_array($message) ? array_values($message) : [$message]; foreach ($messages as $message) { $this->writeln(sprintf(' %s', $message)); } @@ -376,14 +376,14 @@ // Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer return array_map(function ($value) { return substr($value, -4); - }, array_merge(array($this->bufferedOutput->fetch()), (array) $messages)); + }, array_merge([$this->bufferedOutput->fetch()], (array) $messages)); } private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false) { $indentLength = 0; $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix); - $lines = array(); + $lines = []; if (null !== $type) { $type = sprintf('[%s] ', $type); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Terminal.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Terminal.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Terminal.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Terminal.php 2019-02-03 12:23:08.000000000 +0000 @@ -91,11 +91,11 @@ return; } - $descriptorspec = array( - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w'), - ); - $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); + $descriptorspec = [ + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ]; + $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); if (\is_resource($process)) { $info = stream_get_contents($pipes[1]); fclose($pipes[1]); @@ -103,7 +103,7 @@ proc_close($process); if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return array((int) $matches[2], (int) $matches[1]); + return [(int) $matches[2], (int) $matches[1]]; } } } @@ -119,12 +119,12 @@ return; } - $descriptorspec = array( - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w'), - ); + $descriptorspec = [ + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ]; - $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); + $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); if (\is_resource($process)) { $info = stream_get_contents($pipes[1]); fclose($pipes[1]); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tester/ApplicationTester.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tester/ApplicationTester.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tester/ApplicationTester.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tester/ApplicationTester.php 2019-02-03 12:23:08.000000000 +0000 @@ -59,7 +59,7 @@ * * @return int The command exit code */ - public function run(array $input, $options = array()) + public function run(array $input, $options = []) { $this->input = new ArrayInput($input); if (isset($options['interactive'])) { diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tester/CommandTester.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tester/CommandTester.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tester/CommandTester.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tester/CommandTester.php 2019-02-03 12:23:08.000000000 +0000 @@ -28,7 +28,7 @@ private $command; private $input; private $output; - private $inputs = array(); + private $inputs = []; private $statusCode; public function __construct(Command $command) @@ -50,7 +50,7 @@ * * @return int The command exit code */ - public function execute(array $input, array $options = array()) + public function execute(array $input, array $options = []) { // set the command name automatically if the application requires // this argument and no command name was passed @@ -58,7 +58,7 @@ && (null !== $application = $this->command->getApplication()) && $application->getDefinition()->hasArgument('command') ) { - $input = array_merge(array('command' => $this->command->getName()), $input); + $input = array_merge(['command' => $this->command->getName()], $input); } $this->input = new ArrayInput($input); diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/ApplicationTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/ApplicationTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/ApplicationTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/ApplicationTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -83,7 +83,7 @@ $application = new Application('foo', 'bar'); $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument'); - $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default'); + $this->assertEquals(['help', 'list'], array_keys($application->all()), '__construct() registered the help and list commands by default'); } public function testSetGetName() @@ -133,9 +133,9 @@ $commands = $application->all('foo'); $this->assertCount(1, $commands, '->all() takes a namespace as its first argument'); - $application->setCommandLoader(new FactoryCommandLoader(array( + $application->setCommandLoader(new FactoryCommandLoader([ 'foo:bar1' => function () { return new \Foo1Command(); }, - ))); + ])); $commands = $application->all('foo'); $this->assertCount(2, $commands, '->all() takes a namespace as its first argument'); $this->assertInstanceOf(\FooCommand::class, $commands['foo:bar'], '->all() returns the registered commands'); @@ -157,9 +157,9 @@ $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command'); $application = new Application(); - $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command())); + $application->addCommands([$foo = new \FooCommand(), $foo1 = new \Foo1Command()]); $commands = $application->all(); - $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands'); + $this->assertEquals([$foo, $foo1], [$commands['foo:bar'], $commands['foo:bar1']], '->addCommands() registers an array of commands'); } /** @@ -205,9 +205,9 @@ $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); - $application->setCommandLoader(new FactoryCommandLoader(array( + $application->setCommandLoader(new FactoryCommandLoader([ 'foo:bar1' => function () { return new \Foo1Command(); }, - ))); + ])); $this->assertTrue($application->has('afoobar'), '->has() returns true if an instance is registered for an alias even with command loader'); $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns an instance by name even with command loader'); @@ -225,7 +225,7 @@ $application->setCatchExceptions(false); $tester = new ApplicationTester($application); - $tester->run(array('-h' => true, '-q' => true), array('decorated' => false)); + $tester->run(['-h' => true, '-q' => true], ['decorated' => false]); $this->assertEmpty($tester->getDisplay(true)); } @@ -245,7 +245,7 @@ $application = new Application(); $application->add(new \FooCommand()); $application->add(new \Foo1Command()); - $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); + $this->assertEquals(['foo'], $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); } public function testFindNamespace() @@ -367,9 +367,9 @@ public function testFindWithCommandLoader() { $application = new Application(); - $application->setCommandLoader(new FactoryCommandLoader(array( + $application->setCommandLoader(new FactoryCommandLoader([ 'foo:bar' => $f = function () { return new \FooCommand(); }, - ))); + ])); $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists'); $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists'); @@ -400,23 +400,23 @@ public function provideAmbiguousAbbreviations() { - return array( - array('f', 'Command "f" is not defined.'), - array( + return [ + ['f', 'Command "f" is not defined.'], + [ 'a', "Command \"a\" is ambiguous.\nDid you mean one of these?\n". " afoobar The foo:bar command\n". " afoobar1 The foo:bar1 command\n". ' afoobar2 The foo1:bar command', - ), - array( + ], + [ 'foo:b', "Command \"foo:b\" is ambiguous.\nDid you mean one of these?\n". " foo:bar The foo:bar command\n". " foo:bar1 The foo:bar1 command\n". ' foo1:bar The foo1:bar command', - ), - ); + ], + ]; } public function testFindCommandEqualNamespace() @@ -460,10 +460,10 @@ public function provideInvalidCommandNamesSingle() { - return array( - array('foo3:barr'), - array('fooo3:bar'), - ); + return [ + ['foo3:barr'], + ['fooo3:bar'], + ]; } public function testFindAlternativeExceptionMessageMultiple() @@ -521,7 +521,7 @@ $this->fail('->find() throws a CommandNotFoundException if command does not exist'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); - $this->assertSame(array(), $e->getAlternatives()); + $this->assertSame([], $e->getAlternatives()); $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without alternatives'); } @@ -532,7 +532,7 @@ $this->fail('->find() throws a CommandNotFoundException if command does not exist'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); - $this->assertSame(array('afoobar1', 'foo:bar1'), $e->getAlternatives()); + $this->assertSame(['afoobar1', 'foo:bar1'], $e->getAlternatives()); $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"'); $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"'); @@ -543,7 +543,7 @@ public function testFindAlternativeCommandsWithAnAlias() { $fooCommand = new \FooCommand(); - $fooCommand->setAliases(array('foo2')); + $fooCommand->setAliases(['foo2']); $application = new Application(); $application->add($fooCommand); @@ -567,7 +567,7 @@ $this->fail('->find() throws a CommandNotFoundException if namespace does not exist'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist'); - $this->assertSame(array(), $e->getAlternatives()); + $this->assertSame([], $e->getAlternatives()); $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives'); } @@ -596,7 +596,7 @@ $application->add(new \Foo2Command()); $application->add(new \Foo3Command()); - $expectedAlternatives = array( + $expectedAlternatives = [ 'afoobar', 'afoobar1', 'afoobar2', @@ -604,7 +604,7 @@ 'foo3:bar', 'foo:bar', 'foo:bar1', - ); + ]; try { $application->find('foo'); @@ -619,10 +619,10 @@ public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getNamespaces'))->getMock(); + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getNamespaces'])->getMock(); $application->expects($this->once()) ->method('getNamespaces') - ->will($this->returnValue(array('foo:sublong', 'bar:sub'))); + ->will($this->returnValue(['foo:sublong', 'bar:sub'])); $this->assertEquals('foo:sublong', $application->findNamespace('f:sub')); } @@ -649,16 +649,16 @@ $application->setCatchExceptions(true); $this->assertTrue($application->areExceptionsCaught()); - $tester->run(array('command' => 'foo'), array('decorated' => false)); + $tester->run(['command' => 'foo'], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag'); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->setCatchExceptions() sets the catch exception flag'); $this->assertSame('', $tester->getDisplay(true)); $application->setCatchExceptions(false); try { - $tester->run(array('command' => 'foo'), array('decorated' => false)); + $tester->run(['command' => 'foo'], ['decorated' => false]); $this->fail('->setCatchExceptions() sets the catch exception flag'); } catch (\Exception $e) { $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag'); @@ -682,29 +682,29 @@ putenv('COLUMNS=120'); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exception'); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE, 'capture_stderr_separately' => true]); $this->assertContains('Exception trace', $tester->getErrorOutput(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose'); - $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'list', '--foo' => true], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getErrorOutput(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command'); $application->add(new \Foo3Command()); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); + $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]); $this->assertRegExp('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose'); $this->assertRegExp('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose'); $this->assertRegExp('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose'); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => true)); + $tester->run(['command' => 'foo3:bar'], ['decorated' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => true, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo3:bar'], ['decorated' => true, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); $application = new Application(); @@ -712,7 +712,7 @@ putenv('COLUMNS=32'); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal'); putenv('COLUMNS=120'); } @@ -727,10 +727,10 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); - $tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => true, 'capture_stderr_separately' => true]); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); $application = new Application(); @@ -740,7 +740,7 @@ throw new \Exception('コマンドの実行中にエラーが発生しました。'); }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal'); putenv('COLUMNS=120'); } @@ -755,14 +755,14 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false)); + $tester->run(['command' => 'foo'], ['decorated' => false]); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting'); putenv('COLUMNS=120'); } public function testRenderExceptionLineBreaks() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getTerminalWidth'])->getMock(); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -772,7 +772,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false)); + $tester->run(['command' => 'foo'], ['decorated' => false]); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks'); } @@ -785,7 +785,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); + $tester->run(['command' => 'foo'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]); $this->assertContains(sprintf('() at %s:', __FILE__), $tester->getDisplay()); } @@ -796,7 +796,7 @@ $application->setAutoExit(false); $application->setCatchExceptions(false); $application->add($command = new \Foo1Command()); - $_SERVER['argv'] = array('cli.php', 'foo:bar1'); + $_SERVER['argv'] = ['cli.php', 'foo:bar1']; ob_start(); $application->run(); @@ -812,63 +812,63 @@ $this->ensureStaticCommandHelp($application); $tester = new ApplicationTester($application); - $tester->run(array(), array('decorated' => false)); + $tester->run([], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed'); - $tester->run(array('--help' => true), array('decorated' => false)); + $tester->run(['--help' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed'); - $tester->run(array('-h' => true), array('decorated' => false)); + $tester->run(['-h' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed'); - $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false)); + $tester->run(['command' => 'list', '--help' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed'); - $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false)); + $tester->run(['command' => 'list', '-h' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed'); - $tester->run(array('--ansi' => true)); + $tester->run(['--ansi' => true]); $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed'); - $tester->run(array('--no-ansi' => true)); + $tester->run(['--no-ansi' => true]); $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed'); - $tester->run(array('--version' => true), array('decorated' => false)); + $tester->run(['--version' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed'); - $tester->run(array('-V' => true), array('decorated' => false)); + $tester->run(['-V' => true], ['decorated' => false]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed'); - $tester->run(array('command' => 'list', '--quiet' => true)); + $tester->run(['command' => 'list', '--quiet' => true]); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed'); $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed'); - $tester->run(array('command' => 'list', '-q' => true)); + $tester->run(['command' => 'list', '-q' => true]); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed'); $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed'); - $tester->run(array('command' => 'list', '--verbose' => true)); + $tester->run(['command' => 'list', '--verbose' => true]); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed'); - $tester->run(array('command' => 'list', '--verbose' => 1)); + $tester->run(['command' => 'list', '--verbose' => 1]); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed'); - $tester->run(array('command' => 'list', '--verbose' => 2)); + $tester->run(['command' => 'list', '--verbose' => 2]); $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed'); - $tester->run(array('command' => 'list', '--verbose' => 3)); + $tester->run(['command' => 'list', '--verbose' => 3]); $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to debug if --verbose=3 is passed'); - $tester->run(array('command' => 'list', '--verbose' => 4)); + $tester->run(['command' => 'list', '--verbose' => 4]); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if unknown --verbose level is passed'); - $tester->run(array('command' => 'list', '-v' => true)); + $tester->run(['command' => 'list', '-v' => true]); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - $tester->run(array('command' => 'list', '-vv' => true)); + $tester->run(['command' => 'list', '-vv' => true]); $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - $tester->run(array('command' => 'list', '-vvv' => true)); + $tester->run(['command' => 'list', '-vvv' => true]); $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); $application = new Application(); @@ -877,10 +877,10 @@ $application->add(new \FooCommand()); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false)); + $tester->run(['command' => 'foo:bar', '--no-interaction' => true], ['decorated' => false]); $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed'); - $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false)); + $tester->run(['command' => 'foo:bar', '-n' => true], ['decorated' => false]); $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed'); } @@ -900,12 +900,12 @@ $output = new StreamOutput(fopen('php://memory', 'w', false)); - $input = new ArgvInput(array('cli.php', '-v', 'foo:bar')); + $input = new ArgvInput(['cli.php', '-v', 'foo:bar']); $application->run($input, $output); $this->addToAssertionCount(1); - $input = new ArgvInput(array('cli.php', '--verbose', 'foo:bar')); + $input = new ArgvInput(['cli.php', '--verbose', 'foo:bar']); $application->run($input, $output); $this->addToAssertionCount(1); @@ -915,13 +915,13 @@ { $exception = new \Exception('', 4); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock(); + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock(); $application->setAutoExit(false); $application->expects($this->once()) ->method('doRun') ->willThrowException($exception); - $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); + $exitCode = $application->run(new ArrayInput([]), new NullOutput()); $this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception'); } @@ -945,7 +945,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'test')); + $tester->run(['command' => 'test']); $this->assertTrue($passedRightValue, '-> exit code 4 was passed in the console.terminate event'); } @@ -954,13 +954,13 @@ { $exception = new \Exception('', 0); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock(); + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock(); $application->setAutoExit(false); $application->expects($this->once()) ->method('doRun') ->willThrowException($exception); - $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); + $exitCode = $application->run(new ArrayInput([]), new NullOutput()); $this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0'); } @@ -984,7 +984,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'test')); + $tester->run(['command' => 'test']); $this->assertTrue($passedRightValue, '-> exit code 1 was passed in the console.terminate event'); } @@ -1005,12 +1005,12 @@ $application ->register('foo') - ->setAliases(array('f')) - ->setDefinition(array(new InputOption('survey', 'e', InputOption::VALUE_REQUIRED, 'My option with a shortcut.'))) + ->setAliases(['f']) + ->setDefinition([new InputOption('survey', 'e', InputOption::VALUE_REQUIRED, 'My option with a shortcut.')]) ->setCode(function (InputInterface $input, OutputInterface $output) {}) ; - $input = new ArrayInput(array('command' => 'foo')); + $input = new ArrayInput(['command' => 'foo']); $output = new NullOutput(); $application->run($input, $output); @@ -1027,22 +1027,22 @@ $application->setCatchExceptions(false); $application ->register('foo') - ->setDefinition(array($def)) + ->setDefinition([$def]) ->setCode(function (InputInterface $input, OutputInterface $output) {}) ; - $input = new ArrayInput(array('command' => 'foo')); + $input = new ArrayInput(['command' => 'foo']); $output = new NullOutput(); $application->run($input, $output); } public function getAddingAlreadySetDefinitionElementData() { - return array( - array(new InputArgument('command', InputArgument::REQUIRED)), - array(new InputOption('quiet', '', InputOption::VALUE_NONE)), - array(new InputOption('query', 'q', InputOption::VALUE_NONE)), - ); + return [ + [new InputArgument('command', InputArgument::REQUIRED)], + [new InputOption('quiet', '', InputOption::VALUE_NONE)], + [new InputOption('query', 'q', InputOption::VALUE_NONE)], + ]; } public function testGetDefaultHelperSetReturnsDefaultValues() @@ -1062,7 +1062,7 @@ $application->setAutoExit(false); $application->setCatchExceptions(false); - $application->setHelperSet(new HelperSet(array(new FormatterHelper()))); + $application->setHelperSet(new HelperSet([new FormatterHelper()])); $helperSet = $application->getHelperSet(); @@ -1079,7 +1079,7 @@ $application->setAutoExit(false); $application->setCatchExceptions(false); - $application->setHelperSet(new HelperSet(array(new FormatterHelper()))); + $application->setHelperSet(new HelperSet([new FormatterHelper()])); $helperSet = $application->getHelperSet(); @@ -1137,7 +1137,7 @@ $application->setAutoExit(false); $application->setCatchExceptions(false); - $application->setDefinition(new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')))); + $application->setDefinition(new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')])); $inputDefinition = $application->getDefinition(); @@ -1166,7 +1166,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); $this->assertEquals('before.foo.after.'.PHP_EOL, $tester->getDisplay()); } @@ -1186,7 +1186,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); } public function testRunDispatchesAllEventsWithException() @@ -1202,7 +1202,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); $this->assertContains('before.foo.error.after.', $tester->getDisplay()); } @@ -1222,7 +1222,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); $this->assertContains('before.error.after.', $tester->getDisplay()); } @@ -1244,7 +1244,7 @@ $tester = new ApplicationTester($application); try { - $tester->run(array('command' => 'dym')); + $tester->run(['command' => 'dym']); $this->fail('Error expected.'); } catch (\Error $e) { $this->assertSame('dymerr', $e->getMessage()); @@ -1273,7 +1273,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); $this->assertContains('before.error.silenced.after.', $tester->getDisplay()); $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $tester->getStatusCode()); } @@ -1292,7 +1292,7 @@ $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'unknown')); + $tester->run(['command' => 'unknown']); $this->assertContains('silenced command not found', $tester->getDisplay()); $this->assertEquals(1, $tester->getStatusCode()); } @@ -1319,7 +1319,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); + $tester->run(['command' => 'foo']); $this->assertContains('before.caught.error.after.', $tester->getDisplay()); $this->assertContains('replaced in caught.', $tester->getDisplay()); } @@ -1341,7 +1341,7 @@ $tester = new ApplicationTester($application); try { - $tester->run(array('command' => 'dym')); + $tester->run(['command' => 'dym']); $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); } catch (\Error $e) { $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); @@ -1367,7 +1367,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dym')); + $tester->run(['command' => 'dym']); $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); } @@ -1387,7 +1387,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dym')); + $tester->run(['command' => 'dym']); $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); } @@ -1407,7 +1407,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dus')); + $tester->run(['command' => 'dus']); $this->assertSame(1, $tester->getStatusCode(), 'Status code should be 1'); } @@ -1422,7 +1422,7 @@ }); $tester = new ApplicationTester($application); - $exitCode = $tester->run(array('command' => 'foo')); + $exitCode = $tester->run(['command' => 'foo']); $this->assertContains('before.after.', $tester->getDisplay()); $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); } @@ -1449,7 +1449,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo', '--no-interaction' => true)); + $tester->run(['command' => 'foo', '--no-interaction' => true]); $this->assertTrue($noInteractionValue); $this->assertFalse($quietValue); @@ -1479,7 +1479,7 @@ }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo', '--extra' => 'some test value')); + $tester->run(['command' => 'foo', '--extra' => 'some test value']); $this->assertEquals('some test value', $extraValue); } @@ -1499,7 +1499,7 @@ } $application->setTerminalDimensions($width, 80); - $this->assertSame(array($width, 80), $application->getTerminalDimensions()); + $this->assertSame([$width, 80], $application->getTerminalDimensions()); } public function testSetRunCustomDefaultCommand() @@ -1512,14 +1512,14 @@ $application->setDefaultCommand($command->getName()); $tester = new ApplicationTester($application); - $tester->run(array(), array('interactive' => false)); + $tester->run([], ['interactive' => false]); $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); $application = new CustomDefaultCommandApplication(); $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array(), array('interactive' => false)); + $tester->run([], ['interactive' => false]); $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); } @@ -1534,7 +1534,7 @@ $application->setDefaultCommand($command->getName()); $tester = new ApplicationTester($application); - $tester->run(array('--fooopt' => 'opt'), array('interactive' => false)); + $tester->run(['--fooopt' => 'opt'], ['interactive' => false]); $this->assertEquals('called'.PHP_EOL.'opt'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); } @@ -1550,10 +1550,10 @@ $tester = new ApplicationTester($application); - $tester->run(array()); + $tester->run([]); $this->assertContains('called', $tester->getDisplay()); - $tester->run(array('--help' => true)); + $tester->run(['--help' => true]); $this->assertContains('The foo:bar command', $tester->getDisplay()); } @@ -1566,9 +1566,9 @@ $application->setAutoExit(false); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'help')); + $tester->run(['command' => 'help']); - $this->assertFalse($tester->getInput()->hasParameterOption(array('--no-interaction', '-n'))); + $this->assertFalse($tester->getInput()->hasParameterOption(['--no-interaction', '-n'])); $inputStream = $tester->getInput()->getStream(); $this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream)); @@ -1580,9 +1580,9 @@ $container->addCompilerPass(new AddConsoleCommandPass()); $container ->register('lazy-command', LazyCommand::class) - ->addTag('console.command', array('command' => 'lazy:command')) - ->addTag('console.command', array('command' => 'lazy:alias')) - ->addTag('console.command', array('command' => 'lazy:alias2')); + ->addTag('console.command', ['command' => 'lazy:command']) + ->addTag('console.command', ['command' => 'lazy:alias']) + ->addTag('console.command', ['command' => 'lazy:alias2']); $container->compile(); $application = new Application(); @@ -1591,17 +1591,17 @@ $tester = new ApplicationTester($application); - $tester->run(array('command' => 'lazy:command')); + $tester->run(['command' => 'lazy:command']); $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); - $tester->run(array('command' => 'lazy:alias')); + $tester->run(['command' => 'lazy:alias']); $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); - $tester->run(array('command' => 'lazy:alias2')); + $tester->run(['command' => 'lazy:alias2']); $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); $command = $application->get('lazy:command'); - $this->assertSame(array('lazy:alias', 'lazy:alias2'), $command->getAliases()); + $this->assertSame(['lazy:alias', 'lazy:alias2'], $command->getAliases()); } /** @@ -1610,21 +1610,21 @@ public function testGetDisabledLazyCommand() { $application = new Application(); - $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); }))); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); $application->get('disabled'); } public function testHasReturnsFalseForDisabledLazyCommand() { $application = new Application(); - $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); }))); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); $this->assertFalse($application->has('disabled')); } public function testAllExcludesDisabledLazyCommand() { $application = new Application(); - $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); }))); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); $this->assertArrayNotHasKey('disabled', $application->all()); } @@ -1670,7 +1670,7 @@ $tester = new ApplicationTester($application); try { - $tester->run(array('command' => 'dym')); + $tester->run(['command' => 'dym']); $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); } catch (\Error $e) { $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); @@ -1694,7 +1694,7 @@ */ protected function getDefaultInputDefinition() { - return new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'))); + return new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')]); } /** @@ -1704,7 +1704,7 @@ */ protected function getDefaultHelperSet() { - return new HelperSet(array(new FormatterHelper())); + return new HelperSet([new FormatterHelper()]); } } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/CommandTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/CommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/CommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/CommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -71,7 +71,7 @@ $ret = $command->setDefinition($definition = new InputDefinition()); $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface'); $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance'); - $command->setDefinition(array(new InputArgument('foo'), new InputOption('bar'))); + $command->setDefinition([new InputArgument('foo'), new InputOption('bar')]); $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); $command->setDefinition(new InputDefinition()); @@ -130,10 +130,10 @@ public function provideInvalidCommandNames() { - return array( - array(''), - array('foo:'), - ); + return [ + [''], + ['foo:'], + ]; } public function testGetSetDescription() @@ -179,10 +179,10 @@ public function testGetSetAliases() { $command = new \TestCommand(); - $this->assertEquals(array('name'), $command->getAliases(), '->getAliases() returns the aliases'); - $ret = $command->setAliases(array('name1')); + $this->assertEquals(['name'], $command->getAliases(), '->getAliases() returns the aliases'); + $ret = $command->setAliases(['name1']); $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface'); - $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases'); + $this->assertEquals(['name1'], $command->getAliases(), '->setAliases() sets the aliases'); } public function testSetAliasesNull() @@ -231,11 +231,11 @@ public function testMergeApplicationDefinition() { $application1 = new Application(); - $application1->getDefinition()->addArguments(array(new InputArgument('foo'))); - $application1->getDefinition()->addOptions(array(new InputOption('bar'))); + $application1->getDefinition()->addArguments([new InputArgument('foo')]); + $application1->getDefinition()->addOptions([new InputOption('bar')]); $command = new \TestCommand(); $command->setApplication($application1); - $command->setDefinition($definition = new InputDefinition(array(new InputArgument('bar'), new InputOption('foo')))); + $command->setDefinition($definition = new InputDefinition([new InputArgument('bar'), new InputOption('foo')])); $r = new \ReflectionObject($command); $m = $r->getMethod('mergeApplicationDefinition'); @@ -253,11 +253,11 @@ public function testMergeApplicationDefinitionWithoutArgsThenWithArgsAddsArgs() { $application1 = new Application(); - $application1->getDefinition()->addArguments(array(new InputArgument('foo'))); - $application1->getDefinition()->addOptions(array(new InputOption('bar'))); + $application1->getDefinition()->addArguments([new InputArgument('foo')]); + $application1->getDefinition()->addOptions([new InputOption('bar')]); $command = new \TestCommand(); $command->setApplication($application1); - $command->setDefinition($definition = new InputDefinition(array())); + $command->setDefinition($definition = new InputDefinition([])); $r = new \ReflectionObject($command); $m = $r->getMethod('mergeApplicationDefinition'); @@ -277,7 +277,7 @@ { $tester = new CommandTester(new \TestCommand()); - $tester->execute(array(), array('interactive' => true)); + $tester->execute([], ['interactive' => true]); $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive'); } @@ -286,7 +286,7 @@ { $tester = new CommandTester(new \TestCommand()); - $tester->execute(array(), array('interactive' => false)); + $tester->execute([], ['interactive' => false]); $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive'); } @@ -309,7 +309,7 @@ { $command = new \TestCommand(); $tester = new CommandTester($command); - $tester->execute(array('--bar' => true)); + $tester->execute(['--bar' => true]); } public function testRunReturnsIntegerExitCode() @@ -318,7 +318,7 @@ $exitCode = $command->run(new StringInput(''), new NullOutput()); $this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)'); - $command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock(); + $command = $this->getMockBuilder('TestCommand')->setMethods(['execute'])->getMock(); $command->expects($this->once()) ->method('execute') ->will($this->returnValue('2.3')); @@ -364,16 +364,16 @@ }); $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); $tester = new CommandTester($command); - $tester->execute(array()); + $tester->execute([]); $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); } public function getSetCodeBindToClosureTests() { - return array( - array(true, 'not bound to the command'), - array(false, 'bound to the command'), - ); + return [ + [true, 'not bound to the command'], + [false, 'bound to the command'], + ]; } /** @@ -389,7 +389,7 @@ $command = new \TestCommand(); $command->setCode($code); $tester = new CommandTester($command); - $tester->execute(array()); + $tester->execute([]); $this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay()); } @@ -398,7 +398,7 @@ $command = new \TestCommand(); $command->setCode(self::createClosure()); $tester = new CommandTester($command); - $tester->execute(array()); + $tester->execute([]); if (\PHP_VERSION_ID < 70000) { // Cannot bind static closures in PHP 5 @@ -419,10 +419,10 @@ public function testSetCodeWithNonClosureCallable() { $command = new \TestCommand(); - $ret = $command->setCode(array($this, 'callableMethodCommand')); + $ret = $command->setCode([$this, 'callableMethodCommand']); $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); $tester = new CommandTester($command); - $tester->execute(array()); + $tester->execute([]); $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -24,7 +24,7 @@ $command = new HelpCommand(); $command->setApplication(new Application()); $commandTester = new CommandTester($command); - $commandTester->execute(array('command_name' => 'li'), array('decorated' => false)); + $commandTester->execute(['command_name' => 'li'], ['decorated' => false]); $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); @@ -35,7 +35,7 @@ $command = new HelpCommand(); $commandTester = new CommandTester($command); $command->setCommand(new ListCommand()); - $commandTester->execute(array(), array('decorated' => false)); + $commandTester->execute([], ['decorated' => false]); $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); @@ -46,7 +46,7 @@ $command = new HelpCommand(); $commandTester = new CommandTester($command); $command->setCommand(new ListCommand()); - $commandTester->execute(array('--format' => 'xml')); + $commandTester->execute(['--format' => 'xml']); $this->assertContains('getDisplay(), '->execute() returns an XML help text if --xml is passed'); } @@ -54,7 +54,7 @@ { $application = new Application(); $commandTester = new CommandTester($application->get('help')); - $commandTester->execute(array('command_name' => 'list')); + $commandTester->execute(['command_name' => 'list']); $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); @@ -64,7 +64,7 @@ { $application = new Application(); $commandTester = new CommandTester($application->get('help')); - $commandTester->execute(array('command_name' => 'list', '--format' => 'xml')); + $commandTester->execute(['command_name' => 'list', '--format' => 'xml']); $this->assertContains('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('getDisplay(), '->execute() returns an XML help text if --format=xml is passed'); } diff -Nru symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php --- symfony-3.4.21+dfsg/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php 2019-01-06 15:54:26.000000000 +0000 +++ symfony-3.4.22+dfsg/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php 2019-02-03 12:23:08.000000000 +0000 @@ -21,7 +21,7 @@ { $application = new Application(); $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName()), array('decorated' => false)); + $commandTester->execute(['command' => $command->getName()], ['decorated' => false]); $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); } @@ -30,7 +30,7 @@ { $application = new Application(); $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName(), '--format' => 'xml')); + $commandTester->execute(['command' => $command->getName(), '--format' => 'xml']); $this->assertRegExp('/