Merge branch '2.8'

* 2.8: (27 commits)
  [2.8] Fix 3.0 incompatible deps
  [HttpKernel] Fix lowest dep
  [Security] fix check for empty usernames
  [Form] updated exception message of ButtonBuilder::setRequestHandler()
  [travis] Fix deps=high jobs
  Fix typo 'assets.package' => 'assets.packages' in UPGRADE-2.7
  [Serializer] Simplify AbstractNormalizer::prepareForDenormalization()
  [HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content
  [DependencyInjection] Forbid container cloning
  [HttpFoundation] Fix Response::closeOutputBuffers() for HHVM 3.3
  [WebProfilerBundle] Add link to show profile of latest request
  [DependencyInjection] Remove unused code in XmlFileLoader
  [HttpFoundation] Behaviour change in PHP7 for substr
  [Console] Set QuestionHelper max attempts in tests
  [Form] Fix a BC break in the entity
  fix broken ChoiceQuestion
  bumped Symfony version to 2.7.3
  updated VERSION for 2.7.2
  updated CHANGELOG for 2.7.2
  bumped Symfony version to 2.6.11
  ...

Conflicts:
	.travis.yml
	CHANGELOG-2.3.md
	CHANGELOG-2.6.md
	CHANGELOG-2.7.md
	UPGRADE-2.7.md
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Form/composer.json
	src/Symfony/Component/HttpKernel/composer.json
This commit is contained in:
Nicolas Grekas 2015-07-22 15:19:00 +02:00
commit 590ddecd85
31 changed files with 377 additions and 136 deletions

11
.gitignore vendored
View File

@ -1,8 +1,7 @@
.php_cs.cache
autoload.php
vendor/
composer.lock
composer.phar
package*.tar
packages.json
phpunit.xml
/vendor/
.php_cs.cache
composer.phar
package.tar
/packages.json

45
.travis.php Normal file
View File

@ -0,0 +1,45 @@
<?php
if (4 > $_SERVER['argc']) {
echo "Usage: commit-range branch dir1 dir2 ... dirN\n";
exit(1);
}
$dirs = $_SERVER['argv'];
array_shift($dirs);
$range = array_shift($dirs);
$branch = array_shift($dirs);
$packages = array();
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
foreach ($dirs as $dir) {
if (!`git diff --name-only $range -- $dir`) {
continue;
}
echo "$dir\n";
$package = json_decode(file_get_contents($dir.'/composer.json'));
$package->repositories = array(array(
'type' => 'composer',
'url' => 'file://'.__DIR__.'/',
));
file_put_contents($dir.'/composer.json', json_encode($package, $flags));
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
$package->version = $branch.'.x-dev';
$package->dist['type'] = 'tar';
$package->dist['url'] = 'file://'.__DIR__."/$dir/package.tar";
$packages[$package->name][$package->version] = $package;
$versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json');
$versions = json_decode($versions);
foreach ($versions->package->versions as $version => $package) {
$packages[$package->name] += array($version => $package);
}
}
file_put_contents('packages.json', json_encode(compact('packages'), $flags));

View File

@ -1,24 +0,0 @@
branch=$1
if [ -z "$branch" ]; then
echo 'Usage: branch dir1 dir2 ... dirN'
exit 1
fi
shift
components=$*
if [ -z "$components" ]; then
echo 'Usage: branch dir1 dir2 ... dirN'
exit 1
fi
echo '{"packages": {' > packages.json
for c in $components; do
sed -i ':a;N;$!ba;s#^{\n\(\s*\)\("name"\)#{\n\1"repositories": \[{ "type": "composer", "url": "file://'$(pwd)'/" }\],\n\1\2#' $c/composer.json
n=$(php -r '$n=json_decode(file_get_contents("'$c'/composer.json"));echo $n->name;')
echo '"'$n'": {"'$branch'.x-dev": ' >> packages.json
cat $c/composer.json >> packages.json
echo '"version": "'$branch.x-dev'",\n "dist": {"type": "tar", "url": "file://'$(pwd)/$c'/package'$branch'.tar"}\n}},' >> packages.json
done;
sed -i ':a;N;$!ba;s/\n}\n"/,\n "/g' packages.json
sed -i ':a;N;$!ba;s/}},$/\n}}\n}}/' packages.json
for c in $components; do
(cd $c && tar -cf package$branch.tar --exclude='package*.tar' *)
done

View File

@ -31,6 +31,7 @@ env:
before_install:
- composer self-update
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
@ -44,7 +45,7 @@ install:
- if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
- components=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
- if [ "$deps" != "no" ]; then sh .travis.sh $TRAVIS_BRANCH $components; fi;
- if [ "$deps" != "no" ]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $components; fi;
- if [ "$deps" = "2.8" ]; then git fetch origin 2.8; git checkout -m FETCH_HEAD; export COMPOSER_ROOT_VERSION=2.8.x-dev; fi;
script:

View File

@ -15,11 +15,11 @@ Symfony is the result of the work of many people who made the code better
- Christophe Coevoet (stof)
- Jakub Zalas (jakubzalas)
- Pascal Borreli (pborreli)
- Christian Flothmann (xabbuh)
- Hugo Hamon (hhamon)
- Joseph Bielawski (stloyd)
- Karma Dordrak (drak)
- Ryan Weaver (weaverryan)
- Christian Flothmann (xabbuh)
- Lukas Kahwe Smith (lsmith)
- Romain Neutron (romain)
- Jeremy Mikola (jmikola)
@ -27,22 +27,23 @@ Symfony is the result of the work of many people who made the code better
- Benjamin Eberlei (beberlei)
- Igor Wiedler (igorw)
- Martin Hasoň (hason)
- Eriksen Costa (eriksencosta)
- Abdellatif Ait boudad (aitboudad)
- Eriksen Costa (eriksencosta)
- Grégoire Pineau (lyrixx)
- Wouter De Jong (wouterj)
- Jonathan Wage (jwage)
- Alexandre Salomé (alexandresalome)
- William Durand (couac)
- Kévin Dunglas (dunglas)
- ornicar
- stealth35 (stealth35)
- Alexander Mols (asm89)
- Kévin Dunglas (dunglas)
- Bulat Shakirzyanov (avalanche123)
- Francis Besset (francisbesset)
- Saša Stamenković (umpirsky)
- Henrik Bjørnskov (henrikbjorn)
- Miha Vrhovnik
- Diego Saint Esteben (dii3g0)
- Sarah Khalil (saro0h)
- Konstantin Kudryashov (everzet)
- Bilal Amarni (bamarni)
@ -55,15 +56,14 @@ Symfony is the result of the work of many people who made the code better
- Arnout Boks (aboks)
- Christian Raue
- Michel Weimerskirch (mweimerskirch)
- Diego Saint Esteben (dii3g0)
- Lee McDermott
- Brandon Turner
- Luis Cordova (cordoval)
- Douglas Greenshields (shieldo)
- Kevin Bond (kbond)
- Daniel Holmes (dholmes)
- Bart van den Burg (burgov)
- Jordan Alliot (jalliot)
- Kevin Bond (kbond)
- John Wards (johnwards)
- Fran Moreno (franmomu)
- Antoine Hérault (herzult)
@ -71,6 +71,7 @@ Symfony is the result of the work of many people who made the code better
- Gábor Egyed (1ed)
- Arnaud Le Blanc (arnaud-lb)
- Tim Nagel (merk)
- Maxime Steinhausser (ogizanagi)
- Brice BERNARD (brikou)
- marc.weistroff
- lenar
@ -83,16 +84,16 @@ Symfony is the result of the work of many people who made the code better
- excelwebzone
- Jacob Dreesen (jdreesen)
- Matthias Pigulla (mpdude)
- Fabien Pennequin (fabienpennequin)
- Peter Kokot (maastermedia)
- Peter Rehm (rpet)
- Michal Piotrowski (eventhorizon)
- Stefano Sala (stefano.sala)
- Javier Eguiluz (javier.eguiluz)
- Fabien Pennequin (fabienpennequin)
- Peter Rehm (rpet)
- Peter Kokot (maastermedia)
- Gordon Franke (gimler)
- Robert Schönthal (digitalkaoz)
- Juti Noppornpitak (shiroyuki)
- Dariusz Ruminski
- Michal Piotrowski (eventhorizon)
- Stefano Sala (stefano.sala)
- Juti Noppornpitak (shiroyuki)
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto)
@ -102,10 +103,13 @@ Symfony is the result of the work of many people who made the code better
- Pablo Godel (pgodel)
- Eric GELOEN (gelo)
- Jérémie Augustin (jaugustin)
- Rafael Dohms (rdohms)
- Tigran Azatyan (tigranazatyan)
- Alexander Schwenn (xelaris)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
- Joshua Thijssen
- Vladimir Reznichenko (kalessil)
- Tigran Azatyan (tigranazatyan)
- Issei Murasawa (issei_m)
- Richard Shank (iampersistent)
- Clemens Tolboom
- Helmer Aaviksoo
@ -113,15 +117,16 @@ Symfony is the result of the work of many people who made the code better
- Hiromi Hishida (77web)
- Matthieu Ouellette-Vachon (maoueh)
- Michał Pipa (michal.pipa)
- Issei Murasawa (issei_m)
- Amal Raghav (kertz)
- Jonathan Ingram (jonathaningram)
- Artur Kotyrba
- Iltar van der Berg
- Rouven Weßling (realityking)
- Andréia Bohner (andreia)
- Dmitrii Chekaliuk (lazyhammer)
- Clément JOBEILI (dator)
- Dorian Villet (gnutix)
- Javier Spagnoletti (phansys)
- Richard Miller (mr_r_miller)
- hacfi (hifi)
- Mario A. Alvarez Garcia (nomack84)
@ -136,21 +141,17 @@ Symfony is the result of the work of many people who made the code better
- Larry Garfield (crell)
- Martin Schuhfuß (usefulthink)
- Thomas Rabaix (rande)
- Javier Spagnoletti (phansys)
- Matthieu Bontemps (mbontemps)
- Pierre Minnieur (pminnieur)
- fivestar
- Dominique Bongiraud
- Iltar van der Berg
- Leszek Prabucki (l3l0)
- François Zaninotto (fzaninotto)
- Dustin Whittle (dustinwhittle)
- jeff
- Maxime Steinhausser (ogizanagi)
- Joshua Thijssen
- Justin Hileman (bobthecow)
- Sven Paulus (subsven)
- Vladimir Reznichenko (kalessil)
- Warnar Boekkooi (boekkooi)
- Lars Strojny (lstrojny)
- Rui Marinho (ruimarinho)
- Mikael Pajunen
@ -158,11 +159,14 @@ Symfony is the result of the work of many people who made the code better
- Tugdual Saunier (tucksaun)
- Sergey Linnik (linniksa)
- Marcel Beerta (mazen)
- Vincent AUBERT (vincent)
- julien pauli (jpauli)
- Francois Zaninotto
- Alexander Kotynia (olden)
- Daniel Tschinder
- Alexander M. Turek (derrabus)
- Elnur Abdurrakhimov (elnur)
- John Kary (johnkary)
- Manuel Reinhard (sprain)
- Danny Berger (dpb587)
- Roman Marintšenko (inori)
@ -187,11 +191,10 @@ Symfony is the result of the work of many people who made the code better
- Jeremy Livingston (jeremylivingston)
- Nikita Konstantinov
- Wodor Wodorski
- Vincent AUBERT (vincent)
- Matthieu Auger (matthieuauger)
- Sébastien Lavoie (lavoiesl)
- Beau Simensen (simensen)
- Robert Kiss (kepten)
- John Kary (johnkary)
- Ruben Gonzalez (rubenrua)
- Kim Hemsø Rasmussen (kimhemsoe)
- Florian Lonqueu-Brochard (florianlb)
@ -199,8 +202,8 @@ Symfony is the result of the work of many people who made the code better
- Wouter Van Hecke
- Peter Kruithof (pkruithof)
- Michael Holm (hollo)
- Warnar Boekkooi (boekkooi)
- Marc Weistroff (futurecat)
- Kristen Gilden (kgilden)
- Chris Smith (cs278)
- Florian Klein (docteurklein)
- Manuel Kiessling (manuelkiessling)
@ -226,6 +229,7 @@ Symfony is the result of the work of many people who made the code better
- Julien Galenski (ruian)
- Bongiraud Dominique
- janschoenherr
- Thomas Schulz (king2500)
- Marco Pivetta (ocramius)
- Ricard Clau (ricardclau)
- Erin Millard
@ -235,18 +239,18 @@ Symfony is the result of the work of many people who made the code better
- Vitaliy Zakharov (zakharovvi)
- Tobias Sjösten (tobiassjosten)
- Gyula Sallai (salla)
- Alexander M. Turek (derrabus)
- Konstantin Myakshin (koc)
- Inal DJAFAR (inalgnu)
- Christian Gärtner (dagardner)
- Tomasz Kowalczyk (thunderer)
- Daniel Wehner
- Felix Labrecque
- Yaroslav Kiliba
- Sébastien Lavoie (lavoiesl)
- Stepan Anchugov (kix)
- Terje Bråten
- Kristen Gilden (kgilden)
- Robbert Klarenbeek (robbertkl)
- Blanchon Vincent (blanchonvincent)
- Dawid Nowak
- hossein zolfi (ocean)
- Clément Gautier (clementgautier)
- Eduardo Gulias (egulias)
@ -261,6 +265,7 @@ Symfony is the result of the work of many people who made the code better
- Loïc Chardonnet (gnusat)
- Marek Kalnik (marekkalnik)
- Vyacheslav Salakhutdinov (megazoll)
- Hassan Amouhzi
- Tamas Szijarto
- Pavel Volokitin (pvolok)
- Endre Fejes
@ -283,9 +288,9 @@ Symfony is the result of the work of many people who made the code better
- Oscar Cubo Medina (ocubom)
- Karel Souffriau
- Christophe L. (christophelau)
- Massimiliano Arione (garak)
- Anthon Pang (robocoder)
- Jáchym Toušek
- Thomas Schulz (king2500)
- Jannik Zschiesche (apfelbox)
- Emanuele Gaspari (inmarelibero)
- Dariusz Rumiński
@ -304,7 +309,6 @@ Symfony is the result of the work of many people who made the code better
- Asier Illarramendi (doup)
- Chris Sedlmayr (catchamonkey)
- Seb Koelen
- Daniel Wehner
- Christoph Mewes (xrstf)
- Vitaliy Tverdokhlib (vitaliytv)
- Ariel Ferrandini (aferrandini)
@ -313,7 +317,9 @@ Symfony is the result of the work of many people who made the code better
- Jonas Flodén (flojon)
- Christian Schmidt
- Marcin Sikoń (marphi)
- Dominik Zogg (dominik.zogg)
- franek (franek)
- Damien Alexandre (damienalexandre)
- Adam Harvey
- Alex Bakhturin
- François-Xavier de Guillebon (de-gui_f)
@ -322,7 +328,6 @@ Symfony is the result of the work of many people who made the code better
- Jérôme Macias (jeromemacias)
- Fabian Lange (codingfabian)
- Yoshio HANAWA
- Tomasz Kowalczyk (thunderer)
- Sebastian Bergmann
- Pablo Díez (pablodip)
- Kevin McBride
@ -359,6 +364,7 @@ Symfony is the result of the work of many people who made the code better
- Nils Adermann (naderman)
- Gábor Fási
- Benjamin Leveque (benji07)
- Ivan Kurnosov
- sasezaki
- Dawid Pakuła (zulusx)
- Florian Rey (nervo)
@ -369,13 +375,14 @@ Symfony is the result of the work of many people who made the code better
- Daniel Tschinder
- Ryan
- Alexander Deruwe (aderuwe)
- Dave Hulbert (dave1010)
- François Pluchino (francoispluchino)
- Massimiliano Arione (garak)
- Ivan Rey (ivanrey)
- Marcin Chyłek (songoq)
- Ned Schwartz
- Ziumin
- Lenar Lõhmus
- Benjamin Laugueux (yzalis)
- Zach Badgett (zachbadgett)
- Aurélien Fredouelle
- Pavel Campr (pcampr)
@ -416,6 +423,7 @@ Symfony is the result of the work of many people who made the code better
- David Fuhr
- Kamil Kokot (pamil)
- Rostyslav Kinash
- Maciej Malarz (malarzm)
- Daisuke Ohata
- Vincent Simonin
- Stefan Warman
@ -428,7 +436,6 @@ Symfony is the result of the work of many people who made the code better
- umpirski
- Chris Heng (gigablah)
- Ulumuddin Yunus (joenoez)
- Dominik Zogg (dominik.zogg)
- Luc Vieillescazes (iamluc)
- Johann Saunier (prophet777)
- Antoine Corcy
@ -461,9 +468,11 @@ Symfony is the result of the work of many people who made the code better
- Alexander Volochnev (exelenz)
- Michael Piecko
- yclian
- Sergio Santoro
- Sebastian Grodzicki (sgrodzicki)
- Pascal Helfenstein
- Baldur Rensch (brensch)
- Vladyslav Petrovych
- Alex Xandra Albert Sim
- Yuen-Chi Lian
- Besnik Br
@ -485,6 +494,7 @@ Symfony is the result of the work of many people who made the code better
- Marc Morera (mmoreram)
- Andrew Hilobok (hilobok)
- Christian Soronellas (theunic)
- Romain Gautier (mykiwi)
- Yosmany Garcia (yosmanyga)
- Degory Valentine
- Benoit Lévêque (benoit_leveque)
@ -501,7 +511,7 @@ Symfony is the result of the work of many people who made the code better
- fago
- Harm van Tilborg
- Jan Prieser
- Damien Alexandre (damienalexandre)
- Artur Melo (restless)
- James Michael DuPont
- Tom Klingenberg
- Christopher Hall (mythmakr)
@ -510,14 +520,17 @@ Symfony is the result of the work of many people who made the code better
- Berny Cantos (xphere81)
- Reen Lokum
- Martin Parsiegla (spea)
- Possum
- Denis Charrier (brucewouaigne)
- Quentin Schuler
- Pierre Vanliefland (pvanliefland)
- frost-nzcr4
- Oskar Stark (oskarstark)
- Abhoryo
- Fabian Vogler (fabian)
- Korvin Szanto
- MatTheCat
- Maksim Kotlyar (makasim)
- Ivan Kurnosov
- Neil Ferreira
- Dmitry Parnas (parnas)
- DQNEO
@ -541,10 +554,11 @@ Symfony is the result of the work of many people who made the code better
- Shin Ohno (ganchiku)
- Geert De Deckere (geertdd)
- Jan Kramer (jankramer)
- Jean-Baptiste GOMOND (mjbgo)
- Richard van Laak (rvanlaak)
- abdul malik ikhsan (samsonasik)
- Henry Snoek (snoek09)
- Timothée Barray (tyx)
- Benjamin Laugueux (yzalis)
- Christian Morgan
- Alexander Miehe (engerim)
- Morgan Auchede (mauchede)
@ -578,6 +592,7 @@ Symfony is the result of the work of many people who made the code better
- Raul Fraile (raulfraile)
- sensio
- Patrick Kaufmann
- Reece Fowell (reecefowell)
- stefan.r
- Matthieu Napoli (mnapoli)
- Ben Ramsey (ramsey)
@ -594,22 +609,26 @@ Symfony is the result of the work of many people who made the code better
- Michael Tibben
- Sander Marechal
- Radosław Benkel
- Gennady Telegin (gtelegin)
- Marcos Sánchez
- ttomor
- Mei Gwilym (meigwilym)
- Michael H. Arieli (excelwebzone)
- Luciano Mammino (loige)
- fabios
- Jérôme Vasseur
- Sander Coolen (scoolen)
- Nicolas Le Goff (nlegoff)
- Manuele Menozzi
- Anton Babenko (antonbabenko)
- Irmantas Šiupšinskas (irmantas)
- Charles-Henri Bruyand
- Danilo Silva
- Zachary Tong (polyfractal)
- Hryhorii Hrebiniuk
- dantleech
- Xavier Leune
- Christian Schmidt
- Tero Alén (tero)
- DerManoMann
- Guillaume Royer
@ -671,12 +690,12 @@ Symfony is the result of the work of many people who made the code better
- Marcin Chwedziak
- Roland Franssen (ro0)
- Tony Cosentino (tony-co)
- Maciej Malarz
- Rodrigo Díez Villamuera (rodrigodiez)
- e-ivanov
- Jochen Bayer (jocl)
- Jeremy Bush
- wizhippo
- Diego Saint Esteben (dosten)
- rpg600
- Péter Buri (burci)
- Davide Borsatto (davide.borsatto)
@ -701,6 +720,7 @@ 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)
@ -747,6 +767,7 @@ Symfony is the result of the work of many people who made the code better
- Tatsuya Tsuruoka
- Ross Tuck
- Kévin Gomez (kevin)
- azine
- Dawid Sajdak
- Ludek Stepan
- Geoffrey Brier
@ -769,6 +790,7 @@ Symfony is the result of the work of many people who made the code better
- Cédric Lahouste (rapotor)
- Samuel Vogel (samuelvogel)
- Berat Doğan
- twifty
- Anthony Ferrara
- ShiraNai7
- Janusz Jabłoński (yanoosh)
@ -812,6 +834,7 @@ Symfony is the result of the work of many people who made the code better
- Samuel Gordalina (gordalina)
- Max Romanovsky (maxromanovsky)
- Mathieu Morlon
- Daniel Tschinder
- Rafał Muszyński (rafmus90)
- Timothy Anido (xanido)
- Rick Prent
@ -829,7 +852,6 @@ Symfony is the result of the work of many people who made the code better
- Thomas Chmielowiec (chmielot)
- Jānis Lukss
- rkerner
- Vladyslav Petrovych
- Matthew J Mucklo
- fdgdfg (psampaz)
- Stéphane Seng
@ -846,6 +868,7 @@ Symfony is the result of the work of many people who made the code better
- Jonathan Gough
- Benjamin Bender
- Konrad Mohrfeldt
- Lance Chen
- kor3k kor3k (kor3k)
- Stelian Mocanita (stelian)
- Flavian (2much)
@ -877,7 +900,6 @@ Symfony is the result of the work of many people who made the code better
- Adrian Olek (adrianolek)
- Przemysław Piechota (kibao)
- Leonid Terentyev (li0n)
- Oskar Stark (oskarstark)
- Adam Prager (padam87)
- ryunosuke
- victoria
@ -892,7 +914,6 @@ Symfony is the result of the work of many people who made the code better
- catch
- Alexandre Segura
- Josef Cech
- Possum
- Arnau González (arnaugm)
- Nate (frickenate)
- Matthew Foster (mfoster)
@ -930,6 +951,7 @@ Symfony is the result of the work of many people who made the code better
- Grayson Koonce (breerly)
- Karim Cassam Chenaï (ka)
- Nicolas Bastien (nicolas_bastien)
- Andrew Zhilin (zhil)
- Andy Stanberry
- Luiz “Felds” Liscia
- Thomas Rothe
@ -937,11 +959,13 @@ Symfony is the result of the work of many people who made the code better
- avi123
- alsar
- Mike Meier
- michalmarcinkowski
- Warwick
- Chris
- efeen
- Michał Dąbrowski (defrag)
- Simone Fumagalli (hpatoio)
- Brian Graham (incognito)
- Kevin Vergauwen (innocenzo)
- Alessio Baglio (ioalessio)
- John Bafford (jbafford)
@ -960,7 +984,6 @@ Symfony is the result of the work of many people who made the code better
- Daan van Renterghem
- Bram Van der Sype (brammm)
- Julien Moulin (lizjulien)
- Romain Gautier (mykiwi)
- Nikita Nefedov (nikita2206)
- Mauro Foti (skler)
- Yannick Warnier (ywarnier)
@ -989,7 +1012,6 @@ Symfony is the result of the work of many people who made the code better
- Mark de Haan (markdehaan)
- Dan Patrick (mdpatrick)
- Rares Vlaseanu (raresvla)
- Artur Melo (restless)
- Sofiane HADDAG (sofhad)
- tante kinast (tante)
- Vincent LEFORT (vlefort)
@ -1013,7 +1035,6 @@ Symfony is the result of the work of many people who made the code better
- Florian Pfitzer (marmelatze)
- Martin Mayer (martin)
- Grzegorz Łukaszewicz (newicz)
- Richard van Laak (rvanlaak)
- grifx
- Robert Campbell
- Matt Lehner
@ -1022,6 +1043,7 @@ Symfony is the result of the work of many people who made the code better
- Ruben Kruiswijk
- Michael J
- Joseph Maarek
- Alexander Menk
- Alex Pods
- timaschew
- Ian Phillips
@ -1040,6 +1062,7 @@ Symfony is the result of the work of many people who made the code better
- Maerlyn
- Even André Fiskvik
- Diego Agulló
- Gerrit Drost
- Lenar Lõhmus
- Cristian Gonzalez
- Juan M Martínez
@ -1056,7 +1079,6 @@ Symfony is the result of the work of many people who made the code better
- Jeroen Thora (bolle)
- Masao Maeda (brtriver)
- Darius Leskauskas (darles)
- Dave Hulbert (dave1010)
- David Joos (djoos)
- Denis Klementjev (dklementjev)
- Tomáš Polívka (draczris)
@ -1085,6 +1107,7 @@ Symfony is the result of the work of many people who made the code better
- akimsko
- Youpie
- srsbiz
- Taylan Kasap
- Nicolas A. Bérard-Nault
- Gladhon
- Saem Ghani
@ -1108,6 +1131,7 @@ Symfony is the result of the work of many people who made the code better
- Wotre
- goohib
- Xavier HAUSHERR
- Mantas Urnieža
- Cas
- Dusan Kasan
- Myke79
@ -1142,6 +1166,7 @@ Symfony is the result of the work of many people who made the code better
- andreabreu98
- Michael Schneider
- n-aleha
- Şəhriyar İmanov
- Kaipi Yann
- Sam Williams
- Adrian Philipp
@ -1150,6 +1175,7 @@ Symfony is the result of the work of many people who made the code better
- Ondrej Slinták
- vlechemin
- Brian Corrigan
- Ladislav Tánczos
- Brian Freytag
- Skorney
- mieszko4
@ -1175,6 +1201,7 @@ Symfony is the result of the work of many people who made the code better
- Sergiy Sokolenko
- dinitrol
- Penny Leach
- Richard Trebichavský
- g123456789l
- Giorgio Premi
- oscartv
@ -1200,6 +1227,7 @@ Symfony is the result of the work of many people who made the code better
- Alex Olmos (alexolmos)
- Antonio Mansilla (amansilla)
- Juan Ases García (ases)
- Siragusa (asiragusa)
- Daniel Basten (axhm3a)
- DUPUCH (bdupuch)
- Bill Hance (billhance)
@ -1239,6 +1267,7 @@ Symfony is the result of the work of many people who made the code better
- Adam Monsen (meonkeys)
- Ala Eddine Khefifi (nayzo)
- emilienbouard (neime)
- Nicholas Byfleet (nickbyfleet)
- ollie harridge (ollietb)
- Paul Andrieux (paulandrieux)
- Paweł Szczepanek (pauluz)
@ -1270,6 +1299,7 @@ Symfony is the result of the work of many people who made the code better
- Jesper Søndergaard Pedersen (zerrvox)
- Florent Cailhol
- szymek
- Kovacs Nicolas
- craigmarvelley
- Stano Turza
- simpson
@ -1281,6 +1311,7 @@ Symfony is the result of the work of many people who made the code better
- fh-github@fholzhauer.de
- Mark Topper
- Xavier REN
- Zander Baldwin
- Philipp Scheit
- max
- Mohamed Karnichi (amiral)

