diff --git a/.composer-auth.json b/.composer-auth.json
new file mode 100644
index 0000000000000..bf40540cc644c
--- /dev/null
+++ b/.composer-auth.json
@@ -0,0 +1,7 @@
+{
+ "github-oauth": {
+ "github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS",
+ "github.com": "This token is reserved for testing the symfony/symfony repository",
+ "github.com": "52270bad1071a099c8d24629f2db2b7f07db960d"
+ }
+}
diff --git a/.php_cs b/.php_cs
index 11d42d1287e47..290e9bf5fbcba 100644
--- a/.php_cs
+++ b/.php_cs
@@ -24,5 +24,7 @@ return Symfony\CS\Config\Config::create()
->notPath('src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml')
// test template
->notPath('src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
+ // explicit heredoc test
+ ->notPath('src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
)
;
diff --git a/.travis.yml b/.travis.yml
index ac722f4db2cd4..6da2fb04da51c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,17 +30,19 @@ services: mongodb
before_install:
- if [[ ! $deps && ! $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; fi;
- - if [[ ! $deps && ! -d php-$MIN_PHP/sapi ]]; then wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj; (cd php-$MIN_PHP; ./configure --enable-sigchild --enable-pcntl; make -j2); fi;
+ - if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj; (cd php-$MIN_PHP; ./configure --enable-sigchild --enable-pcntl; make -j2); fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
- echo memory_limit = -1 >> $INI_FILE
- echo session.gc_probability = 0 >> $INI_FILE
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE) || echo "Let's continue without apcu extension"; fi;
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
+ - if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* && ! $deps ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi;
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
+ - if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
- if [[ $deps != skip ]]; then composer self-update; fi;
- if [[ $deps != skip ]]; then ./phpunit install; fi;
- export PHPUNIT=$(readlink -f ./phpunit)
@@ -49,16 +51,16 @@ install:
- if [[ $deps != skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
- if [[ $deps != skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi;
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi;
- - if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi;
+ - if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
- if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi;
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
- - if [[ ! $deps ]]; then composer --prefer-source install; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
+ - if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
script:
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
- - if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | parallel --gnu 'echo -e "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi;
- - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
- - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
+ - if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi;
+ - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
+ - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
- if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi;
diff --git a/CHANGELOG-3.0.md b/CHANGELOG-3.0.md
index da9b973fda50d..4f119cb3603da 100644
--- a/CHANGELOG-3.0.md
+++ b/CHANGELOG-3.0.md
@@ -7,6 +7,103 @@ in 3.0 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.0.0...v3.0.1
+* 3.0.2 (2016-02-03)
+
+ * bug #17658 [FrameworkBundle] fix assets and templating tests (xabbuh)
+ * bug #17596 [Translation] Add resources from fallback locale to parent catalogue (c960657)
+ * bug #17605 [FrameworkBundle] remove default null value for asset version (xabbuh)
+ * bug #17606 [DependencyInjection] pass triggerDeprecationError arg to parent class (xabbuh)
+ * bug #16956 [DependencyInjection] XmlFileLoader: enforce tags to have a name (xabbuh)
+ * bug #16265 [BrowserKit] Corrected HTTP_HOST logic (Naktibalda)
+ * bug #17559 [SecurityBundle] Fix HTTP Digest auth not being passed user checker (SamFleming)
+ * bug #17554 [DependencyInjection] resolve aliases in factories (xabbuh)
+ * bug #17555 [DependencyInjection] resolve aliases in factory services (xabbuh)
+ * bug #17511 [Form] ArrayChoiceList can now deal with a null in choices (issei-m)
+ * bug #17430 [Serializer] Ensure that groups are strings (dunglas)
+ * bug #16795 [FrameworkBundle][Validator] Fix apc cache service & config (ogizanagi)
+ * bug #15272 [FrameworkBundle] Fix template location for PHP templates (jakzal)
+ * bug #11232 [Routing] Fixes fatal errors with object resources in AnnotationDirectoryLoader::supports (Tischoi)
+ * bug #17526 Escape the delimiter in Glob::toRegex (javiereguiluz)
+ * bug #17527 fixed undefined variable (fabpot)
+ * bug #15706 [framework-bundle] Added support for the `0.0.0.0/0` trusted proxy (zerkms)
+ * bug #16274 [HttpKernel] Lookup the response even if the lock was released after two second wait (jakzal)
+ * bug #16954 [TranslationUpdateCommand] fixed undefined resultMessage var. (aitboudad)
+ * bug #17355 [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument (xavismeh)
+ * bug #17330 Limit the max height/width of icons in the profiler menu (javiereguiluz)
+ * bug #17454 Allow absolute URLs to be displayed in the debug toolbar (javiereguiluz)
+ * bug #16736 [Request] Ignore invalid IP addresses sent by proxies (GromNaN)
+ * bug #17459 [EventDispatcher] TraceableEventDispatcher resets event listener priorities (c960657)
+ * bug #17486 [FrameworkBundle] Throw for missing container extensions (kix)
+ * bug #16961 Overriding profiler position in CSS breaks JS positioning (aschempp)
+ * bug #16873 Able to load big xml files with DomCrawler (zorn-v)
+ * bug #16897 [Form] Fix constraints could be null if not set (DZunke)
+ * bug #16912 [Translation][Writer] avoid calling setBackup if the dumper is not FileDumper (aitboudad)
+ * bug #17505 sort bundles in config:dump-reference command (xabbuh)
+ * bug #17506 [FrameworkBundle] enable assets when templates are enabled (xabbuh)
+ * bug #17514 [Asset] Add defaultNull to version configuration (ewgRa)
+ * bug #16511 [Asset] Ability to set empty version strategy in packages (ewgRa)
+ * bug #17457 Display Ajax requests from newest to oldest in the toolbar (javiereguiluz)
+ * bug #17503 [Asset] CLI: use request context to generate absolute URLs (xabbuh)
+ * bug #17478 [HttpFoundation] Do not overwrite the Authorization header if it is already set (jakzal)
+ * bug #17461 [Yaml] tag for dumped PHP objects must be a local one (xabbuh)
+ * bug #16822 [FrameworkBundle][Validator] Fix apc cache service deprecation (ogizanagi)
+ * bug #17463 [Form] make tests compatible with Symfony 2.8 and 3.0 (xabbuh)
+ * bug #17456 [DX] Remove default match from AbstractConfigCommand::findExtension (kix)
+ * bug #17455 Fixed form types in profiler (javiereguiluz)
+ * bug #17424 [Process] Update in 2.7 for stream-based output storage (romainneutron)
+ * bug #17417 Fixed the form profiler when using long form types (javiereguiluz)
+ * bug #17423 [Process] Use stream based storage to avoid memory issues (romainneutron)
+ * bug #17041 [FrameworkBundle] Added the assets helper again (dosten)
+ * bug #17406 [Form] ChoiceType: Fix a notice when 'choices' normalizer is replaced (paradajozsef)
+ * bug #17433 [FrameworkBundle] Don't log twice with the error handler (nicolas-grekas)
+ * bug #17418 Fixed Bootstrap form theme form "reset" buttons (javiereguiluz)
+ * bug #17416 [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn'… (dunglas)
+ * bug #17404 fix merge 2.3 into 2.7 for SecureRandom dependency (Tobion)
+ * bug #17373 [SecurityBundle] fix SecureRandom service constructor args (Tobion)
+ * bug #17397 Remove remaining calls to non-existing method (paradajozsef)
+ * bug #17382 [TwigBridge] Use label_format option for checkbox and radio labels (enumag)
+ * bug #17380 [TwigBridge] Use label_format option for checkbox and radio labels (enumag)
+ * bug #17377 Fix performance (PHP5) and memory (PHP7) issues when using token_get_all (nicolas-grekas, peteward)
+ * bug #17389 [Routing] Fixed correct class name in thrown exception (fixes #17388) (robinvdvleuten)
+ * bug #17358 [ClassLoader] Use symfony/polyfill-apcu (nicolas-grekas)
+ * bug #17370 [HttpFoundation][Cookie] Cookie DateTimeInterface fix (wildewouter)
+ * security #17359 do not ship with a custom rng implementation (xabbuh, fabpot)
+ * bug #17253 [Console] HHVM read input stream bug (mbutkereit)
+ * bug #17314 Fix max width for multibyte keys in choice question (mheki)
+ * bug #17326 [Console] Display console application name even when no version set (polc)
+ * bug #17328 [Serializer] Allow to use proxies in object_to_populate (dunglas)
+ * bug #17202 [FrameworkBundle] Don't log twice with the error handler (nicolas-grekas)
+ * bug #17347 Workaround https://bugs.php.net/63206 (nicolas-grekas)
+ * bug #17340 [HttpFoundation] Fixed Request HTTP_USER_AGENT on 3.X versions (davelima)
+ * bug #17199 [Serializer] Allow context to contain not serializable data (dunglas, nicolas-grekas)
+ * bug #17334 [WebProfiler] Fixed sf-minitoolbar height (yceruto)
+ * bug #17140 [Serializer] Remove normalizer cache in Serializer class (jvasseur)
+ * bug #17320 [Debug] Fixed erroneous deprecation notice for extended Interfaces (peterrehm)
+ * bug #17307 [FrameworkBundle] Fix paths with % in it (like urlencoded) (scaytrase)
+ * bug #17078 [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator (Disparity)
+ * bug #17298 [FrameworkBundle] Use proper class to fetch $versionStrategy property (dosten)
+ * bug #17287 [HttpKernel] Forcing string comparison on query parameters sort in UriSigner (Tim van Densen)
+ * bug #17279 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
+ * bug #17278 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
+ * bug #17063 bug #14246 [Filesystem] dumpFile() negates default file permissions (Hidde Boomsma)
+ * bug #17283 [WebProfilerBundle] Remove loading status from AJAX toolbar after error (kucharovic)
+ * bug #17275 [PhpUnitBridge] Re-enable the garbage collector (nicolas-grekas)
+ * bug #17276 [Process] Fix potential race condition (nicolas-grekas)
+ * bug #17261 [FrameworkBundle] Allow to autowire service_container (dunglas)
+ * bug #17183 [FrameworkBundle] Set the kernel.name properly after a cache warmup (jakzal)
+ * bug #17197 [Yaml] cast arrays to objects after parsing has finished (xabbuh)
+ * bug #17247 Fix toolbar display when nvd3 is loaded on page (Seldaek)
+ * bug #17159 [Yaml] recognize when a block scalar is left (xabbuh)
+ * bug #17195 bug #14246 [Filesystem] dumpFile() non atomic (Hidde Boomsma)
+ * feature #16747 [Form] Improved performance of ChoiceType and its subtypes (webmozart)
+ * bug #17179 [WebProfiler] Removed an object as route generator argument (iltar)
+ * bug #17177 [Process] Fix potential race condition leading to transient tests (nicolas-grekas)
+ * bug #17163 [Form] fix Catchable Fatal Error if choices is not an array (Gladhon, nicolas-grekas)
+ * bug #17152 [DoctrineBridge] [PropertyInfo] Catch Doctrine\ORM\Mapping\MappingException (dunglas)
+ * bug #17119 [Form] improve deprecation message for "empty_value" and "choice_list" options. (hhamon)
+ * bug #17156 [HttpFoundation] add missing symfony/polyfill-php55 dependency (xabbuh)
+ * bug #17162 [Form] Fix regression on Collection type (hason)
+
* 3.0.1 (2015-12-26)
* bug #16864 [Yaml] fix indented line handling in folded blocks (xabbuh)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9b30d35c1a0ae..5786f19dde7d6 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -13,8 +13,8 @@ Symfony is the result of the work of many people who made the code better
- Christophe Coevoet (stof)
- Johannes S (johannes)
- Kris Wallsmith (kriswallsmith)
- - Jakub Zalas (jakubzalas)
- Christian Flothmann (xabbuh)
+ - Jakub Zalas (jakubzalas)
- Ryan Weaver (weaverryan)
- Pascal Borreli (pborreli)
- Hugo Hamon (hhamon)
@@ -30,8 +30,8 @@ Symfony is the result of the work of many people who made the code better
- Martin Hasoň (hason)
- Wouter De Jong (wouterj)
- Eriksen Costa (eriksencosta)
- - Grégoire Pineau (lyrixx)
- Javier Eguiluz (javier.eguiluz)
+ - Grégoire Pineau (lyrixx)
- Kévin Dunglas (dunglas)
- Jonathan Wage (jwage)
- Alexandre Salomé (alexandresalome)
@@ -49,17 +49,17 @@ Symfony is the result of the work of many people who made the code better
- Konstantin Kudryashov (everzet)
- Bilal Amarni (bamarni)
- Florin Patan (florinpatan)
+ - Maxime Steinhausser (ogizanagi)
- Eric Clemmons (ericclemmons)
- Andrej Hudec (pulzarraider)
- - Maxime Steinhausser (ogizanagi)
- Deni
- Henrik Westphal (snc)
- Dariusz Górecki (canni)
- Gábor Egyed (1ed)
- Christian Raue
+ - Michel Weimerskirch (mweimerskirch)
- Arnout Boks (aboks)
- Kevin Bond (kbond)
- - Michel Weimerskirch (mweimerskirch)
- Douglas Greenshields (shieldo)
- Lee McDermott
- Brandon Turner
@@ -67,57 +67,60 @@ Symfony is the result of the work of many people who made the code better
- Daniel Holmes (dholmes)
- Bart van den Burg (burgov)
- Jordan Alliot (jalliot)
+ - Matthias Pigulla (mpdude)
- John Wards (johnwards)
- Fran Moreno (franmomu)
- Antoine Hérault (herzult)
- Toni Uebernickel (havvg)
- - Matthias Pigulla (mpdude)
- Arnaud Le Blanc (arnaud-lb)
- Tim Nagel (merk)
- Brice BERNARD (brikou)
+ - Graham Campbell (graham)
- Jérôme Tamarelle (gromnan)
- marc.weistroff
+ - Michal Piotrowski (eventhorizon)
- lenar
- - Graham Campbell (graham)
- Włodzimierz Gajda (gajdaw)
- Florian Voutzinos (florianv)
+ - Peter Rehm (rpet)
- Colin Frei
+ - Dariusz Ruminski
- Adrien Brault (adrienbrault)
- excelwebzone
- Jacob Dreesen (jdreesen)
- - Michal Piotrowski (eventhorizon)
- Peter Kokot (maastermedia)
- Fabien Pennequin (fabienpennequin)
- - Peter Rehm (rpet)
- Pierre du Plessis (pierredup)
- Alexander Schwenn (xelaris)
- Gordon Franke (gimler)
+ - Iltar van der Berg (kjarli)
- Robert Schönthal (digitalkaoz)
- Jérémy DERUSSÉ (jderusse)
- - Dariusz Ruminski
- Joshua Thijssen
- Stefano Sala (stefano.sala)
- David Buchmann (dbu)
- Issei Murasawa (issei_m)
- - Iltar van der Berg (kjarli)
- Juti Noppornpitak (shiroyuki)
- Eric GELOEN (gelo)
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto)
+ - Vladimir Reznichenko (kalessil)
- Guilherme Blanco (guilhermeblanco)
- Pablo Godel (pgodel)
- - Vladimir Reznichenko (kalessil)
+ - Tigran Azatyan (tigranazatyan)
- Jérémie Augustin (jaugustin)
- Sebastiaan Stok (sstok)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
- - Tigran Azatyan (tigranazatyan)
+ - Alexander M. Turek (derrabus)
- Richard Shank (iampersistent)
+ - Charles Sarrazin (csarrazi)
- Clemens Tolboom
- Helmer Aaviksoo
- Baptiste Clavié (talus)
- Tugdual Saunier (tucksaun)
+ - Andréia Bohner (andreia)
- Hiromi Hishida (77web)
- Matthieu Ouellette-Vachon (maoueh)
- Michał Pipa (michal.pipa)
@@ -125,9 +128,7 @@ Symfony is the result of the work of many people who made the code better
- Jonathan Ingram (jonathaningram)
- Artur Kotyrba
- Rouven Weßling (realityking)
- - Charles Sarrazin (csarrazi)
- Warnar Boekkooi (boekkooi)
- - Andréia Bohner (andreia)
- Dmitrii Chekaliuk (lazyhammer)
- Clément JOBEILI (dator)
- Dorian Villet (gnutix)
@@ -135,19 +136,20 @@ Symfony is the result of the work of many people who made the code better
- Richard Miller (mr_r_miller)
- hacfi (hifi)
- Mario A. Alvarez Garcia (nomack84)
+ - Thomas Rabaix (rande)
- Dennis Benkert (denderello)
- - Alexander M. Turek (derrabus)
- Konstantin Myakshin (koc)
- Benjamin Dulau (dbenjamin)
- Andreas Hucks (meandmymonkey)
- Mikael Pajunen
- Noel Guilbert (noel)
- Joel Wurtz (brouznouf)
+ - Evgeniy (ewgraf)
- bronze1man
- sun (sun)
- Larry Garfield (crell)
- Martin Schuhfuß (usefulthink)
- - Thomas Rabaix (rande)
+ - Jáchym Toušek
- Matthieu Bontemps (mbontemps)
- Pierre Minnieur (pminnieur)
- fivestar
@@ -163,10 +165,8 @@ Symfony is the result of the work of many people who made the code better
- Lars Strojny (lstrojny)
- Daniel Wehner
- Rui Marinho (ruimarinho)
- - Evgeniy (ewgraf)
- Julien Brochet (mewt)
- Sergey Linnik (linniksa)
- - Jáchym Toušek
- Marcel Beerta (mazen)
- Vincent AUBERT (vincent)
- julien pauli (jpauli)
@@ -177,6 +177,7 @@ Symfony is the result of the work of many people who made the code better
- Elnur Abdurrakhimov (elnur)
- Manuel Reinhard (sprain)
- Danny Berger (dpb587)
+ - Diego Saint Esteben (dosten)
- Roman Marintšenko (inori)
- Xavier Montaña Carreras (xmontana)
- Chris Wilkinson (thewilkybarkid)
@@ -207,7 +208,6 @@ Symfony is the result of the work of many people who made the code better
- Ruben Gonzalez (rubenrua)
- Marcos Sánchez
- Kim Hemsø Rasmussen (kimhemsoe)
- - Diego Saint Esteben (dosten)
- Tom Van Looy (tvlooy)
- Wouter Van Hecke
- Peter Kruithof (pkruithof)
@@ -237,6 +237,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Decavele (jandc)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
+ - Titouan Galopin (tgalopin)
- Tiago Ribeiro (fixe)
- Bob den Otter (bopp)
- Adrian Rudnik (kreischweide)
@@ -244,6 +245,7 @@ Symfony is the result of the work of many people who made the code better
- Julien Galenski (ruian)
- Bongiraud Dominique
- janschoenherr
+ - Jannik Zschiesche (apfelbox)
- Thomas Schulz (king2500)
- Marco Pivetta (ocramius)
- Ricard Clau (ricardclau)
@@ -252,6 +254,7 @@ Symfony is the result of the work of many people who made the code better
- Erin Millard
- Matthew Lewinski (lewinski)
- Antonio J. García Lagar (ajgarlag)
+ - Roumen Damianoff (roumen)
- alquerci
- Francesco Levorato
- Vitaliy Zakharov (zakharovvi)
@@ -273,7 +276,9 @@ Symfony is the result of the work of many people who made the code better
- Stéphane PY (steph_py)
- Philipp Kräutli (pkraeutli)
- Kirill chEbba Chebunin (chebba)
+ - Filippo Tessarotto
- Greg Thornton (xdissent)
+ - jeremyFreeAgent (jeremyfreeagent)
- Costin Bereveanu (schniper)
- Loïc Chardonnet (gnusat)
- Marek Kalnik (marekkalnik)
@@ -306,7 +311,6 @@ Symfony is the result of the work of many people who made the code better
- Christophe L. (christophelau)
- Massimiliano Arione (garak)
- Anthon Pang (robocoder)
- - Jannik Zschiesche (apfelbox)
- Emanuele Gaspari (inmarelibero)
- Dariusz Rumiński
- Brian King
@@ -318,12 +322,14 @@ Symfony is the result of the work of many people who made the code better
- Jan Schumann
- Niklas Fiekas
- Mark Challoner (markchalloner)
+ - Gregor Harlan (gharlan)
- Markus Bachmann (baachi)
- lancergr
- Olivier Dolbeau (odolbeau)
- - Roumen Damianoff (roumen)
+ - Ben Davies (bendavies)
- vagrant
- Asier Illarramendi (doup)
+ - Artur Melo (restless)
- Chris Sedlmayr (catchamonkey)
- Seb Koelen
- Christoph Mewes (xrstf)
@@ -333,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
- cedric lombardot (cedriclombardot)
- Jonas Flodén (flojon)
- Christian Schmidt
+ - Jakub Kucharovic (jkucharovic)
- Marcin Sikoń (marphi)
- Dominik Zogg (dominik.zogg)
- Mathieu Lemoine
@@ -348,10 +355,11 @@ Symfony is the result of the work of many people who made the code better
- Sebastian Bergmann
- Pablo Díez (pablodip)
- Kevin McBride
+ - Ener-Getick (energetick)
- Philipp Rieber (bicpi)
- Manuel de Ruiter (manuel)
- - Jérémy Romey (jeremyfreeagent)
- Eduardo Oliveira (entering)
+ - Eugene Wissner
- Iker Ibarguren (ikerib)
- Ricardo Oliveira (ricardolotr)
- ondrowan
@@ -391,7 +399,6 @@ Symfony is the result of the work of many people who made the code better
- MatTheCat
- John Bafford (jbafford)
- Denis Gorbachev (starfall)
- - Titouan Galopin (tgalopin)
- Steven Surowiec
- Kevin Saliou (kbsali)
- Ryan
@@ -406,6 +413,7 @@ Symfony is the result of the work of many people who made the code better
- Lenar Lõhmus
- Benjamin Laugueux (yzalis)
- Zach Badgett (zachbadgett)
+ - Loïc Faugeron
- Aurélien Fredouelle
- Pavel Campr (pcampr)
- Johnny Robeson (johnny)
@@ -434,7 +442,7 @@ Symfony is the result of the work of many people who made the code better
- Wang Jingyu
- Åsmund Garfors
- Maxime Douailin
- - Gregor Harlan
+ - Michael Hirschler (mvhirsch)
- Javier López (loalf)
- Reinier Kip
- Dustin Dobervich (dustin10)
@@ -450,7 +458,6 @@ Symfony is the result of the work of many people who made the code better
- Tristan Maindron (tmaindron)
- Ke WANG (yktd26)
- Strate
- - Jakub Kucharovic
- Miquel Rodríguez Telep (mrtorrent)
- Sergey Kolodyazhnyy (skolodyazhnyy)
- umpirski
@@ -465,7 +472,6 @@ Symfony is the result of the work of many people who made the code better
- Sascha Grossenbacher
- Szijarto Tamas
- Benjamin Zikarsky (bzikarsky)
- - Ben Davies (bendavies)
- Mickaël Andrieu (mickaelandrieu)
- Simon Schick (simonsimcity)
- redstar504
@@ -485,13 +491,13 @@ Symfony is the result of the work of many people who made the code better
- Mark Sonnabaum
- Alexander Obuhovich (aik099)
- jochenvdv
- - Filippo Tessarotto
- Arturas Smorgun (asarturas)
- Alexander Volochnev (exelenz)
- Michael Piecko
- yclian
- Sergio Santoro
- Sebastian Grodzicki (sgrodzicki)
+ - Martin Hujer (martinhujer)
- Pascal Helfenstein
- Baldur Rensch (brensch)
- Vladyslav Petrovych
@@ -501,6 +507,7 @@ Symfony is the result of the work of many people who made the code better
- Joshua Nye
- Dave Marshall (davedevelopment)
- avorobiev
+ - Gladhon
- Venu
- Lars Vierbergen
- Dennis Hotson
@@ -521,6 +528,7 @@ Symfony is the result of the work of many people who made the code better
- Benoit Lévêque (benoit_leveque)
- Jeroen Fiege (fieg)
- Krzysiek Łabuś
+ - Ilya Antipenko (aivus)
- Nicolas Dewez (nicolas_dewez)
- Xavier Lacot (xavier)
- Olivier Maisonneuve (olineuve)
@@ -532,7 +540,6 @@ Symfony is the result of the work of many people who made the code better
- fago
- Harm van Tilborg
- Jan Prieser
- - Artur Melo (restless)
- James Michael DuPont
- Tom Klingenberg
- Christopher Hall (mythmakr)
@@ -566,6 +573,7 @@ Symfony is the result of the work of many people who made the code better
- Aleksey Podskrebyshev
- Steffen Roßkamp
- David Marín Carreño (davefx)
+ - Hidde Boomsma (hboomsma)
- Jörn Lang (j.lang)
- mwsaz
- Benoît Bourgeois
@@ -609,6 +617,7 @@ Symfony is the result of the work of many people who made the code better
- Benoît Merlet (trompette)
- Koen Kuipers
- datibbaw
+ - Sébastien Santoro
- Raul Fraile (raulfraile)
- sensio
- Patrick Kaufmann
@@ -628,6 +637,7 @@ Symfony is the result of the work of many people who made the code better
- xaav
- Jean-Christophe Cuvelier [Artack]
- Mahmoud Mostafa (mahmoud)
+ - Pieter
- Michael Tibben
- Sander Marechal
- Radosław Benkel
@@ -635,7 +645,6 @@ Symfony is the result of the work of many people who made the code better
- Mei Gwilym (meigwilym)
- Michael H. Arieli (excelwebzone)
- Luciano Mammino (loige)
- - Michael Hirschler (mvhirsch)
- fabios
- Jérôme Vasseur
- Sander Coolen (scoolen)
@@ -646,6 +655,7 @@ Symfony is the result of the work of many people who made the code better
- Irmantas Šiupšinskas (irmantas)
- Charles-Henri Bruyand
- Danilo Silva
+ - Konstantin S. M. Möllers (ksmmoellers)
- Zachary Tong (polyfractal)
- Hryhorii Hrebiniuk
- dantleech
@@ -679,6 +689,7 @@ Symfony is the result of the work of many people who made the code better
- Max Beutel
- Michal Trojanowski
- Catalin Dan
+ - Mihai Stancu
- nacho
- Piotr Antosik (antek88)
- Artem Lopata
@@ -691,6 +702,7 @@ Symfony is the result of the work of many people who made the code better
- Max Grigorian (maxakawizard)
- benatespina (benatespina)
- Denis Kop
+ - EdgarPE
- jfcixmedia
- Martijn Evers
- Benjamin Paap (benjaminpaap)
@@ -748,7 +760,6 @@ Symfony is the result of the work of many people who made the code better
- Brooks Boyd
- Roger Webb
- Dmitriy Simushev
- - Martin Hujer (martinhujer)
- Max Voloshin (maxvoloshin)
- Nicolas Fabre (nfabre)
- Raul Rodriguez (raul782)
@@ -765,6 +776,7 @@ Symfony is the result of the work of many people who made the code better
- Philipp Strube
- Christian Sciberras
- Anton Bakai
+ - Chad Sikorra (chadsikorra)
- Clement Herreman (clemherreman)
- Nyro (nyro)
- Trent Steel (trsteel88)
@@ -779,6 +791,8 @@ Symfony is the result of the work of many people who made the code better
- Jakub Kulhan
- Mo Di (modi)
- Jeroen van den Enden (stoefke)
+ - Christian Wahler
+ - Jelte Steijaert (jelte)
- Quique Porta (quiqueporta)
- Tomasz Szymczyk (karion)
- ConneXNL
@@ -796,6 +810,7 @@ Symfony is the result of the work of many people who made the code better
- Sebastian Göttschkes (sgoettschkes)
- Tatsuya Tsuruoka
- Ross Tuck
+ - Zander Baldwin
- Kévin Gomez (kevin)
- azine
- Dawid Sajdak
@@ -835,11 +850,14 @@ Symfony is the result of the work of many people who made the code better
- m.chwedziak
- Philip Frank
- Lance McNearney
+ - Dominik Ritter (dritter)
- Frank Neff (fneff)
+ - Roman Lapin (memphys)
- Giorgio Premi
- caponica
- Matt Daum (daum)
- Alberto Pirovano (geezmo)
+ - Jules Pietri (heah)
- Pete Mitchell (peterjmit)
- Tom Corrigan (tomcorrigan)
- Martin Pärtel
@@ -868,6 +886,7 @@ Symfony is the result of the work of many people who made the code better
- Adrien Samson (adriensamson)
- Samuel Gordalina (gordalina)
- Max Romanovsky (maxromanovsky)
+ - Dariusz Ruminski
- Mathieu Morlon
- Daniel Tschinder
- Rafał Muszyński (rafmus90)
@@ -948,6 +967,7 @@ Symfony is the result of the work of many people who made the code better
- 2manypeople
- Wing
- Thomas Bibb
+ - Alessandro Chitolina
- Matt Farmer
- catch
- Alexandre Segura
@@ -965,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
- Michal Gebauer
- Gleb Sidora
- David Stone
+ - Adrien Lucas (adrienlucas)
- Pablo Maria Martelletti (pmartelletti)
- Yassine Guedidi (yguedidi)
- Luis Muñoz
@@ -977,6 +998,7 @@ Symfony is the result of the work of many people who made the code better
- nuncanada
- flack
- František Bereň
+ - Almog Baku (almogbaku)
- Christoph Nissle (derstoffel)
- Ionel Scutelnicu (ionelscutelnicu)
- Nicolas Tallefourtané (nicolab)
@@ -1040,12 +1062,14 @@ Symfony is the result of the work of many people who made the code better
- devel
- Trevor Suarez
- gedrox
+ - Mathieu MARCHOIS
- dropfen
- Andrey Chernykh
- Edvinas Klovas
- Drew Butler
- J Bruni
- Alexey Prilipko
+ - Oleg Voronkovich
- bertillon
- Victor Bocharsky (bocharsky_bw)
- Luca Genuzio (genuzio)
@@ -1092,6 +1116,7 @@ Symfony is the result of the work of many people who made the code better
- Alex Pods
- hadriengem
- timaschew
+ - Jelle Kapitein
- Ian Phillips
- Haritz
- Matthieu Prat
@@ -1104,6 +1129,7 @@ Symfony is the result of the work of many people who made the code better
- David Windell
- Gabriel Birke
- skafandri
+ - NothingWeAre
- Alan Chen
- Maerlyn
- Even André Fiskvik
@@ -1112,6 +1138,7 @@ Symfony is the result of the work of many people who made the code better
- Lenar Lõhmus
- Cristian Gonzalez
- AlberT
+ - hainey
- Juan M Martínez
- Gilles Gauthier
- ddebree
@@ -1121,6 +1148,7 @@ Symfony is the result of the work of many people who made the code better
- possum
- Rafał
- Adria Lopez (adlpz)
+ - Andreas Schempp (aschempp)
- Rosio (ben-rosio)
- Simon Paarlberg (blamh)
- Jeroen Thora (bolle)
@@ -1147,7 +1175,9 @@ Symfony is the result of the work of many people who made the code better
- Pablo Monterde Perez (plebs)
- Jimmy Leger (redpanda)
- Pavel Batanov (scaytrase)
+ - Simone Di Maulo (toretto460)
- Cyrille Jouineau (tuxosaurus)
+ - Sander Toonen (xatoo)
- Yorkie Chadwick (yorkie76)
- Yanick Witschi
- Ondrej Mirtes
@@ -1156,7 +1186,6 @@ Symfony is the result of the work of many people who made the code better
- srsbiz
- Taylan Kasap
- Nicolas A. Bérard-Nault
- - Gladhon
- Saem Ghani
- Stefan Oderbolz
- Curtis
@@ -1197,6 +1226,7 @@ Symfony is the result of the work of many people who made the code better
- Vladimir Sazhin
- lol768
- jamogon
+ - Antoine LA
- Vyacheslav Slinko
- Johannes
- Jörg Rühl
@@ -1209,6 +1239,7 @@ Symfony is the result of the work of many people who made the code better
- Eric J. Duran
- cmfcmf
- Drew Butler
+ - pawel-lewtak
- Steve Müller
- Andras Ratz
- andreabreu98
@@ -1219,7 +1250,6 @@ Symfony is the result of the work of many people who made the code better
- Sam Williams
- Adrian Philipp
- James Michael DuPont
- - Eugene Wissner
- Kasperki
- Tammy D
- Ondrej Slinták
@@ -1248,6 +1278,7 @@ Symfony is the result of the work of many people who made the code better
- Norman Soetbeer
- Benjamin Long
- Matt Janssen
+ - Jeremy Benoist
- Peter Gribanov
- kwiateusz
- David Soria Parra
@@ -1267,6 +1298,7 @@ Symfony is the result of the work of many people who made the code better
- Dawid Nowak
- Richard Quadling
- Karolis Daužickas
+ - Baptiste Lafontaine
- tirnanog06
- phc
- Дмитрий Пацура
@@ -1314,6 +1346,7 @@ Symfony is the result of the work of many people who made the code better
- Ismail Faizi (kanafghan)
- Sébastien Armand (khepin)
- Krzysztof Menżyk (krymen)
+ - Krzysztof Piasecki (krzysztek)
- samuel laulhau (lalop)
- Laurent Bachelier (laurentb)
- Jérôme Parmentier (lctrs)
diff --git a/LICENSE b/LICENSE
index 43028bc600f26..12a74531e40a4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Fabien Potencier
+Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md
index a115df128e6bb..d91b2d4cdab39 100644
--- a/UPGRADE-3.0.md
+++ b/UPGRADE-3.0.md
@@ -10,7 +10,7 @@ UPGRADE FROM 2.x to 3.0
| -------- | ---
| `registerNamespaces()` | `addPrefixes()`
| `registerPrefixes()` | `addPrefixes()`
- | `registerNamespaces()` | `addPrefix()`
+ | `registerNamespace()` | `addPrefix()`
| `registerPrefix()` | `addPrefix()`
| `getNamespaces()` | `getPrefixes()`
| `getNamespaceFallbacks()` | `getFallbackDirs()`
@@ -20,6 +20,16 @@ UPGRADE FROM 2.x to 3.0
`DebugClassLoader`. The difference is that the constructor now takes a
loader to wrap.
+### Config
+
+ * `\Symfony\Component\Config\Resource\ResourceInterface::isFresh()` has been removed. Also,
+ cache validation through this method (which was still supported in 2.8 for BC) does no longer
+ work because the `\Symfony\Component\Config\Resource\BCResourceInterfaceChecker` helper class
+ has been removed as well.
+
+ * The `__toString()` method of the `\Symfony\Component\Config\ConfigCache` class
+ was removed in favor of the new `getPath()` method.
+
### Console
* The `dialog` helper has been removed in favor of the `question` helper.
@@ -96,6 +106,79 @@ UPGRADE FROM 2.x to 3.0
* The method `remove` was added to `Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface`.
+ * The concept of scopes was removed, the removed methods are:
+
+ - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopes()`
+ - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopeChildren()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::enterScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::leaveScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::addScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::hasScope()`
+ - `Symfony\Component\DependencyInjection\ContainerInterface::isScopeActive()`
+ - `Symfony\Component\DependencyInjection\Definition::setScope()`
+ - `Symfony\Component\DependencyInjection\Definition::getScope()`
+ - `Symfony\Component\DependencyInjection\Reference::isStrict()`
+
+ Also, the `$scope` and `$strict` parameters of `Symfony\Component\DependencyInjection\ContainerInterface::set()`
+ and `Symfony\Component\DependencyInjection\Reference` respectively were removed.
+
+ * A new `shared` flag has been added to the service definition
+ in replacement of the `prototype` scope.
+
+ Before:
+
+ ```php
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo', 'stdClass')
+ ->setScope(ContainerBuilder::SCOPE_PROTOTYPE)
+ ;
+ ```
+
+ ```yml
+ services:
+ foo:
+ class: stdClass
+ scope: prototype
+ ```
+
+ ```xml
+
+
+
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo', 'stdClass')
+ ->setShared(false)
+ ;
+ ```
+
+ ```yml
+ services:
+ foo:
+ class: stdClass
+ shared: false
+ ```
+
+ ```xml
+
+
+
+ ```
+
+ * `Symfony\Component\DependencyInjection\ContainerAware` was removed, use
+ `Symfony\Component\DependencyInjection\ContainerAwareTrait` or implement
+ `Symfony\Component\DependencyInjection\ContainerAwareInterface` manually
+
* The methods `Definition::setFactoryClass()`,
`Definition::setFactoryMethod()`, and `Definition::setFactoryService()` have
been removed in favor of `Definition::setFactory()`. Services defined using
@@ -121,6 +204,26 @@ UPGRADE FROM 2.x to 3.0
$crawler->getIterator()->current();
```
+### DoctrineBridge
+
+ * The `property` option of `DoctrineType` was removed in favor of the `choice_label` option.
+
+ * The `loader` option of `DoctrineType` was removed. You now have to override the `getLoader()`
+ method in your custom type.
+
+ * The `Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList` was removed in favor
+ of `Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader`.
+
+ * Passing a query builder closure to `ORMQueryBuilderLoader` is not supported anymore.
+ You should pass resolved query builders only.
+
+ Consequently, the arguments `$manager` and `$class` of `ORMQueryBuilderLoader`
+ have been removed as well.
+
+ Note that the `query_builder` option of `DoctrineType` *does* support
+ closures, but the closure is now resolved in the type instead of in the
+ loader.
+
### EventDispatcher
* The method `getListenerPriority($eventName, $listener)` has been added to the
@@ -131,17 +234,184 @@ UPGRADE FROM 2.x to 3.0
### Form
* The `getBlockPrefix()` method was added to the `FormTypeInterface` in replacement of
- the `getName()` method which has been has been removed.
+ the `getName()` method which has been removed.
+
* The `configureOptions()` method was added to the `FormTypeInterface` in replacement
of the `setDefaultOptions()` method which has been removed.
+
* The `getBlockPrefix()` method was added to the `ResolvedFormTypeInterface` in
- replacement of the `getName()` method which has been has been removed.
+ replacement of the `getName()` method which has been removed.
+
+ * The option `options` of the `CollectionType` has been removed in favor
+ of the `entry_options` option.
+
+ * The `cascade_validation` option was removed. Use the `constraints` option
+ together with the `Valid` constraint instead.
+
+ * Type names were removed. Instead of referencing types by name, you must
+ reference them by their fully-qualified class name (FQCN) instead:
+
+ Before:
+
+ ```php
+ $form = $this->createFormBuilder()
+ ->add('name', 'text')
+ ->add('age', 'integer')
+ ->getForm();
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
+ use Symfony\Component\Form\Extension\Core\Type\TextType;
+
+ $form = $this->createFormBuilder()
+ ->add('name', TextType::class)
+ ->add('age', IntegerType::class)
+ ->getForm();
+ ```
+
+ If you want to customize the block prefix of a type in Twig, you must now
+ implement `FormTypeInterface::getBlockPrefix()`:
+
+ Before:
+
+ ```php
+ class UserProfileType extends AbstractType
+ {
+ public function getName()
+ {
+ return 'profile';
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ class UserProfileType extends AbstractType
+ {
+ public function getBlockPrefix()
+ {
+ return 'profile';
+ }
+ }
+ ```
+
+ If you don't customize `getBlockPrefix()`, it defaults to the class name
+ without "Type" suffix in underscore notation (here: "user_profile").
+
+ Type extension must return the fully-qualified class name of the extended
+ type from `FormTypeExtensionInterface::getExtendedType()` now.
+
+ Before:
+
+ ```php
+ class MyTypeExtension extends AbstractTypeExtension
+ {
+ public function getExtendedType()
+ {
+ return 'form';
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ class MyTypeExtension extends AbstractTypeExtension
+ {
+ public function getExtendedType()
+ {
+ return FormType::class;
+ }
+ }
+ ```
+
+ * The `FormTypeInterface::getName()` method was removed.
+
+ * Returning type instances from `FormTypeInterface::getParent()` is not
+ supported anymore. Return the fully-qualified class name of the parent
+ type class instead.
+
+ Before:
+
+ ```php
+ class MyType
+ {
+ public function getParent()
+ {
+ return new ParentType();
+ }
+ }
+ ```
+
+ After:
+
+ ```php
+ class MyType
+ {
+ public function getParent()
+ {
+ return ParentType::class;
+ }
+ }
+ ```
+
+ * The option `type` of the `CollectionType` has been removed in favor of
+ the `entry_type` option. The value for the `entry_type` option must be
+ the fully-qualified class name (FQCN).
+
+ * Passing type instances to `Form::add()`, `FormBuilder::add()` and the
+ `FormFactory::create*()` methods is not supported anymore. Pass the
+ fully-qualified class name of the type instead.
+
+ Before:
+
+ ```php
+ $form = $this->createForm(new MyType());
+ ```
+
+ After:
+
+ ```php
+ $form = $this->createForm(MyType::class);
+ ```
+
+ * The alias option of the `form.type_extension` tag was removed in favor of
+ the `extended_type`/`extended-type` option.
+
+ Before:
+ ```xml
+
+
+
+ ```
+
+ After:
+ ```xml
+
+
+
+ ```
+
+ * The `ChoiceToBooleanArrayTransformer`, `ChoicesToBooleanArrayTransformer`,
+ `FixRadioInputListener`, and `FixCheckboxInputListener` classes were removed.
+
+ * The `choice_list` option of `ChoiceType` was removed.
+
+>>>>>>> 2.8
* The option "precision" was renamed to "scale".
Before:
```php
- $builder->add('length', 'number', array(
+ use Symfony\Component\Form\Extension\Core\Type\NumberType;
+
+ $builder->add('length', NumberType::class, array(
'precision' => 3,
));
```
@@ -149,7 +419,9 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- $builder->add('length', 'number', array(
+ use Symfony\Component\Form\Extension\Core\Type\NumberType;
+
+ $builder->add('length', NumberType::class, array(
'scale' => 3,
));
```
@@ -159,7 +431,9 @@ UPGRADE FROM 2.x to 3.0
Before:
```php
- $builder->add('address', 'form', array(
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ $builder->add('address', FormType::class, array(
'virtual' => true,
));
```
@@ -167,7 +441,9 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- $builder->add('address', 'form', array(
+ use Symfony\Component\Form\Extension\Core\Type\FormType;
+
+ $builder->add('address', FormType::class, array(
'inherit_data' => true,
));
```
@@ -294,12 +570,12 @@ UPGRADE FROM 2.x to 3.0
// ...
}
```
-
+
* The option "options" of the CollectionType has been renamed to "entry_options".
* The option "type" of the CollectionType has been renamed to "entry_type".
- As a value for the option you must provide the fully-qualified class name (FQCN)
- now as well.
+ As a value for the option you must provide the fully-qualified class name (FQCN)
+ now as well.
* The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace.
@@ -307,11 +583,11 @@ UPGRADE FROM 2.x to 3.0
`NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,
`ROUND_HALF_UP` and `ROUND_HALF_DOWN`.
- * The methods `ChoiceListInterface::getIndicesForChoices()` and
- `ChoiceListInterface::getIndicesForValues()` were removed. No direct
- replacement exists, although in most cases
- `ChoiceListInterface::getChoicesForValues()` and
- `ChoiceListInterface::getValuesForChoices()` should be sufficient.
+ * The `Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface` was
+ removed in favor of `Symfony\Component\Form\ChoiceList\ChoiceListInterface`.
+
+ * `Symfony\Component\Form\Extension\Core\View\ChoiceView` was removed in favor of
+ `Symfony\Component\Form\ChoiceList\View\ChoiceView`.
* The interface `Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface`
and all of its implementations were removed. Use the new interface
@@ -347,8 +623,8 @@ UPGRADE FROM 2.x to 3.0
* The `Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList` class has been removed in
favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.
-
- * The `TimezoneType::getTimezones()` method was removed. You should not use
+
+ * The `TimezoneType::getTimezones()` method was removed. You should not use
this method.
* The `Symfony\Component\Form\ChoiceList\ArrayKeyChoiceList` class has been removed in
@@ -395,11 +671,11 @@ UPGRADE FROM 2.x to 3.0
}
}
```
-
+
* In Symfony 2.7 a small BC break was introduced with the new choices_as_values
option. In order to have the choice values populated to the html value attribute
you had to define the choice_value option. This is now not any more needed.
-
+
Before:
```php
@@ -419,9 +695,9 @@ UPGRADE FROM 2.x to 3.0
},
));
```
-
+
After:
-
+
```php
$form->add('status', ChoiceType::class, array(
'choices' => array(
@@ -430,56 +706,11 @@ UPGRADE FROM 2.x to 3.0
'Ignored' => Status::IGNORED,
)
));
- ```
+ ```
* The `request` service was removed. You must inject the `request_stack`
service instead.
- * The `templating.helper.assets` was removed in Symfony 3.0. You should
- use the `assets.package` service instead.
-
- Before:
-
- ```php
- use Symfony\Component\Templating\Helper\CoreAssetsHelper;
-
- class DemoService
- {
- private $assetsHelper;
-
- public function __construct(CoreAssetsHelper $assetsHelper)
- {
- $this->assetsHelper = $assetsHelper;
- }
-
- public function testMethod()
- {
- return $this->assetsHelper->getUrl('thumbnail.png', null, $this->assetsHelper->getVersion());
- }
- }
- ```
-
- After:
-
- ```php
- use Symfony\Component\Asset\Packages;
-
- class DemoService
- {
- private $assetPackages;
-
- public function __construct(Packages $assetPackages)
- {
- $this->assetPackages = $assetPackages;
- }
-
- public function testMethod()
- {
- return $this->assetPackages->getUrl('thumbnail.png').$this->assetPackages->getVersion();
- }
- }
- ```
-
* The `enctype` method of the `form` helper was removed. You should use the
new method `start` instead.
@@ -549,6 +780,27 @@ UPGRADE FROM 2.x to 3.0
interface.
The `security.csrf.token_manager` should be used instead.
+ * The `validator.mapping.cache.apc` service has been removed in favor of the `validator.mapping.cache.doctrine.apc` one.
+
+ * The ability to pass `apc` as the `framework.validation.cache` configuration key value has been removed.
+ Use `validator.mapping.cache.doctrine.apc` instead:
+
+ Before:
+
+ ```yaml
+ framework:
+ validation:
+ cache: apc
+ ```
+
+ After:
+
+ ```yaml
+ framework:
+ validation:
+ cache: validator.mapping.cache.doctrine.apc
+ ```
+
### HttpKernel
* The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in
@@ -624,7 +876,7 @@ UPGRADE FROM 2.x to 3.0
* Some route settings have been renamed:
- * The `pattern` setting for a route has been deprecated in favor of `path`
+ * The `pattern` setting has been removed in favor of `path`
* The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings
Before:
@@ -677,12 +929,17 @@ UPGRADE FROM 2.x to 3.0
the performance gains were minimal and it's hard to replicate the behaviour
of PHP implementation.
+ * The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
+ `Symfony\Component\Routing\Router` have been changed from `public` to `protected`.
+
### Security
* The `vote()` method from the `VoterInterface` was changed to now accept arbitrary
types and not only objects. You can rely on the new abstract `Voter` class introduced
in 2.8 to ease integrating your own voters.
+ * The `AbstractVoter` class was removed in favor of the new `Voter` class.
+
* The `Resources/` directory was moved to `Core/Resources/`
* The `key` settings of `anonymous`, `remember_me` and `http_digest` are
@@ -774,8 +1031,12 @@ UPGRADE FROM 2.x to 3.0
));
```
- * The `AbstractVoter::getSupportedAttributes()` and `AbstractVoter::getSupportedClasses()`
- methods have been removed in favor of `AbstractVoter::supports()`.
+ * The `AbstractVoter` class was removed. Instead, extend the new `Voter` class,
+ introduced in 2.8, and move your voting logic to the to the `supports($attribute, $subject)`
+ and `voteOnAttribute($attribute, $object, TokenInterface $token)` methods.
+
+ * The `supportsClass` and `supportsAttribute` methods were
+ removed from the `VoterInterface` interface.
Before:
@@ -799,14 +1060,19 @@ UPGRADE FROM 2.x to 3.0
After:
```php
- class MyVoter extends AbstractVoter
+ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
+
+ class MyVoter extends Voter
{
protected function supports($attribute, $object)
{
return $object instanceof Post && in_array($attribute, array('CREATE', 'EDIT'));
}
- // ...
+ protected function voteOnAttribute($attribute, $object, TokenInterface $token)
+ {
+ // Return true or false
+ }
}
```
@@ -843,6 +1109,26 @@ UPGRADE FROM 2.x to 3.0
* The `supportsAttribute()` and `supportsClass()` methods of classes `AuthenticatedVoter`, `ExpressionVoter`
and `RoleVoter` have been removed.
+ * The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.
+
+ * The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.
+
+### SecurityBundle
+
+ * The `intention` firewall listener setting was renamed to `csrf_token_id`.
+
+ * The `csrf_provider` firewall listener setting was renamed to `csrf_token_generator`.
+
+### Serializer
+
+ * The `setCamelizedAttributes()` method of the
+ `Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer` and
+ `Symfony\Component\Serializer\Normalizer\PropertyNormalizer` classes
+ was removed.
+
+ * The `Symfony\Component\Serializer\Exception\Exception` interface was removed
+ in favor of the new `Symfony\Component\Serializer\Exception\ExceptionInterface`.
+
### Translator
* The `Translator::setFallbackLocale()` method has been removed in favor of
@@ -910,6 +1196,10 @@ UPGRADE FROM 2.x to 3.0
}
```
+ * The `getMessages()` method of the `Symfony\Component\Translation\Translator`
+ class was removed. You should use the `getCatalogue()` method of the
+ `Symfony\Component\Translation\TranslatorBagInterface`.
+
### Twig Bridge
* The `twig:lint` command has been deprecated since Symfony 2.7 and will be
@@ -969,11 +1259,18 @@ UPGRADE FROM 2.x to 3.0
### TwigBundle
+ * The `Symfony\Bundle\TwigBundle\TwigDefaultEscapingStrategy` was removed
+ in favor of `Twig_FileExtensionEscapingStrategy`.
+
* The `twig:debug` command has been deprecated since Symfony 2.7 and will be
removed in Symfony 3.0. Use the `debug:twig` command instead.
### Validator
+ * The PHP7-incompatible constraints (`Null`, `True`, `False`) and their related
+ validators (`NullValidator`, `TrueValidator`, `FalseValidator`) have been
+ removed in favor of their `Is`-prefixed equivalent.
+
* The class `Symfony\Component\Validator\Mapping\Cache\ApcCache` has been removed in favor
of `Symfony\Component\Validator\Mapping\Cache\DoctrineCache`.
@@ -1439,6 +1736,23 @@ UPGRADE FROM 2.x to 3.0
Yaml::parse(file_get_contents($fileName));
```
+### WebProfiler
+
+ * The `profiler:import` and `profiler:export` commands have been deprecated and
+ will be removed in 3.0.
+
+ * All the profiler storages different than `FileProfilerStorage` have been
+ removed. The removed classes are:
+
+ - `Symfony\Component\HttpKernel\Profiler\BaseMemcacheProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\PdoProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage`
+ - `Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage`
+
### Process
* `Process::setStdin()` and `Process::getStdin()` have been removed. Use
@@ -1459,10 +1773,3 @@ UPGRADE FROM 2.x to 3.0
### HttpFoundation
* `Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface` no longer implements the `IteratorAggregate` interface. Use the `all()` method instead of iterating over the flash bag.
-
-### Config
-
- * `\Symfony\Component\Config\Resource\ResourceInterface::isFresh()` has been removed. Also,
- cache validation through this method (which was still supported in 2.8 for BC) does no longer
- work because the `\Symfony\Component\Config\Resource\BCResourceInterfaceChecker` helper class
- has been removed as well.
diff --git a/appveyor.yml b/appveyor.yml
index de3093f45ff80..6456c27916d13 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -14,6 +14,7 @@ init:
- SET PHP=1
- SET ANSICON=121x90 (121x90)
- SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped
+ - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
install:
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
@@ -46,13 +47,14 @@ install:
- appveyor DownloadFile https://getcomposer.org/composer.phar
- copy /Y php.ini-max php.ini
- cd c:\projects\symfony
+ - mkdir %APPDATA%\Composer
+ - IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer-auth.json %APPDATA%\Composer\auth.json
- php phpunit install
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
- - composer update --prefer-source --no-progress --ansi
+ - composer update --prefer-dist --no-progress --ansi
test_script:
- cd c:\projects\symfony
- - Setlocal EnableDelayedExpansion
- SET X=0
- copy /Y c:\php\php.ini-min c:\php\php.ini
- php phpunit symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
diff --git a/composer.json b/composer.json
index da34246718a27..7fe4d1436a671 100644
--- a/composer.json
+++ b/composer.json
@@ -80,6 +80,7 @@
"monolog/monolog": "~1.11",
"ocramius/proxy-manager": "~0.4|~1.0",
"egulias/email-validator": "~1.2",
+ "symfony/polyfill-apcu": "~1.1",
"symfony/security-acl": "~2.8|~3.0",
"phpdocumentor/reflection": "^1.0.7"
},
@@ -91,7 +92,6 @@
"Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/",
"Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/",
"Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/",
- "Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/",
"Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/",
"Symfony\\Bundle\\": "src/Symfony/Bundle/",
"Symfony\\Component\\": "src/Symfony/Component/"
diff --git a/phpunit b/phpunit
index 146ab9d37610c..dba1222189066 100755
--- a/phpunit
+++ b/phpunit
@@ -27,7 +27,7 @@ if ('phpdbg' === PHP_SAPI) {
$PHP .= ' -qrr';
}
-$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : `which composer.phar`))
+$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar`))
? $PHP.' '.ProcessUtils::escapeArgument($COMPOSER)
: 'composer';
@@ -53,7 +53,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
chdir("phpunit-$PHPUNIT_VERSION");
passthru("$COMPOSER remove --no-update symfony/yaml");
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
- passthru("$COMPOSER install --prefer-source --no-progress --ansi");
+ passthru("$COMPOSER install --prefer-dist --no-progress --ansi");
file_put_contents('phpunit', <<getFilename());
+ $bundleDir = dirname($bundle->getFileName());
if (!$bundleConfig['type']) {
$bundleConfig['type'] = $this->detectMetadataDriver($bundleDir, $container);
diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
index de35c55219f2e..96f05eb5b60c9 100644
--- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
+++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php
@@ -60,7 +60,7 @@ private function updateValidatorMappingFiles(ContainerBuilder $container, $mappi
foreach ($container->getParameter('kernel.bundles') as $bundle) {
$reflection = new \ReflectionClass($bundle);
- if (is_file($file = dirname($reflection->getFilename()).'/'.$validationPath)) {
+ if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) {
$files[] = realpath($file);
$container->addResource(new FileResource($file));
}
diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
index 353c18528710f..9b3c50307ce61 100644
--- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
+++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
@@ -111,7 +111,12 @@ public function getQueryBuilderPartsForCachingHash($queryBuilder)
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null)
{
$this->registry = $registry;
- $this->choiceListFactory = $choiceListFactory ?: new PropertyAccessDecorator(new DefaultChoiceListFactory(), $propertyAccessor);
+ $this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(
+ new PropertyAccessDecorator(
+ new DefaultChoiceListFactory(),
+ $propertyAccessor
+ )
+ );
}
public function buildForm(FormBuilderInterface $builder, array $options)
diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
index f0c8a9e785157..21f1860efd6e8 100644
--- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
+++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
@@ -12,6 +12,7 @@
namespace Symfony\Bridge\Doctrine\Form\Type;
use Doctrine\Common\Persistence\ObjectManager;
+use Doctrine\ORM\Query\Parameter;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
@@ -78,8 +79,20 @@ public function getBlockPrefix()
public function getQueryBuilderPartsForCachingHash($queryBuilder)
{
return array(
- $queryBuilder->getQuery()->getSQL(),
- $queryBuilder->getParameters()->toArray(),
+ $queryBuilder->getQuery()->getSQL(),
+ array_map(array($this, 'parameterToArray'), $queryBuilder->getParameters()->toArray()),
);
}
+
+ /**
+ * Converts a query parameter to an array.
+ *
+ * @param Parameter $parameter The query parameter
+ *
+ * @return array The array representation of the parameter
+ */
+ private function parameterToArray(Parameter $parameter)
+ {
+ return array($parameter->getName(), $parameter->getType(), $parameter->getValue());
+ }
}
diff --git a/src/Symfony/Bridge/Doctrine/LICENSE b/src/Symfony/Bridge/Doctrine/LICENSE
index 43028bc600f26..12a74531e40a4 100644
--- a/src/Symfony/Bridge/Doctrine/LICENSE
+++ b/src/Symfony/Bridge/Doctrine/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Fabien Potencier
+Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
index 51f9f75e4b62c..18fb341e5b74c 100644
--- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
+++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
@@ -49,12 +49,8 @@ public function startQuery($sql, array $params = null, array $types = null)
$this->stopwatch->start('doctrine', 'doctrine');
}
- if (is_array($params)) {
- $params = $this->normalizeParams($params);
- }
-
if (null !== $this->logger) {
- $this->log($sql, null === $params ? array() : $params);
+ $this->log($sql, null === $params ? array() : $this->normalizeParams($params));
}
}
diff --git a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php
index dc22e235959bd..6e330e558aa06 100644
--- a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php
+++ b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php
@@ -14,6 +14,7 @@
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
use Doctrine\Common\Persistence\Mapping\MappingException;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
+use Doctrine\ORM\Mapping\MappingException as OrmMappingException;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;
@@ -44,6 +45,8 @@ public function getProperties($class, array $context = array())
$metadata = $this->classMetadataFactory->getMetadataFor($class);
} catch (MappingException $exception) {
return;
+ } catch (OrmMappingException $exception) {
+ return;
}
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
@@ -58,6 +61,8 @@ public function getTypes($class, $property, array $context = array())
$metadata = $this->classMetadataFactory->getMetadataFor($class);
} catch (MappingException $exception) {
return;
+ } catch (OrmMappingException $exception) {
+ return;
}
if ($metadata->hasAssociation($property)) {
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
index d090fd604f0f0..0303c355c055b 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
@@ -1127,6 +1127,69 @@ public function testLoaderCaching()
$this->assertSame($choiceLoader1, $choiceLoader3);
}
+ public function testLoaderCachingWithParameters()
+ {
+ $entity1 = new SingleIntIdEntity(1, 'Foo');
+ $entity2 = new SingleIntIdEntity(2, 'Bar');
+ $entity3 = new SingleIntIdEntity(3, 'Baz');
+
+ $this->persist(array($entity1, $entity2, $entity3));
+
+ $repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
+
+ $entityType = new EntityType(
+ $this->emRegistry,
+ PropertyAccess::createPropertyAccessor()
+ );
+
+ $entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry);
+
+ $factory = Forms::createFormFactoryBuilder()
+ ->addType($entityType)
+ ->addTypeGuesser($entityTypeGuesser)
+ ->getFormFactory();
+
+ $formBuilder = $factory->createNamedBuilder('form', 'Symfony\Component\Form\Extension\Core\Type\FormType');
+
+ $formBuilder->add('property1', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', array(
+ 'em' => 'default',
+ 'class' => self::SINGLE_IDENT_CLASS,
+ 'query_builder' => $repo->createQueryBuilder('e')->where('e.id = :id')->setParameter('id', 1),
+ ));
+
+ $formBuilder->add('property2', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', array(
+ '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', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', array(
+ '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(
+ 'property1' => 1,
+ 'property2' => 1,
+ 'property3' => 2,
+ ));
+
+ $choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader');
+ $choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader');
+ $choiceLoader3 = $form->get('property3')->getConfig()->getOption('choice_loader');
+
+ $this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $choiceLoader1);
+ $this->assertSame($choiceLoader1, $choiceLoader2);
+ $this->assertSame($choiceLoader1, $choiceLoader3);
+ }
+
protected function createRegistryMock($name, $em)
{
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
index df6c355895086..ac1bb5f96e41b 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
@@ -26,7 +26,7 @@ class DoctrineExtractorTest extends \PHPUnit_Framework_TestCase
*/
private $extractor;
- public function setUp()
+ protected function setUp()
{
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'), true);
$entityManager = EntityManager::create(array('driver' => 'pdo_sqlite'), $config);
@@ -81,4 +81,14 @@ public function typesProvider()
array('notMapped', null),
);
}
+
+ public function testGetPropertiesCatchException()
+ {
+ $this->assertNull($this->extractor->getProperties('Not\Exist'));
+ }
+
+ public function testGetTypesCatchException()
+ {
+ $this->assertNull($this->extractor->getTypes('Not\Exist', 'baz'));
+ }
}
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
index 8cf6ec0c8d1f7..201324126b081 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
@@ -11,11 +11,11 @@
namespace Symfony\Bridge\Doctrine\Tests\Validator\Constraints;
+use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
-use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleNameEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity;
@@ -330,6 +330,44 @@ public function testValidateUniquenessWithUnrewoundArray()
$this->assertNoViolation();
}
+ /**
+ * @dataProvider resultTypesProvider
+ */
+ public function testValidateResultTypes($entity1, $result)
+ {
+ $constraint = new UniqueEntity(array(
+ 'message' => 'myMessage',
+ 'fields' => array('name'),
+ 'em' => self::EM_NAME,
+ 'repositoryMethod' => 'findByCustom',
+ ));
+
+ $repository = $this->createRepositoryMock();
+ $repository->expects($this->once())
+ ->method('findByCustom')
+ ->will($this->returnValue($result))
+ ;
+ $this->em = $this->createEntityManagerMock($repository);
+ $this->registry = $this->createRegistryMock($this->em);
+ $this->validator = $this->createValidator();
+ $this->validator->initialize($this->context);
+
+ $this->validator->validate($entity1, $constraint);
+
+ $this->assertNoViolation();
+ }
+
+ public function resultTypesProvider()
+ {
+ $entity = new SingleIntIdEntity(1, 'foo');
+
+ return array(
+ array($entity, array($entity)),
+ array($entity, new \ArrayIterator(array($entity))),
+ array($entity, new ArrayCollection(array($entity))),
+ );
+ }
+
public function testAssociatedEntity()
{
$constraint = new UniqueEntity(array(
@@ -359,7 +397,7 @@ public function testAssociatedEntity()
$this->buildViolation('myMessage')
->atPath('property.path.single')
- ->setInvalidValue(1)
+ ->setInvalidValue($entity1)
->assertRaised();
}
@@ -383,29 +421,6 @@ public function testAssociatedEntityWithNull()
$this->assertNoViolation();
}
- /**
- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
- * @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
- */
- public function testAssociatedCompositeEntity()
- {
- $constraint = new UniqueEntity(array(
- 'message' => 'myMessage',
- 'fields' => array('composite'),
- 'em' => self::EM_NAME,
- ));
-
- $composite = new CompositeIntIdEntity(1, 1, 'test');
- $associated = new AssociationEntity();
- $associated->composite = $composite;
-
- $this->em->persist($composite);
- $this->em->persist($associated);
- $this->em->flush();
-
- $this->validator->validate($associated, $constraint);
- }
-
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
* @expectedExceptionMessage Object manager "foo" does not exist.
diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
index 0fbf42c5bec65..3936b5fd806a7 100644
--- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
+++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
@@ -12,7 +12,6 @@
namespace Symfony\Bridge\Doctrine\Validator\Constraints;
use Doctrine\Common\Persistence\ManagerRegistry;
-use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
@@ -97,23 +96,16 @@ public function validate($entity, Constraint $constraint)
* getter methods in the Proxy are being bypassed.
*/
$em->initializeObject($criteria[$fieldName]);
-
- $relatedClass = $em->getClassMetadata($class->getAssociationTargetClass($fieldName));
- $relatedId = $relatedClass->getIdentifierValues($criteria[$fieldName]);
-
- if (count($relatedId) > 1) {
- throw new ConstraintDefinitionException(
- 'Associated entities are not allowed to have more than one identifier field to be '.
- 'part of a unique constraint in: '.$class->getName().'#'.$fieldName
- );
- }
- $criteria[$fieldName] = array_pop($relatedId);
}
}
$repository = $em->getRepository(get_class($entity));
$result = $repository->{$constraint->repositoryMethod}($criteria);
+ if ($result instanceof \IteratorAggregate) {
+ $result = $result->getIterator();
+ }
+
/* If the result is a MongoCursor, it must be advanced to the first
* element. Rewinding should have no ill effect if $result is another
* iterator implementation.
@@ -135,16 +127,9 @@ public function validate($entity, Constraint $constraint)
$errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0];
$invalidValue = isset($criteria[$errorPath]) ? $criteria[$errorPath] : $criteria[$fields[0]];
- if ($this->context instanceof ExecutionContextInterface) {
- $this->context->buildViolation($constraint->message)
- ->atPath($errorPath)
- ->setInvalidValue($invalidValue)
- ->addViolation();
- } else {
- $this->buildViolation($constraint->message)
- ->atPath($errorPath)
- ->setInvalidValue($invalidValue)
- ->addViolation();
- }
+ $this->context->buildViolation($constraint->message)
+ ->atPath($errorPath)
+ ->setInvalidValue($invalidValue)
+ ->addViolation();
}
}
diff --git a/src/Symfony/Bridge/Monolog/LICENSE b/src/Symfony/Bridge/Monolog/LICENSE
index 43028bc600f26..12a74531e40a4 100644
--- a/src/Symfony/Bridge/Monolog/LICENSE
+++ b/src/Symfony/Bridge/Monolog/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Fabien Potencier
+Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/PhpUnit/ClockMock.php b/src/Symfony/Bridge/PhpUnit/ClockMock.php
index b81fee965880a..fe5cd851258d2 100644
--- a/src/Symfony/Bridge/PhpUnit/ClockMock.php
+++ b/src/Symfony/Bridge/PhpUnit/ClockMock.php
@@ -109,5 +109,4 @@ function usleep(\$us)
);
}
}
-
}
diff --git a/src/Symfony/Bridge/PhpUnit/LICENSE b/src/Symfony/Bridge/PhpUnit/LICENSE
index ef1cde91a61c3..39fa189d2b5fc 100644
--- a/src/Symfony/Bridge/PhpUnit/LICENSE
+++ b/src/Symfony/Bridge/PhpUnit/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2015 Fabien Potencier
+Copyright (c) 2014-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/PhpUnit/README.md b/src/Symfony/Bridge/PhpUnit/README.md
index ef5f76f1a7f93..90dbe83bb8e79 100644
--- a/src/Symfony/Bridge/PhpUnit/README.md
+++ b/src/Symfony/Bridge/PhpUnit/README.md
@@ -5,7 +5,6 @@ Provides utilities for PHPUnit, especially user deprecation notices management.
It comes with the following features:
- * disable the garbage collector;
* enforce a consistent `C` locale;
* auto-register `class_exists` to load Doctrine annotations;
* print a user deprecation notices summary at the end of the test suite;
diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php
index c0abdaa700604..1283da08fa408 100644
--- a/src/Symfony/Bridge/PhpUnit/bootstrap.php
+++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php
@@ -17,10 +17,6 @@
return;
}
-// Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+
-// https://bugs.php.net/bug.php?id=53976
-gc_disable();
-
// Enforce a consistent locale
setlocale(LC_ALL, 'C');
diff --git a/src/Symfony/Bridge/ProxyManager/LICENSE b/src/Symfony/Bridge/ProxyManager/LICENSE
index 43028bc600f26..12a74531e40a4 100644
--- a/src/Symfony/Bridge/ProxyManager/LICENSE
+++ b/src/Symfony/Bridge/ProxyManager/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Fabien Potencier
+Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
index ad7949dfaa682..69d6d326f4d08 100644
--- a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
+++ b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php
@@ -13,6 +13,7 @@
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\RequestContext;
/**
* Twig extension for the Symfony HttpFoundation component.
@@ -22,10 +23,12 @@
class HttpFoundationExtension extends \Twig_Extension
{
private $requestStack;
+ private $requestContext;
- public function __construct(RequestStack $requestStack)
+ public function __construct(RequestStack $requestStack, RequestContext $requestContext = null)
{
$this->requestStack = $requestStack;
+ $this->requestContext = $requestContext;
}
/**
@@ -57,6 +60,23 @@ public function generateAbsoluteUrl($path)
}
if (!$request = $this->requestStack->getMasterRequest()) {
+ if (null !== $this->requestContext && '' !== $host = $this->requestContext->getHost()) {
+ $scheme = $this->requestContext->getScheme();
+ $port = '';
+
+ if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) {
+ $port = ':'.$this->requestContext->getHttpPort();
+ } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) {
+ $port = ':'.$this->requestContext->getHttpsPort();
+ }
+
+ if ('/' !== $path[0]) {
+ $path = rtrim($this->requestContext->getBaseUrl(), '/').'/'.$path;
+ }
+
+ return $scheme.'://'.$host.$port.$path;
+ }
+
return $path;
}
diff --git a/src/Symfony/Bridge/Twig/LICENSE b/src/Symfony/Bridge/Twig/LICENSE
index 43028bc600f26..12a74531e40a4 100644
--- a/src/Symfony/Bridge/Twig/LICENSE
+++ b/src/Symfony/Bridge/Twig/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Fabien Potencier
+Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
index e997615d11378..5de20b1b8f181 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
@@ -65,6 +65,17 @@ col-sm-2
{% endspaceless %}
{% endblock submit_row %}
+{% block reset_row -%}
+{% spaceless %}
+
+
+
+ {{ form_widget(form) }}
+
+
+{% endspaceless %}
+{% endblock reset_row %}
+
{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}
diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
index 165236ef613ec..5affc7a6a1b92 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
@@ -167,7 +167,14 @@
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
{% endif %}
{% if label is not same as(false) and label is empty %}
- {% set label = name|humanize %}
+ {%- if label_format is not empty -%}
+ {% set label = label_format|replace({
+ '%name%': name,
+ '%id%': id,
+ }) %}
+ {%- else -%}
+ {% set label = name|humanize %}
+ {%- endif -%}
{% endif %}