diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 0bef18db33..e459d1e55f 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -2,6 +2,23 @@
/src/Symfony/Component/Console/Logger/ConsoleLogger.php @dunglas
# DependencyInjection
/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php @dunglas
+# Form
+/src/Symfony/Bridge/Twig/Extension/FormExtension.php @xabbuh
+/src/Symfony/Bridge/Twig/Form/* @xabbuh
+/src/Symfony/Bridge/Twig/Node/FormThemeNode.php @xabbuh
+/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php @xabbuh
+/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php @xabbuh
+/src/Symfony/Bridge/Twig/Tests/Extension/FormExtension* @xabbuh
+/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php @xabbuh
+/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php @xabbuh
+/src/Symfony/Bridge/Twig/TokenParser/FormThemeTokenParser.php @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/Resources/views/* @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.php @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @xabbuh
+/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @xabbuh
+/src/Symfony/Component/Form/* @xabbuh
# HttpKernel
/src/Symfony/Component/HttpKernel/Log/Logger.php @dunglas
# LDAP
diff --git a/src/Symfony/Bridge/PhpUnit/composer.json b/src/Symfony/Bridge/PhpUnit/composer.json
index 289d92ee50..496bb8a385 100644
--- a/src/Symfony/Bridge/PhpUnit/composer.json
+++ b/src/Symfony/Bridge/PhpUnit/composer.json
@@ -21,8 +21,7 @@
"php": ">=5.5.9"
},
"suggest": {
- "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader",
- "ext-zip": "Zip support is required when using bin/simple-phpunit"
+ "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelShutdownOnTearDownTrait.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelShutdownOnTearDownTrait.php
new file mode 100644
index 0000000000..7eb4d0726e
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelShutdownOnTearDownTrait.php
@@ -0,0 +1,45 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\FrameworkBundle\Test;
+
+use PHPUnit\Framework\TestCase;
+
+// Auto-adapt to PHPUnit 8 that added a `void` return-type to the tearDown method
+
+if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \ReflectionMethod(TestCase::class, 'tearDown'))->hasReturnType()) {
+eval('
+ /**
+ * @internal
+ */
+ trait KernelShutdownOnTearDownTrait
+ {
+ protected function tearDown(): void
+ {
+ static::ensureKernelShutdown();
+ }
+ }
+');
+} else {
+ /**
+ * @internal
+ */
+ trait KernelShutdownOnTearDownTrait
+ {
+ /**
+ * @return void
+ */
+ protected function tearDown()
+ {
+ static::ensureKernelShutdown();
+ }
+ }
+}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
index a91df7c0d3..666831b041 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
@@ -23,6 +23,8 @@ use Symfony\Contracts\Service\ResetInterface;
*/
abstract class KernelTestCase extends TestCase
{
+ use KernelShutdownOnTearDownTrait;
+
protected static $class;
/**
@@ -112,9 +114,7 @@ abstract class KernelTestCase extends TestCase
}
/**
- * @after
- *
- * Shuts the kernel down if it was used in the test.
+ * Shuts the kernel down if it was used in the test - called by the tearDown method by default.
*/
protected static function ensureKernelShutdown()
{
diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php
index eda99c0a62..d322c1d8d9 100644
--- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php
+++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php
@@ -50,7 +50,7 @@ class MappingRule
*/
public function match($propertyPath)
{
- if ($propertyPath === (string) $this->propertyPath) {
+ if ($propertyPath === $this->propertyPath) {
return $this->getTarget();
}
}
diff --git a/src/Symfony/Component/Form/FormTypeGuesserInterface.php b/src/Symfony/Component/Form/FormTypeGuesserInterface.php
index 0aec6364c4..6521ea47ca 100644
--- a/src/Symfony/Component/Form/FormTypeGuesserInterface.php
+++ b/src/Symfony/Component/Form/FormTypeGuesserInterface.php
@@ -32,7 +32,7 @@ interface FormTypeGuesserInterface
* @param string $class The fully qualified class name
* @param string $property The name of the property to guess for
*
- * @return Guess\ValueGuess A guess for the field's required setting
+ * @return Guess\ValueGuess|null A guess for the field's required setting
*/
public function guessRequired($class, $property);
diff --git a/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php b/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php
index 1a1a24e2b2..16d4045e6d 100644
--- a/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php
+++ b/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php
@@ -285,6 +285,26 @@ abstract class AbstractRequestHandlerTest extends TestCase
$this->assertSame($file, $form->getData());
}
+ /**
+ * @dataProvider methodExceptGetProvider
+ */
+ public function testSubmitFileWithNamelessForm($method)
+ {
+ $form = $this->createForm('', $method, true);
+ $fileForm = $this->createBuilder('document', false, ['allow_file_upload' => true])->getForm();
+ $form->add($fileForm);
+ $file = $this->getUploadedFile();
+ $this->setRequestData($method, [
+ 'document' => null,
+ ], [
+ 'document' => $file,
+ ]);
+ $this->requestHandler->handleRequest($form, $this->request);
+
+ $this->assertTrue($form->isSubmitted());
+ $this->assertSame($file, $fileForm->getData());
+ }
+
/**
* @dataProvider getPostMaxSizeFixtures
*/
diff --git a/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php b/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php
index 80082b0099..4aff3b4581 100644
--- a/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php
@@ -83,6 +83,10 @@ class SwitchUserListener implements ListenerInterface
return;
}
+ if (null === $this->tokenStorage->getToken()) {
+ throw new AuthenticationCredentialsNotFoundException('Could not find original Token object.');
+ }
+
if (self::EXIT_VALUE === $username) {
$this->tokenStorage->setToken($this->attemptExitUser($request));
} else {
@@ -165,7 +169,7 @@ class SwitchUserListener implements ListenerInterface
*/
private function attemptExitUser(Request $request)
{
- if (null === ($currentToken = $this->tokenStorage->getToken()) || false === $original = $this->getOriginalToken($currentToken)) {
+ if (false === $original = $this->getOriginalToken($this->tokenStorage->getToken())) {
throw new AuthenticationCredentialsNotFoundException('Could not find original Token object.');
}
diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
index 2be2cc2207..f26b72fc14 100644
--- a/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
+++ b/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
@@ -267,6 +267,17 @@ class SwitchUserListenerTest extends TestCase
$this->assertSame($replacedToken, $this->tokenStorage->getToken());
}
+ /**
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
+ */
+ public function testSwitchtUserThrowsAuthenticationExceptionIfNoCurrentToken()
+ {
+ $this->tokenStorage->setToken(null);
+ $this->request->query->set('_switch_user', 'username');
+ $listener = new SwitchUserListener($this->tokenStorage, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
+ $listener->handle($this->event);
+ }
+
public function testSwitchUserStateless()
{
$token = new UsernamePasswordToken('username', '', 'key', ['ROLE_FOO']);
diff --git a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
index fec0080fe0..3c95c097e8 100644
--- a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
+++ b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
@@ -13,7 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
use Symfony\Component\PropertyAccess\PropertyAccess;
-use Symfony\Component\PropertyAccess\PropertyAccessor;
+use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
@@ -29,7 +29,7 @@ abstract class AbstractComparisonValidator extends ConstraintValidator
{
private $propertyAccessor;
- public function __construct(PropertyAccessor $propertyAccessor = null)
+ public function __construct(PropertyAccessorInterface $propertyAccessor = null)
{
$this->propertyAccessor = $propertyAccessor;
}
diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf
index 4950e0ccd1..eacd8d777d 100644
--- a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf
+++ b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf
@@ -310,6 +310,26 @@
هذه القيمة غير متطابقة مع صيغة التحويل {{ charset }}.
+
+
+ هذه القيمة ليست رمز معرّف نشاط تجاري صالح (BIC).
+
+
+
+ خطأ
+
+
+
+ هذا ليس UUID صالح.
+
+
+
+ هذه القيمة يجب أن تكون مضاعف ل {{ compared_value }}.
+
+
+
+ رمز المعرّف نشاط تجاري (BIC) هذا لا يرتبط مع IBAN {{ iban }}.
+