View File

@ -87,7 +87,7 @@ abstract class DoctrineType extends AbstractType
*/
public static function createChoiceName($choice, $key, $value)
{
return (string) $value;
return str_replace('-', '_', (string) $value);
}
/**

View File

@ -495,6 +495,31 @@ class EntityTypeTest extends TypeTestCase
$this->assertSame('3', $field['3']->getViewData());
}
public function testSubmitMultipleExpandedWithNegativeIntegerId()
{
$entity1 = new SingleIntIdEntity(-1, 'Foo');
$entity2 = new SingleIntIdEntity(2, 'Bar');
$this->persist(array($entity1, $entity2));
$field = $this->factory->createNamed('name', 'entity', null, array(
'multiple' => true,
'expanded' => true,
'em' => 'default',
'class' => self::SINGLE_IDENT_CLASS,
'choice_label' => 'name',
));
$field->submit(array('-1'));
$expected = new ArrayCollection(array($entity1));
$this->assertTrue($field->isSynchronized());
$this->assertEquals($expected, $field->getData());
$this->assertTrue($field['_1']->getData());
$this->assertFalse($field['2']->getData());
}
public function testOverrideChoices()
{
$entity1 = new SingleIntIdEntity(1, 'Foo');

View File

@ -33,20 +33,20 @@
"doctrine/annotations": "~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7|~3.0.0",
"symfony/browser-kit": "~2.4|~3.0.0",
"symfony/console": "~2.7|~3.0.0",
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",
"symfony/intl": "~2.3|~3.0.0",
"symfony/security": "~2.6|~3.0.0",
"symfony/form": "~2.8|~3.0.0",
"symfony/class-loader": "~2.1|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
"symfony/validator": "~2.5|~3.0.0",
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/browser-kit": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/css-selector": "~2.8|~3.0",
"symfony/dom-crawler": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0",
"symfony/intl": "~2.8|~3.0",
"symfony/security": "~2.8|~3.0",
"symfony/form": "~2.8|~3.0",
"symfony/class-loader": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
"symfony/validator": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0"
},
"suggest": {
"symfony/console": "For using the console commands",

View File

@ -91,6 +91,10 @@ class ProfilerController
$panel = $request->query->get('panel', 'request');
$page = $request->query->get('page', 'home');
if ('latest' === $token && $latest = current($this->profiler->find(null, null, 1, null, null, null))) {
$token = $latest['token'];
}
if (!$profile = $this->profiler->loadProfile($token)) {
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token)), 200, array('Content-Type' => 'text/html'));
}

View File

@ -25,10 +25,17 @@
<em>The token already exists in the database.</em>
</p>
{% elseif about == 'no_token' %}
<h2>Token not found</h2>
<p>
<em>Token "{{ token }}" was not found in the database.</em>
</p>
{% if token == 'latest' %}
<h2>No profiles</h2>
<p>
<em>No profiles found in the database.</em>
</p>
{% else %}
<h2>Token not found</h2>
<p>
<em>Token "{{ token }}" was not found in the database.</em>
</p>
{% endif %}
{% endif %}
{% endblock %}
</div>

View File

@ -14,6 +14,7 @@
{% if profile %}
<div id="resume">
<a id="resume-view-all" href="{{ path('_profiler_search', {limit: 10}) }}">View last 10</a>
<a id="resume-view-latest" href="{{ path('_profiler', {token: 'latest', 'panel': panel}) }}">View latest</a>
<strong>Profile for:</strong>
{{ profile.method|upper }}
{% if profile.method|upper in ['GET', 'HEAD'] %}

View File

@ -217,7 +217,7 @@ li {
border-top-right-radius: 16px;
line-height: 18px;
}
a#resume-view-all {
a#resume-view-all, a#resume-view-latest {
display: inline-block;
padding: 0.2em 0.7em;
margin-right: 0.5em;

View File

@ -162,7 +162,7 @@ class ChoiceQuestion extends Question
throw new \InvalidArgumentException(sprintf($errorMessage, $value));
}
$multiselectChoices[] = $choices[(string) $result];
$multiselectChoices[] = (string) $result;
}
if ($multiselect) {

View File

@ -36,15 +36,18 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$questionHelper->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n"));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
$question->setMaxAttempts(1);
// first answer is an empty answer, we're supposed to receive the default value
$this->assertEquals('Spiderman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
$question->setMaxAttempts(1);
$this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
$question->setErrorMessage('Input "%s" is not a superhero!');
$question->setMaxAttempts(2);
$this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question));
rewind($output->getStream());
@ -61,6 +64,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
}
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
$question->setMaxAttempts(1);
$question->setMultiselect(true);
$this->assertEquals(array('Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
@ -68,11 +72,13 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
$question->setMaxAttempts(1);
$question->setMultiselect(true);
$this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
$question->setMaxAttempts(1);
$question->setMultiselect(true);
$this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
@ -227,6 +233,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$dialog->setHelperSet($helperSet);
$question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
$question->setMaxAttempts(1);
$answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
$this->assertSame($expectedValue, $answer);

View File

@ -596,4 +596,8 @@ class Container implements IntrospectableContainerInterface
{
return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
}
private function __clone()
{
}
}

View File

@ -49,7 +49,7 @@ class XmlFileLoader extends FileLoader
$this->parseImports($xml, $path);
// parameters
$this->parseParameters($xml, $path);
$this->parseParameters($xml);
// extensions
$this->loadFromExtensions($xml);
@ -70,9 +70,8 @@ class XmlFileLoader extends FileLoader
* Parses parameters.
*
* @param \DOMDocument $xml
* @param string $file
*/
private function parseParameters(\DOMDocument $xml, $file)
private function parseParameters(\DOMDocument $xml)
{
if ($parameters = $this->getChildren($xml->documentElement, 'parameters')) {
$this->container->getParameterBag()->add($this->getArgumentsAsPhp($parameters[0], 'parameter'));

View File

@ -650,6 +650,16 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($c->has('alias'));
$this->assertSame($c->get('alias'), $c->get('bar'));
}
public function testThatCloningIsNotSupported()
{
$class = new \ReflectionClass('Symfony\Component\DependencyInjection\Container');
$clone = $class->getMethod('__clone');
if (PHP_VERSION_ID >= 540000) {
$this->assertFalse($class->isCloneable());
}
$this->assertTrue($clone->isPrivate());
}
}
class ProjectServiceContainer extends Container

