diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 9deacb4981..c3af769a41 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -7,6 +7,15 @@ in 4.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1 +* 4.0.6 (2018-03-05) + + * bug #26393 [DI] Skip resource tracking if disabled (chalasr) + * bug #26403 fix the handling of timestamp in the MongoDBSessionHandler (hjanuschka) + * bug #26355 [DI] Fix missing "id" normalization when dumping the container (nicolas-grekas) + * bug #26368 [WebProfilerBundle] Fix Debug toolbar breaks app (xkobal) + * bug #26369 Use fill instead of style for svg colors (rpkamp) + * bug #26358 [FrameworkBundle] Silence "Failed to remove directory" on cache:clear (nicolas-grekas) + * 4.0.5 (2018-03-01) * bug #26327 [Form][WCAG] Errors sign for people that do not see colors (Nyholm) diff --git a/src/Symfony/Bridge/PhpUnit/CoverageListener.php b/src/Symfony/Bridge/PhpUnit/CoverageListener.php index 79333fbd00..d41c26968f 100644 --- a/src/Symfony/Bridge/PhpUnit/CoverageListener.php +++ b/src/Symfony/Bridge/PhpUnit/CoverageListener.php @@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve } else { class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener'); } + +if (false) { + class CoverageListener + { + } +} diff --git a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php index d46a79e00e..a753525b76 100644 --- a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php +++ b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php @@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve } else { class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener'); } + +if (false) { + class SymfonyTestsListener + { + } +} diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 2f97e32e11..a549cd7da4 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -26,8 +26,13 @@ if (PHP_VERSION_ID >= 70200) { $PHPUNIT_VERSION = '4.8'; } +if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') { + putenv('COMPOSER=composer.json'); + $_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json'; +} + $root = __DIR__; -while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) { +while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) { if ($root === dirname($root)) { break; } diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig index f0c4626daf..d6b08f7637 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig @@ -62,4 +62,4 @@ col-sm-10 {{- form_errors(form) -}} {#--#} -{%- endblock checkbox_row %} \ No newline at end of file +{%- endblock checkbox_row %} diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index a3484d9036..2acd7086b0 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -203,7 +203,13 @@ {% set label = name|humanize %} {%- endif -%} {%- endif -%} - <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}} + <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %} + {%- else -%} + {%- if errors|length > 0 -%} +
+ {{- form_errors(form) -}} +
+ {%- endif -%} {%- endif -%} {%- endblock form_label %} @@ -261,12 +267,12 @@ {% block form_errors -%} {%- if errors|length > 0 -%} -
- -
+ + {%- for error in errors -%} + + {{ 'Error'|trans({}, 'validators') }} {{ error.message }} + + {%- endfor -%} + {%- endif %} {%- endblock form_errors %} diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 7d993fb1f5..096fadd0f8 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -317,7 +317,14 @@ {% if decision.attributes|length == 1 %} - {{ decision.attributes|first }} + {% set attribute = decision.attributes|first %} + {% if attribute.expression is defined %} + Expression:
{{ attribute.expression }}
+ {% elseif attribute.type == 'string' %} + {{ attribute }} + {% else %} + {{ profiler_dump(attribute) }} + {% endif %} {% else %} {{ profiler_dump(decision.attributes) }} {% endif %} diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php index 629ff18a0c..8d2e34aa20 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php @@ -86,7 +86,7 @@ class UserPasswordEncoderCommandTest extends WebTestCase $this->assertContains('Password encoding succeeded', $output); $encoder = new Argon2iPasswordEncoder(); - preg_match('# Encoded password\s+(\$argon2id\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches); + preg_match('# Encoded password\s+(\$argon2id?\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches); $hash = $matches[1]; $this->assertTrue($encoder->isPasswordValid($hash, 'password', null)); } diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 0beea40c4d..0f5c410a4b 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -79,7 +79,7 @@ abstract class Client } /** - * Sets the maximum number of requests that crawler can follow. + * Sets the maximum number of redirects that crawler can follow. * * @param int $maxRedirects */ @@ -90,7 +90,7 @@ abstract class Client } /** - * Returns the maximum number of requests that crawler can follow. + * Returns the maximum number of redirects that crawler can follow. * * @return int */ diff --git a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php index c5b7abf896..bf8e5625ac 100644 --- a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php +++ b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php @@ -148,12 +148,16 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali yield print_r($defaults, true); } - if ($class->isSubclassOf(EventSubscriberInterface::class)) { + if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) { + return; + } + + if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) { yield EventSubscriberInterface::class; yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true); } - if ($class->isSubclassOf(ServiceSubscriberInterface::class)) { + if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) { yield ServiceSubscriberInterface::class; yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true); } diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php index 00a7901f3a..9d61c9cd83 100644 --- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php +++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php @@ -55,7 +55,7 @@ class XmlUtilsTest extends TestCase XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')); $this->fail(); } catch (\InvalidArgumentException $e) { - $this->assertRegExp('/The XML file "[\w:\/\\\.-]+" is not valid\./', $e->getMessage()); + $this->assertRegExp('/The XML file "[\w:\/\\\.~+-]+" is not valid\./', $e->getMessage()); } $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'))); diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 5ece0fa4a5..9a109e8a1c 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -935,9 +935,13 @@ EOF; if (Container::class !== $baseClassWithNamespace) { $r = $this->container->getReflectionClass($baseClassWithNamespace, false); - - if (null !== $r && (null !== $constructor = $r->getConstructor()) && 0 === $constructor->getNumberOfRequiredParameters()) { - $code .= " parent::__construct();\n\n"; + if (null !== $r + && (null !== $constructor = $r->getConstructor()) + && 0 === $constructor->getNumberOfRequiredParameters() + && Container::class !== $constructor->getDeclaringClass()->name + ) { + $code .= " parent::__construct();\n"; + $code .= " \$this->parameterBag = null;\n\n"; } } @@ -1619,7 +1623,7 @@ EOF; private function dumpParameter(string $name): string { - if ($this->container->isCompiled() && $this->container->hasParameter($name)) { + if ($this->container->hasParameter($name)) { $value = $this->container->getParameter($name); $dumpedValue = $this->dumpValue($value, false); diff --git a/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php b/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php new file mode 100644 index 0000000000..b1ee044e9e --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php @@ -0,0 +1,304 @@ +setParameter('env(foo)', $value); + $container->compile(); + + $processor = new EnvVarProcessor($container); + + $result = $processor->getEnv('string', 'foo', function () { + $this->fail('Should not be called'); + }); + + $this->assertSame($processed, $result); + } + + public function validStrings() + { + return array( + array('hello', 'hello'), + array('true', 'true'), + array('false', 'false'), + array('null', 'null'), + array('1', '1'), + array('0', '0'), + array('1.1', '1.1'), + array('1e1', '1e1'), + ); + } + + /** + * @dataProvider validBools + */ + public function testGetEnvBool($value, $processed) + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('bool', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + + $this->assertSame($processed, $result); + } + + public function validBools() + { + return array( + array('true', true), + array('false', false), + array('null', false), + array('1', true), + array('0', false), + array('1.1', true), + array('1e1', true), + ); + } + + /** + * @dataProvider validInts + */ + public function testGetEnvInt($value, $processed) + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('int', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + + $this->assertSame($processed, $result); + } + + public function validInts() + { + return array( + array('1', 1), + array('1.1', 1), + array('1e1', 10), + ); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage Non-numeric env var + * @dataProvider invalidInts + */ + public function testGetEnvIntInvalid($value) + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('int', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + } + + public function invalidInts() + { + return array( + array('foo'), + array('true'), + array('null'), + ); + } + + /** + * @dataProvider validFloats + */ + public function testGetEnvFloat($value, $processed) + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('float', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + + $this->assertSame($processed, $result); + } + + public function validFloats() + { + return array( + array('1', 1.0), + array('1.1', 1.1), + array('1e1', 10.0), + ); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage Non-numeric env var + * @dataProvider invalidFloats + */ + public function testGetEnvFloatInvalid($value) + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('float', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + } + + public function invalidFloats() + { + return array( + array('foo'), + array('true'), + array('null'), + ); + } + + /** + * @dataProvider validConsts + */ + public function testGetEnvConst($value, $processed) + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('const', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + + $this->assertSame($processed, $result); + } + + public function validConsts() + { + return array( + array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::TEST_CONST', self::TEST_CONST), + array('E_ERROR', E_ERROR), + ); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage undefined constant + * @dataProvider invalidConsts + */ + public function testGetEnvConstInvalid($value) + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('const', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return $value; + }); + } + + public function invalidConsts() + { + return array( + array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::UNDEFINED_CONST'), + array('UNDEFINED_CONST'), + ); + } + + public function testGetEnvBase64() + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('base64', 'foo', function ($name) { + $this->assertSame('foo', $name); + + return base64_encode('hello'); + }); + + $this->assertSame('hello', $result); + } + + public function testGetEnvJson() + { + $processor = new EnvVarProcessor(new Container()); + + $result = $processor->getEnv('json', 'foo', function ($name) { + $this->assertSame('foo', $name); + + return json_encode(array(1)); + }); + + $this->assertSame(array(1), $result); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage Syntax error + */ + public function testGetEnvInvalidJson() + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('json', 'foo', function ($name) { + $this->assertSame('foo', $name); + + return 'invalid_json'; + }); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage Invalid JSON env var + * @dataProvider otherJsonValues + */ + public function testGetEnvJsonOther($value) + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('json', 'foo', function ($name) use ($value) { + $this->assertSame('foo', $name); + + return json_encode($value); + }); + } + + public function otherJsonValues() + { + return array( + array(1), + array(1.1), + array(true), + array(false), + ); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException + * @expectedExceptionMessage Unsupported env var prefix + */ + public function testGetEnvUnknown() + { + $processor = new EnvVarProcessor(new Container()); + + $processor->getEnv('unknown', 'foo', function ($name) { + $this->assertSame('foo', $name); + + return 'foo'; + }); + } +} diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php index 7514cc7c1b..b14b013f1f 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php @@ -2,6 +2,8 @@ namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Container; -class NoConstructorContainer +use Symfony\Component\DependencyInjection\Container; + +class NoConstructorContainer extends Container { } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php index 01caae6489..a6b9962b3d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php @@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes public function __construct() { parent::__construct(); + $this->parameterBag = null; $this->services = $this->privates = array(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php index 1c20741bf7..84986f1638 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php @@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes public function __construct() { parent::__construct(); + $this->parameterBag = null; $this->services = $this->privates = array(); diff --git a/src/Symfony/Component/DomCrawler/Field/FormField.php b/src/Symfony/Component/DomCrawler/Field/FormField.php index 567164d046..33c0bbeac0 100644 --- a/src/Symfony/Component/DomCrawler/Field/FormField.php +++ b/src/Symfony/Component/DomCrawler/Field/FormField.php @@ -75,8 +75,6 @@ abstract class FormField if ($labels->length > 0) { return $labels->item(0); } - - return; } /** diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php index e8ede167b3..c906c6549a 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php @@ -32,14 +32,12 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4 [ ./label[@for="name"] [ - ./div[ - ./ul - [./li - [./span[.="[trans]Error[/trans]"]] - [./span[.="[trans]Error![/trans]"]] - ] - [count(./li)=1] - ] + ./span[@class="alert alert-danger"] + [./span[@class="mb-0 d-block"] + [./span[.="[trans]Error[/trans]"]] + [./span[.="[trans]Error![/trans]"]] + ] + [count(./span)=1] ] /following-sibling::div[./input[@id="name"]] ] diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php index ec97577818..6e448c413a 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php @@ -32,14 +32,12 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest [ ./label[@for="name"] [ - ./div[ - ./ul - [./li - [./span[.="[trans]Error[/trans]"]] - [./span[.="[trans]Error![/trans]"]] - ] - [count(./li)=1] - ] + ./span[@class="alert alert-danger"] + [./span[@class="mb-0 d-block"] + [./span[.="[trans]Error[/trans]"]] + [./span[.="[trans]Error![/trans]"]] + ] + [count(./span)=1] ] /following-sibling::input[@id="name"] ] @@ -162,26 +160,32 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest $html = $this->renderErrors($view); $this->assertMatchesXpath($html, -'/div +'/span [@class="alert alert-danger"] [ - ./ul - [@class="list-unstyled mb-0"] - [ - ./li - [./span[.="[trans]Error[/trans]"]] - [./span[.="[trans]Error 1[/trans]"]] - - /following-sibling::li - [./span[.="[trans]Error[/trans]"]] - [./span[.="[trans]Error 2[/trans]"]] - ] - [count(./li)=2] + ./span[@class="mb-0 d-block"] + [./span[.="[trans]Error[/trans]"]] + [./span[.="[trans]Error 1[/trans]"]] + + /following-sibling::span[@class="mb-0 d-block"] + [./span[.="[trans]Error[/trans]"]] + [./span[.="[trans]Error 2[/trans]"]] ] + [count(./span)=2] ' ); } + public function testErrorWithNoLabel() + { + $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('label'=>false)); + $form->addError(new FormError('[trans]Error 1[/trans]')); + $view = $form->createView(); + $html = $this->renderLabel($view); + + $this->assertMatchesXpath($html, '//span[.="[trans]Error[/trans]"]'); + } + public function testCheckedCheckbox() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', true); diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php index 9f4ef7028e..dd37eae14e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -80,7 +80,9 @@ class MemcachedSessionHandler extends AbstractSessionHandler */ public function updateTimestamp($sessionId, $data) { - return $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl); + $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl); + + return true; } /** diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php index e58fbd2ed5..925e37b071 100644 --- a/src/Symfony/Component/HttpKernel/KernelInterface.php +++ b/src/Symfony/Component/HttpKernel/KernelInterface.php @@ -18,7 +18,7 @@ use Symfony\Component\Config\Loader\LoaderInterface; /** * The Kernel is the heart of the Symfony system. * - * It manages an environment made of bundles. + * It manages an environment made of application kernel and bundles. * * @author Fabien Potencier */ @@ -27,7 +27,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable /** * Returns an array of bundles to register. * - * @return BundleInterface[] An array of bundle instances + * @return iterable|BundleInterface[] An iterable of bundle instances */ public function registerBundles(); @@ -67,7 +67,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable public function getBundle($name); /** - * Returns the file path for a given resource. + * Returns the file path for a given bundle resource. * * A Resource can be a file or a directory. * diff --git a/src/Symfony/Component/HttpKernel/Resources/welcome.html.php b/src/Symfony/Component/HttpKernel/Resources/welcome.html.php index d8c37beb56..caac7fd6eb 100644 --- a/src/Symfony/Component/HttpKernel/Resources/welcome.html.php +++ b/src/Symfony/Component/HttpKernel/Resources/welcome.html.php @@ -76,7 +76,7 @@

- You're seeing this message because you have debug mode enabled and you haven't configured any URLs. + You're seeing this page because debug mode is enabled and you haven't configured any homepage URL.

diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index aa8f61cc8b..72804699ea 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -193,11 +193,10 @@ EOF } } - if ('' === $code) { - $code .= " if ('/' === \$pathinfo) {\n"; - $code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n"; - $code .= " }\n"; - } + // used to display the Welcome Page in apps that don't define a homepage + $code .= " if ('/' === \$pathinfo) {\n"; + $code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n"; + $code .= " }\n"; return $code; } diff --git a/src/Symfony/Component/Routing/Matcher/UrlMatcher.php b/src/Symfony/Component/Routing/Matcher/UrlMatcher.php index e37cae0361..3862d7d42e 100644 --- a/src/Symfony/Component/Routing/Matcher/UrlMatcher.php +++ b/src/Symfony/Component/Routing/Matcher/UrlMatcher.php @@ -88,7 +88,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface return $ret; } - if (0 === count($this->routes) && '/' === $pathinfo) { + if ('/' === $pathinfo) { throw new NoConfigurationException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php index 97a544b7ba..21dfd7fc24 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php @@ -238,6 +238,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher10.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher10.php index 4166936568..2a97138ba6 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher10.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher10.php @@ -2821,6 +2821,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher11.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher11.php index 2167b4e917..dd348f57ce 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher11.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher11.php @@ -146,6 +146,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } return null; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher12.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher12.php index be3d1f4373..30767d1410 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher12.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher12.php @@ -91,6 +91,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher13.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher13.php index f31a0544fe..e0b441d86a 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher13.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher13.php @@ -60,6 +60,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php index acffa8e6a2..96ed00cc81 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php @@ -275,6 +275,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } return null; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php index fc5c9853a2..a3b280fe9a 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php @@ -103,6 +103,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php index a5ea6c6276..feecc9df27 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php @@ -75,6 +75,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher return $ret; } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } + throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php index 152cc61cec..a6536ef6a3 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php @@ -145,6 +145,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } return null; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php index 960e20157d..3a9f9baf81 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php @@ -122,6 +122,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php index 591b526c14..ccb32ebb75 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php @@ -157,6 +157,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } return null; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher8.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher8.php index 0e1d0c8e95..fc20bbfffb 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher8.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher8.php @@ -79,6 +79,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $offset += strlen($m); } } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher9.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher9.php index c459408d70..28f3f36d17 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher9.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher9.php @@ -44,6 +44,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher break; } + if ('/' === $pathinfo) { + throw new Symfony\Component\Routing\Exception\NoConfigurationException(); + } + throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); } } diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index b4e8e46dc2..c9a7da9b81 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -34,7 +34,6 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer { const ENABLE_MAX_DEPTH = 'enable_max_depth'; const DEPTH_KEY_PATTERN = 'depth_%s::%s'; - const ALLOW_EXTRA_ATTRIBUTES = 'allow_extra_attributes'; const DISABLE_TYPE_ENFORCEMENT = 'disable_type_enforcement'; private $propertyTypeExtractor;