diff --git a/.php_cs.dist b/.php_cs.dist index a73e16918c..9b8d082116 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -10,6 +10,7 @@ return PhpCsFixer\Config::create() '@Symfony:risky' => true, 'array_syntax' => array('syntax' => 'long'), 'protected_to_private' => false, + 'php_unit_dedicate_assert' => array('target' => '3.5'), )) ->setRiskyAllowed(true) ->setFinder( diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 0cee61b0cf..8bd9ce3466 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -627,7 +627,7 @@ HttpKernel # ... # explicit commands registration - AppBundle\Command: + AppBundle\Command\: resource: '../../src/AppBundle/Command/*' tags: ['console.command'] ``` diff --git a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php index fd09e82ded..c019c31a9a 100644 --- a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php @@ -12,7 +12,6 @@ namespace Symfony\Bridge\Doctrine; use ProxyManager\Proxy\LazyLoadingInterface; -use Psr\Container\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Doctrine\Common\Persistence\AbstractManagerRegistry; @@ -24,7 +23,7 @@ use Doctrine\Common\Persistence\AbstractManagerRegistry; abstract class ManagerRegistry extends AbstractManagerRegistry { /** - * @var ContainerInterface + * @var Container */ protected $container; @@ -58,7 +57,7 @@ abstract class ManagerRegistry extends AbstractManagerRegistry $name = $this->aliases[$name]; } if (isset($this->fileMap[$name])) { - $wrappedInstance = $this->load($this->fileMap[$name], false); + $wrappedInstance = $this->load($this->fileMap[$name]); } else { $method = $this->methodMap[$name] ?? 'get'.strtr($name, $this->underscoreMap).'Service'; // BC with DI v3.4 $wrappedInstance = $this->{$method}(false); diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php index ed76f8db68..692ee89e4b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php @@ -15,8 +15,7 @@ class RegisterMappingsPassTest extends TestCase */ public function testNoDriverParmeterException() { - $container = $this->createBuilder(array( - )); + $container = $this->createBuilder(); $this->process($container, array( 'manager.param.one', 'manager.param.two', diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php index 4999bda42e..b24a374fed 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php @@ -19,12 +19,18 @@ use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader; use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface; use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; +use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface; /** * @author Bernhard Schussek */ class DoctrineChoiceLoaderTest extends TestCase { + /** + * @var ChoiceListFactoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $factory; + /** * @var ObjectManager|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index c41629b4de..0213714397 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -31,7 +31,6 @@ use Symfony\Component\Form\ChoiceList\View\ChoiceView; use Symfony\Component\Form\Forms; use Symfony\Component\Form\Tests\Extension\Core\Type\BaseTypeTest; use Symfony\Component\Form\Tests\Extension\Core\Type\FormTypeTest; -use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleAssociationToIntIdEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity; @@ -1120,10 +1119,7 @@ class EntityTypeTest extends BaseTypeTest $repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS); - $entityType = new EntityType( - $this->emRegistry, - PropertyAccess::createPropertyAccessor() - ); + $entityType = new EntityType($this->emRegistry); $entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry); @@ -1183,10 +1179,7 @@ class EntityTypeTest extends BaseTypeTest $repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS); - $entityType = new EntityType( - $this->emRegistry, - PropertyAccess::createPropertyAccessor() - ); + $entityType = new EntityType($this->emRegistry); $entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry); diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php index 2f86ac0dde..fd6c23279c 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Bridge\Doctrine\PropertyInfo\Tests; +namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo; use Doctrine\DBAL\Types\Type as DBALType; use Doctrine\ORM\EntityManager; diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php index a3b9c573bc..fa610e5c06 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php @@ -116,7 +116,7 @@ class CodeHelper extends Helper { if (is_readable($file)) { if (extension_loaded('fileinfo')) { - $finfo = new \Finfo(); + $finfo = new \finfo(); // Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 1485e1b20d..77e4cf0de8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -141,13 +141,6 @@ abstract class FrameworkExtensionTest extends TestCase $container = $this->createContainerFromFile('esi_disabled'); $this->assertFalse($container->hasDefinition('fragment.renderer.esi'), 'The ESI fragment renderer is not registered'); - } - - public function testEsiInactive() - { - $container = $this->createContainerFromFile('default_config'); - - $this->assertFalse($container->hasDefinition('fragment.renderer.esi')); $this->assertFalse($container->hasDefinition('esi')); } @@ -164,6 +157,7 @@ abstract class FrameworkExtensionTest extends TestCase $container = $this->createContainerFromFile('ssi_disabled'); $this->assertFalse($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is not registered'); + $this->assertFalse($container->hasDefinition('ssi')); } public function testEsiAndSsiWithoutFragments() @@ -175,14 +169,6 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertTrue($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is registered'); } - public function testSsiInactive() - { - $container = $this->createContainerFromFile('default_config'); - - $this->assertFalse($container->hasDefinition('fragment.renderer.ssi')); - $this->assertFalse($container->hasDefinition('ssi')); - } - public function testEnabledProfiler() { $container = $this->createContainerFromFile('profiler'); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php index 3ddbb1fd4c..287ba531f4 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\SecurityBundle\Tests; +namespace Symfony\Bundle\SecurityBundle\Tests\Debug; use PHPUnit\Framework\TestCase; use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener; diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php index a7a330859f..a21c11adca 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php @@ -9,12 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\TwigBundle\Tests; +namespace Symfony\Bundle\TwigBundle\Tests\Functional; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\TwigBundle\Tests\TestCase; use Symfony\Bundle\TwigBundle\TwigBundle; class CacheWarmingTest extends TestCase diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php index 3cf0268203..952b5e6ae1 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php @@ -9,12 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\TwigBundle\Tests; +namespace Symfony\Bundle\TwigBundle\Tests\Functional; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\TwigBundle\Tests\TestCase; use Symfony\Bundle\TwigBundle\TwigBundle; class NoTemplatingEntryTest extends TestCase diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index e83e95ae13..aac9e3a0d4 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -250,6 +250,8 @@ mode: arguments[0].mode, redirect: arguments[0].redirect }; + } else { + url = String(url); } if (!url.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) { var method = 'GET'; diff --git a/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php b/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php index 13304fae36..0a9312346e 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php @@ -12,13 +12,9 @@ namespace Symfony\Component\Config\Tests\Definition\Builder; use PHPUnit\Framework\TestCase; -use Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder as CustomNodeBuilder; +use Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder as CustomNodeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder; -require __DIR__.'/../../Fixtures/Builder/NodeBuilder.php'; -require __DIR__.'/../../Fixtures/Builder/BarNodeDefinition.php'; -require __DIR__.'/../../Fixtures/Builder/VariableNodeDefinition.php'; - class TreeBuilderTest extends TestCase { public function testUsingACustomNodeBuilder() @@ -28,11 +24,11 @@ class TreeBuilderTest extends TestCase $nodeBuilder = $root->children(); - $this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder); + $this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder); $nodeBuilder = $nodeBuilder->arrayNode('deeper')->children(); - $this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder); + $this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder); } public function testOverrideABuiltInNodeType() @@ -42,7 +38,7 @@ class TreeBuilderTest extends TestCase $definition = $root->children()->variableNode('variable'); - $this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition', $definition); + $this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\VariableNodeDefinition', $definition); } public function testAddANodeType() @@ -52,7 +48,7 @@ class TreeBuilderTest extends TestCase $definition = $root->children()->barNode('variable'); - $this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition', $definition); + $this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\BarNodeDefinition', $definition); } public function testCreateABuiltInNodeTypeWithACustomNodeBuilder() diff --git a/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php b/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php index 0d46f3d2c8..b9c62e5377 100644 --- a/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php +++ b/src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Config\Tests\Definition\Builder; +namespace Symfony\Component\Config\Tests\Fixtures\Builder; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Tests\Fixtures\BarNode; diff --git a/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php b/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php index aa5986311b..22b8b32fb6 100644 --- a/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php +++ b/src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Config\Tests\Definition\Builder; +namespace Symfony\Component\Config\Tests\Fixtures\Builder; use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder; diff --git a/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php b/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php index 1017880c11..6126ed434f 100644 --- a/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php +++ b/src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Config\Tests\Definition\Builder; +namespace Symfony\Component\Config\Tests\Fixtures\Builder; use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition; diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 0bc1bb4ba9..dc088a0565 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -46,6 +46,12 @@ class QuestionHelper extends Helper } if (!$input->isInteractive()) { + if ($question instanceof ChoiceQuestion) { + $choices = $question->getChoices(); + + return $choices[$question->getDefault()]; + } + return $question->getDefault(); } diff --git a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index 4ba20fe797..3b8c07d393 100644 --- a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -83,6 +83,10 @@ class QuestionHelperTest extends AbstractQuestionHelperTest $question->setMultiselect(true); $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question)); + + $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 0); + // We are supposed to get the default value since we are not in interactive mode + $this->assertEquals('Superman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, true), $this->createOutputInterface(), $question)); } public function testAsk() diff --git a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php index d68f9a035e..c4cf58315a 100644 --- a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php +++ b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php @@ -258,6 +258,7 @@ class FlattenExceptionTest extends TestCase public function testRecursionInArguments() { + $a = null; $a = array('foo', array(2, &$a)); $exception = $this->createException($a); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterEnvVarProcessorsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterEnvVarProcessorsPassTest.php index d807a6fa41..cddb62dce9 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterEnvVarProcessorsPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterEnvVarProcessorsPassTest.php @@ -26,7 +26,7 @@ class RegisterEnvVarProcessorsPassTest extends TestCase (new RegisterEnvVarProcessorsPass())->process($container); $this->assertTrue($container->has('container.env_var_processors_locator')); - $this->assertInstanceof(SimpleProcessor::class, $container->get('container.env_var_processors_locator')->get('foo')); + $this->assertInstanceOf(SimpleProcessor::class, $container->get('container.env_var_processors_locator')->get('foo')); $expected = array( 'foo' => array('string'), diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php index 1ca36e974f..21a2810578 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php @@ -32,7 +32,7 @@ class ResolveInstanceofConditionalsPassTest extends TestCase $parent = 'instanceof.'.parent::class.'.0.foo'; $def = $container->getDefinition('foo'); $this->assertEmpty($def->getInstanceofConditionals()); - $this->assertInstanceof(ChildDefinition::class, $def); + $this->assertInstanceOf(ChildDefinition::class, $def); $this->assertTrue($def->isAutowired()); $this->assertSame($parent, $def->getParent()); $this->assertSame(array('tag' => array(array()), 'baz' => array(array('attr' => 123))), $def->getTags()); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php index 78fe2954af..2ad4ac34fa 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php @@ -412,6 +412,7 @@ class ProjectServiceContainer extends Container public $__foo_bar; public $__foo_baz; public $__internal; + protected $privates; protected $methodMap = array( 'bar' => 'getBarService', 'foo_bar' => 'getFooBarService', diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 8d21ca3523..def1e5fc09 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -1519,7 +1519,7 @@ class FilesystemTest extends FilesystemTestCase // skip mode check on Windows if ('\\' !== DIRECTORY_SEPARATOR) { - $this->assertFilePermissions(664, $filename, 'The written file should keep the same permissions as before.'); + $this->assertFilePermissions(664, $filename); umask($oldMask); } } diff --git a/src/Symfony/Component/Form/FormRegistry.php b/src/Symfony/Component/Form/FormRegistry.php index 7d08d690df..6be83ab95d 100644 --- a/src/Symfony/Component/Form/FormRegistry.php +++ b/src/Symfony/Component/Form/FormRegistry.php @@ -82,11 +82,14 @@ class FormRegistry implements FormRegistryInterface if (!$type) { // Support fully-qualified class names - if (class_exists($name) && in_array('Symfony\Component\Form\FormTypeInterface', class_implements($name))) { - $type = new $name(); - } else { - throw new InvalidArgumentException(sprintf('Could not load type "%s"', $name)); + if (!class_exists($name)) { + throw new InvalidArgumentException(sprintf('Could not load type "%s": class does not exist.', $name)); } + if (!is_subclass_of($name, 'Symfony\Component\Form\FormTypeInterface')) { + throw new InvalidArgumentException(sprintf('Could not load type "%s": class does not implement "Symfony\Component\Form\FormTypeInterface".', $name)); + } + + $type = new $name(); } $this->types[$name] = $this->resolveType($type); diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index e3318822bd..b35727962e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -989,7 +989,7 @@ class ResponseTest extends ResponseTestCase $ianaCodesReasonPhrases = array(); - $xpath = new \DomXPath($ianaHttpStatusCodes); + $xpath = new \DOMXPath($ianaHttpStatusCodes); $xpath->registerNamespace('ns', 'http://www.iana.org/assignments'); $records = $xpath->query('//ns:record'); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php index 9d2c1949f3..8e97848763 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php @@ -24,8 +24,8 @@ class StrictSessionHandlerTest extends TestCase ->with('path', 'name')->willReturn(true); $proxy = new StrictSessionHandler($handler); - $this->assertInstanceof('SessionUpdateTimestampHandlerInterface', $proxy); - $this->assertInstanceof(AbstractSessionHandler::class, $proxy); + $this->assertInstanceOf('SessionUpdateTimestampHandlerInterface', $proxy); + $this->assertInstanceOf(AbstractSessionHandler::class, $proxy); $this->assertTrue($proxy->open('path', 'name')); } diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php index 3fc1974bfc..3444c10f83 100644 --- a/src/Symfony/Component/Intl/Intl.php +++ b/src/Symfony/Component/Intl/Intl.php @@ -234,7 +234,7 @@ final class Intl */ public static function getIcuStubVersion() { - return '60.1'; + return '60.2'; } /** diff --git a/src/Symfony/Component/Intl/Resources/bin/icu.ini b/src/Symfony/Component/Intl/Resources/bin/icu.ini index f06bc75335..da25128e28 100644 --- a/src/Symfony/Component/Intl/Resources/bin/icu.ini +++ b/src/Symfony/Component/Intl/Resources/bin/icu.ini @@ -15,4 +15,4 @@ 57 = http://source.icu-project.org/repos/icu/icu/tags/release-57-1/source 58 = http://source.icu-project.org/repos/icu/tags/release-58-2/icu4c/source 59 = http://source.icu-project.org/repos/icu/tags/release-59-1/icu4c/source -60 = http://source.icu-project.org/repos/icu/tags/release-60-1/icu4c/source +60 = http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c/source diff --git a/src/Symfony/Component/Intl/Resources/data/currencies/de.json b/src/Symfony/Component/Intl/Resources/data/currencies/de.json index 0a07964357..015dfbd138 100644 --- a/src/Symfony/Component/Intl/Resources/data/currencies/de.json +++ b/src/Symfony/Component/Intl/Resources/data/currencies/de.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.11", + "Version": "2.1.37.96", "Names": { "ADP": [ "ADP", diff --git a/src/Symfony/Component/Intl/Resources/data/currencies/ur.json b/src/Symfony/Component/Intl/Resources/data/currencies/ur.json index bbe4edc0ea..0a5ca9e1d3 100644 --- a/src/Symfony/Component/Intl/Resources/data/currencies/ur.json +++ b/src/Symfony/Component/Intl/Resources/data/currencies/ur.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.28", + "Version": "2.1.37.69", "Names": { "AED": [ "AED", diff --git a/src/Symfony/Component/Intl/Resources/data/languages/de.json b/src/Symfony/Component/Intl/Resources/data/languages/de.json index f4a01cd421..58e7a7c571 100644 --- a/src/Symfony/Component/Intl/Resources/data/languages/de.json +++ b/src/Symfony/Component/Intl/Resources/data/languages/de.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.11", + "Version": "2.1.37.96", "Names": { "aa": "Afar", "ab": "Abchasisch", diff --git a/src/Symfony/Component/Intl/Resources/data/languages/ur.json b/src/Symfony/Component/Intl/Resources/data/languages/ur.json index 33871c2dee..e28f6175c9 100644 --- a/src/Symfony/Component/Intl/Resources/data/languages/ur.json +++ b/src/Symfony/Component/Intl/Resources/data/languages/ur.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.28", + "Version": "2.1.37.69", "Names": { "aa": "افار", "ab": "ابقازیان", diff --git a/src/Symfony/Component/Intl/Resources/data/regions/de.json b/src/Symfony/Component/Intl/Resources/data/regions/de.json index bd2259f580..1bc40b718a 100644 --- a/src/Symfony/Component/Intl/Resources/data/regions/de.json +++ b/src/Symfony/Component/Intl/Resources/data/regions/de.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.11", + "Version": "2.1.37.96", "Names": { "AC": "Ascension", "AD": "Andorra", diff --git a/src/Symfony/Component/Intl/Resources/data/regions/ur.json b/src/Symfony/Component/Intl/Resources/data/regions/ur.json index a28f28f770..89fbae8bf9 100644 --- a/src/Symfony/Component/Intl/Resources/data/regions/ur.json +++ b/src/Symfony/Component/Intl/Resources/data/regions/ur.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.28", + "Version": "2.1.37.69", "Names": { "AC": "اسینشن آئلینڈ", "AD": "انڈورا", diff --git a/src/Symfony/Component/Intl/Resources/data/scripts/de.json b/src/Symfony/Component/Intl/Resources/data/scripts/de.json index 07898c2c2e..735ee0fdcf 100644 --- a/src/Symfony/Component/Intl/Resources/data/scripts/de.json +++ b/src/Symfony/Component/Intl/Resources/data/scripts/de.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.11", + "Version": "2.1.37.96", "Names": { "Afak": "Afaka", "Aghb": "Kaukasisch-Albanisch", diff --git a/src/Symfony/Component/Intl/Resources/data/scripts/ur.json b/src/Symfony/Component/Intl/Resources/data/scripts/ur.json index bedfaaae75..7c26e92044 100644 --- a/src/Symfony/Component/Intl/Resources/data/scripts/ur.json +++ b/src/Symfony/Component/Intl/Resources/data/scripts/ur.json @@ -1,5 +1,5 @@ { - "Version": "2.1.37.28", + "Version": "2.1.37.69", "Names": { "Arab": "عربی", "Armn": "آرمینیائی", diff --git a/src/Symfony/Component/Intl/Resources/data/svn-info.txt b/src/Symfony/Component/Intl/Resources/data/svn-info.txt index c452480e2f..1bfc195f5b 100644 --- a/src/Symfony/Component/Intl/Resources/data/svn-info.txt +++ b/src/Symfony/Component/Intl/Resources/data/svn-info.txt @@ -1,7 +1,7 @@ SVN information =============== -URL: http://source.icu-project.org/repos/icu/tags/release-60-1/icu4c/source -Revision: 40662 +URL: http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c/source +Revision: 40727 Author: yoshito -Date: 2017-10-31T15:14:15.305164Z +Date: 2017-12-13T20:01:38.026283Z diff --git a/src/Symfony/Component/Intl/Resources/data/version.txt b/src/Symfony/Component/Intl/Resources/data/version.txt index c4601b28ee..76887d82ad 100644 --- a/src/Symfony/Component/Intl/Resources/data/version.txt +++ b/src/Symfony/Component/Intl/Resources/data/version.txt @@ -1 +1 @@ -60.1 +60.2 diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php index 18d2abba8f..7a4f01b66a 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php @@ -852,7 +852,9 @@ abstract class AbstractIntlDateFormatterTest extends TestCase $position = null; $formatter = $this->getDefaultDateFormatter('y'); $this->assertSame(0, $formatter->parse('1970', $position)); - $this->assertNull($position); + // Since $position is not supported by the Symfony implementation, the following won't work. + // The intl implementation works this way since 60.2. + // $this->assertSame(4, $position); } public function testSetPattern() diff --git a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php index 37ac752a6b..e4c18c47b1 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php @@ -75,7 +75,7 @@ class PhpMatcherDumperTest extends TestCase ->setMethods(array('redirect')) ->setConstructorArgs(array(new RequestContext())) ->getMock(); - + $matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/', 'foo')->willReturn(array()); $matcher->match('/foo%3Abar'); diff --git a/src/Symfony/Component/Workflow/Tests/DependencyInjection/ValidateWorkflowsPassTest.php b/src/Symfony/Component/Workflow/Tests/DependencyInjection/ValidateWorkflowsPassTest.php index 3b7ddf6d6d..d728cc1195 100644 --- a/src/Symfony/Component/Workflow/Tests/DependencyInjection/ValidateWorkflowsPassTest.php +++ b/src/Symfony/Component/Workflow/Tests/DependencyInjection/ValidateWorkflowsPassTest.php @@ -1,6 +1,6 @@