View File

@ -498,7 +498,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
*/
public function setRequestHandler(RequestHandlerInterface $requestHandler)
{
throw new BadMethodCallException('Buttons do not support form processors.');
throw new BadMethodCallException('Buttons do not support request handlers.');
}
/**

View File

@ -224,13 +224,13 @@ class Request
/**
* Constructor.
*
* @param array $query The GET parameters
* @param array $request The POST parameters
* @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array $cookies The COOKIE parameters
* @param array $files The FILES parameters
* @param array $server The SERVER parameters
* @param string $content The raw body data
* @param array $query The GET parameters
* @param array $request The POST parameters
* @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array $cookies The COOKIE parameters
* @param array $files The FILES parameters
* @param array $server The SERVER parameters
* @param string|resource $content The raw body data
*
* @api
*/
@ -244,13 +244,13 @@ class Request
*
* This method also re-initializes all properties.
*
* @param array $query The GET parameters
* @param array $request The POST parameters
* @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array $cookies The COOKIE parameters
* @param array $files The FILES parameters
* @param array $server The SERVER parameters
* @param string $content The raw body data
* @param array $query The GET parameters
* @param array $request The POST parameters
* @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...)
* @param array $cookies The COOKIE parameters
* @param array $files The FILES parameters
* @param array $server The SERVER parameters
* @param string|resource $content The raw body data
*
* @api
*/
@ -1563,16 +1563,38 @@ class Request
*/
public function getContent($asResource = false)
{
if (PHP_VERSION_ID < 50600 && (false === $this->content || (true === $asResource && null !== $this->content))) {
$currentContentIsResource = is_resource($this->content);
if (PHP_VERSION_ID < 50600 && false === $this->content) {
throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.');
}
if (true === $asResource) {
if ($currentContentIsResource) {
rewind($this->content);
return $this->content;
}
// Content passed in parameter (test)
if (is_string($this->content)) {
$resource = fopen('php://temp','r+');
fwrite($resource, $this->content);
rewind($resource);
return $resource;
}
$this->content = false;
return fopen('php://input', 'rb');
}
if ($currentContentIsResource) {
rewind($this->content);
return stream_get_contents($this->content);
}
if (null === $this->content) {
$this->content = file_get_contents('php://input');
}
@ -1902,7 +1924,8 @@ class Request
$requestUri = substr($requestUri, 0, $pos);
}
if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
$pathInfo = substr($requestUri, strlen($baseUrl));
if (null !== $baseUrl && (false === $pathInfo || '' === $pathInfo)) {
// If substr() returns false then PATH_INFO is set to an empty string
return '/';
} elseif (null === $baseUrl) {

View File

@ -1247,7 +1247,7 @@ class Response
{
$status = ob_get_status(true);
$level = count($status);
$flags = PHP_VERSION_ID >= 50400 ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1;
$flags = defined('PHP_OUTPUT_HANDLER_REMOVABLE') ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1;
while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) {
if ($flush) {

View File

@ -969,6 +969,26 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$this->assertTrue(feof($retval));
}
public function testGetContentReturnsResourceWhenContentSetInConstructor()
{
$req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent');
$resource = $req->getContent(true);
$this->assertTrue(is_resource($resource));
$this->assertEquals('MyContent', stream_get_contents($resource));
}
public function testContentAsResource()
{
$resource = fopen('php://memory','r+');
fwrite($resource, 'My other content');
rewind($resource);
$req = new Request(array(), array(), array(), array(), array(), array(), $resource);
$this->assertEquals('My other content', stream_get_contents($req->getContent(true)));
$this->assertEquals('My other content', $req->getContent());
}
/**
* @expectedException \LogicException
* @dataProvider getContentCantBeCalledTwiceWithResourcesProvider
@ -1013,7 +1033,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
return array(
'Resource then fetch' => array(true, false),
'Resource then resource' => array(true, true),
'Fetch then resource' => array(false, true),
);
}

View File

@ -88,7 +88,7 @@ class PropertyAccessor implements PropertyAccessorInterface
$this->writeProperty($objectOrArray, $property, $value);
}
if ($propertyValues[$i][self::IS_REF]) {
if ($propertyValues[$i][self::IS_REF] && is_object($objectOrArray)) {
return;
}
@ -149,7 +149,7 @@ class PropertyAccessor implements PropertyAccessorInterface
}
}
if ($propertyValues[$i][self::IS_REF]) {
if ($propertyValues[$i][self::IS_REF] && is_object($objectOrArray)) {
return true;
}
}

View File

@ -0,0 +1,27 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
class TestClassIsWritable
{
protected $value;
public function getValue()
{
return $this->value;
}
public function __construct($value)
{
$this->value = $value;
}
}

View File

@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
class TestClassSetValue
{
protected $value;
public function getValue()
{
return $this->value;
}
public function setValue($value)
{
$this->value = $value;
}
public function __construct($value)
{
$this->value = $value;
}
}

View File

@ -16,6 +16,8 @@ use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClass;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicGet;
use Symfony\Component\PropertyAccess\Tests\Fixtures\Ticket5775Object;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassSetValue;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassIsWritable;
class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
{
@ -446,4 +448,45 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
$this->propertyAccessor->setValue($obj, 'publicProperty[foo][bar]', 'Updated');
$this->assertSame('Updated', $obj->publicProperty['foo']['bar']);
}
}
public function getReferenceChainObjectsForSetValue()
{
return array(
array(array('a' => array('b' => array('c' => 'old-value'))), '[a][b][c]', 'new-value'),
array(new TestClassSetValue(new TestClassSetValue('old-value')), 'value.value', 'new-value'),
array(new TestClassSetValue(array('a' => array('b' => array('c' => new TestClassSetValue('old-value'))))), 'value[a][b][c].value', 'new-value'),
array(new TestClassSetValue(array('a' => array('b' => 'old-value'))), 'value[a][b]', 'new-value'),
array(new \ArrayIterator(array('a' => array('b' => array('c' => 'old-value')))), '[a][b][c]', 'new-value'),
);
}
/**
* @dataProvider getReferenceChainObjectsForSetValue
*/
public function testSetValueForReferenceChainIssue($object, $path, $value)
{
$this->propertyAccessor->setValue($object, $path, $value);
$this->assertEquals($value, $this->propertyAccessor->getValue($object, $path));
}
public function getReferenceChainObjectsForIsWritable()
{
return array(
array(new TestClassIsWritable(array('a' => array('b' => 'old-value'))), 'value[a][b]', false),
array(new TestClassIsWritable(new \ArrayIterator(array('a' => array('b' => 'old-value')))), 'value[a][b]', true),
array(new TestClassIsWritable(array('a' => array('b' => array('c' => new TestClassSetValue('old-value'))))), 'value[a][b][c].value', true),
);
}
/**
* @dataProvider getReferenceChainObjectsForIsWritable
*/
public function testIsWritableForReferenceChainIssue($object, $path, $value)
{
$this->assertEquals($value, $this->propertyAccessor->isWritable($object, $path));
}
}

View File

@ -36,7 +36,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface
*/
public function __construct($username, $class)
{
if (empty($username)) {
if ('' === $username || null === $username) {
throw new \InvalidArgumentException('$username must not be empty.');
}
if (empty($class)) {

View File

@ -62,7 +62,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
}
$username = $token->getUsername();
if (empty($username)) {
if ('' === $username || null === $username) {
$username = 'NONE_PROVIDED';
}

View File

@ -40,7 +40,7 @@ final class PersistentToken implements PersistentTokenInterface
if (empty($class)) {
throw new \InvalidArgumentException('$class must not be empty.');
}
if (empty($username)) {
if ('' === $username || null === $username) {
throw new \InvalidArgumentException('$username must not be empty.');
}
if (empty($series)) {

View File

@ -30,7 +30,7 @@ final class User implements AdvancedUserInterface
public function __construct($username, $password, array $roles = array(), $enabled = true, $userNonExpired = true, $credentialsNonExpired = true, $userNonLocked = true)
{
if (empty($username)) {
if ('' === $username || null === $username) {
throw new \InvalidArgumentException('The username cannot be empty.');
}

View File

@ -223,19 +223,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
*/
protected function prepareForDenormalization($data)
{
if (is_array($data) || is_object($data) && $data instanceof \ArrayAccess) {
$normalizedData = $data;
} elseif (is_object($data)) {
$normalizedData = array();
foreach ($data as $attribute => $value) {
$normalizedData[$attribute] = $value;
}
} else {
$normalizedData = array();
}
return $normalizedData;
return (array) $data;
}
/**

View File

@ -22,7 +22,7 @@
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/property-access": "~2.8|~3.0.0",
"symfony/property-access": "~2.8|~3.0",
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0"
},