diff --git a/.php_cs.dist b/.php_cs.dist index 6206f7144adc0..b73611c4308f9 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -10,17 +10,9 @@ return PhpCsFixer\Config::create() '@Symfony:risky' => true, '@PHPUnit75Migration:risky' => true, 'php_unit_dedicate_assert' => ['target' => '5.6'], - 'phpdoc_no_empty_return' => false, // triggers almost always false positive 'array_syntax' => ['syntax' => 'short'], 'fopen_flags' => false, - 'ordered_imports' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], 'protected_to_private' => false, - // Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading - 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true], - // Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], ]) ->setRiskyAllowed(true) ->setFinder( diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 29759d78bec50..a72767317ec96 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,14 @@ in 3.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.4.0...v3.4.1 +* 3.4.34 (2019-11-11) + + * bug #34297 [DI] fix locators with numeric keys (nicolas-grekas) + * bug #34282 [DI] Dont cache classes with missing parents (nicolas-grekas) + * bug #34181 [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods (TimoBakx) + * bug #34179 [Stopwatch] Fixed a bug in StopwatchEvent::getStartTime (TimoBakx) + * bug #34203 [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month (erics86) + * 3.4.33 (2019-11-01) * bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4cad5acf4d72d..ccca55ab4bb11 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -22,16 +22,16 @@ Symfony is the result of the work of many people who made the code better - Johannes S (johannes) - Grégoire Pineau (lyrixx) - Kris Wallsmith (kriswallsmith) - - Hugo Hamon (hhamon) - Yonel Ceruto (yonelceruto) + - Hugo Hamon (hhamon) - Abdellatif Ait boudad (aitboudad) - Samuel ROZE (sroze) - Romain Neutron (romain) - Pascal Borreli (pborreli) - Wouter De Jong (wouterj) - Joseph Bielawski (stloyd) - - Karma Dordrak (drak) - Alexander M. Turek (derrabus) + - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) - Martin Hasoň (hason) - Hamza Amrouche (simperfit) @@ -78,8 +78,8 @@ Symfony is the result of the work of many people who made the code better - Vladimir Reznichenko (kalessil) - Florin Patan (florinpatan) - Jáchym Toušek (enumag) - - Michel Weimerskirch (mweimerskirch) - Andrej Hudec (pulzarraider) + - Michel Weimerskirch (mweimerskirch) - Issei Murasawa (issei_m) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) @@ -124,6 +124,7 @@ Symfony is the result of the work of many people who made the code better - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) - Colin Frei + - Oskar Stark (oskarstark) - Javier Spagnoletti (phansys) - Joshua Thijssen - Alex Pott @@ -131,7 +132,6 @@ Symfony is the result of the work of many people who made the code better - excelwebzone - Gordon Franke (gimler) - Teoh Han Hui (teohhanhui) - - Oskar Stark (oskarstark) - Fabien Pennequin (fabienpennequin) - Théo FIDRY (theofidry) - Eric GELOEN (gelo) @@ -147,6 +147,7 @@ Symfony is the result of the work of many people who made the code better - Evgeniy (ewgraf) - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) + - Alexander Schranz (alexander-schranz) - Anthony MARTIN (xurudragon) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) @@ -162,13 +163,12 @@ Symfony is the result of the work of many people who made the code better - François-Xavier de Guillebon (de-gui_f) - Oleg Voronkovich - Philipp Wahala (hifi) + - Massimiliano Arione (garak) - Rafael Dohms (rdohms) - jwdeitch - - Alexander Schranz (alexander-schranz) - Mikael Pajunen - Alessandro Chitolina (alekitto) - Yanick Witschi (toflar) - - Massimiliano Arione (garak) - Niels Keurentjes (curry684) - Vyacheslav Pavlov - Richard van Laak (rvanlaak) @@ -261,6 +261,7 @@ Symfony is the result of the work of many people who made the code better - Mantis Development - Loïc Faugeron - Hidde Wieringa (hiddewie) + - dFayet - Marco Pivetta (ocramius) - Rob Frawley 2nd (robfrawley) - julien pauli (jpauli) @@ -284,6 +285,7 @@ Symfony is the result of the work of many people who made the code better - Xavier Montaña Carreras (xmontana) - Rémon van de Kamp (rpkamp) - Mickaël Andrieu (mickaelandrieu) + - Anthony GRASSIOT (antograssiot) - Xavier Perez - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA @@ -321,7 +323,6 @@ Symfony is the result of the work of many people who made the code better - Frank de Jonge (frenkynet) - Nikita Konstantinov - Wodor Wodorski - - dFayet - Thomas Lallement (raziel057) - Colin O'Dell (colinodell) - Giorgio Premi @@ -405,6 +406,7 @@ Symfony is the result of the work of many people who made the code better - Dmytro Borysovskyi (dmytr0) - Tomasz Kowalczyk (thunderer) - Artur Eshenbrener + - Timo Bakx (timobakx) - Damien Alexandre (damienalexandre) - Thomas Perez (scullwm) - Saif Eddin Gmati (azjezz) @@ -427,7 +429,6 @@ Symfony is the result of the work of many people who made the code better - Grzegorz (Greg) Zdanowski (kiler129) - Iker Ibarguren (ikerib) - Kirill chEbba Chebunin (chebba) - - Anthony GRASSIOT (antograssiot) - Greg Thornton (xdissent) - Martin Hujer (martinhujer) - Alex Bowers @@ -442,6 +443,7 @@ Symfony is the result of the work of many people who made the code better - Michele Locati - Pavel Volokitin (pvolok) - Valentine Boineau (valentineboineau) + - Christopher Hertel (chertel) - Arthur de Moulins (4rthem) - Matthias Althaus (althaus) - Nicolas Dewez (nicolas_dewez) @@ -483,6 +485,7 @@ Symfony is the result of the work of many people who made the code better - Steffen Roßkamp - Alexandru Furculita (afurculita) - Valentin Jonovs (valentins-jonovs) + - Guilhem N (guilhemn) - Laurent VOULLEMIER (lvo) - Jeanmonod David (jeanmonod) - Christopher Davis (chrisguitarguy) @@ -606,7 +609,6 @@ Symfony is the result of the work of many people who made the code better - Karoly Gossler (connorhu) - Scott Arciszewski - Xavier HAUSHERR - - Christopher Hertel (chertel) - Norbert Orzechowicz (norzechowicz) - Denis Charrier (brucewouaigne) - Matthijs van den Bos (matthijs) @@ -664,6 +666,7 @@ Symfony is the result of the work of many people who made the code better - Sebastian Krebs - Piotr Stankowski - Baptiste Leduc (bleduc) + - Julien Maulny - Jean-Christophe Cuvelier [Artack] - Julien Montel (julienmgel) - Philippe Segatori @@ -717,7 +720,6 @@ Symfony is the result of the work of many people who made the code better - dantleech - Anne-Sophie Bachelard (annesophie) - Sebastian Marek (proofek) - - Guilhem N (guilhemn) - Erkhembayar Gantulga (erheme318) - zenmate - Michal Trojanowski @@ -725,7 +727,6 @@ Symfony is the result of the work of many people who made the code better - Mathias STRASSER (roukmoute) - Max Grigorian (maxakawizard) - DerManoMann - - Timo Bakx (timobakx) - Rostyslav Kinash - Dennis Fridrich (dfridrich) - Mardari Dorel (dorumd) @@ -736,6 +737,7 @@ Symfony is the result of the work of many people who made the code better - adev - Stefan Warman - Arkadius Stefanski (arkadius) + - Antonio Pauletich (x-coder264) - Tristan Maindron (tmaindron) - Behnoush Norouzali (behnoush) - Wesley Lancel @@ -753,6 +755,7 @@ Symfony is the result of the work of many people who made the code better - Shaun Simmons (simshaun) - Richard Bradley - Ulumuddin Yunus (joenoez) + - rtek - Johann Saunier (prophet777) - Sergey (upyx) - Andreas Erhard @@ -772,6 +775,7 @@ Symfony is the result of the work of many people who made the code better - Simon Schick (simonsimcity) - redstar504 - Tristan Roussel + - HypeMC - Cameron Porter - Hossein Bukhamsin - Oliver Hoff @@ -973,6 +977,7 @@ Symfony is the result of the work of many people who made the code better - Alexander Miehe (engerim) - Morgan Auchede (mauchede) - Sascha Dens (saschadens) + - Chi-teck - Don Pinkster - Maksim Muruev - Emil Einarsson @@ -1052,6 +1057,7 @@ Symfony is the result of the work of many people who made the code better - neghmurken - xaav - Mahmoud Mostafa (mahmoud) + - Mathias Arlaud (mtarld) - Ahmed Abdou - Daniel Iwaniec - Pieter @@ -1092,7 +1098,6 @@ Symfony is the result of the work of many people who made the code better - Ashura - Hryhorii Hrebiniuk - johnstevenson - - Antonio Pauletich (x-coder264) - hamza - dantleech - Bastien DURAND (deamon) @@ -1129,9 +1134,9 @@ Symfony is the result of the work of many people who made the code better - Chris Tiearney - Oliver Hoff - Ole Rößner (basster) - - rtek - Faton (notaf) - Tom Houdmont + - tamar peled - Per Sandström (per) - Goran Juric - Laurent Ghirardotti (laurentg) @@ -1169,8 +1174,8 @@ Symfony is the result of the work of many people who made the code better - Ken Marfilla (marfillaster) - benatespina (benatespina) - Denis Kop - - HypeMC - Jean-Guilhem Rouel (jean-gui) + - HypeMC - jfcixmedia - Dominic Tubach - Nikita Konstantinov @@ -1223,6 +1228,7 @@ Symfony is the result of the work of many people who made the code better - Dan Wilga - Andrew Tch - Alexander Cheprasov + - Tristan Bessoussa (sf_tristanb) - Rodrigo Díez Villamuera (rodrigodiez) - James Hudson - Stephen Clouse @@ -1381,6 +1387,7 @@ Symfony is the result of the work of many people who made the code better - Zacharias Luiten - Sebastian Utz - Adrien Gallou (agallou) + - Fabien Salles (blacked) - Maks Rafalko (bornfree) - Karol Sójko (karolsojko) - sl_toto (sl_toto) @@ -1544,6 +1551,7 @@ Symfony is the result of the work of many people who made the code better - 1ma (jautenim) - Nicolas Schwartz (nicoschwartz) - Patrik Gmitter (patie) + - Peter Schultz - Jonathan Gough - Benjamin Bender - Jared Farrish @@ -1616,6 +1624,7 @@ Symfony is the result of the work of many people who made the code better - ryunosuke - victoria - Francisco Facioni (fran6co) + - Stanislav Gamayunov (happyproff) - Iwan van Staveren (istaveren) - Povilas S. (povilas) - Laurent Negre (raulnet) @@ -1630,6 +1639,7 @@ Symfony is the result of the work of many people who made the code better - catch - Alexandre Segura - Josef Cech + - Glodzienski - Andrii Boiko - Harold Iedema - Ikhsan Agustian @@ -1670,6 +1680,7 @@ Symfony is the result of the work of many people who made the code better - Matthew Donadio - Houziaux mike - Phobetor + - Eric Schildkamp - Andreas - Markus - Daniel Gorgan @@ -1700,6 +1711,7 @@ Symfony is the result of the work of many people who made the code better - Mathieu Dewet (mdewet) - Nicolas Tallefourtané (nicolab) - Botond Dani (picur) + - Romaric Drigon (romaricdrigon) - Thierry Marianne (thierrymarianne) - Nick Stemerdink - David Stone @@ -1899,7 +1911,6 @@ Symfony is the result of the work of many people who made the code better - Hein Zaw Htet™ - Ruben Kruiswijk - Cosmin-Romeo TANASE - - Julien Maulny - Michael J - Joseph Maarek - Alexander Menk @@ -2037,6 +2048,7 @@ Symfony is the result of the work of many people who made the code better - HADJEDJ Vincent (hadjedjvincent) - Daniele Cesarini (ijanki) - Ismail Asci (ismailasci) + - Jeffrey Moelands (jeffreymoelands) - Hugo Alliaume (kocal) - Simon CONSTANS (kosssi) - Kristof Van Cauwenbergh (kristofvc) @@ -2051,7 +2063,6 @@ Symfony is the result of the work of many people who made the code better - Ulf Reimers (ureimers) - Wotre - goohib - - Chi-teck - Tom Counsell - George Bateman - Xavier HAUSHERR @@ -2344,6 +2355,7 @@ Symfony is the result of the work of many people who made the code better - Stano Turza - simpson - drublic + - MaPePeR - Andreas Streichardt - Alexandre Segura - Pascal Hofmann diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php index ad1590edf6bba..e40114abe8945 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php @@ -123,7 +123,7 @@ private static function formatFileSize($path) private static function isExpired($date) { - $date = \DateTime::createFromFormat('m/Y', $date); + $date = \DateTime::createFromFormat('d/m/Y', '01/'.$date); return false !== $date && new \DateTime() > $date->modify('last day of this month 23:59:59'); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index f81a1c740a7ee..92e92c0fef54e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -35,6 +35,7 @@ abstract class KernelTestCase extends TestCase private function doTearDown() { static::ensureKernelShutdown(); + static::$kernel = null; } /** diff --git a/src/Symfony/Component/Config/Resource/ClassExistenceResource.php b/src/Symfony/Component/Config/Resource/ClassExistenceResource.php index e7ab1b8d7288e..1ba8e76248322 100644 --- a/src/Symfony/Component/Config/Resource/ClassExistenceResource.php +++ b/src/Symfony/Component/Config/Resource/ClassExistenceResource.php @@ -155,7 +155,7 @@ public static function throwOnRequiredClass($class, \Exception $previous = null) throw $previous; } - $e = new \ReflectionException("Class $class not found", 0, $previous); + $e = new \ReflectionException(sprintf('Class "%s" not found while loading "%s".', $class, self::$autoloadedClass), 0, $previous); if (null !== $previous) { throw $e; diff --git a/src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php b/src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php index ad331240debaf..b7ae81eaa6dda 100644 --- a/src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php +++ b/src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php @@ -84,7 +84,7 @@ public function testBadParentWithTimestamp() public function testBadParentWithNoTimestamp() { $this->expectException('ReflectionException'); - $this->expectExceptionMessage('Class Symfony\Component\Config\Tests\Fixtures\MissingParent not found'); + $this->expectExceptionMessage('Class "Symfony\Component\Config\Tests\Fixtures\MissingParent" not found while loading "Symfony\Component\Config\Tests\Fixtures\BadParent".'); $res = new ClassExistenceResource(BadParent::class, false); $res->isFresh(0); diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php index 0d77d7e4839d9..a7427c5a5bd66 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php @@ -41,6 +41,8 @@ protected function processValue($value, $isRoot = false) throw new InvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set.', $this->currentId)); } + $i = 0; + foreach ($arguments[0] as $k => $v) { if ($v instanceof ServiceClosureArgument) { continue; @@ -49,10 +51,13 @@ protected function processValue($value, $isRoot = false) throw new InvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \is_object($v) ? \get_class($v) : \gettype($v), $k)); } - if (\is_int($k)) { + if ($i === $k) { unset($arguments[0][$k]); $k = (string) $v; + ++$i; + } elseif (\is_int($k)) { + $i = null; } $arguments[0][$k] = new ServiceClosureArgument($v); } diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 53873c15e6252..f9bfcb52109d5 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -361,7 +361,7 @@ public function getReflectionClass($class, $throw = true) return null; } - $resource = null; + $resource = $classReflector = null; try { if (isset($this->classReflectors[$class])) { @@ -376,7 +376,6 @@ public function getReflectionClass($class, $throw = true) if ($throw) { throw $e; } - $classReflector = false; } if ($this->trackResources) { diff --git a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php index 186c9c4cec7c0..77cad3c046d73 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php @@ -149,12 +149,7 @@ private function findClasses($namespace, $pattern, $excludePattern) try { $r = $this->container->getReflectionClass($class); } catch (\ReflectionException $e) { - $classes[$class] = sprintf( - 'While discovering services from namespace "%s", an error was thrown when processing the class "%s": "%s".', - $namespace, - $class, - $e->getMessage() - ); + $classes[$class] = $e->getMessage(); continue; } // check to make sure the expected class exists diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php index 7eb7f6024696f..c5bcc660a5e48 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php @@ -380,7 +380,7 @@ public function testClassNotFoundThrowsException() public function testParentClassNotFoundThrowsException() { $this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException'); - $this->expectExceptionMessage('Cannot autowire service "a": argument "$r" of method "Symfony\Component\DependencyInjection\Tests\Compiler\BadParentTypeHintedArgument::__construct()" has type "Symfony\Component\DependencyInjection\Tests\Compiler\OptionalServiceClass" but this class is missing a parent class (Class Symfony\Bug\NotExistClass not found).'); + $this->expectExceptionMessageRegExp('{^Cannot autowire service "a": argument "\$r" of method "(Symfony\\\\Component\\\\DependencyInjection\\\\Tests\\\\Compiler\\\\)BadParentTypeHintedArgument::__construct\(\)" has type "\1OptionalServiceClass" but this class is missing a parent class \(Class "?Symfony\\\\Bug\\\\NotExistClass"? not found}'); $container = new ContainerBuilder(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php index 1de02d2577079..66af69b543202 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php @@ -114,6 +114,7 @@ public function testInheritedKeyOverwritesPreviousServiceWithKey() ->setArguments([[ 'bar' => new Reference('baz'), new Reference('bar'), + 16 => new Reference('baz'), ]]) ->addTag('container.service_locator') ; @@ -124,6 +125,7 @@ public function testInheritedKeyOverwritesPreviousServiceWithKey() $locator = $container->get('foo'); $this->assertSame(TestDefinition1::class, \get_class($locator('bar'))); + $this->assertSame(TestDefinition2::class, \get_class($locator(16))); } public function testBindingsAreCopied() diff --git a/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php b/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php index f93965f46ebfb..7f757297bc35c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator; /** - * Tests for {@see \Symfony\Component\DependencyInjection\Instantiator\RealServiceInstantiator}. + * Tests for {@see \Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator}. * * @author Marco Pivetta */ diff --git a/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php index b1b9b399c3728..5ae14932454d7 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper; /** - * Tests for {@see \Symfony\Component\DependencyInjection\PhpDumper\NullDumper}. + * Tests for {@see \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper}. * * @author Marco Pivetta */ diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php index b6a816e40898e..ffe58a67ef3bb 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php @@ -178,9 +178,9 @@ public function testMissingParentClass() $this->assertTrue($container->has(MissingParent::class)); - $this->assertSame( - ['While discovering services from namespace "Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\BadClasses\", an error was thrown when processing the class "Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\BadClasses\MissingParent": "Class Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\BadClasses\MissingClass not found".'], - $container->getDefinition(MissingParent::class)->getErrors() + $this->assertRegExp( + '{Class "?Symfony\\\\Component\\\\DependencyInjection\\\\Tests\\\\Fixtures\\\\Prototype\\\\BadClasses\\\\MissingClass"? not found}', + $container->getDefinition(MissingParent::class)->getErrors()[0] ); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php index b316c83e66a5b..d6bd1823f4a71 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -41,12 +41,12 @@ protected function setUp() protected function tearDown() { - $this->sessionDir = null; - $this->storage = null; - array_map('unlink', glob($this->sessionDir.'/*.session')); + array_map('unlink', glob($this->sessionDir.'/*')); if (is_dir($this->sessionDir)) { rmdir($this->sessionDir); } + $this->sessionDir = null; + $this->storage = null; } public function testStart() diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php index 96d60c003fbb9..673bf5c5fdab2 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -81,8 +81,8 @@ public function collect(Request $request, Response $response, \Exception $except $this->data['symfony_state'] = $this->determineSymfonyState(); $this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION); - $eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE); - $eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE); + $eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE); + $eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE); $this->data['symfony_eom'] = $eom->format('F Y'); $this->data['symfony_eol'] = $eol->format('F Y'); } @@ -314,8 +314,8 @@ public function getName() private function determineSymfonyState() { $now = new \DateTime(); - $eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)->modify('last day of this month'); - $eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)->modify('last day of this month'); + $eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month'); + $eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month'); if ($now > $eol) { $versionState = 'eol'; diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 0f310d1087823..7f9e4b4b05e94 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,11 +67,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.33'; - const VERSION_ID = 30433; + const VERSION = '3.4.34'; + const VERSION_ID = 30434; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 33; + const RELEASE_VERSION = 34; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; diff --git a/src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php b/src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php index beb73324cac89..64714d354dba2 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php +++ b/src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php @@ -75,7 +75,7 @@ interface UrlGeneratorInterface extends RequestContextAwareInterface * @param mixed[] $parameters An array of parameters * @param int $referenceType The type of reference to be generated (one of the constants) * - * @return string|null The generated URL + * @return string The generated URL * * @throws RouteNotFoundException If the named route doesn't exist * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route diff --git a/src/Symfony/Component/Stopwatch/StopwatchEvent.php b/src/Symfony/Component/Stopwatch/StopwatchEvent.php index bc8c6b5f47b79..e6739469de397 100644 --- a/src/Symfony/Component/Stopwatch/StopwatchEvent.php +++ b/src/Symfony/Component/Stopwatch/StopwatchEvent.php @@ -154,7 +154,15 @@ public function getPeriods() */ public function getStartTime() { - return isset($this->periods[0]) ? $this->periods[0]->getStartTime() : 0; + if (isset($this->periods[0])) { + return $this->periods[0]->getStartTime(); + } + + if ($this->started) { + return $this->started[0]; + } + + return 0; } /** @@ -177,12 +185,10 @@ public function getEndTime() public function getDuration() { $periods = $this->periods; - $stopped = \count($periods); - $left = \count($this->started) - $stopped; + $left = \count($this->started); - for ($i = 0; $i < $left; ++$i) { - $index = $stopped + $i; - $periods[] = new StopwatchPeriod($this->started[$index], $this->getNow(), $this->morePrecision); + for ($i = $left - 1; $i >= 0; --$i) { + $periods[] = new StopwatchPeriod($this->started[$i], $this->getNow(), $this->morePrecision); } $total = 0; diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index 86a02b153591f..349334db74839 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -99,8 +99,25 @@ public function testDurationBeforeStop() $event->stop(); usleep(50000); $event->start(); - usleep(100000); $this->assertEqualsWithDelta(100, $event->getDuration(), self::DELTA); + usleep(100000); + $this->assertEqualsWithDelta(200, $event->getDuration(), self::DELTA); + } + + public function testDurationWithMultipleStarts() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(100000); + $event->start(); + usleep(100000); + $this->assertEqualsWithDelta(300, $event->getDuration(), self::DELTA); + $event->stop(); + $this->assertEqualsWithDelta(300, $event->getDuration(), self::DELTA); + usleep(100000); + $this->assertEqualsWithDelta(400, $event->getDuration(), self::DELTA); + $event->stop(); + $this->assertEqualsWithDelta(400, $event->getDuration(), self::DELTA); } public function testStopWithoutStart() @@ -152,6 +169,27 @@ public function testStartTime() $this->assertEqualsWithDelta(0, $event->getStartTime(), self::DELTA); } + public function testStartTimeWhenStartedLater() + { + $event = new StopwatchEvent(microtime(true) * 1000); + usleep(100000); + $this->assertLessThanOrEqual(0.5, $event->getStartTime()); + + $event = new StopwatchEvent(microtime(true) * 1000); + usleep(100000); + $event->start(); + $event->stop(); + $this->assertLessThanOrEqual(101, $event->getStartTime()); + + $event = new StopwatchEvent(microtime(true) * 1000); + usleep(100000); + $event->start(); + usleep(100000); + $this->assertEqualsWithDelta(100, $event->getStartTime(), self::DELTA); + $event->stop(); + $this->assertEqualsWithDelta(100, $event->getStartTime(), self::DELTA); + } + public function testInvalidOriginThrowsAnException() { $this->expectException('InvalidArgumentException'); diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf index d047c8bb9ef82..84c24720dae3c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf @@ -278,6 +278,18 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Väärtus ei tohiks olla identne väärtusega {{ compared_value_type }} {{ compared_value }}. + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Kuvasuhe on liiga suur ({{ ratio }}). Lubatud maksimaalne suhe on {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Kuvasuhe on liiga väike ({{ ratio }}). Oodatav minimaalne suhe on {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Pilt on ruudukujuline ({{ width }}x{{ height }}px). Ruudukujulised pildid pole lubatud. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf index 6510514900583..6f9ab0a1cfa64 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf @@ -72,7 +72,7 @@ This value should be {{ limit }} or less. - הערך צריל להכיל {{ limit }} תווים לכל היותר. + הערך צריך להכיל {{ limit }} תווים לכל היותר. This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. @@ -84,7 +84,7 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות. + הערך קצר מידי. הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות. This value should not be blank. @@ -224,83 +224,147 @@ This is not a valid International Bank Account Number (IBAN). - This is not a valid International Bank Account Number (IBAN). + מספר חשבון בנק בינלאומי אינו חוקי (IBAN). This value is not a valid ISBN-10. - This value is not a valid ISBN-10. + הערך אינו ערך ISBN-10 חוקי. This value is not a valid ISBN-13. - This value is not a valid ISBN-13. + הערך אינו ערך ISBN-13 חוקי. This value is neither a valid ISBN-10 nor a valid ISBN-13. - This value is neither a valid ISBN-10 nor a valid ISBN-13. + הערך אינו ערך ISBN-10 חוקי או ערך ISBN-13 חוקי. This value is not a valid ISSN. - This value is not a valid ISSN. + הערך אינו ערך ISSN חוקי. This value is not a valid currency. - This value is not a valid currency. + הערך אינו ערך מטבע חוקי. This value should be equal to {{ compared_value }}. - This value should be equal to {{ compared_value }}. + הערך חייב להיות שווה ל {{ compared_value }}. This value should be greater than {{ compared_value }}. - This value should be greater than {{ compared_value }}. + הערך חייב להיות גדול מ {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. - This value should be greater than or equal to {{ compared_value }}. + הערך חייב להיות גדול או שווה ל {{ compared_value }}. This value should be identical to {{ compared_value_type }} {{ compared_value }}. - This value should be identical to {{ compared_value_type }} {{ compared_value }}. + הערך חייב להיות זהה ל {{ compared_value_type }} {{ compared_value }}. This value should be less than {{ compared_value }}. - This value should be less than {{ compared_value }}. + הערך חייב להיות קטן מ {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. - This value should be less than or equal to {{ compared_value }}. + הערך חייב להיות קטן או שווה ל {{ compared_value }}. This value should not be equal to {{ compared_value }}. - This value should not be equal to {{ compared_value }}. + הערך חייב להיות לא שווה ל {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + הערך חייב להיות לא זהה ל {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + היחס של התמונה הוא גדול מדי ({{ ratio }}). היחס המקסימלי האפשרי הוא {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + היחס של התמונה הוא קטן מדי ({{ ratio }}). היחס המינימלי האפשרי הוא {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + התמונה מרובעת ({{ width }}x{{ height }}px). אסורות תמונות מרובעות. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + התמונה היא לרוחב ({{ width }}x{{ height }}px). אסורות תמונות לרוחב. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + התמונה היא לאורך ({{ width }}x{{ height }}px). אסורות תמונות לאורך. An empty file is not allowed. - An empty file is not allowed. + אסור קובץ ריק. + + + The host could not be resolved. + לא הייתה אפשרות לזהות את המארח. + + + This value does not match the expected {{ charset }} charset. + הערך אינו תואם למערך התווים {{ charset }} הצפוי. + + + This is not a valid Business Identifier Code (BIC). + קוד זיהוי עסקי אינו חוקי (BIC). + + + Error + שגיאה + + + This is not a valid UUID. + הערך אינו ערך UUID חוקי. + + + This value should be a multiple of {{ compared_value }}. + הערך חייב להיות כפולה של {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + הקוד זיהוי עסקי (BIC) אינו משוייך ל IBAN {{ iban }}. + + + This value should be valid JSON. + הערך אינו ערך JSON תקין. + + + This collection should contain only unique elements. + האוסף חייב להכיל רק אלמנטים ייחודיים. + + + This value should be positive. + הערך חייב להיות חיובי. + + + This value should be either positive or zero. + הערך חייב להיות חיובי או אפס. + + + This value should be negative. + הערך חייב להיות שלילי. + + + This value should be either negative or zero. + הערך חייב להיות שלילי או אפס. + + + This value is not a valid timezone. + הערך אינו אזור זמן תקין. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + סיסמא זו הודלפה בהדלפת מידע, אסור להשתמש בה. אנא השתמש בסיסמה אחרת. + + + This value should be between {{ min }} and {{ max }}. + הערך חייב להיות בין {{ min }} ו- {{ max }}. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index f4c188d1dd3aa..3ec620ad6d48b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -362,6 +362,10 @@ This password has been leaked in a data breach, it must not be used. Please use another password. Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usare una password diversa. + + This value should be between {{ min }} and {{ max }}. + Questo valore dovrebbe essere compreso tra {{ min }} e {{ max }}. +