diff --git a/UPGRADE-3.3.md b/UPGRADE-3.3.md
index 40d864222a..d20f403d5a 100644
--- a/UPGRADE-3.3.md
+++ b/UPGRADE-3.3.md
@@ -84,7 +84,7 @@ DependencyInjection
* Autowiring services based on the types they implement is deprecated and won't be supported in version 4.0. Rename (or alias) your services to their FQCN id to make them autowirable.
- * [BC BREAK] The `NullDumper` class has been made final
+ * The `NullDumper` class has been made final
* [BC BREAK] `_defaults` and `_instanceof` are now reserved service names in Yaml configurations. Please rename any services with that names.
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index 07df3ff889..3fc769c90b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -69,16 +69,11 @@ use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
use Symfony\Component\Security\Core\Security;
-use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Encoder\DecoderInterface;
use Symfony\Component\Serializer\Encoder\EncoderInterface;
-use Symfony\Component\Serializer\Encoder\YamlEncoder;
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
-use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
use Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer;
-use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
-use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Translation\Command\XliffLintCommand as BaseXliffLintCommand;
@@ -1533,39 +1528,6 @@ class FrameworkExtension extends Extension
*/
private function registerSerializerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
{
- if (class_exists('Symfony\Component\Serializer\Normalizer\DataUriNormalizer')) {
- // Run before serializer.normalizer.object
- $definition = $container->register('serializer.normalizer.data_uri', DataUriNormalizer::class);
- $definition->setPublic(false);
- $definition->addTag('serializer.normalizer', array('priority' => -920));
- }
-
- if (class_exists('Symfony\Component\Serializer\Normalizer\DateTimeNormalizer')) {
- // Run before serializer.normalizer.object
- $definition = $container->register('serializer.normalizer.datetime', DateTimeNormalizer::class);
- $definition->setPublic(false);
- $definition->addTag('serializer.normalizer', array('priority' => -910));
- }
-
- if (class_exists('Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer')) {
- // Run before serializer.normalizer.object
- $definition = $container->register('serializer.normalizer.json_serializable', JsonSerializableNormalizer::class);
- $definition->setPublic(false);
- $definition->addTag('serializer.normalizer', array('priority' => -900));
- }
-
- if (class_exists(YamlEncoder::class) && defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
- $definition = $container->register('serializer.encoder.yaml', YamlEncoder::class);
- $definition->setPublic(false);
- $definition->addTag('serializer.encoder');
- }
-
- if (class_exists(CsvEncoder::class)) {
- $definition = $container->register('serializer.encoder.csv', CsvEncoder::class);
- $definition->setPublic(false);
- $definition->addTag('serializer.encoder');
- }
-
$loader->load('serializer.xml');
if (!class_exists(DateIntervalNormalizer::class)) {
@@ -1630,7 +1592,7 @@ class FrameworkExtension extends Extension
$container->getDefinition('serializer.mapping.class_metadata_factory')->replaceArgument(
1, new Reference($config['cache'])
);
- } elseif (!$container->getParameter('kernel.debug') && class_exists(CacheClassMetadataFactory::class)) {
+ } elseif (!$container->getParameter('kernel.debug')) {
$cacheMetadataFactory = new Definition(
CacheClassMetadataFactory::class,
array(
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml
index 16edff5446..42dc667530 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml
@@ -30,6 +30,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
null
@@ -93,6 +108,14 @@
+
+
+
+
+
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
index 80f54afd20..50122ed194 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
@@ -166,12 +166,11 @@ class ConfigurationTest extends TestCase
*/
public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMessage)
{
- $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(
- InvalidConfigurationException::class,
- $expectedMessage
- );
- if (method_exists($this, 'expectExceptionMessage')) {
+ if (method_exists($this, 'expectException')) {
+ $this->expectException(InvalidConfigurationException::class);
$this->expectExceptionMessage($expectedMessage);
+ } else {
+ $this->setExpectedException(InvalidConfigurationException::class, $expectedMessage);
}
$processor = new Processor();
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 89f8f48182..e5d23ad7d6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -36,7 +36,6 @@ use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer;
use Symfony\Component\Serializer\Serializer;
-use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
@@ -764,10 +763,6 @@ abstract class FrameworkExtensionTest extends TestCase
public function testDataUriNormalizerRegistered()
{
- if (!class_exists('Symfony\Component\Serializer\Normalizer\DataUriNormalizer')) {
- $this->markTestSkipped('The DataUriNormalizer has been introduced in the Serializer Component version 3.1.');
- }
-
$container = $this->createContainerFromFile('full');
$definition = $container->getDefinition('serializer.normalizer.data_uri');
@@ -794,10 +789,6 @@ abstract class FrameworkExtensionTest extends TestCase
public function testDateTimeNormalizerRegistered()
{
- if (!class_exists('Symfony\Component\Serializer\Normalizer\DateTimeNormalizer')) {
- $this->markTestSkipped('The DateTimeNormalizer has been introduced in the Serializer Component version 3.1.');
- }
-
$container = $this->createContainerFromFile('full');
$definition = $container->getDefinition('serializer.normalizer.datetime');
@@ -809,10 +800,6 @@ abstract class FrameworkExtensionTest extends TestCase
public function testJsonSerializableNormalizerRegistered()
{
- if (!class_exists('Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer')) {
- $this->markTestSkipped('The JsonSerializableNormalizer has been introduced in the Serializer Component version 3.1.');
- }
-
$container = $this->createContainerFromFile('full');
$definition = $container->getDefinition('serializer.normalizer.json_serializable');
@@ -835,10 +822,6 @@ abstract class FrameworkExtensionTest extends TestCase
public function testSerializerCacheActivated()
{
- if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
- $this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.');
- }
-
$container = $this->createContainerFromFile('serializer_enabled');
$this->assertTrue($container->hasDefinition('serializer.mapping.cache_class_metadata_factory'));
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
index 667acfc350..3fedcbddc0 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
@@ -43,7 +43,14 @@ class ExtensionPass implements CompilerPassInterface
if ($container->has('form.extension')) {
$container->getDefinition('twig.extension.form')->addTag('twig.extension');
$reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
- $container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
+
+ $coreThemePath = dirname(dirname($reflClass->getFileName())).'/Resources/views/Form';
+ $container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', array($coreThemePath));
+
+ $paths = $container->getDefinition('twig.cache_warmer')->getArgument(2);
+ $paths[$coreThemePath] = null;
+ $container->getDefinition('twig.cache_warmer')->replaceArgument(2, $paths);
+ $container->getDefinition('twig.template_iterator')->replaceArgument(2, $paths);
}
if ($container->has('router')) {
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
index 3beb9b5cf9..f9443ba098 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
@@ -113,6 +113,7 @@ class TwigExtension extends Extension
}
}
+ // paths are modified in ExtensionPass if forms are enabled
$container->getDefinition('twig.cache_warmer')->replaceArgument(2, $config['paths']);
$container->getDefinition('twig.template_iterator')->replaceArgument(2, $config['paths']);
diff --git a/src/Symfony/Component/Debug/DebugClassLoader.php b/src/Symfony/Component/Debug/DebugClassLoader.php
index 58565606c7..372f74f6f9 100644
--- a/src/Symfony/Component/Debug/DebugClassLoader.php
+++ b/src/Symfony/Component/Debug/DebugClassLoader.php
@@ -166,18 +166,11 @@ class DebugClassLoader
}
// Don't trigger deprecations for classes in the same vendor
- if (2 > $len = 1 + (strpos($name, '\\', 1 + strpos($name, '\\')) ?: strpos($name, '_'))) {
+ if (2 > $len = 1 + (strpos($name, '\\') ?: strpos($name, '_'))) {
$len = 0;
$ns = '';
} else {
- switch ($ns = substr($name, 0, $len)) {
- case 'Symfony\Bridge\\':
- case 'Symfony\Bundle\\':
- case 'Symfony\Component\\':
- $ns = 'Symfony\\';
- $len = strlen($ns);
- break;
- }
+ $ns = substr($name, 0, $len);
}
// Detect annotations on the class
diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php
index 5d201dff1e..a54b580e4e 100644
--- a/src/Symfony/Component/DomCrawler/Crawler.php
+++ b/src/Symfony/Component/DomCrawler/Crawler.php
@@ -1071,7 +1071,7 @@ class Crawler implements \Countable, \IteratorAggregate
}
/**
- * @return \ArrayIterator
+ * @return \ArrayIterator|\DOMElement[]
*/
public function getIterator()
{
diff --git a/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf
index 4e2518b16b..2a5e57ca81 100644
--- a/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf
+++ b/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf
@@ -11,8 +11,8 @@
Den uppladdade filen var för stor. Försök ladda upp en mindre fil.
- The CSRF token is invalid.
- CSRF-symbolen är inte giltig.
+ The CSRF token is invalid. Please try to resubmit the form.
+ CSRF-elementet är inte giltigt. Försök att skicka formuläret igen.