From 95dcf51682029e89450aee86267e3d553aa7c487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sat, 9 Oct 2021 14:10:44 +0200 Subject: [PATCH 01/72] Fix missing extra trusted header in sub-request --- .../Component/HttpKernel/HttpCache/SubRequestHandler.php | 1 + .../HttpKernel/Tests/HttpCache/SubRequestHandlerTest.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php b/src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php index 294b964acc670..fab8fa690ce62 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php @@ -38,6 +38,7 @@ public static function handle(HttpKernelInterface $kernel, Request $request, int 'X_FORWARDED_HOST' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_HOST, 'X_FORWARDED_PROTO' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PROTO, 'X_FORWARDED_PORT' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PORT, + 'X_FORWARDED_PREFIX' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PREFIX, ]; foreach (array_filter($trustedHeaders) as $name => $key) { $request->headers->remove($name); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/SubRequestHandlerTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/SubRequestHandlerTest.php index 7ab9b6c45f037..f17abb20281f3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/SubRequestHandlerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/SubRequestHandlerTest.php @@ -42,6 +42,7 @@ public function testTrustedHeadersAreKept() $request->headers->set('X-Forwarded-Host', 'Good'); $request->headers->set('X-Forwarded-Port', '1234'); $request->headers->set('X-Forwarded-Proto', 'https'); + $request->headers->set('X-Forwarded-Prefix', '/admin'); $kernel = new TestSubRequestHandlerKernel(function ($request, $type, $catch) { $this->assertSame('127.0.0.1', $request->server->get('REMOTE_ADDR')); @@ -49,6 +50,7 @@ public function testTrustedHeadersAreKept() $this->assertSame('Good', $request->headers->get('X-Forwarded-Host')); $this->assertSame('1234', $request->headers->get('X-Forwarded-Port')); $this->assertSame('https', $request->headers->get('X-Forwarded-Proto')); + $this->assertSame('/admin', $request->headers->get('X-Forwarded-Prefix')); }); SubRequestHandler::handle($kernel, $request, HttpKernelInterface::MAIN_REQUEST, true); @@ -64,6 +66,7 @@ public function testUntrustedHeadersAreRemoved() $request->headers->set('X-Forwarded-Host', 'Evil'); $request->headers->set('X-Forwarded-Port', '1234'); $request->headers->set('X-Forwarded-Proto', 'http'); + $request->headers->set('X-Forwarded-Prefix', '/admin'); $request->headers->set('Forwarded', 'Evil2'); $kernel = new TestSubRequestHandlerKernel(function ($request, $type, $catch) { @@ -72,6 +75,7 @@ public function testUntrustedHeadersAreRemoved() $this->assertFalse($request->headers->has('X-Forwarded-Host')); $this->assertFalse($request->headers->has('X-Forwarded-Port')); $this->assertFalse($request->headers->has('X-Forwarded-Proto')); + $this->assertFalse($request->headers->has('X-Forwarded-Prefix')); $this->assertSame('for="10.0.0.1";host="localhost";proto=http', $request->headers->get('Forwarded')); }); @@ -112,12 +116,14 @@ public function testTrustedXForwardedForHeader() $request->headers->set('X-Forwarded-For', '10.0.0.2'); $request->headers->set('X-Forwarded-Host', 'foo.bar'); $request->headers->set('X-Forwarded-Proto', 'https'); + $request->headers->set('X-Forwarded-Prefix', '/admin'); $kernel = new TestSubRequestHandlerKernel(function ($request, $type, $catch) { $this->assertSame('127.0.0.1', $request->server->get('REMOTE_ADDR')); $this->assertSame('10.0.0.2', $request->getClientIp()); $this->assertSame('foo.bar', $request->getHttpHost()); $this->assertSame('https', $request->getScheme()); + $this->assertSame('/admin', $request->getBaseUrl()); }); SubRequestHandler::handle($kernel, $request, HttpKernelInterface::MAIN_REQUEST, true); From 36a808b857cd3240244f4b224452fb1e70dc6dfc Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sat, 23 Oct 2021 13:11:11 +0200 Subject: [PATCH 02/72] [SecurityBundle] Default signature_properties to the previous behavior --- .../Security/Factory/RememberMeFactory.php | 1 + .../Security/UserChangingUserProvider.php | 23 ++++++++++------ .../Tests/Functional/RememberMeTest.php | 27 +++++++++++++++++-- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php index de19f488454f2..525726b0bd68d 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php @@ -208,6 +208,7 @@ public function addConfiguration(NodeDefinition $node) ->requiresAtLeastOneElement() ->info('An array of properties on your User that are used to sign the remember-me cookie. If any of these change, all existing cookies will become invalid.') ->example(['email', 'password']) + ->defaultValue(['password']) ->end() ->arrayNode('token_provider') ->beforeNormalization() diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/UserChangingUserProvider.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/UserChangingUserProvider.php index a5306b6bf1607..f2eebacf2ca3b 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/UserChangingUserProvider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/UserChangingUserProvider.php @@ -21,6 +21,8 @@ class UserChangingUserProvider implements UserProviderInterface { private $inner; + public static $changePassword = false; + public function __construct(InMemoryUserProvider $inner) { $this->inner = $inner; @@ -28,26 +30,31 @@ public function __construct(InMemoryUserProvider $inner) public function loadUserByUsername($username) { - return $this->inner->loadUserByUsername($username); + return $this->changeUser($this->inner->loadUserByUsername($username)); } public function loadUserByIdentifier(string $userIdentifier): UserInterface { - return $this->inner->loadUserByIdentifier($userIdentifier); + return $this->changeUser($this->inner->loadUserByIdentifier($userIdentifier)); } public function refreshUser(UserInterface $user) { - $user = $this->inner->refreshUser($user); - - $alterUser = \Closure::bind(function (InMemoryUser $user) { $user->password = 'foo'; }, null, class_exists(User::class) ? User::class : InMemoryUser::class); - $alterUser($user); - - return $user; + return $this->changeUser($this->inner->refreshUser($user)); } public function supportsClass($class) { return $this->inner->supportsClass($class); } + + private function changeUser(UserInterface $user): UserInterface + { + if (self::$changePassword) { + $alterUser = \Closure::bind(function (InMemoryUser $user) { $user->password = 'changed!'; }, null, class_exists(User::class) ? User::class : InMemoryUser::class); + $alterUser($user); + } + + return $user; + } } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeTest.php index 7af43e1154a42..c1958c7dee3ff 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeTest.php @@ -11,8 +11,15 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; +use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RememberMeBundle\Security\UserChangingUserProvider; + class RememberMeTest extends AbstractWebTestCase { + protected function setUp(): void + { + UserChangingUserProvider::$changePassword = false; + } + /** * @dataProvider provideConfigs */ @@ -51,11 +58,19 @@ public function testUserChangeClearsCookie() $this->assertSame(302, $client->getResponse()->getStatusCode()); $cookieJar = $client->getCookieJar(); - $this->assertNotNull($cookieJar->get('REMEMBERME')); + $this->assertNotNull($cookie = $cookieJar->get('REMEMBERME')); + + UserChangingUserProvider::$changePassword = true; + // change password (through user provider), this deauthenticates the session $client->request('GET', '/profile'); $this->assertRedirect($client->getResponse(), '/login'); $this->assertNull($cookieJar->get('REMEMBERME')); + + // restore the old remember me cookie, it should no longer be valid + $cookieJar->set($cookie); + $client->request('GET', '/profile'); + $this->assertRedirect($client->getResponse(), '/login'); } public function testSessionLessRememberMeLogout() @@ -121,11 +136,19 @@ public function testLegacyUserChangeClearsCookie() $this->assertSame(302, $client->getResponse()->getStatusCode()); $cookieJar = $client->getCookieJar(); - $this->assertNotNull($cookieJar->get('REMEMBERME')); + $this->assertNotNull($cookie = $cookieJar->get('REMEMBERME')); + + UserChangingUserProvider::$changePassword = true; + // change password (through user provider), this deauthenticates the session $client->request('GET', '/profile'); $this->assertRedirect($client->getResponse(), '/login'); $this->assertNull($cookieJar->get('REMEMBERME')); + + // restore the old remember me cookie, it should no longer be valid + $cookieJar->set($cookie); + $client->request('GET', '/profile'); + $this->assertRedirect($client->getResponse(), '/login'); } /** From 255516797535d9a5370a0814fbd0fa1954b56ff8 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Wed, 3 Nov 2021 17:12:13 +0100 Subject: [PATCH 03/72] Allow autodetecting mapping type for any object --- .../DependencyInjection/AbstractDoctrineExtension.php | 6 ++++-- .../Tests/DependencyInjection/DoctrineExtensionTest.php | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index 2714e27d754a3..a7e0d31a732cd 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -290,13 +290,15 @@ private function detectMappingType(string $directory, ContainerBuilder $containe $glob = new GlobResource($directory, '*', true); $container->addResource($glob); + $quotedMappingObjectName = preg_quote($this->getMappingObjectDefaultName(), '/'); + foreach ($glob as $file) { $content = file_get_contents($file); - if (preg_match('/^#\[.*Entity\b/m', $content)) { + if (preg_match('/^#\[.*'.$quotedMappingObjectName.'\b/m', $content)) { break; } - if (preg_match('/^ \* @.*Entity\b/m', $content)) { + if (preg_match('/^ \* @.*'.$quotedMappingObjectName.'\b/m', $content)) { $type = 'annotation'; break; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index dc86ee22b640e..b665b242cc496 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -49,6 +49,10 @@ protected function setUp(): void ->willReturnCallback(function ($name) { return 'doctrine.orm.'.$name; }); + + $this->extension + ->method('getMappingObjectDefaultName') + ->willReturn('Entity'); } public function testFixManagersAutoMappingsWithTwoAutomappings() From 3da6f2d45e7536ccb2a26f52fbaf340917e208a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 15 Nov 2021 11:47:04 +0100 Subject: [PATCH 04/72] Use single quote to escape formulas --- .../Serializer/Encoder/CsvEncoder.php | 7 +- .../Tests/Encoder/CsvEncoderTest.php | 85 +++++++++++++++++-- 2 files changed, 81 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php index ef34b3480a0f7..a525c61e3a3e1 100644 --- a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php @@ -35,7 +35,8 @@ class CsvEncoder implements EncoderInterface, DecoderInterface private const UTF8_BOM = "\xEF\xBB\xBF"; - private $formulasStartCharacters = ['=', '-', '+', '@']; + private const FORMULAS_START_CHARACTERS = ['=', '-', '+', '@', "\t", "\r"]; + private $defaultContext = [ self::DELIMITER_KEY => ',', self::ENCLOSURE_KEY => '"', @@ -238,8 +239,8 @@ private function flatten(iterable $array, array &$result, string $keySeparator, if (is_iterable($value)) { $this->flatten($value, $result, $keySeparator, $parentKey.$key.$keySeparator, $escapeFormulas); } else { - if ($escapeFormulas && \in_array(substr((string) $value, 0, 1), $this->formulasStartCharacters, true)) { - $result[$parentKey.$key] = "\t".$value; + if ($escapeFormulas && \in_array(substr((string) $value, 0, 1), self::FORMULAS_START_CHARACTERS, true)) { + $result[$parentKey.$key] = "'".$value; } else { // Ensures an actual value is used when dealing with true and false $result[$parentKey.$key] = false === $value ? 0 : (true === $value ? 1 : $value); diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php index 33a16ee4402e2..596afa28b7eed 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php @@ -285,31 +285,52 @@ private function doTestEncodeFormulas(bool $legacy = false) $this->assertSame(<<<'CSV' 0 -" =2+3" +'=2+3 CSV , $this->encoder->encode(['=2+3'], 'csv')); $this->assertSame(<<<'CSV' 0 -" -2+3" +'-2+3 CSV , $this->encoder->encode(['-2+3'], 'csv')); $this->assertSame(<<<'CSV' 0 -" +2+3" +'+2+3 CSV , $this->encoder->encode(['+2+3'], 'csv')); $this->assertSame(<<<'CSV' 0 -" @MyDataColumn" +'@MyDataColumn CSV , $this->encoder->encode(['@MyDataColumn'], 'csv')); + + $this->assertSame(<<<'CSV' +0 +"' tab" + +CSV + , $this->encoder->encode(["\ttab"], 'csv')); + + $this->assertSame(<<<'CSV' +0 +"'=1+2"";=1+2" + +CSV + , $this->encoder->encode(['=1+2";=1+2'], 'csv')); + + $this->assertSame(<<<'CSV' +0 +"'=1+2'"" ;,=1+2" + +CSV + , $this->encoder->encode(['=1+2\'" ;,=1+2'], 'csv')); } public function testDoNotEncodeFormulas() @@ -341,13 +362,34 @@ public function testDoNotEncodeFormulas() CSV , $this->encoder->encode(['@MyDataColumn'], 'csv')); + + $this->assertSame(<<<'CSV' +0 +" tab" + +CSV + , $this->encoder->encode(["\ttab"], 'csv')); + + $this->assertSame(<<<'CSV' +0 +"=1+2"";=1+2" + +CSV + , $this->encoder->encode(['=1+2";=1+2'], 'csv')); + + $this->assertSame(<<<'CSV' +0 +"=1+2'"" ;,=1+2" + +CSV + , $this->encoder->encode(['=1+2\'" ;,=1+2'], 'csv')); } public function testEncodeFormulasWithSettingsPassedInContext() { $this->assertSame(<<<'CSV' 0 -" =2+3" +'=2+3 CSV , $this->encoder->encode(['=2+3'], 'csv', [ @@ -356,7 +398,7 @@ public function testEncodeFormulasWithSettingsPassedInContext() $this->assertSame(<<<'CSV' 0 -" -2+3" +'-2+3 CSV , $this->encoder->encode(['-2+3'], 'csv', [ @@ -365,7 +407,7 @@ public function testEncodeFormulasWithSettingsPassedInContext() $this->assertSame(<<<'CSV' 0 -" +2+3" +'+2+3 CSV , $this->encoder->encode(['+2+3'], 'csv', [ @@ -374,12 +416,39 @@ public function testEncodeFormulasWithSettingsPassedInContext() $this->assertSame(<<<'CSV' 0 -" @MyDataColumn" +'@MyDataColumn CSV , $this->encoder->encode(['@MyDataColumn'], 'csv', [ CsvEncoder::ESCAPE_FORMULAS_KEY => true, ])); + + $this->assertSame(<<<'CSV' +0 +"' tab" + +CSV + , $this->encoder->encode(["\ttab"], 'csv', [ + CsvEncoder::ESCAPE_FORMULAS_KEY => true, + ])); + + $this->assertSame(<<<'CSV' +0 +"'=1+2"";=1+2" + +CSV + , $this->encoder->encode(['=1+2";=1+2'], 'csv', [ + CsvEncoder::ESCAPE_FORMULAS_KEY => true, + ])); + + $this->assertSame(<<<'CSV' +0 +"'=1+2'"" ;,=1+2" + +CSV + , $this->encoder->encode(['=1+2\'" ;,=1+2'], 'csv', [ + CsvEncoder::ESCAPE_FORMULAS_KEY => true, + ])); } public function testEncodeWithoutHeader() From c6d1a6f9db94fda5e239e55492fdf4740093a642 Mon Sep 17 00:00:00 2001 From: satalaondrej Date: Wed, 10 Nov 2021 20:33:30 +0100 Subject: [PATCH 05/72] [Serializer] PropertyNormalizer - return unique (i.e. filter duplicate ) attributes in extractAttributes function --- .../Component/Serializer/Normalizer/PropertyNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php index 9989c60e40643..8ecd340816698 100644 --- a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php @@ -119,7 +119,7 @@ protected function extractAttributes($object, $format = null, array $context = [ } } while ($reflectionObject = $reflectionObject->getParentClass()); - return $attributes; + return array_unique($attributes); } /** From 6b2260d34e2bd37733fa681a2f72df523007d717 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 18 Nov 2021 16:29:48 +0100 Subject: [PATCH 06/72] Update CHANGELOG for 5.4.0-BETA3 --- CHANGELOG-5.4.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG-5.4.md b/CHANGELOG-5.4.md index cc6a762c0c1ed..22eace057214e 100644 --- a/CHANGELOG-5.4.md +++ b/CHANGELOG-5.4.md @@ -7,6 +7,28 @@ in 5.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/v5.4.0...v5.4.1 +* 5.4.0-BETA3 (2021-11-18) + + * feature #44125 Add a setter on DateTimeNormalizer to change the default context at runtime (Seldaek) + * bug #44110 [FrameworkBundle] Fix default PHP attributes support in validation and serializer configuration when doctrine/annotations is not installed with PHP 8 (fancyweb) + * bug #44115 [WebProfilerBundle] Tweak the colors of the security panel (javiereguiluz) + * bug #44121 [Serializer] fix support for lazy properties (nicolas-grekas) + * bug #44108 [FrameworkBundle][Messenger] remove `FlattenExceptionNormalizer` definition if serializer not available (kbond) + * bug #44111 [Serializer] fix support for unset properties on PHP < 7.4 (nicolas-grekas) + * bug #44098 [DependencyInjection] fix preloading (nicolas-grekas) + * bug #44065 [FrameworkBundle] Add framework config for DBAL cache adapter (GromNaN) + * bug #44096 Make ExpressionVoter Cacheable (jderusse) + * bug #44070 [Process] intersect with getenv() to populate default envs (nicolas-grekas) + * feature #43181 Allow AbstractDoctrineExtension implementations to support the newer bundle structure (mbabker) + * bug #44060 [Cache] Fix calculate ttl in couchbase sdk 3.0 (ajcerezo) + * bug #43990 [Translation] [Loco] Generate id parameter instead of letting Loco do it (welcoMattic) + * bug #44043 [Cache] fix dbindex Redis (a1812) + * feature #44015 [Cache] Decrease the probability of invalidation loss on tag eviction (nicolas-grekas) + * bug #44064 [Cache] fix releasing not acquired locks (nicolas-grekas) + * bug #44063 [DependencyInjection] fix creating 2nd container instances (nicolas-grekas) + * bug #44051 [Notifier] Fix package name (fabpot) + * bug #44050 [Notifier] Fix package names (fabpot) + * 5.4.0-BETA2 (2021-11-14) * bug #44042 Fix DateIntervalToStringTransformer::transform() doc (BenMorel) From 0a42b5ee6ab8eaf911fa752abb6959d081473501 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 18 Nov 2021 16:29:53 +0100 Subject: [PATCH 07/72] Update VERSION for 5.4.0-BETA3 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 1f8a2c37b5d8d..585651ee0b623 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.0-DEV'; + public const VERSION = '5.4.0-BETA3'; public const VERSION_ID = 50400; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = 'BETA3'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From b43d83e3b8a94b207cea4731736dbd3a30f0cc71 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 18 Nov 2021 16:31:36 +0100 Subject: [PATCH 08/72] Bump Symfony version to 5.4.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 585651ee0b623..1f8a2c37b5d8d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static $freshCache = []; - public const VERSION = '5.4.0-BETA3'; + public const VERSION = '5.4.0-DEV'; public const VERSION_ID = 50400; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = 'BETA3'; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2024'; public const END_OF_LIFE = '11/2025'; From a1c9f1095e37977e7e9d65ee56be7378385b5c37 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 18 Nov 2021 16:35:55 +0100 Subject: [PATCH 09/72] Bump Symfony version to 6.0.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index c5583e49738d0..28c499510d984 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.0-BETA3'; + public const VERSION = '6.0.0-DEV'; public const VERSION_ID = 60000; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = 'BETA3'; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '07/2022'; public const END_OF_LIFE = '07/2022'; From b87cda7c6dca555ebb4022d13caf11991a1dab6a Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Thu, 18 Nov 2021 18:08:18 +0100 Subject: [PATCH 10/72] [SecurityBundle] Remove dead conditions based on authenticatorManagerEnabled --- .../views/Collector/security.html.twig | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) 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 33285fc8f565d..ba479f2fbe832 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -4,8 +4,6 @@ {% block toolbar %} {% if collector.firewall %} - {% set color_code = collector.enabled and not collector.authenticatorManagerEnabled ? 'yellow' %} - {% set icon %} {{ include('@Security/Collector/icon.svg') }} {{ collector.user|default('n/a') }} @@ -85,7 +83,7 @@ {% endset %} - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endif %} {% endblock %} @@ -176,12 +174,6 @@ {{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }} Stateless - {% if collector.authenticatorManagerEnabled == false %} -
- {{ include('@WebProfiler/Icon/' ~ (collector.firewall.allows_anonymous ? 'yes' : 'no') ~ '.svg') }} - Allows anonymous -
- {% endif %} {% if collector.firewall.security_enabled %} @@ -218,17 +210,10 @@ access_denied_url {{ collector.firewall.access_denied_url ?: '(none)' }} - {% if collector.authenticatorManagerEnabled %} - - authenticators - {{ collector.firewall.authenticators is empty ? '(none)' : profiler_dump(collector.firewall.authenticators, maxDepth=1) }} - - {% else %} - - listeners - {{ collector.firewall.listeners is empty ? '(none)' : profiler_dump(collector.firewall.listeners, maxDepth=1) }} - - {% endif %} + + authenticators + {{ collector.firewall.authenticators is empty ? '(none)' : profiler_dump(collector.firewall.authenticators, maxDepth=1) }} + {% endif %} From 940031118dc8995d6e2d50f2d61804ea185a5805 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 30 Jul 2021 10:53:48 +0200 Subject: [PATCH 11/72] do not merge label classes into expanded choice labels --- .../Twig/Resources/views/Form/bootstrap_3_layout.html.twig | 3 --- .../Twig/Resources/views/Form/bootstrap_4_layout.html.twig | 3 --- .../Twig/Resources/views/Form/foundation_5_layout.html.twig | 3 --- 3 files changed, 9 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index 44492cebe74d7..12d9545f3aaff 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -85,9 +85,6 @@ {%- if required -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%} {%- endif -%} - {%- if parent_label_class is defined -%} - {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) -%} - {%- endif -%} {%- if label is not same as(false) and label is empty -%} {%- if label_format is not empty -%} {%- set label = label_format|replace({ 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 00ca8694c704a..f08fc8d20f9cc 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 @@ -261,9 +261,6 @@ {%- if required -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%} {%- endif -%} - {%- if parent_label_class is defined -%} - {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|replace({'checkbox-inline': '', 'radio-inline': '', 'checkbox-custom': '', 'radio-custom': ''})|trim}) -%} - {%- endif -%} {%- if label is not same as(false) and label is empty -%} {%- if label_format is not empty -%} {%- set label = label_format|replace({ diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig index b02b94210d9be..f8c51b83dd8ed 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig @@ -253,9 +253,6 @@ {% if errors|length > 0 -%} {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' error')|trim}) %} {% endif %} - {% if parent_label_class is defined %} - {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ parent_label_class)|trim}) %} - {% endif %} {% if label is empty %} {%- if label_format is not empty -%} {% set label = label_format|replace({ From 1e7e7e0f9c751bf23504749edb2c294362e56a2c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 18 Nov 2021 19:10:16 +0100 Subject: [PATCH 12/72] properly parse quoted strings tagged with !!str --- src/Symfony/Component/Yaml/Inline.php | 27 ++++++++++++------- .../Component/Yaml/Tests/InlineTest.php | 18 ++++++++++--- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 22ca97b546528..cb68755404224 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -269,10 +269,11 @@ private static function dumpNull(int $flags): string * * @throws ParseException When malformed inline YAML string is parsed */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = []) + public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null) { if (\in_array($scalar[$i], ['"', "'"])) { // quoted scalar + $isQuoted = true; $output = self::parseQuotedScalar($scalar, $i); if (null !== $delimiters) { @@ -286,6 +287,8 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi } } else { // "normal" string + $isQuoted = false; + if (!$delimiters) { $output = substr($scalar, $i); $i += \strlen($output); @@ -308,7 +311,7 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi } if ($evaluate) { - $output = self::evaluateScalar($output, $flags, $references); + $output = self::evaluateScalar($output, $flags, $references, $isQuoted); } } @@ -320,7 +323,7 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi * * @throws ParseException When malformed inline YAML string is parsed */ - private static function parseQuotedScalar(string $scalar, int &$i): string + private static function parseQuotedScalar(string $scalar, int &$i = 0): string { if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); @@ -373,8 +376,7 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, $value = self::parseMapping($sequence, $flags, $i, $references); break; default: - $isQuoted = \in_array($sequence[$i], ['"', "'"]); - $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references); + $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted); // the value can be an array if a reference has been resolved to an array var if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { @@ -521,8 +523,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a } break; default: - $isValueQuoted = \in_array($mapping[$i], ['"', "'"]); - $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references); + $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted); // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. @@ -561,8 +562,9 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a * * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = []) + private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null) { + $isQuotedString = false; $scalar = trim($scalar); $scalarLower = strtolower($scalar); @@ -597,7 +599,14 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer case '!' === $scalar[0]: switch (true) { case 0 === strpos($scalar, '!!str '): - return (string) substr($scalar, 6); + $s = (string) substr($scalar, 6); + + if (\in_array($s[0] ?? '', ['"', "'"], true)) { + $isQuotedString = true; + $s = self::parseQuotedScalar($s); + } + + return $s; case 0 === strpos($scalar, '! '): return substr($scalar, 2); case 0 === strpos($scalar, '!php/object'): diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 2d09d678bc701..852d498b1772b 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -906,21 +906,31 @@ public function ideographicSpaceProvider(): array ]; } + public function testParseSingleQuotedTaggedString() + { + $this->assertSame('foo', Inline::parse("!!str 'foo'")); + } + + public function testParseDoubleQuotedTaggedString() + { + $this->assertSame('foo', Inline::parse('!!str "foo"')); + } + public function testParseQuotedReferenceLikeStringsInMapping() { $yaml = <<assertSame(['foo' => '&foo', 'bar' => '&bar'], Inline::parse($yaml)); + $this->assertSame(['foo' => '&foo', 'bar' => '&bar', 'baz' => '&baz'], Inline::parse($yaml)); } public function testParseQuotedReferenceLikeStringsInSequence() { $yaml = <<assertSame(['&foo', '&bar'], Inline::parse($yaml)); + $this->assertSame(['&foo', '&bar', '&baz'], Inline::parse($yaml)); } } From b1e4befad4595808c9f335d817367b06c1b36d2c Mon Sep 17 00:00:00 2001 From: Anne-Julia Seitz Date: Fri, 19 Nov 2021 11:42:09 +0100 Subject: [PATCH 13/72] Prevent installation of incompatible mailer component versions --- src/Symfony/Bundle/WebProfilerBundle/composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/composer.json b/src/Symfony/Bundle/WebProfilerBundle/composer.json index 6f3db08702779..3f67bb6ff5675 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/composer.json +++ b/src/Symfony/Bundle/WebProfilerBundle/composer.json @@ -33,6 +33,7 @@ }, "conflict": { "symfony/form": "<4.4", + "symfony/mailer": "<5.4", "symfony/messenger": "<4.4", "symfony/dependency-injection": "<5.2" }, From 22d642eacd65bada64b4c117d28276fc207f8162 Mon Sep 17 00:00:00 2001 From: Julien BERNARD Date: Wed, 17 Nov 2021 16:08:32 -0500 Subject: [PATCH 14/72] [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance --- .../Component/HttpClient/HttpClientTrait.php | 2 +- .../HttpClient/Tests/HttpClientTraitTest.php | 2 ++ .../Component/Mime/Encoder/IdnAddressEncoder.php | 2 +- .../Mime/Tests/Encoder/IdnAddressEncoderTest.php | 13 +++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/Symfony/Component/Mime/Tests/Encoder/IdnAddressEncoderTest.php diff --git a/src/Symfony/Component/HttpClient/HttpClientTrait.php b/src/Symfony/Component/HttpClient/HttpClientTrait.php index 70df9250f5e93..07bd717de91eb 100644 --- a/src/Symfony/Component/HttpClient/HttpClientTrait.php +++ b/src/Symfony/Component/HttpClient/HttpClientTrait.php @@ -456,7 +456,7 @@ private static function parseUrl(string $url, array $query = [], array $allowedS throw new InvalidArgumentException(sprintf('Unsupported IDN "%s", try enabling the "intl" PHP extension or running "composer require symfony/polyfill-intl-idn".', $host)); } - $host = \defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($host, \IDNA_DEFAULT, \INTL_IDNA_VARIANT_UTS46) ?: strtolower($host) : strtolower($host); + $host = \defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($host, \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46) ?: strtolower($host) : strtolower($host); $host .= $port ? ':'.$port : ''; } diff --git a/src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php b/src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php index 0feccd22b7dc7..40b099ce2cca3 100644 --- a/src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php +++ b/src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php @@ -160,6 +160,8 @@ public function provideParseUrl(): iterable yield [[null, null, 'bar', '?a%5Bb%5Bc%5D=d', null], 'bar?a[b[c]=d', []]; yield [[null, null, 'bar', '?a%5Bb%5D%5Bc%5D=dd', null], 'bar?a[b][c]=d&e[f]=g', ['a' => ['b' => ['c' => 'dd']], 'e[f]' => null]]; yield [[null, null, 'bar', '?a=b&a%5Bb%20c%5D=d&e%3Df=%E2%9C%93', null], 'bar?a=b', ['a' => ['b c' => 'd'], 'e=f' => '✓']]; + // IDNA 2008 compliance + yield [['https:', '//xn--fuball-cta.test', null, null, null], 'https://fußball.test']; } /** diff --git a/src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php b/src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php index 69ab8872ec11a..e049fe5e74921 100644 --- a/src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php +++ b/src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php @@ -43,7 +43,7 @@ public function encodeString(string $address): string } if (preg_match('/[^\x00-\x7F]/', $domain)) { - $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, \INTL_IDNA_VARIANT_UTS46)); + $address = sprintf('%s@%s', $local, idn_to_ascii($domain, \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46)); } } diff --git a/src/Symfony/Component/Mime/Tests/Encoder/IdnAddressEncoderTest.php b/src/Symfony/Component/Mime/Tests/Encoder/IdnAddressEncoderTest.php new file mode 100644 index 0000000000000..71e7716f8961b --- /dev/null +++ b/src/Symfony/Component/Mime/Tests/Encoder/IdnAddressEncoderTest.php @@ -0,0 +1,13 @@ +assertSame('test@xn--fuball-cta.test', (new IdnAddressEncoder())->encodeString('test@fußball.test')); + } +} From 3750553ef4952eb90ad91e05e2663c423001bda9 Mon Sep 17 00:00:00 2001 From: Ana Raro Date: Fri, 19 Nov 2021 14:03:59 +0000 Subject: [PATCH 15/72] added missing translations for portuguese [#43726] --- .../Validator/Resources/translations/validators.pt.xlf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index 6b1d061b81ed3..090add6bd3413 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -394,6 +394,14 @@ This value is not a valid CSS color. Este valor não é uma cor de CSS válida. + + This value is not a valid CIDR notation. + Este valor não é uma notação CIDR válida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + O valor da máscara de rede deve estar entre {{ min }} e {{ max }}. + From b17ab7453c938ac869213b96f1c85d64ceb24ca0 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 20 Nov 2021 12:01:24 +0100 Subject: [PATCH 16/72] drop dev dependency on the HttpClient component --- .../Google/Tests/Transport/GmailTransportFactoryTest.php | 2 +- src/Symfony/Component/Mailer/Bridge/Google/composer.json | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Symfony/Component/Mailer/Bridge/Google/Tests/Transport/GmailTransportFactoryTest.php b/src/Symfony/Component/Mailer/Bridge/Google/Tests/Transport/GmailTransportFactoryTest.php index ff9e41058434f..51f0b3ba0f0f0 100644 --- a/src/Symfony/Component/Mailer/Bridge/Google/Tests/Transport/GmailTransportFactoryTest.php +++ b/src/Symfony/Component/Mailer/Bridge/Google/Tests/Transport/GmailTransportFactoryTest.php @@ -12,7 +12,7 @@ class GmailTransportFactoryTest extends TransportFactoryTestCase { public function getFactory(): TransportFactoryInterface { - return new GmailTransportFactory($this->getDispatcher(), $this->getClient(), $this->getLogger()); + return new GmailTransportFactory($this->getDispatcher(), null, $this->getLogger()); } public function supportsProvider(): iterable diff --git a/src/Symfony/Component/Mailer/Bridge/Google/composer.json b/src/Symfony/Component/Mailer/Bridge/Google/composer.json index a3fbd96f95f0a..b7fd1eaeac64d 100644 --- a/src/Symfony/Component/Mailer/Bridge/Google/composer.json +++ b/src/Symfony/Component/Mailer/Bridge/Google/composer.json @@ -19,9 +19,6 @@ "php": ">=7.1.3", "symfony/mailer": "^4.4|^5.0" }, - "require-dev": { - "symfony/http-client": "^4.3|^5.0" - }, "autoload": { "psr-4": { "Symfony\\Component\\Mailer\\Bridge\\Google\\": "" }, "exclude-from-classmap": [ From 1688ffc499525ca36cd7a14b17dd5b9f4c820131 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Sat, 20 Nov 2021 14:33:26 +0100 Subject: [PATCH 17/72] Resync UPGRADE-6.0 --- UPGRADE-6.0.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/UPGRADE-6.0.md b/UPGRADE-6.0.md index c5506acbea75e..10c9dcc9199e3 100644 --- a/UPGRADE-6.0.md +++ b/UPGRADE-6.0.md @@ -109,6 +109,7 @@ FrameworkBundle * Remove the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead * Remove `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead * Deprecate the `cache.adapter.doctrine` service: The Doctrine Cache library is deprecated. Either switch to Symfony Cache or use the PSR-6 adapters provided by Doctrine Cache. + * Make the `framework.messenger.reset_on_message` configuration option default to `true` * In `framework.cache` configuration, using the `cache.adapter.pdo` with a Doctrine DBAL connection is no longer supported, use `cache.adapter.doctrine_dbal` instead. HttpFoundation @@ -118,9 +119,17 @@ HttpFoundation * Removed `Response::create()`, `JsonResponse::create()`, `RedirectResponse::create()`, `StreamedResponse::create()` and `BinaryFileResponse::create()` methods (use `__construct()` instead) - * Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `InvalidArgumentException`; wrap your filter in a closure instead. - * Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead. + * Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead + * Not passing a `Closure` together with `FILTER_CALLBACK` to `InputBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead + * Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead * Rename `RequestStack::getMasterRequest()` to `getMainRequest()` + * Not passing `FILTER_REQUIRE_ARRAY` or `FILTER_FORCE_ARRAY` flags to `InputBag::filter()` when filtering an array will throw `BadRequestException` + * Removed the `Request::HEADER_X_FORWARDED_ALL` constant + * Retrieving non-scalar values using `InputBag::get()` will throw `BadRequestException` (use `InputBad::all()` instead to retrieve an array) + * Passing non-scalar default value as the second argument `InputBag::get()` will throw `\InvalidArgumentException` + * Passing non-scalar, non-array value as the second argument `InputBag::set()` will throw `\InvalidArgumentException` + * Passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()` is not supported anymore. + * Remove the `upload_progress.*` and `url_rewriter.tags` session options HttpKernel ---------- @@ -488,7 +497,8 @@ Validator After: ```php - $builder->enableAnnotationMapping(true) + $builder + ->enableAnnotationMapping() ->setDoctrineAnnotationReader($reader); ``` @@ -503,7 +513,8 @@ Validator After: ```php - $builder->enableAnnotationMapping(true) + $builder + ->enableAnnotationMapping() ->addDefaultDoctrineAnnotationReader(); ``` From f7d77497e7bb0554ea8a47231ea5339ba3980335 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Sat, 20 Nov 2021 15:57:49 +0100 Subject: [PATCH 18/72] [Tests] Remove some unused fixtures --- .../Tests/Fixtures/BaseBundle/BaseBundle.php | 18 --------- .../Resources/views/base.format.engine | 0 .../views/controller/base.format.engine | 0 .../views/this.is.a.template.format.engine | 0 .../SecurityExtensionTest.php | 40 ------------------- .../Cache/Tests/Fixtures/PrunableCache.php | 19 --------- 6 files changed, 77 deletions(-) delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine delete mode 100644 src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php deleted file mode 100644 index 494a18dff0a14..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/BaseBundle.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BaseBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class BaseBundle extends Bundle -{ -} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/base.format.engine deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/controller/base.format.engine deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/BaseBundle/Resources/views/this.is.a.template.format.engine deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index bd6fd9c3ade5b..450f6644cdde3 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -35,7 +35,6 @@ use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; -use Symfony\Component\Security\Guard\AuthenticatorInterface as GuardAuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\HttpBasicAuthenticator; use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; @@ -835,45 +834,6 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio } } -class NullAuthenticator implements GuardAuthenticatorInterface -{ - public function start(Request $request, AuthenticationException $authException = null) - { - } - - public function supports(Request $request) - { - } - - public function getCredentials(Request $request) - { - } - - public function getUser($credentials, UserProviderInterface $userProvider) - { - } - - public function checkCredentials($credentials, UserInterface $user) - { - } - - public function createAuthenticatedToken(UserInterface $user, string $providerKey) - { - } - - public function onAuthenticationFailure(Request $request, AuthenticationException $exception) - { - } - - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey) - { - } - - public function supportsRememberMe() - { - } -} - class TestUserChecker implements UserCheckerInterface { public function checkPreAuth(UserInterface $user) diff --git a/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php b/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php deleted file mode 100644 index c1b3f740129d8..0000000000000 --- a/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Cache\Tests\Fixtures; - -use Psr\SimpleCache\CacheInterface; -use Symfony\Component\Cache\PruneableInterface; - -abstract class PrunableCache implements CacheInterface, PruneableInterface -{ -} From a0a431cdfd0d967910fc77d11a18a9c5dacc0925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sat, 20 Nov 2021 15:31:05 +0100 Subject: [PATCH 19/72] Remove code relating to old SotreInterface --- .../DependencyInjection/FrameworkExtension.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 96ae42c0ac18c..ac57f39750f9d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -81,11 +81,9 @@ use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\Lock\Lock; use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\PersistingStoreInterface; use Symfony\Component\Lock\Store\StoreFactory; -use Symfony\Component\Lock\StoreInterface; use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory; use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory; use Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory; @@ -1815,7 +1813,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont $storeDefinitions = []; foreach ($resourceStores as $storeDsn) { $storeDsn = $container->resolveEnvPlaceholders($storeDsn, null, $usedEnvs); - $storeDefinition = new Definition(interface_exists(StoreInterface::class) ? StoreInterface::class : PersistingStoreInterface::class); + $storeDefinition = new Definition(PersistingStoreInterface::class); $storeDefinition->setFactory([StoreFactory::class, 'createStore']); $storeDefinition->setArguments([$storeDsn]); @@ -1838,12 +1836,6 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont $factoryDefinition->replaceArgument(0, new Reference($storeDefinitionId)); $container->setDefinition('lock.'.$resourceName.'.factory', $factoryDefinition); - // Generate services for lock instances - $lockDefinition = new Definition(Lock::class); - $lockDefinition->setPublic(false); - $lockDefinition->setFactory([new Reference('lock.'.$resourceName.'.factory'), 'createLock']); - $lockDefinition->setArguments([$resourceName]); - // provide alias for default resource if ('default' === $resourceName) { $container->setAlias('lock.factory', new Alias('lock.'.$resourceName.'.factory', false)); From cfb809e81b8f0e32598ab0b18efb2cf38840d4f9 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 20 Nov 2021 18:59:37 +0100 Subject: [PATCH 20/72] Remove obsolete PHP version checks --- .../Resource/ReflectionClassResource.php | 42 ++++++++----------- .../Resource/ReflectionClassResourceTest.php | 12 ++---- .../Compiler/CheckArgumentsValidityPass.php | 4 +- .../ErrorHandler/DebugClassLoader.php | 4 +- .../VarExporter/Tests/VarExporterTest.php | 18 +++----- 5 files changed, 30 insertions(+), 50 deletions(-) diff --git a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php index a157d25f96859..6381d70bb3674 100644 --- a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php +++ b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php @@ -119,14 +119,12 @@ private function computeHash(): string private function generateSignature(\ReflectionClass $class): iterable { - if (\PHP_VERSION_ID >= 80000) { - $attributes = []; - foreach ($class->getAttributes() as $a) { - $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; - } - yield print_r($attributes, true); - $attributes = []; + $attributes = []; + foreach ($class->getAttributes() as $a) { + $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; } + yield print_r($attributes, true); + $attributes = []; yield $class->getDocComment(); yield (int) $class->isFinal(); @@ -144,13 +142,11 @@ private function generateSignature(\ReflectionClass $class): iterable $defaults = $class->getDefaultProperties(); foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) { - if (\PHP_VERSION_ID >= 80000) { - foreach ($p->getAttributes() as $a) { - $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; - } - yield print_r($attributes, true); - $attributes = []; + foreach ($p->getAttributes() as $a) { + $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; } + yield print_r($attributes, true); + $attributes = []; yield $p->getDocComment(); yield $p->isDefault() ? '' : ''; @@ -164,24 +160,20 @@ private function generateSignature(\ReflectionClass $class): iterable $defined = \Closure::bind(static function ($c) { return \defined($c); }, null, $class->name); foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) { - if (\PHP_VERSION_ID >= 80000) { - foreach ($m->getAttributes() as $a) { - $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; - } - yield print_r($attributes, true); - $attributes = []; + foreach ($m->getAttributes() as $a) { + $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; } + yield print_r($attributes, true); + $attributes = []; $defaults = []; $parametersWithUndefinedConstants = []; foreach ($m->getParameters() as $p) { - if (\PHP_VERSION_ID >= 80000) { - foreach ($p->getAttributes() as $a) { - $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; - } - yield print_r($attributes, true); - $attributes = []; + foreach ($p->getAttributes() as $a) { + $attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()]; } + yield print_r($attributes, true); + $attributes = []; if (!$p->isDefaultValueAvailable()) { $defaults[$p->name] = null; diff --git a/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php b/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php index 1443ca95dd93c..c6d52a147a745 100644 --- a/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php +++ b/src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php @@ -121,10 +121,7 @@ public function provideHashedSignature(): iterable { yield [false, 0, "// line change\n\n"]; yield [true, 0, '/** class docblock */']; - - if (\PHP_VERSION_ID >= 80000) { - yield [true, 0, '#[Foo]']; - } + yield [true, 0, '#[Foo]']; if (\PHP_VERSION_ID >= 80100) { yield [true, 0, '#[Foo(new MissingClass)]']; @@ -154,11 +151,8 @@ public function provideHashedSignature(): iterable yield [false, 11, "public function pub(\$arg = null) {\nreturn 123;\n}"]; yield [true, 12, '/** prot docblock */']; yield [true, 13, 'protected function prot($a = [123]) {}']; - - if (\PHP_VERSION_ID >= 80000) { - yield [true, 13, '#[Foo] protected function prot($a = []) {}']; - yield [true, 13, 'protected function prot(#[Foo] $a = []) {}']; - } + yield [true, 13, '#[Foo] protected function prot($a = []) {}']; + yield [true, 13, 'protected function prot(#[Foo] $a = []) {}']; if (\PHP_VERSION_ID >= 80100) { yield [true, 13, '#[Foo(new MissingClass)] protected function prot($a = []) {}']; diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php index d7d65a12ab992..e0054ef9d2e84 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php @@ -41,7 +41,7 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed $i = 0; $hasNamedArgs = false; foreach ($value->getArguments() as $k => $v) { - if (\PHP_VERSION_ID >= 80000 && preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $k)) { + if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $k)) { $hasNamedArgs = true; continue; } @@ -79,7 +79,7 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed $i = 0; $hasNamedArgs = false; foreach ($methodCall[1] as $k => $v) { - if (\PHP_VERSION_ID >= 80000 && preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $k)) { + if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $k)) { $hasNamedArgs = true; continue; } diff --git a/src/Symfony/Component/ErrorHandler/DebugClassLoader.php b/src/Symfony/Component/ErrorHandler/DebugClassLoader.php index b66adb61fe9a9..d0c9e8d47879c 100644 --- a/src/Symfony/Component/ErrorHandler/DebugClassLoader.php +++ b/src/Symfony/Component/ErrorHandler/DebugClassLoader.php @@ -130,7 +130,7 @@ public function __construct(callable $classLoader) $this->patchTypes += [ 'force' => null, 'php' => \PHP_MAJOR_VERSION.'.'.\PHP_MINOR_VERSION, - 'deprecations' => \PHP_VERSION_ID >= 70400, + 'deprecations' => true, ]; if ('phpdoc' === $this->patchTypes['force']) { @@ -878,7 +878,7 @@ private function normalizeType(string $type, string $class, ?string $parent, ?\R */ private function patchReturnTypeWillChange(\ReflectionMethod $method) { - if (\PHP_VERSION_ID >= 80000 && \count($method->getAttributes(\ReturnTypeWillChange::class))) { + if (\count($method->getAttributes(\ReturnTypeWillChange::class))) { return; } diff --git a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php index 0795700f6211a..bd3367a18db57 100644 --- a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php +++ b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php @@ -69,13 +69,10 @@ public function provideFailingSerialization() yield [$a]; - // This test segfaults on the final PHP 7.2 release - if (\PHP_VERSION_ID !== 70234) { - $a = [null, $h]; - $a[0] = &$a; + $a = [null, $h]; + $a[0] = &$a; - yield [$a]; - } + yield [$a]; } /** @@ -181,13 +178,10 @@ public function provideExport() yield ['hard-references', $value]; - // This test segfaults on the final PHP 7.2 release - if (\PHP_VERSION_ID !== 70234) { - $value = []; - $value[0] = &$value; + $value = []; + $value[0] = &$value; - yield ['hard-references-recursive', $value]; - } + yield ['hard-references-recursive', $value]; static $value = [123]; From 2f6bd6aa842ea6200464d63358fa05e0913aaad0 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Sat, 20 Nov 2021 19:25:16 +0100 Subject: [PATCH 21/72] [Tests] Remove some unused fixtures --- .../Serializer/Tests/SerializerTest.php | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/src/Symfony/Component/Serializer/Tests/SerializerTest.php b/src/Symfony/Component/Serializer/Tests/SerializerTest.php index 8d5ff1e6335eb..0d4c8700d432c 100644 --- a/src/Symfony/Component/Serializer/Tests/SerializerTest.php +++ b/src/Symfony/Component/Serializer/Tests/SerializerTest.php @@ -1150,38 +1150,6 @@ public function getIterator(): \ArrayIterator } } -class BazLegacy -{ - public $list; - - public $settings = []; - - public function __construct(array $list) - { - $this->list = new DummyListLegacy($list); - } -} - -class DummyListLegacy implements \Countable, \IteratorAggregate -{ - public $list; - - public function __construct(array $list) - { - $this->list = $list; - } - - public function count(): int - { - return \count($this->list); - } - - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->list); - } -} - interface NormalizerAwareNormalizer extends NormalizerInterface, NormalizerAwareInterface { } From d7efc42c77e888ef0a2da1339a37f87b2f425fb2 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Sat, 20 Nov 2021 19:48:49 +0100 Subject: [PATCH 22/72] [Tests] Remove some unused fixtures --- .../Token/AbstractTokenTest.php | 60 ------------------- .../Security/Core/Tests/SecurityTest.php | 8 --- 2 files changed, 68 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php index 03cc6d17e89ed..056123f644baa 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php @@ -94,66 +94,6 @@ public function testSetUser($user) } } -class TestUser -{ - protected $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function __toString(): string - { - return $this->name; - } -} - -class SerializableUser implements UserInterface -{ - private $roles; - private $name; - - public function __construct($name, array $roles = []) - { - $this->name = $name; - $this->roles = $roles; - } - - public function getUsername(): string - { - return $this->name; - } - - public function getUserIdentifier(): string - { - return $this->name; - } - - public function getPassword(): ?string - { - return '***'; - } - - public function getRoles(): array - { - if (empty($this->roles)) { - return ['ROLE_USER']; - } - - return $this->roles; - } - - public function eraseCredentials() - { - } - - public function getSalt(): ?string - { - return null; - } -} - class ConcreteToken extends AbstractToken { private $credentials = 'credentials_value'; diff --git a/src/Symfony/Component/Security/Core/Tests/SecurityTest.php b/src/Symfony/Component/Security/Core/Tests/SecurityTest.php index 53dd23b20b175..064998f97293e 100644 --- a/src/Symfony/Component/Security/Core/Tests/SecurityTest.php +++ b/src/Symfony/Component/Security/Core/Tests/SecurityTest.php @@ -93,11 +93,3 @@ private function createContainer($serviceId, $serviceObject) return $container; } } - -class StringishUser -{ - public function __toString(): string - { - return 'stringish_user'; - } -} From 4bd5c8b135e13eead61e6cdea10fdca3ada86879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sat, 20 Nov 2021 15:25:35 +0100 Subject: [PATCH 23/72] Leverage array_is_list --- .../FrameworkBundle/DependencyInjection/Configuration.php | 4 ++-- src/Symfony/Bundle/FrameworkBundle/composer.json | 1 + .../Component/DependencyInjection/Dumper/XmlDumper.php | 2 +- src/Symfony/Component/DependencyInjection/composer.json | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 9dc8ada27aa8d..519803f15c5ee 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -343,7 +343,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode) $workflows = []; } - if (1 === \count($workflows) && isset($workflows['workflows']) && array_keys($workflows['workflows']) !== range(0, \count($workflows) - 1) && !empty(array_diff(array_keys($workflows['workflows']), ['audit_trail', 'type', 'marking_store', 'supports', 'support_strategy', 'initial_marking', 'places', 'transitions']))) { + if (1 === \count($workflows) && isset($workflows['workflows']) && !array_is_list($workflows['workflows']) && !empty(array_diff(array_keys($workflows['workflows']), ['audit_trail', 'type', 'marking_store', 'supports', 'support_strategy', 'initial_marking', 'places', 'transitions']))) { $workflows = $workflows['workflows']; } @@ -1280,7 +1280,7 @@ private function addLockSection(ArrayNodeDefinition $rootNode, callable $enableI ->ifString()->then(function ($v) { return ['default' => $v]; }) ->end() ->beforeNormalization() - ->ifTrue(function ($v) { return \is_array($v) && array_keys($v) === range(0, \count($v) - 1); }) + ->ifTrue(function ($v) { return \is_array($v) && array_is_list($v); }) ->then(function ($v) { $resources = []; foreach ($v as $resource) { diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index c797289672f9d..d3694fa05bfc5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -28,6 +28,7 @@ "symfony/http-kernel": "^5.4|^6.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", "symfony/filesystem": "^4.4|^5.0|^6.0", "symfony/finder": "^4.4|^5.0|^6.0", "symfony/routing": "^5.3|^6.0" diff --git a/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php index d3491acb3b3cc..6dfc1669fa837 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php @@ -268,7 +268,7 @@ private function addServices(\DOMElement $parent) private function convertParameters(array $parameters, string $type, \DOMElement $parent, string $keyAttribute = 'key') { - $withKeys = array_keys($parameters) !== range(0, \count($parameters) - 1); + $withKeys = !array_is_list($parameters); foreach ($parameters as $key => $value) { $element = $this->document->createElement($type); if ($withKeys) { diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index 7ca3476027a56..0a0e488214f6a 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -20,6 +20,7 @@ "psr/container": "^1.1.1", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", "symfony/service-contracts": "^1.1.6|^2" }, "require-dev": { From 3c01aca3f218dc55e73e295072b3891650271253 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 20 Nov 2021 23:23:27 +0100 Subject: [PATCH 24/72] Guard is incompatible with Symfony 6 --- src/Symfony/Component/Security/Guard/composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Guard/composer.json b/src/Symfony/Component/Security/Guard/composer.json index ffd6bd5981cf0..4852ce9e0e34d 100644 --- a/src/Symfony/Component/Security/Guard/composer.json +++ b/src/Symfony/Component/Security/Guard/composer.json @@ -17,8 +17,8 @@ ], "require": { "php": ">=7.2.5", - "symfony/security-core": "^5.0|^6.0", - "symfony/security-http": "^5.3|^6.0", + "symfony/security-core": "^5.0", + "symfony/security-http": "^5.3", "symfony/polyfill-php80": "^1.15" }, "require-dev": { From 5909bdb2c952eb7401b97dd5bda05b7512d3ef60 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 21 Nov 2021 00:25:20 +0100 Subject: [PATCH 25/72] [SecurityBundle] There is no Guard 6 --- src/Symfony/Bundle/SecurityBundle/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index 50345333fc550..ba0fd02c9ae7a 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -28,7 +28,7 @@ "symfony/polyfill-php80": "^1.16", "symfony/security-core": "^5.4|^6.0", "symfony/security-csrf": "^4.4|^5.0|^6.0", - "symfony/security-guard": "^5.3|^6.0", + "symfony/security-guard": "^5.3", "symfony/security-http": "^5.4|^6.0" }, "require-dev": { From ecc1b6b88a1ec7d1400b62c393e2240a7490fe8e Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 21 Nov 2021 00:49:27 +0100 Subject: [PATCH 26/72] [Ldap] Add missing security-http dependency --- .../Security/CheckLdapCredentialsListenerTest.php | 12 ------------ src/Symfony/Component/Ldap/composer.json | 6 ++++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index 9a879c22490ef..b7e00b8589793 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -41,10 +41,6 @@ class CheckLdapCredentialsListenerTest extends TestCase protected function setUp(): void { - if (!interface_exists(AuthenticatorInterface::class)) { - $this->markTestSkipped('This test requires symfony/security-http:^5.1'); - } - $this->ldap = $this->createMock(LdapInterface::class); } @@ -61,10 +57,6 @@ public function testShouldNotCheckPassport($authenticator, $passport) public function provideShouldNotCheckPassport() { - if (!interface_exists(AuthenticatorInterface::class)) { - $this->markTestSkipped('This test requires symfony/security-http:^5.1'); - } - // no LdapBadge yield [new TestAuthenticator(), new Passport(new UserBadge('test'), new PasswordCredentials('s3cret'))]; @@ -110,10 +102,6 @@ public function testWrongPassport($passport) public function provideWrongPassportData() { - if (!interface_exists(AuthenticatorInterface::class)) { - $this->markTestSkipped('This test requires symfony/security-http:^5.1'); - } - // no password credentials yield [new SelfValidatingPassport(new UserBadge('test'), [new LdapBadge('app.ldap')])]; diff --git a/src/Symfony/Component/Ldap/composer.json b/src/Symfony/Component/Ldap/composer.json index dc6b0a5d5a796..0468e28efbce1 100644 --- a/src/Symfony/Component/Ldap/composer.json +++ b/src/Symfony/Component/Ldap/composer.json @@ -22,11 +22,13 @@ "ext-ldap": "*" }, "require-dev": { - "symfony/security-core": "^5.3" + "symfony/security-core": "^5.3", + "symfony/security-http": "^5.2" }, "conflict": { "symfony/options-resolver": "<4.4", - "symfony/security-core": "<5.3" + "symfony/security-core": "<5.3", + "symfony/security-http": "<5.2" }, "autoload": { "psr-4": { "Symfony\\Component\\Ldap\\": "" }, From 30234490724ada7997dacc0f108fd34c7641f02d Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 21 Nov 2021 10:01:59 +0100 Subject: [PATCH 27/72] Fix test --- .../CheckLdapCredentialsListenerTest.php | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index b7e00b8589793..3d5475d20039e 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -194,27 +194,25 @@ private function createListener() } } -if (interface_exists(AuthenticatorInterface::class)) { - class TestAuthenticator implements AuthenticatorInterface +class TestAuthenticator implements AuthenticatorInterface +{ + public function supports(Request $request): ?bool { - public function supports(Request $request): ?bool - { - } + } - public function authenticate(Request $request): PassportInterface - { - } + public function authenticate(Request $request): PassportInterface + { + } - public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface - { - } + public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface + { + } - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response - { - } + public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response + { + } - public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response - { - } + public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response + { } } From 1b2b22a5d098255503c42d43bc6135afe7bc0cbf Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 21 Nov 2021 10:19:49 +0100 Subject: [PATCH 28/72] [SecurityBundle] Remove Guard --- src/Symfony/Bundle/SecurityBundle/composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index f4e7877a26e0c..9f928c2c4fb57 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -27,7 +27,6 @@ "symfony/password-hasher": "^5.4|^6.0", "symfony/security-core": "^5.4|^6.0", "symfony/security-csrf": "^5.4|^6.0", - "symfony/security-guard": "^5.4|^6.0", "symfony/security-http": "^5.4|^6.0" }, "require-dev": { From 426ef7e0be9d20396312398b3a590e08885dcdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 21 Nov 2021 13:57:26 +0100 Subject: [PATCH 29/72] Fix JS error when toolbar is reloaded --- .../Resources/views/Profiler/base_js.html.twig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 4b234d24b354c..fbe3c0794314b 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 @@ -409,6 +409,14 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { renderAjaxRequests: renderAjaxRequests, + getSfwdt: function(token) { + if (!this.sfwdt) { + this.sfwdt = document.getElementById('sfwdt' + token); + } + + return this.sfwdt; + }, + load: function(selector, url, onSuccess, onError, options) { var el = document.getElementById(selector); @@ -440,7 +448,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { }, showToolbar: function(token) { - var sfwdt = document.getElementById('sfwdt' + token); + var sfwdt = this.getSfwdt(token); removeClass(sfwdt, 'sf-display-none'); if (getPreference('toolbar/displayState') == 'none') { @@ -455,7 +463,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { }, hideToolbar: function(token) { - var sfwdt = document.getElementById('sfwdt' + token); + var sfwdt = this.getSfwdt(token); addClass(sfwdt, 'sf-display-none'); }, @@ -606,7 +614,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { }, function(xhr) { if (xhr.status !== 0 && !options.stop) { - var sfwdt = document.getElementById('sfwdt' + token); + var sfwdt = that.getSfwdt(token); sfwdt.innerHTML = '\
\
\ From 4c2c5c9ba76ba8db9e88748ae519605c01b4b736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 21 Nov 2021 14:47:39 +0100 Subject: [PATCH 30/72] [Config] Add tests to compare generated code --- .../AddToList/Messenger/ReceivingConfig.php | 73 +++++++++ .../AddToList/Messenger/RoutingConfig.php | 51 +++++++ .../Config/AddToList/MessengerConfig.php | 67 +++++++++ .../Config/AddToList/TranslatorConfig.php | 71 +++++++++ .../Symfony/Config/AddToListConfig.php | 77 ++++++++++ .../Config/ArrayExtraKeys/BarConfig.php | 87 +++++++++++ .../Config/ArrayExtraKeys/FooConfig.php | 87 +++++++++++ .../Symfony/Config/ArrayExtraKeysConfig.php | 71 +++++++++ .../Messenger/TransportsConfig.php | 93 ++++++++++++ .../NodeInitialValues/MessengerConfig.php | 52 +++++++ .../SomeCleverNameConfig.php | 73 +++++++++ .../Config/NodeInitialValuesConfig.php | 77 ++++++++++ .../Symfony/Config/PlaceholdersConfig.php | 98 ++++++++++++ .../Symfony/Config/PrimitiveTypesConfig.php | 141 ++++++++++++++++++ .../Symfony/Config/VariableTypeConfig.php | 57 +++++++ .../Tests/Builder/GeneratedConfigTest.php | 64 +++++++- 16 files changed, 1232 insertions(+), 7 deletions(-) create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/MessengerConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToListConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/MessengerConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValuesConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php new file mode 100644 index 0000000000000..ca4db117acd37 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php @@ -0,0 +1,73 @@ +priority = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function color($value): self + { + $this->color = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['priority'])) { + $this->priority = $value['priority']; + unset($value['priority']); + } + + if (isset($value['color'])) { + $this->color = $value['color']; + unset($value['color']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->priority) { + $output['priority'] = $this->priority; + } + if (null !== $this->color) { + $output['color'] = $this->color; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php new file mode 100644 index 0000000000000..7f44a8553f66f --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php @@ -0,0 +1,51 @@ + $value + * @return $this + */ + public function senders($value): self + { + $this->senders = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['senders'])) { + $this->senders = $value['senders']; + unset($value['senders']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->senders) { + $output['senders'] = $this->senders; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/MessengerConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/MessengerConfig.php new file mode 100644 index 0000000000000..2189fde0f3bec --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/MessengerConfig.php @@ -0,0 +1,67 @@ +routing[$message_class])) { + return $this->routing[$message_class] = new \Symfony\Config\AddToList\Messenger\RoutingConfig($value); + } + if ([] === $value) { + return $this->routing[$message_class]; + } + + throw new InvalidConfigurationException('The node created by "routing()" has already been initialized. You cannot pass values the second time you call routing().'); + } + + public function receiving(array $value = []): \Symfony\Config\AddToList\Messenger\ReceivingConfig + { + return $this->receiving[] = new \Symfony\Config\AddToList\Messenger\ReceivingConfig($value); + } + + public function __construct(array $value = []) + { + + if (isset($value['routing'])) { + $this->routing = array_map(function ($v) { return new \Symfony\Config\AddToList\Messenger\RoutingConfig($v); }, $value['routing']); + unset($value['routing']); + } + + if (isset($value['receiving'])) { + $this->receiving = array_map(function ($v) { return new \Symfony\Config\AddToList\Messenger\ReceivingConfig($v); }, $value['receiving']); + unset($value['receiving']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->routing) { + $output['routing'] = array_map(function ($v) { return $v->toArray(); }, $this->routing); + } + if (null !== $this->receiving) { + $output['receiving'] = array_map(function ($v) { return $v->toArray(); }, $this->receiving); + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php new file mode 100644 index 0000000000000..570e415ce2830 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php @@ -0,0 +1,71 @@ + $value + * @return $this + */ + public function fallbacks($value): self + { + $this->fallbacks = $value; + + return $this; + } + + /** + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function source(string $source_class, $value): self + { + $this->sources[$source_class] = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['fallbacks'])) { + $this->fallbacks = $value['fallbacks']; + unset($value['fallbacks']); + } + + if (isset($value['sources'])) { + $this->sources = $value['sources']; + unset($value['sources']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->fallbacks) { + $output['fallbacks'] = $this->fallbacks; + } + if (null !== $this->sources) { + $output['sources'] = $this->sources; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToListConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToListConfig.php new file mode 100644 index 0000000000000..679aa9bbc7fca --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToListConfig.php @@ -0,0 +1,77 @@ +translator) { + $this->translator = new \Symfony\Config\AddToList\TranslatorConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "translator()" has already been initialized. You cannot pass values the second time you call translator().'); + } + + return $this->translator; + } + + public function messenger(array $value = []): \Symfony\Config\AddToList\MessengerConfig + { + if (null === $this->messenger) { + $this->messenger = new \Symfony\Config\AddToList\MessengerConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "messenger()" has already been initialized. You cannot pass values the second time you call messenger().'); + } + + return $this->messenger; + } + + public function getExtensionAlias(): string + { + return 'add_to_list'; + } + + public function __construct(array $value = []) + { + + if (isset($value['translator'])) { + $this->translator = new \Symfony\Config\AddToList\TranslatorConfig($value['translator']); + unset($value['translator']); + } + + if (isset($value['messenger'])) { + $this->messenger = new \Symfony\Config\AddToList\MessengerConfig($value['messenger']); + unset($value['messenger']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->translator) { + $output['translator'] = $this->translator->toArray(); + } + if (null !== $this->messenger) { + $output['messenger'] = $this->messenger->toArray(); + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php new file mode 100644 index 0000000000000..87eba94c6b91f --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php @@ -0,0 +1,87 @@ +corge = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function grault($value): self + { + $this->grault = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['corge'])) { + $this->corge = $value['corge']; + unset($value['corge']); + } + + if (isset($value['grault'])) { + $this->grault = $value['grault']; + unset($value['grault']); + } + + $this->_extraKeys = $value; + + } + + public function toArray(): array + { + $output = []; + if (null !== $this->corge) { + $output['corge'] = $this->corge; + } + if (null !== $this->grault) { + $output['grault'] = $this->grault; + } + + return $output + $this->_extraKeys; + } + + /** + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function set(string $key, $value): self + { + if (null === $value) { + unset($this->_extraKeys[$key]); + } else { + $this->_extraKeys[$key] = $value; + } + + return $this; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php new file mode 100644 index 0000000000000..46632c7f9a0e7 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php @@ -0,0 +1,87 @@ +baz = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function qux($value): self + { + $this->qux = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['baz'])) { + $this->baz = $value['baz']; + unset($value['baz']); + } + + if (isset($value['qux'])) { + $this->qux = $value['qux']; + unset($value['qux']); + } + + $this->_extraKeys = $value; + + } + + public function toArray(): array + { + $output = []; + if (null !== $this->baz) { + $output['baz'] = $this->baz; + } + if (null !== $this->qux) { + $output['qux'] = $this->qux; + } + + return $output + $this->_extraKeys; + } + + /** + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function set(string $key, $value): self + { + if (null === $value) { + unset($this->_extraKeys[$key]); + } else { + $this->_extraKeys[$key] = $value; + } + + return $this; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php new file mode 100644 index 0000000000000..31af46713d4e2 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php @@ -0,0 +1,71 @@ +foo) { + $this->foo = new \Symfony\Config\ArrayExtraKeys\FooConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "foo()" has already been initialized. You cannot pass values the second time you call foo().'); + } + + return $this->foo; + } + + public function bar(array $value = []): \Symfony\Config\ArrayExtraKeys\BarConfig + { + return $this->bar[] = new \Symfony\Config\ArrayExtraKeys\BarConfig($value); + } + + public function getExtensionAlias(): string + { + return 'array_extra_keys'; + } + + public function __construct(array $value = []) + { + + if (isset($value['foo'])) { + $this->foo = new \Symfony\Config\ArrayExtraKeys\FooConfig($value['foo']); + unset($value['foo']); + } + + if (isset($value['bar'])) { + $this->bar = array_map(function ($v) { return new \Symfony\Config\ArrayExtraKeys\BarConfig($v); }, $value['bar']); + unset($value['bar']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->foo) { + $output['foo'] = $this->foo->toArray(); + } + if (null !== $this->bar) { + $output['bar'] = array_map(function ($v) { return $v->toArray(); }, $this->bar); + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php new file mode 100644 index 0000000000000..a3fe5218f0678 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php @@ -0,0 +1,93 @@ +dsn = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function serializer($value): self + { + $this->serializer = $value; + + return $this; + } + + /** + * @param ParamConfigurator|list $value + * @return $this + */ + public function options($value): self + { + $this->options = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['dsn'])) { + $this->dsn = $value['dsn']; + unset($value['dsn']); + } + + if (isset($value['serializer'])) { + $this->serializer = $value['serializer']; + unset($value['serializer']); + } + + if (isset($value['options'])) { + $this->options = $value['options']; + unset($value['options']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->dsn) { + $output['dsn'] = $this->dsn; + } + if (null !== $this->serializer) { + $output['serializer'] = $this->serializer; + } + if (null !== $this->options) { + $output['options'] = $this->options; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/MessengerConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/MessengerConfig.php new file mode 100644 index 0000000000000..8e59732f2d024 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/MessengerConfig.php @@ -0,0 +1,52 @@ +transports[$name])) { + return $this->transports[$name] = new \Symfony\Config\NodeInitialValues\Messenger\TransportsConfig($value); + } + if ([] === $value) { + return $this->transports[$name]; + } + + throw new InvalidConfigurationException('The node created by "transports()" has already been initialized. You cannot pass values the second time you call transports().'); + } + + public function __construct(array $value = []) + { + + if (isset($value['transports'])) { + $this->transports = array_map(function ($v) { return new \Symfony\Config\NodeInitialValues\Messenger\TransportsConfig($v); }, $value['transports']); + unset($value['transports']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->transports) { + $output['transports'] = array_map(function ($v) { return $v->toArray(); }, $this->transports); + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php new file mode 100644 index 0000000000000..2db3d4cf95578 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php @@ -0,0 +1,73 @@ +first = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function second($value): self + { + $this->second = $value; + + return $this; + } + + public function __construct(array $value = []) + { + + if (isset($value['first'])) { + $this->first = $value['first']; + unset($value['first']); + } + + if (isset($value['second'])) { + $this->second = $value['second']; + unset($value['second']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->first) { + $output['first'] = $this->first; + } + if (null !== $this->second) { + $output['second'] = $this->second; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValuesConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValuesConfig.php new file mode 100644 index 0000000000000..d2f8bc654cfde --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValuesConfig.php @@ -0,0 +1,77 @@ +someCleverName) { + $this->someCleverName = new \Symfony\Config\NodeInitialValues\SomeCleverNameConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "someCleverName()" has already been initialized. You cannot pass values the second time you call someCleverName().'); + } + + return $this->someCleverName; + } + + public function messenger(array $value = []): \Symfony\Config\NodeInitialValues\MessengerConfig + { + if (null === $this->messenger) { + $this->messenger = new \Symfony\Config\NodeInitialValues\MessengerConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "messenger()" has already been initialized. You cannot pass values the second time you call messenger().'); + } + + return $this->messenger; + } + + public function getExtensionAlias(): string + { + return 'node_initial_values'; + } + + public function __construct(array $value = []) + { + + if (isset($value['some_clever_name'])) { + $this->someCleverName = new \Symfony\Config\NodeInitialValues\SomeCleverNameConfig($value['some_clever_name']); + unset($value['some_clever_name']); + } + + if (isset($value['messenger'])) { + $this->messenger = new \Symfony\Config\NodeInitialValues\MessengerConfig($value['messenger']); + unset($value['messenger']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->someCleverName) { + $output['some_clever_name'] = $this->someCleverName->toArray(); + } + if (null !== $this->messenger) { + $output['messenger'] = $this->messenger->toArray(); + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php new file mode 100644 index 0000000000000..909c95585b441 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php @@ -0,0 +1,98 @@ +enabled = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|float $value + * @return $this + */ + public function favoriteFloat($value): self + { + $this->favoriteFloat = $value; + + return $this; + } + + /** + * @param ParamConfigurator|list $value + * @return $this + */ + public function goodIntegers($value): self + { + $this->goodIntegers = $value; + + return $this; + } + + public function getExtensionAlias(): string + { + return 'placeholders'; + } + + public function __construct(array $value = []) + { + + if (isset($value['enabled'])) { + $this->enabled = $value['enabled']; + unset($value['enabled']); + } + + if (isset($value['favorite_float'])) { + $this->favoriteFloat = $value['favorite_float']; + unset($value['favorite_float']); + } + + if (isset($value['good_integers'])) { + $this->goodIntegers = $value['good_integers']; + unset($value['good_integers']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->enabled) { + $output['enabled'] = $this->enabled; + } + if (null !== $this->favoriteFloat) { + $output['favorite_float'] = $this->favoriteFloat; + } + if (null !== $this->goodIntegers) { + $output['good_integers'] = $this->goodIntegers; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php new file mode 100644 index 0000000000000..fd802032c28f6 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php @@ -0,0 +1,141 @@ +booleanNode = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|'foo'|'bar'|'baz' $value + * @return $this + */ + public function enumNode($value): self + { + $this->enumNode = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|float $value + * @return $this + */ + public function floatNode($value): self + { + $this->floatNode = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|int $value + * @return $this + */ + public function integerNode($value): self + { + $this->integerNode = $value; + + return $this; + } + + /** + * @default null + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function scalarNode($value): self + { + $this->scalarNode = $value; + + return $this; + } + + public function getExtensionAlias(): string + { + return 'primitive_types'; + } + + public function __construct(array $value = []) + { + + if (isset($value['boolean_node'])) { + $this->booleanNode = $value['boolean_node']; + unset($value['boolean_node']); + } + + if (isset($value['enum_node'])) { + $this->enumNode = $value['enum_node']; + unset($value['enum_node']); + } + + if (isset($value['float_node'])) { + $this->floatNode = $value['float_node']; + unset($value['float_node']); + } + + if (isset($value['integer_node'])) { + $this->integerNode = $value['integer_node']; + unset($value['integer_node']); + } + + if (isset($value['scalar_node'])) { + $this->scalarNode = $value['scalar_node']; + unset($value['scalar_node']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->booleanNode) { + $output['boolean_node'] = $this->booleanNode; + } + if (null !== $this->enumNode) { + $output['enum_node'] = $this->enumNode; + } + if (null !== $this->floatNode) { + $output['float_node'] = $this->floatNode; + } + if (null !== $this->integerNode) { + $output['integer_node'] = $this->integerNode; + } + if (null !== $this->scalarNode) { + $output['scalar_node'] = $this->scalarNode; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php new file mode 100644 index 0000000000000..0ee7efe7f362b --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php @@ -0,0 +1,57 @@ +anyValue = $value; + + return $this; + } + + public function getExtensionAlias(): string + { + return 'variable_type'; + } + + public function __construct(array $value = []) + { + + if (isset($value['any_value'])) { + $this->anyValue = $value['any_value']; + unset($value['any_value']); + } + + if ([] !== $value) { + throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); + } + } + + public function toArray(): array + { + $output = []; + if (null !== $this->anyValue) { + $output['any_value'] = $this->anyValue; + } + + return $output; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php index 4089bacc97f26..83b98d12ac363 100644 --- a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php +++ b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php @@ -11,6 +11,8 @@ use Symfony\Component\Config\Tests\Builder\Fixtures\NodeInitialValues; use Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator; use Symfony\Config\AddToListConfig; /** @@ -20,6 +22,23 @@ */ class GeneratedConfigTest extends TestCase { + private $tempDir = []; + + protected function setup(): void + { + parent::setup(); + + $this->tempDir = []; + } + + protected function tearDown(): void + { + (new Filesystem())->remove($this->tempDir); + $this->tempDir = []; + + parent::tearDown(); + } + public function fixtureNames() { $array = [ @@ -49,11 +68,19 @@ public function fixtureNames() public function testConfig(string $name, string $alias) { $basePath = __DIR__.'/Fixtures/'; - $configBuilder = $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name); $callback = include $basePath.$name.'.config.php'; $expectedOutput = include $basePath.$name.'.output.php'; + $expectedCode = $basePath.$name; + + // to regenerate snapshot files, uncomment this line + // $configBuilder = $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $expectedCode); + + $outputDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true); + $configBuilder = $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $outputDir); $callback($configBuilder); + $this->assertDirectorySame($expectedCode, $outputDir); + $this->assertInstanceOf(ConfigBuilderInterface::class, $configBuilder); $this->assertSame($alias, $configBuilder->getExtensionAlias()); $output = $configBuilder->toArray(); @@ -118,8 +145,13 @@ public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse() /** * Generate the ConfigBuilder or return an already generated instance. */ - private function generateConfigBuilder(string $configurationClass) + private function generateConfigBuilder(string $configurationClass, string $outputDir = null) { + $outputDir ?? $outputDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true); + if (!str_contains($outputDir, __DIR__)) { + $this->tempDir[] = $outputDir; + } + $configuration = new $configurationClass(); $rootNode = $configuration->getConfigTreeBuilder()->buildTree(); $rootClass = new ClassBuilder('Symfony\\Config', $rootNode->getName()); @@ -128,13 +160,31 @@ private function generateConfigBuilder(string $configurationClass) return new $fqcn(); } - $outputDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true); - - // This line is helpful for debugging - // $outputDir = __DIR__.'/.build'; - $loader = (new ConfigBuilderGenerator($outputDir))->build(new $configurationClass()); return $loader(); } + + private function assertDirectorySame($expected, $current) + { + $expectedFiles = []; + foreach (new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($expected, \FilesystemIterator::SKIP_DOTS)) as $file) { + if ($file->isDir()) { + continue; + } + $expectedFiles[substr($file->getPathname(), \strlen($expected))] = $file->getPathname(); + } + $currentFiles = []; + foreach (new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($current, \FilesystemIterator::SKIP_DOTS)) as $file) { + if ($file->isDir()) { + continue; + } + $currentFiles[substr($file->getPathname(), \strlen($current))] = $file->getPathname(); + } + + $this->assertSame(array_keys($expectedFiles), array_keys($currentFiles)); + foreach ($expectedFiles as $fileName => $filePath) { + $this->assertFileEquals($filePath, $currentFiles[$fileName]); + } + } } From 8b452803bad657b3b649e34f8a18eff8e74c0888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 21 Nov 2021 01:00:46 +0100 Subject: [PATCH 31/72] Default ansi option to null --- src/Symfony/Component/Console/Application.php | 2 +- src/Symfony/Component/Console/CHANGELOG.md | 1 + .../Component/Console/Tests/Fixtures/application_1.md | 4 ++-- .../Component/Console/Tests/Fixtures/application_2.md | 10 +++++----- .../Console/Tests/Fixtures/application_mbstring.md | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 769c65d63e6bf..9f9f8394e6bf8 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -1040,7 +1040,7 @@ protected function getDefaultInputDefinition() new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', false), + new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), ]); } diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 8808563869273..c41b65f14abd3 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG * Add support for bright colors * Add `#[AsCommand]` attribute for declaring commands on PHP 8 * Add `Helper::width()` and `Helper::length()` + * The `--ansi` and `--no-ansi` options now default to `null`. 5.2.0 ----- diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md index fb1d089f4f902..1ecb4e62f1ded 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -103,7 +103,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -230,7 +230,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md index 75ed6bd5f7792..96d5431e676a2 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md @@ -116,7 +116,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -243,7 +243,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -318,7 +318,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -409,7 +409,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -481,7 +481,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md index 1481222959b4f..e3838905f3239 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md @@ -107,7 +107,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -234,7 +234,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` @@ -325,7 +325,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` From a557bdc0c93f2cacc0907e22c6ede4e0bb557ed6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 11:04:59 +0100 Subject: [PATCH 32/72] [VarExporter] fix exporting declared but unset properties when __sleep() is implemented --- .../VarExporter/Internal/Exporter.php | 31 +++++++++---------- .../VarExporter/Tests/VarExporterTest.php | 7 +++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/VarExporter/Internal/Exporter.php b/src/Symfony/Component/VarExporter/Internal/Exporter.php index 0d7310c3fb094..4c49d87da61bf 100644 --- a/src/Symfony/Component/VarExporter/Internal/Exporter.php +++ b/src/Symfony/Component/VarExporter/Internal/Exporter.php @@ -90,13 +90,12 @@ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount $properties = []; $sleep = null; - $arrayValue = (array) $value; $proto = Registry::$prototypes[$class]; if (($value instanceof \ArrayIterator || $value instanceof \ArrayObject) && null !== $proto) { // ArrayIterator and ArrayObject need special care because their "flags" // option changes the behavior of the (array) casting operator. - $properties = self::getArrayObjectProperties($value, $arrayValue, $proto); + [$arrayValue, $properties] = self::getArrayObjectProperties($value, $proto); // populates Registry::$prototypes[$class] with a new instance Registry::getClassReflector($class, Registry::$instantiableWithoutConstructor[$class], Registry::$cloneable[$class]); @@ -108,25 +107,23 @@ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount $properties[] = $value[$v]; } $properties = ['SplObjectStorage' => ["\0" => $properties]]; + $arrayValue = (array) $value; } elseif ($value instanceof \Serializable || $value instanceof \__PHP_Incomplete_Class) { ++$objectsCount; $objectsPool[$value] = [$id = \count($objectsPool), serialize($value), [], 0]; $value = new Reference($id); goto handle_value; - } - - if (method_exists($class, '__sleep')) { - if (!\is_array($sleep = $value->__sleep())) { - trigger_error('serialize(): __sleep should return an array only containing the names of instance-variables to serialize', \E_USER_NOTICE); - $value = null; - goto handle_value; - } - foreach ($sleep as $name) { - if (property_exists($value, $name) && !$reflector->hasProperty($name)) { - $arrayValue[$name] = $value->$name; + } else { + if (method_exists($class, '__sleep')) { + if (!\is_array($sleep = $value->__sleep())) { + trigger_error('serialize(): __sleep should return an array only containing the names of instance-variables to serialize', \E_USER_NOTICE); + $value = null; + goto handle_value; } + $sleep = array_flip($sleep); } - $sleep = array_flip($sleep); + + $arrayValue = (array) $value; } $proto = (array) $proto; @@ -370,13 +367,13 @@ private static function exportHydrator(Hydrator $value, string $indent, string $ * @param \ArrayIterator|\ArrayObject $value * @param \ArrayIterator|\ArrayObject $proto */ - private static function getArrayObjectProperties($value, array &$arrayValue, $proto): array + private static function getArrayObjectProperties($value, $proto): array { $reflector = $value instanceof \ArrayIterator ? 'ArrayIterator' : 'ArrayObject'; $reflector = Registry::$reflectors[$reflector] ?? Registry::getClassReflector($reflector); $properties = [ - $arrayValue, + $arrayValue = (array) $value, $reflector->getMethod('getFlags')->invoke($value), $value instanceof \ArrayObject ? $reflector->getMethod('getIteratorClass')->invoke($value) : 'ArrayIterator', ]; @@ -402,6 +399,6 @@ private static function getArrayObjectProperties($value, array &$arrayValue, $pr $properties = [$reflector->class => ["\0" => $properties]]; } - return $properties; + return [$arrayValue, $properties]; } } diff --git a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php index 73b9f163e99b2..fffccd4b53db1 100644 --- a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php +++ b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php @@ -332,6 +332,13 @@ public function setFlags($flags): void class GoodNight { + public $good; + + public function __construct() + { + unset($this->good); + } + public function __sleep(): array { $this->good = 'night'; From 837a7e6e1dd80cc8d40e13c32d88491d68632ad7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 12:33:26 +0100 Subject: [PATCH 33/72] [Console] fix merge --- .../Console/Tests/Fixtures/application_1.json | 16 +++++----- .../Console/Tests/Fixtures/application_1.md | 2 +- .../Console/Tests/Fixtures/application_2.json | 32 +++++++++---------- .../Console/Tests/Fixtures/application_2.md | 2 +- .../Tests/Fixtures/application_mbstring.md | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json index 8c8ba2285f59a..280a4247eb39f 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json @@ -63,7 +63,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -72,7 +72,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -175,7 +175,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -184,7 +184,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -287,7 +287,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -296,7 +296,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -390,7 +390,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -399,7 +399,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md index e1e1665813abb..98474874d2e59 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -111,7 +111,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json index 172eaa310fb44..89171150ca858 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json @@ -67,7 +67,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -76,7 +76,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -179,7 +179,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -188,7 +188,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -291,7 +291,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -300,7 +300,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -394,7 +394,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -403,7 +403,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -482,7 +482,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -491,7 +491,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -578,7 +578,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -587,7 +587,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -655,7 +655,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -664,7 +664,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", @@ -734,7 +734,7 @@ "is_value_required": false, "is_multiple": false, "description": "Force (or disable --no-ansi) ANSI output", - "default": false + "default": null }, "no-ansi": { "name": "--no-ansi", @@ -743,7 +743,7 @@ "is_value_required": false, "is_multiple": false, "description": "Negate the \"--ansi\" option", - "default": false + "default": null }, "no-interaction": { "name": "--no-interaction", diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md index e340c9cbb5050..265e7117f21c9 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md @@ -124,7 +124,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md index 89988bf31ed27..2e6fc5f695b8a 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_mbstring.md @@ -115,7 +115,7 @@ Force (or disable --no-ansi) ANSI output * Is value required: no * Is multiple: no * Is negatable: yes -* Default: `false` +* Default: `NULL` #### `--no-interaction|-n` From 6a7da852be36bf978fa385e899528ee5a85b8f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 22 Nov 2021 13:28:40 +0100 Subject: [PATCH 34/72] Replace PHP_EOL by \n to generate same code on Win/Lin --- .../Config/Builder/ConfigBuilderGenerator.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Config/Builder/ConfigBuilderGenerator.php b/src/Symfony/Component/Config/Builder/ConfigBuilderGenerator.php index d35bed2b679a2..979c95522704c 100644 --- a/src/Symfony/Component/Config/Builder/ConfigBuilderGenerator.php +++ b/src/Symfony/Component/Config/Builder/ConfigBuilderGenerator.php @@ -301,31 +301,31 @@ private function getComment(VariableNode $node): string { $comment = ''; if ('' !== $info = (string) $node->getInfo()) { - $comment .= ' * '.$info.\PHP_EOL; + $comment .= ' * '.$info."\n"; } foreach ((array) ($node->getExample() ?? []) as $example) { - $comment .= ' * @example '.$example.\PHP_EOL; + $comment .= ' * @example '.$example."\n"; } if ('' !== $default = $node->getDefaultValue()) { - $comment .= ' * @default '.(null === $default ? 'null' : var_export($default, true)).\PHP_EOL; + $comment .= ' * @default '.(null === $default ? 'null' : var_export($default, true))."\n"; } if ($node instanceof EnumNode) { $comment .= sprintf(' * @param ParamConfigurator|%s $value', implode('|', array_map(function ($a) { return var_export($a, true); - }, $node->getValues()))).\PHP_EOL; + }, $node->getValues())))."\n"; } else { $parameterType = $this->getParameterType($node); if (null === $parameterType || '' === $parameterType) { $parameterType = 'mixed'; } - $comment .= ' * @param ParamConfigurator|'.$parameterType.' $value'.\PHP_EOL; + $comment .= ' * @param ParamConfigurator|'.$parameterType.' $value'."\n"; } if ($node->isDeprecated()) { - $comment .= ' * @deprecated '.$node->getDeprecation($node->getName(), $node->getParent()->getName())['message'].\PHP_EOL; + $comment .= ' * @deprecated '.$node->getDeprecation($node->getName(), $node->getParent()->getName())['message']."\n"; } return $comment; From 6f005e2985b5cb2eb189b1137ad53500b0efbdbb Mon Sep 17 00:00:00 2001 From: HypeMC Date: Mon, 22 Nov 2021 13:40:17 +0100 Subject: [PATCH 35/72] [Config] Add test for missing use statement --- .../Tests/Builder/Fixtures/ArrayExtraKeys.php | 3 ++ .../Config/ArrayExtraKeys/BazConfig.php | 45 +++++++++++++++++++ .../Symfony/Config/ArrayExtraKeysConfig.php | 21 +++++++++ 3 files changed, 69 insertions(+) create mode 100644 src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys.php index 453468330b26d..751fe5c2934cc 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys.php @@ -29,6 +29,9 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->end() ->end() + ->arrayNode('baz') + ->ignoreExtraKeys(false) + ->end() ; return $tb; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php new file mode 100644 index 0000000000000..fae09098ab103 --- /dev/null +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php @@ -0,0 +1,45 @@ +_extraKeys = $value; + + } + + public function toArray(): array + { + $output = []; + + return $output + $this->_extraKeys; + } + + /** + * @param ParamConfigurator|mixed $value + * @return $this + */ + public function set(string $key, $value): self + { + if (null === $value) { + unset($this->_extraKeys[$key]); + } else { + $this->_extraKeys[$key] = $value; + } + + return $this; + } + +} diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php index 31af46713d4e2..20ff730475f54 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeysConfig.php @@ -4,6 +4,7 @@ require_once __DIR__.\DIRECTORY_SEPARATOR.'ArrayExtraKeys'.\DIRECTORY_SEPARATOR.'FooConfig.php'; require_once __DIR__.\DIRECTORY_SEPARATOR.'ArrayExtraKeys'.\DIRECTORY_SEPARATOR.'BarConfig.php'; +require_once __DIR__.\DIRECTORY_SEPARATOR.'ArrayExtraKeys'.\DIRECTORY_SEPARATOR.'BazConfig.php'; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; @@ -15,6 +16,7 @@ class ArrayExtraKeysConfig implements \Symfony\Component\Config\Builder\ConfigBu { private $foo; private $bar; + private $baz; public function foo(array $value = []): \Symfony\Config\ArrayExtraKeys\FooConfig { @@ -32,6 +34,17 @@ public function bar(array $value = []): \Symfony\Config\ArrayExtraKeys\BarConfig return $this->bar[] = new \Symfony\Config\ArrayExtraKeys\BarConfig($value); } + public function baz(array $value = []): \Symfony\Config\ArrayExtraKeys\BazConfig + { + if (null === $this->baz) { + $this->baz = new \Symfony\Config\ArrayExtraKeys\BazConfig($value); + } elseif ([] !== $value) { + throw new InvalidConfigurationException('The node created by "baz()" has already been initialized. You cannot pass values the second time you call baz().'); + } + + return $this->baz; + } + public function getExtensionAlias(): string { return 'array_extra_keys'; @@ -50,6 +63,11 @@ public function __construct(array $value = []) unset($value['bar']); } + if (isset($value['baz'])) { + $this->baz = new \Symfony\Config\ArrayExtraKeys\BazConfig($value['baz']); + unset($value['baz']); + } + if ([] !== $value) { throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); } @@ -64,6 +82,9 @@ public function toArray(): array if (null !== $this->bar) { $output['bar'] = array_map(function ($v) { return $v->toArray(); }, $this->bar); } + if (null !== $this->baz) { + $output['baz'] = $this->baz->toArray(); + } return $output; } From d6401e1c4b7d8ea49973d39fc0d46f9684faacef Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:10:44 +0100 Subject: [PATCH 36/72] Update CHANGELOG for 4.4.34 --- CHANGELOG-4.4.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG-4.4.md b/CHANGELOG-4.4.md index 18b1ae705bb72..669b5dccca4d5 100644 --- a/CHANGELOG-4.4.md +++ b/CHANGELOG-4.4.md @@ -7,6 +7,35 @@ in 4.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/v4.4.0...v4.4.1 +* 4.4.34 (2021-11-22) + + * bug #44188 [VarExporter] fix exporting declared but unset properties when __sleep() is implemented (nicolas-grekas) + * bug #44119 [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance (j-bernard) + * bug #44131 [Yaml] properly parse quoted strings tagged with !!str (xabbuh) + * bug #42323 [TwigBridge] do not merge label classes into expanded choice labels (xabbuh) + * bug #44121 [Serializer] fix support for lazy properties (nicolas-grekas) + * bug #44111 [Serializer] fix support for unset properties on PHP < 7.4 (nicolas-grekas) + * bug #44070 [Process] intersect with getenv() to populate default envs (nicolas-grekas) + * bug #44043 [Cache] fix dbindex Redis (a1812) + * bug #44042 Fix DateIntervalToStringTransformer::transform() doc (BenMorel) + * bug #44034 [Yaml] don't try to replace references in quoted strings (xabbuh) + * bug #44028 [ErrorHandler] Fix FlattenException::setPrevious argument typing (welcoMattic) + * bug #44012 [DependencyInjection] fix inlining when non-shared services are involved (nicolas-grekas) + * bug #44002 [Cache] Fix Memory leak (a1812) + * bug #43981 [FrameworkBundle] fix registering late resettable services (nicolas-grekas) + * bug #43988 [DoctrineBridge] add support for the JSON type (dunglas) + * bug #43987 [PhpUnitBridge] Fix Uncaught ValueError (dunglas) + * bug #43961 [HttpClient] Curl http client has to reinit curl multi handle on reset (rmikalkenas) + * bug #43922 [DependencyInjection] only allow `ReflectionNamedType` for `ServiceSubscriberTrait` (kbond) + * bug #43901 [SecurityBundle] Default access_decision_manager.strategy option with merge (biozshock) + * bug #43909 [VarExporter] escape unicode chars involved in directionality (nicolas-grekas) + * bug #43867 [VarDumper] Make dumping DateInterval instances timezone-independent (derrabus) + * bug #43096 [Messenger] Use `TransportMessageIdStamp` in `InMemoryTransport` allows retrying (alexndlm) + * bug #43501 [HttpKernel] fix ErrorException in CacheWarmerAggregate (Ahummeling) + * bug #42361 [Translation] correctly handle intl domains with TargetOperation (acran) + * bug #43834 [Inflector] Fix inflector for "zombies" (acodispo) + * bug #43267 [Config] Fix signature generation with nested attributes on PHP 8.1 (agustingomes) + * 4.4.33 (2021-10-29) * bug #43798 [Dotenv] Duplicate $_SERVER values in $_ENV if they don't exist (fancyweb) From 44f032687d1672de10ff5835b98b814f0be42384 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:10:52 +0100 Subject: [PATCH 37/72] Update CONTRIBUTORS for 4.4.34 --- CONTRIBUTORS.md | 119 +++++++++++++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 43 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1ac10f641e698..92b9b528b9c50 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -20,9 +20,9 @@ The Symfony Connect username in parenthesis allows to get more information - Jordi Boggiano (seldaek) - Victor Berchet (victor) - Javier Eguiluz (javier.eguiluz) + - Thomas Calvet (fancyweb) - Ryan Weaver (weaverryan) - Roland Franssen (ro0) - - Thomas Calvet (fancyweb) - Jakub Zalas (jakubzalas) - Johannes S (johannes) - Kris Wallsmith (kriswallsmith) @@ -46,20 +46,21 @@ The Symfony Connect username in parenthesis allows to get more information - Jan Schädlich (jschaedl) - Igor Wiedler (igorw) - Eriksen Costa (eriksencosta) + - Kevin Bond (kbond) - Ener-Getick (energetick) - Sarah Khalil (saro0h) - - Kevin Bond (kbond) - Pierre du Plessis (pierredup) + - Vasilij Duško (staff) - Valentin Udaltsov (vudaltsov) - Iltar van der Berg (kjarli) - Jonathan Wage (jwage) - - Vasilij Duško (staff) - Matthias Pigulla (mpdude) - Diego Saint Esteben (dosten) - Grégoire Paris (greg0ire) - Alexandre Salomé (alexandresalome) - William Durand (couac) - ornicar + - Jérôme Tamarelle (gromnan) - Konstantin Myakshin (koc) - Dany Maillard (maidmaid) - Francis Besset (francisbesset) @@ -68,13 +69,12 @@ The Symfony Connect username in parenthesis allows to get more information - Titouan Galopin (tgalopin) - Laurent VOULLEMIER (lvo) - Vasilij Dusko | CREATION - - Jérôme Tamarelle (gromnan) - Bulat Shakirzyanov (avalanche123) - David Maicher (dmaicher) + - Gábor Egyed (1ed) - gadelat (gadelat) - Saša Stamenković (umpirsky) - Peter Rehm (rpet) - - Gábor Egyed (1ed) - Henrik Bjørnskov (henrikbjorn) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) @@ -82,10 +82,10 @@ The Symfony Connect username in parenthesis allows to get more information - Konstantin Kudryashov (everzet) - Vladimir Reznichenko (kalessil) - Bilal Amarni (bamarni) + - Antoine M (amakdessi) - Florin Patan (florinpatan) - Jáchym Toušek (enumag) - Alex Pott - - Antoine M (amakdessi) - Michel Weimerskirch (mweimerskirch) - Andrej Hudec (pulzarraider) - Christian Raue @@ -112,24 +112,25 @@ The Symfony Connect username in parenthesis allows to get more information - Toni Uebernickel (havvg) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) + - Mathieu Santostefano (welcomattic) - John Wards (johnwards) - Tomas Norkūnas (norkunas) - Baptiste Clavié (talus) - Antoine Hérault (herzult) - Paráda József (paradajozsef) + - Alexandre Daubois (alexandre-daubois) - Vincent Langlet (deviling) + - HypeMC (hypemc) - Massimiliano Arione (garak) - Arnaud Le Blanc (arnaud-lb) - Przemysław Bogusz (przemyslaw-bogusz) + - Julien Falque (julienfalque) - Maxime STEINHAUSSER - Michal Piotrowski (eventhorizon) - Tomáš Votruba (tomas_votruba) - Mathias Arlaud (mtarld) - Tim Nagel (merk) - - Alexandre Daubois (alexandre-daubois) - - HypeMC (hypemc) - Chris Wilkinson (thewilkybarkid) - - Julien Falque (julienfalque) - Peter Kokot (maastermedia) - Lars Strojny (lstrojny) - Brice BERNARD (brikou) @@ -144,7 +145,6 @@ The Symfony Connect username in parenthesis allows to get more information - Adrien Brault (adrienbrault) - Yanick Witschi (toflar) - Jacob Dreesen (jdreesen) - - Mathieu Santostefano (welcomattic) - Malte Schlüter (maltemaltesich) - Joel Wurtz (brouznouf) - Théo FIDRY (theofidry) @@ -168,6 +168,7 @@ The Symfony Connect username in parenthesis allows to get more information - Gary PEGEOT (gary-p) - Matthieu Napoli (mnapoli) - Ruud Kamphuis (ruudk) + - Ion Bazan (ionbazan) - Jannik Zschiesche (apfelbox) - Robert Schönthal (digitalkaoz) - Florian Lonqueu-Brochard (florianlb) @@ -186,7 +187,6 @@ The Symfony Connect username in parenthesis allows to get more information - Hidenori Goto (hidenorigoto) - Jan Rosier (rosier) - Alessandro Chitolina (alekitto) - - Ion Bazan (ionbazan) - Albert Casademont (acasademont) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) @@ -202,6 +202,8 @@ The Symfony Connect username in parenthesis allows to get more information - George Mponos (gmponos) - jwdeitch - Jeroen Spee (jeroens) + - Jérôme Parmentier (lctrs) + - Marco Pivetta (ocramius) - Fabien Bourigault (fbourigault) - Joe Bennett (kralos) - Mikael Pajunen @@ -216,16 +218,16 @@ The Symfony Connect username in parenthesis allows to get more information - Thomas Rabaix (rande) - Chi-teck - Timo Bakx (timobakx) - - Marco Pivetta (ocramius) - Vincent Touzet (vincenttouzet) - Nate Wiebe (natewiebe13) - Rouven Weßling (realityking) - - Jérôme Parmentier (lctrs) + - Michael Babker (mbabker) - Ben Davies (bendavies) - Clemens Tolboom - Helmer Aaviksoo - Christopher Hertel (chertel) - Remon van de Kamp (rpkamp) + - Rokas Mikalkėnas (rokasm) - Filippo Tessarotto (slamdunk) - Hiromi Hishida (77web) - Michael Käfer (michael_kaefer) @@ -233,6 +235,7 @@ The Symfony Connect username in parenthesis allows to get more information - Michał Pipa (michal.pipa) - Dawid Nowak - Andreas Möller (localheinz) + - Roman Martinuk (a2a4) - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba @@ -241,8 +244,9 @@ The Symfony Connect username in parenthesis allows to get more information - Samuel NELA (snela) - David Prévot - Hugo Monteiro (monteiro) + - Baptiste Leduc (korbeil) - Dmitrii Poddubnyi (karser) - - Michael Babker (mbabker) + - zairig imad (zairigimad) - Tien Vo (tienvx) - Timothée Barray (tyx) - James Halsall (jaitsu) @@ -270,11 +274,9 @@ The Symfony Connect username in parenthesis allows to get more information - Philippe Segatori - Thibaut Cheymol (tcheymol) - Sebastien Morel (plopix) - - Baptiste Leduc (korbeil) - mcfedr (mcfedr) - Ruben Gonzalez (rubenrua) - Benjamin Dulau (dbenjamin) - - zairig imad (zairigimad) - Baptiste Lafontaine (magnetik) - Mathieu Lemoine (lemoinem) - Denis Brumann (dbrumann) @@ -287,13 +289,11 @@ The Symfony Connect username in parenthesis allows to get more information - Stadly - Stepan Anchugov (kix) - François Pluchino (francoispluchino) - - Rokas Mikalkėnas (rokasm) - bronze1man - sun (sun) - Larry Garfield (crell) - Edi Modrić (emodric) - Gocha Ossinkine (ossinkine) - - Roman Martinuk (a2a4) - Leo Feyer (leofeyer) - Nikolay Labinskiy (e-moe) - Martin Schuhfuß (usefulthink) @@ -317,6 +317,7 @@ The Symfony Connect username in parenthesis allows to get more information - Dustin Whittle (dustinwhittle) - jeff - John Kary (johnkary) + - fd6130 (fdtvui) - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) - Maciej Malarz (malarzm) @@ -330,6 +331,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bastien Jaillot (bastnic) - Rui Marinho (ruimarinho) - Patrick Landolt (scube) + - Michał (bambucha15) - Eugene Wissner - Bohan Yang (brentybh) - Pascal Montoya @@ -362,7 +364,6 @@ The Symfony Connect username in parenthesis allows to get more information - Marcos Sánchez - Elnur Abdurrakhimov (elnur) - Manuel Reinhard (sprain) - - fd6130 (fdtvui) - Harm van Tilborg (hvt) - Danny Berger (dpb587) - Antonio J. García Lagar (ajgarlag) @@ -375,9 +376,9 @@ The Symfony Connect username in parenthesis allows to get more information - Xavier Perez - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA + - Sylvain Fabre (sylfabre) - Patrick McDougle (patrick-mcdougle) - Marc Weistroff (futurecat) - - Michał (bambucha15) - Alif Rachmawadi - Anton Chernikov (anton_ch1989) - Kristen Gilden (kgilden) @@ -387,6 +388,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sullivan SENECHAL (soullivaneuh) - Thomas Bisignani (toma) - Uwe Jäger (uwej711) + - Dāvis Zālītis (k0d3r1s) - Eugene Leonovich (rybakit) - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) @@ -395,11 +397,13 @@ The Symfony Connect username in parenthesis allows to get more information - Jan Sorgalla (jsor) - Ray - Chekote + - Aleksandar Jakovljevic (ajakov) - Thomas Adam - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) - jdhoek - Thomas Landauer (thomas-landauer) + - Jurica Vlahoviček (vjurica) - Bob den Otter (bopp) - Thomas Schulz (king2500) - Frank de Jonge (frenkynet) @@ -412,6 +416,7 @@ The Symfony Connect username in parenthesis allows to get more information - Dmitriy Mamontov (mamontovdmitriy) - Ben Ramsey (ramsey) - Laurent Masforné (heisenberg) + - Sergey (upyx) - Giorgio Premi - Guillaume (guill) - renanbr @@ -434,7 +439,6 @@ The Symfony Connect username in parenthesis allows to get more information - Soner Sayakci - Peter Kruithof (pkruithof) - Michael Holm (hollo) - - Sylvain Fabre (sylfabre) - Arjen van der Meijden - Markus Fasselt (digilist) - Damien Alexandre (damienalexandre) @@ -452,7 +456,6 @@ The Symfony Connect username in parenthesis allows to get more information - Chris Smith (cs278) - Florian Klein (docteurklein) - W0rma - - Dāvis Zālītis (k0d3r1s) - Manuel Kiessling (manuelkiessling) - Dimitri Gritsajuk (ottaviano) - Alexey Kopytko (sanmai) @@ -497,6 +500,7 @@ The Symfony Connect username in parenthesis allows to get more information - Berny Cantos (xphere81) - Andrii Bodnar - Thierry Thuon (lepiaf) + - Antonio Jose Cerezo (ajcerezo) - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) - Loïc Frémont (loic425) @@ -507,9 +511,9 @@ The Symfony Connect username in parenthesis allows to get more information - Tri Pham (phamuyentri) - Urinbayev Shakhobiddin (shokhaa) - Gennady Telegin (gtelegin) - - Sergey (upyx) - Krystian Marcisz (simivar) - Toni Rudolf (toooni) + - Dalibor Karlović (dkarlovi) - Erin Millard - Artur Melo (restless) - Matthew Lewinski (lewinski) @@ -526,10 +530,12 @@ The Symfony Connect username in parenthesis allows to get more information - Tobias Sjösten (tobiassjosten) - Gyula Sallai (salla) - Benjamin Cremer (bcremer) + - Hendrik Luup (hluup) - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Dmytro Borysovskyi (dmytr0) - Tomasz Kowalczyk (thunderer) + - Artem Lopata - Artur Eshenbrener - Thomas Perez (scullwm) - Yoann RENARD (yrenard) @@ -585,7 +591,6 @@ The Symfony Connect username in parenthesis allows to get more information - Daniel Beyer - Manuel Alejandro Paz Cetina - Shein Alexey - - Aleksandar Jakovljevic (ajakov) - Jacek Jędrzejewski (jacek.jedrzejewski) - Romain Gautier (mykiwi) - Stefan Kruppa @@ -611,7 +616,6 @@ The Symfony Connect username in parenthesis allows to get more information - Marc Morales Valldepérez (kuert) - Jean-Baptiste GOMOND (mjbgo) - Vadim Kharitonov (virtuozzz) - - Jurica Vlahoviček (vjurica) - Oscar Cubo Medina (ocubom) - Karel Souffriau - Christophe L. (christophelau) @@ -630,7 +634,6 @@ The Symfony Connect username in parenthesis allows to get more information - Alexandru Furculita (afurculita) - Valentin Jonovs (valentins-jonovs) - Bastien DURAND (deamon) - - Antonio Jose Cerezo (ajcerezo) - Jeanmonod David (jeanmonod) - Christin Gruber (christingruber) - Andrey Sevastianov @@ -640,11 +643,11 @@ The Symfony Connect username in parenthesis allows to get more information - Noémi Salaün (noemi-salaun) - Niklas Fiekas - Philippe Segatori - - Dalibor Karlović (dkarlovi) - Markus Bachmann (baachi) - Kévin THERAGE (kevin_therage) - Michel Hunziker - Gunnstein Lye (glye) + - scyzoryck - Matthias Krauser (mkrauser) - Erkhembayar Gantulga (erheme318) - Lorenzo Millucci (lmillucci) @@ -665,14 +668,12 @@ The Symfony Connect username in parenthesis allows to get more information - Stefan Gehrig (sgehrig) - vagrant - Aurimas Niekis (gcds) - - Hendrik Luup (hluup) - EdgarPE - Florian Pfitzer (marmelatze) - Asier Illarramendi (doup) - Martijn Cuppens - Vlad Gregurco (vgregurco) - Boris Vujicic (boris.vujicic) - - Artem Lopata - Chris Sedlmayr (catchamonkey) - Indra Gunawan (indragunawan) - Mathias STRASSER (roukmoute) @@ -703,6 +704,7 @@ The Symfony Connect username in parenthesis allows to get more information - Lukáš Holeczy (holicz) - Erik Saunier (snickers) - franek (franek) + - Jerzy (jlekowski) - Raulnet - Christian Wahler - Dries Vints @@ -770,6 +772,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alex Bacart - mcben - Jérôme Vieilledent (lolautruche) + - Roman Anasal - Maks Slesarenko - Filip Procházka (fprochazka) - mmoreram @@ -808,6 +811,7 @@ The Symfony Connect username in parenthesis allows to get more information - Tom Klingenberg - Gábor Fási - DUPUCH (bdupuch) + - Dadang NH (dadangnh) - Nate (frickenate) - Joachim Løvgaard (loevgaard) - Stefan Kruppa @@ -832,8 +836,10 @@ The Symfony Connect username in parenthesis allows to get more information - Samuele Lilli (doncallisto) - Gawain Lynch (gawain) - Peter Bowyer (pbowyer) + - Wojciech Kania - mmokhi - NothingWeAre + - Andrii Dembitskyi - Ryan - Lctrs - Alexander Deruwe (aderuwe) @@ -857,6 +863,7 @@ The Symfony Connect username in parenthesis allows to get more information - Johnny Robeson (johnny) - Disquedur - Michiel Boeckaert (milio) + - Benjamin Morel - Dmitriy Derepko - Geoffrey Tran (geoff) - Pablo Lozano (arkadis) @@ -992,7 +999,6 @@ The Symfony Connect username in parenthesis allows to get more information - Timothée BARRAY - Nilmar Sanchez Muguercia - Ivo Bathke (ivoba) - - scyzoryck - Ippei SUmida (ippey_s) - David Molineus - Strate @@ -1010,6 +1016,7 @@ The Symfony Connect username in parenthesis allows to get more information - rtek - Benjamin Dos Santos - Jérémy Jarrié (gagnar) + - Adrien Jourdier - Tomas Javaisis - Ivan Grigoriev - Johann Saunier (prophet777) @@ -1019,6 +1026,7 @@ The Symfony Connect username in parenthesis allows to get more information - Michael Devery (mickadoo) - Antoine Corcy - Ahmed Ashraf (ahmedash95) + - Gert Wijnalda (cinamo) - Luca Saba (lucasaba) - maxime.perrimond - Sascha Grossenbacher @@ -1090,7 +1098,6 @@ The Symfony Connect username in parenthesis allows to get more information - Junaid Farooq (junaidfarooq) - Massimiliano Braglia (massimilianobraglia) - Frankie Wittevrongel - - Jerzy (jlekowski) - Richard Quadling - Raphaëll Roussel - Anton Kroshilin @@ -1240,6 +1247,7 @@ The Symfony Connect username in parenthesis allows to get more information - Jake (jakesoft) - Flinsch - Quentin Dreyer + - Bahman Mehrdad (bahman) - Jordan de Laune (jdelaune) - Christopher Hall (mythmakr) - none (nelexa) @@ -1251,6 +1259,7 @@ The Symfony Connect username in parenthesis allows to get more information - Martin Parsiegla (spea) - Bernhard Rusch - bhavin (bhavin4u) + - Mario Ramundo (rammar) - Ivan - Quentin Schuler - Nico Haase @@ -1259,6 +1268,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sofiane HADDAG (sofhad) - frost-nzcr4 - Taylor Otwell + - Shahriar56 - Sami Mussbach - Dhananjay Goratela - Kien Nguyen @@ -1268,17 +1278,18 @@ The Symfony Connect username in parenthesis allows to get more information - Achilles Kaloeridis (achilles) - Adrien Wilmet (adrienfr) - Laurent Bassin (lbassin) + - Mouad ZIANI (mouadziani) - Tomasz Ignatiuk - andrey1s - Abhoryo - Fabian Vogler (fabian) + - Shakhobiddin - Korvin Szanto - Stéphan Kochen - Steven Dubois - Arjan Keeman - siganushka - Alaattin Kahramanlar (alaattin) - - Dadang NH (dadangnh) - Sergey Zolotov (enleur) - Maksim Kotlyar (makasim) - Neil Ferreira @@ -1287,6 +1298,7 @@ The Symfony Connect username in parenthesis allows to get more information - Paul LE CORRE - Loïc Beurlet - Sébastien COURJEAN + - Ana Raro - Daniel Gorgan - Ana Raro - Tony Malzhacker @@ -1295,9 +1307,9 @@ The Symfony Connect username in parenthesis allows to get more information - Cyril Quintin (cyqui) - Cyrille Bourgois (cyrilleb) - Gerard van Helden (drm) + - Ivan Sarastov (isarastov) - Johnny Peck (johnnypeck) - Jordi Sala Morales (jsala) - - Roman Anasal - Ivan Menshykov - David Romaní - Patrick Allaert @@ -1305,7 +1317,6 @@ The Symfony Connect username in parenthesis allows to get more information - Matt Robinson (inanimatt) - Aleksey Podskrebyshev - Calin Mihai Pristavu - - Andrii Dembitskyi - David Marín Carreño (davefx) - Fabien LUCAS (flucas2) - Ondrej Machulda (ondram) @@ -1328,6 +1339,7 @@ The Symfony Connect username in parenthesis allows to get more information - Derek ROTH - Ben Johnson - mweimerskirch + - Andrew Codispoti - Benjamin Franzke - baron (bastien) - Dmytro Boiko (eagle) @@ -1379,7 +1391,6 @@ The Symfony Connect username in parenthesis allows to get more information - Matthew Davis (mdavis1982) - Paulo Ribeiro (paulo) - Markus S. (staabm) - - Benjamin Morel - Maks - Knallcharge - Antoine LA @@ -1467,6 +1478,7 @@ The Symfony Connect username in parenthesis allows to get more information - Mahmoud Mostafa (mahmoud) - Fractal Zombie - Ahmed Abdou + - Khoo Yong Jun - shreyadenny - Daniel Iwaniec - Pieter @@ -1500,6 +1512,7 @@ The Symfony Connect username in parenthesis allows to get more information - Amirreza Shafaat (amirrezashafaat) - Adoni Pavlakis (adoni) - Nicolas Le Goff (nlegoff) + - Alex Hofbauer (alexhofbauer) - Maarten Nusteling (nusje2000) - Ahmed EBEN HASSINE (famas23) - Ben Oman @@ -1777,6 +1790,7 @@ The Symfony Connect username in parenthesis allows to get more information - Jorge Vahldick (jvahldick) - Frederic Godfrin - Paul Matthews + - aim8604 - Jakub Kisielewski - Vacheslav Silyutin - Aleksandr Dankovtsev @@ -1831,6 +1845,7 @@ The Symfony Connect username in parenthesis allows to get more information - Rubén Calvo (rubencm) - Abdul.Mohsen B. A. A - Swen van Zanten + - Agustin Gomes - Benoît Burnichon - pthompson - Malaney J. Hill @@ -1845,6 +1860,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sebastian Göttschkes (sgoettschkes) - Tatsuya Tsuruoka - Ross Tuck + - Oleksiy (alexndlm) - Kévin Gomez (kevin) - Mihai Nica (redecs) - Andrei Igna @@ -1935,7 +1951,9 @@ The Symfony Connect username in parenthesis allows to get more information - Lance McNearney - Volodymyr Kupriienko (greeflas) - Serhiy Lunak (slunak) + - Wojciech Błoszyk (wbloszyk) - Giorgio Premi + - abunch - Sergey Belyshkin - tamcy - Mikko Pesari @@ -1958,6 +1976,7 @@ The Symfony Connect username in parenthesis allows to get more information - Foxprodev - Max Summe - WedgeSama + - Dale.Nash - Felds Liscia - Chihiro Adachi (chihiro-adachi) - Raphaëll Roussel @@ -2030,6 +2049,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alexander Janssen (tnajanssen) - Thomas Chmielowiec (chmielot) - Jānis Lukss + - Julien BERNARD - Michael Zangerle - rkerner - Alex Silcock @@ -2177,6 +2197,7 @@ The Symfony Connect username in parenthesis allows to get more information - Matt Farmer - catch - aetxebeste + - Juga Paazmaya - Alexandre Segura - afaricamp - Josef Cech @@ -2186,11 +2207,12 @@ The Symfony Connect username in parenthesis allows to get more information - Andrii Boiko - Harold Iedema - WaiSkats + - Morimoto Ryosuke - Ikhsan Agustian - Arnau González (arnaugm) - - Bahman Mehrdad (bahman) - Simon Bouland (bouland) - Jibé Barth (jibbarth) + - Jm Aribau (jmaribau) - Matthew Foster (mfoster) - Reyo Stallenberg (reyostallenberg) - Paul Seiffert (seiffert) @@ -2226,6 +2248,7 @@ The Symfony Connect username in parenthesis allows to get more information - Eric Schildkamp - Andreas - Markus + - agaktr - kernig - Thomas Chmielowiec - shdev @@ -2239,6 +2262,7 @@ The Symfony Connect username in parenthesis allows to get more information - Joe Springe - Mickael GOETZ - Maciej Schmidt + - botbotbot - Dennis Væversted - Timon van der Vorm - nuncanada @@ -2255,7 +2279,6 @@ The Symfony Connect username in parenthesis allows to get more information - Mathieu Dewet (mdewet) - Nicolas Tallefourtané (nicolab) - Botond Dani (picur) - - Mario Ramundo (rammar) - Rémi Faivre (rfv) - Thierry Marianne (thierrymarianne) - Nick Stemerdink @@ -2263,6 +2286,7 @@ The Symfony Connect username in parenthesis allows to get more information - jjanvier - Julius Beckmann - Ruben Jansen + - Marc Biorklund - shreypuranik - loru88 - Thibaut Salanon @@ -2291,6 +2315,7 @@ The Symfony Connect username in parenthesis allows to get more information - Yuri Karaban - Johan - Thomas Rothe + - Edwin - Martin - nietonfir - Andriy @@ -2300,21 +2325,26 @@ The Symfony Connect username in parenthesis allows to get more information - Pavel.Batanov - avi123 - Pavel Prischepa + - qzylalala - alsar - downace - Aarón Nieves Fernández - Mike Meier + - Mikolaj Czajkowski - Kirill Saksin - Shiro - Reda DAOUDI - Koalabaerchen - michalmarcinkowski - Warwick + - Jesper Skytte - Chris - Farid Jalilov - Christiaan Wiesenekker - Florent Olivaud + - Sergey Panteleev - JakeFr + - Dmitry Hordinky - Oliver Klee - Simon Sargeant - efeen @@ -2329,20 +2359,22 @@ The Symfony Connect username in parenthesis allows to get more information - kshida - Michał Dąbrowski (defrag) - Aryel Tupinamba (dfkimera) + - Florian Wolfsjaeger (flowolf) - Hans Höchtl (hhoechtl) - Simone Fumagalli (hpatoio) - Brian Graham (incognito) - Kevin Vergauwen (innocenzo) - Alessio Baglio (ioalessio) + - Jawira Portugal (jawira) - Johannes Müller (johmue) - Jordi Llonch (jordillonch) - - Mouad ZIANI (mouadziani) - Nicholas Ruunu (nicholasruunu) - Jeroen van den Nieuwenhuisen (nieuwenhuisen) - Cyril Pascal (paxal) - Cédric Dugat (ph3nol) - Philip Dahlstrøm (phidah) - Milos Colakovic (project2481) + - Raphael de Almeida (raphaeldealmeida) - Rénald Casagraude (rcasagraude) - Robin Duval (robin-duval) - Grinbergs Reinis (shima5) @@ -2446,6 +2478,7 @@ The Symfony Connect username in parenthesis allows to get more information - Darryl Hein (xmmedia) - Sadicov Vladimir (xtech) - Kevin EMO (zarcox) + - Marcel Berteler - sdkawata - Andrzej - Alexander Zogheb @@ -2473,7 +2506,6 @@ The Symfony Connect username in parenthesis allows to get more information - adenkejawen - Florent SEVESTRE (aniki-taicho) - Ari Pringle (apringle) - - Gert Wijnalda (cinamo) - Dan Ordille (dordille) - Jan Eichhorn (exeu) - Grégory Pelletier (ip512) @@ -2493,16 +2525,13 @@ The Symfony Connect username in parenthesis allows to get more information - grifx - Robert Campbell - Matt Lehner - - Shakhobiddin - Helmut Januschka - Hein Zaw Htet™ - Ruben Kruiswijk - Cosmin-Romeo TANASE - - Ana Raro - Michael J - youssef saoubou - Joseph Maarek - - Ivan Sarastov - Alexander Menk - Alex Pods - hadriengem @@ -2517,6 +2546,7 @@ The Symfony Connect username in parenthesis allows to get more information - Matthieu Prat - Grummfy - zors1 + - Peter Simoncic - Paul Le Corre - Noel Light-Hilary - Filipe Guerra @@ -2693,6 +2723,7 @@ The Symfony Connect username in parenthesis allows to get more information - temperatur - misterx - Cas + - arend - Vincent Godé - Dusan Kasan - Michael Steininger @@ -2739,7 +2770,6 @@ The Symfony Connect username in parenthesis allows to get more information - Daniel Bannert - Karim Miladi - Michael Genereux - - Wojciech Kania - patrick-mcdougle - Dariusz Czech - Bruno Baguette @@ -2811,6 +2841,7 @@ The Symfony Connect username in parenthesis allows to get more information - Adam Klvač - Bruno Nogueira Nascimento Wowk - Tomanhez + - satalaondrej - jonmldr - Yevgen Kovalienia - Lebnik @@ -2871,6 +2902,7 @@ The Symfony Connect username in parenthesis allows to get more information - Nicolas - Sergio Santoro - tirnanog06 + - Andrejs Leonovs - phc - Дмитрий Пацура - Signor Pedro @@ -3037,6 +3069,7 @@ The Symfony Connect username in parenthesis allows to get more information - ddegentesh - DSeemiller - Jan Emrich + - Anne-Julia Seitz - Mark Topper - Xavier REN - Zander Baldwin From 56d918f39936b3d1ecb1499a768a810755b70b2d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:10:53 +0100 Subject: [PATCH 38/72] Update VERSION for 4.4.34 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index e9af358a6cad2..ec602df7230ad 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.34-DEV'; + public const VERSION = '4.4.34'; public const VERSION_ID = 40434; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 34; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From eb05e125e416d608dec46c4a16a74bc716c26d23 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:16:10 +0100 Subject: [PATCH 39/72] Bump Symfony version to 4.4.35 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index ec602df7230ad..8149c1b6c07fb 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.34'; - public const VERSION_ID = 40434; + public const VERSION = '4.4.35-DEV'; + public const VERSION_ID = 40435; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 34; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 35; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2022'; public const END_OF_LIFE = '11/2023'; From cd796bba7a09f713681b9ea652bd7d76885066dc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:24:19 +0100 Subject: [PATCH 40/72] Update CHANGELOG for 5.3.11 --- CHANGELOG-5.3.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG-5.3.md b/CHANGELOG-5.3.md index dff9252ddcf24..f73800bc11f80 100644 --- a/CHANGELOG-5.3.md +++ b/CHANGELOG-5.3.md @@ -7,6 +7,48 @@ in 5.3 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/v5.3.0...v5.3.1 +* 5.3.11 (2021-11-22) + + * bug #44188 [VarExporter] fix exporting declared but unset properties when __sleep() is implemented (nicolas-grekas) + * bug #44176 [Console] Default ansi option to null (jderusse) + * bug #44119 [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance (j-bernard) + * bug #44131 [Yaml] properly parse quoted strings tagged with !!str (xabbuh) + * bug #42323 [TwigBridge] do not merge label classes into expanded choice labels (xabbuh) + * bug #44110 [FrameworkBundle] Fix default PHP attributes support in validation and serializer configuration when doctrine/annotations is not installed with PHP 8 (fancyweb) + * bug #44121 [Serializer] fix support for lazy properties (nicolas-grekas) + * bug #44108 [FrameworkBundle][Messenger] remove `FlattenExceptionNormalizer` definition if serializer not available (kbond) + * bug #44111 [Serializer] fix support for unset properties on PHP < 7.4 (nicolas-grekas) + * bug #44070 [Process] intersect with getenv() to populate default envs (nicolas-grekas) + * bug #43990 [Translation] [Loco] Generate id parameter instead of letting Loco do it (welcoMattic) + * bug #44043 [Cache] fix dbindex Redis (a1812) + * bug #44050 [Notifier] Fix package names (fabpot) + * bug #44042 Fix DateIntervalToStringTransformer::transform() doc (BenMorel) + * bug #44034 [Yaml] don't try to replace references in quoted strings (xabbuh) + * bug #44028 [ErrorHandler] Fix FlattenException::setPrevious argument typing (welcoMattic) + * bug #44012 [DependencyInjection] fix inlining when non-shared services are involved (nicolas-grekas) + * bug #44002 [Cache] Fix Memory leak (a1812) + * bug #43981 [FrameworkBundle] fix registering late resettable services (nicolas-grekas) + * bug #43988 [DoctrineBridge] add support for the JSON type (dunglas) + * bug #43987 [PhpUnitBridge] Fix Uncaught ValueError (dunglas) + * bug #43961 [HttpClient] Curl http client has to reinit curl multi handle on reset (rmikalkenas) + * bug #43948 [Asset][Security] Fixed leftover deprecations PHP 8.1 (michaljusiega) + * bug #43945 [Runtime] fix defining APP_DEBUG when Dotenv is not enabled (nicolas-grekas) + * bug #43922 [DependencyInjection] only allow `ReflectionNamedType` for `ServiceSubscriberTrait` (kbond) + * bug #43814 [Intl] Update the ICU data to 70.1 - 5.3 (jderusse) + * bug #43915 [Messenger] Fix tests (jderusse) + * bug #43901 [SecurityBundle] Default access_decision_manager.strategy option with merge (biozshock) + * bug #43909 [VarExporter] escape unicode chars involved in directionality (nicolas-grekas) + * bug #43900 [Security] Fix TypeError message in ChainUserProvider (derrabus) + * bug #43884 [Console] Runtime conflict for psr/log >= 3.0 instead of composer conflict (fancyweb) + * bug #43867 [VarDumper] Make dumping DateInterval instances timezone-independent (derrabus) + * bug #43096 [Messenger] Use `TransportMessageIdStamp` in `InMemoryTransport` allows retrying (alexndlm) + * bug #42168 [RateLimiter] Fix wait duration for fixed window policy (jlekowski) + * bug #43501 [HttpKernel] fix ErrorException in CacheWarmerAggregate (Ahummeling) + * bug #42361 [Translation] correctly handle intl domains with TargetOperation (acran) + * bug #43833 [Runtime] Consider also $_ENV when resolving APP_RUNTIME and APP_RUNTIME_OPTIONS (Peter Simoncic) + * bug #43834 [Inflector] Fix inflector for "zombies" (acodispo) + * bug #43267 [Config] Fix signature generation with nested attributes on PHP 8.1 (agustingomes) + * 5.3.10 (2021-10-29) * bug #43798 [Dotenv] Duplicate $_SERVER values in $_ENV if they don't exist (fancyweb) From 600d018dda8439a43425f931855e5abe964387ff Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:24:23 +0100 Subject: [PATCH 41/72] Update VERSION for 5.3.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 70e65dd794ac8..0fe69a5e48a4c 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -75,12 +75,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '5.3.11-DEV'; + public const VERSION = '5.3.11'; public const VERSION_ID = 50311; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 3; public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '01/2022'; public const END_OF_LIFE = '01/2022'; From 8464442aed39f68eb948fd73b1000dff21df9d36 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 22 Nov 2021 15:32:28 +0100 Subject: [PATCH 42/72] Bump Symfony version to 5.3.12 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 0fe69a5e48a4c..d7d01dca5502c 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -75,12 +75,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '5.3.11'; - public const VERSION_ID = 50311; + public const VERSION = '5.3.12-DEV'; + public const VERSION_ID = 50312; public const MAJOR_VERSION = 5; public const MINOR_VERSION = 3; - public const RELEASE_VERSION = 11; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 12; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '01/2022'; public const END_OF_LIFE = '01/2022'; From a8fc556267f7118d1f6922fbb712ff19b8fb956b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 16:13:51 +0100 Subject: [PATCH 43/72] [Contracts] update changelog --- src/Symfony/Contracts/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Contracts/CHANGELOG.md b/src/Symfony/Contracts/CHANGELOG.md index 275415078d4c0..75d1729e41dd1 100644 --- a/src/Symfony/Contracts/CHANGELOG.md +++ b/src/Symfony/Contracts/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.5 +--- + + * Add `SubscribedService` attribute, deprecate current `ServiceSubscriberTrait` usage + 2.4 --- From e4baeffdf94c9ca2ad6da99c800fa41f3e364658 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 16:19:30 +0100 Subject: [PATCH 44/72] [Contracts] update changelog --- src/Symfony/Contracts/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Contracts/CHANGELOG.md b/src/Symfony/Contracts/CHANGELOG.md index 75d1729e41dd1..5c9c3d08d4c9e 100644 --- a/src/Symfony/Contracts/CHANGELOG.md +++ b/src/Symfony/Contracts/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +3.0 +--- + + * Bump to PHP 8 minimum + * Add native return types + * Remove deprecated features + 2.5 --- From 7ab35218a65d48c20f3b46264d7a6a20daad9382 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Mon, 22 Nov 2021 16:27:47 +0100 Subject: [PATCH 45/72] [FrameworkBundle] Fix enable_annotations wrong check for validation config --- .../DependencyInjection/FrameworkExtension.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index ac57f39750f9d..6b91858fde767 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1437,10 +1437,6 @@ private function registerValidationConfiguration(array $config, ContainerBuilder $definition->replaceArgument(0, $config['email_validation_mode']); if (\array_key_exists('enable_annotations', $config) && $config['enable_annotations']) { - if (!$this->annotationsConfigEnabled) { - throw new \LogicException('"enable_annotations" on the validator cannot be set as the PHP version is lower than 8 and Doctrine Annotations support is disabled. Consider upgrading PHP.'); - } - $validatorBuilder->addMethodCall('enableAnnotationMapping', [true]); if ($this->annotationsConfigEnabled) { $validatorBuilder->addMethodCall('setDoctrineAnnotationReader', [new Reference('annotation_reader')]); From e088118d60a9c537af258fb82faf1056bc7a7dee Mon Sep 17 00:00:00 2001 From: Petr Duda Date: Mon, 22 Nov 2021 22:43:32 +0100 Subject: [PATCH 46/72] [Validator] Add missing Czech translations --- .../Validator/Resources/translations/validators.cs.xlf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf index b341436bc5e18..75410192190ef 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf @@ -394,6 +394,14 @@ This value is not a valid CSS color. Tato hodnota není platná barva CSS. + + This value is not a valid CIDR notation. + Tato hodnota není platná notace CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Hodnota masky sítě musí být mezi {{ min }} a {{ max }}. + From f1e258d5bb13b67c0914d765b43e7d7fd5e4ad5c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 22:43:45 +0100 Subject: [PATCH 47/72] [HttpClient] fix closing curl multi handle when destructing client --- .../Component/HttpClient/CurlHttpClient.php | 31 ++---------- .../HttpClient/Internal/CurlClientState.php | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index af480d45bf518..119c45924e4cd 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -336,33 +336,8 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa public function reset() { - if ($this->logger) { - foreach ($this->multi->pushedResponses as $url => $response) { - $this->logger->debug(sprintf('Unused pushed response: "%s"', $url)); - } - } - - $this->multi->pushedResponses = []; - $this->multi->dnsCache->evictions = $this->multi->dnsCache->evictions ?: $this->multi->dnsCache->removals; - $this->multi->dnsCache->removals = $this->multi->dnsCache->hostnames = []; - - if (\is_resource($this->multi->handle) || $this->multi->handle instanceof \CurlMultiHandle) { - if (\defined('CURLMOPT_PUSHFUNCTION')) { - curl_multi_setopt($this->multi->handle, \CURLMOPT_PUSHFUNCTION, null); - } - - $active = 0; - while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active)); - } - - foreach ($this->multi->openHandles as [$ch]) { - if (\is_resource($ch) || $ch instanceof \CurlHandle) { - curl_setopt($ch, \CURLOPT_VERBOSE, false); - } - } - - curl_multi_close($this->multi->handle); - $this->multi->handle = curl_multi_init(); + $this->multi->logger = $this->logger; + $this->multi->reset(); } /** @@ -380,7 +355,7 @@ public function __wakeup() public function __destruct() { - $this->reset(); + $this->multi->logger = $this->logger; } private function handlePush($parent, $pushed, array $requestHeaders, int $maxPendingPushes): int diff --git a/src/Symfony/Component/HttpClient/Internal/CurlClientState.php b/src/Symfony/Component/HttpClient/Internal/CurlClientState.php index af2e6869b37b3..a4c596eb45d3f 100644 --- a/src/Symfony/Component/HttpClient/Internal/CurlClientState.php +++ b/src/Symfony/Component/HttpClient/Internal/CurlClientState.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpClient\Internal; +use Psr\Log\LoggerInterface; + /** * Internal representation of the cURL client's state. * @@ -26,10 +28,58 @@ final class CurlClientState extends ClientState public $pushedResponses = []; /** @var DnsCache */ public $dnsCache; + /** @var LoggerInterface|null */ + public $logger; public function __construct() { $this->handle = curl_multi_init(); $this->dnsCache = new DnsCache(); } + + public function reset() + { + if ($this->logger) { + foreach ($this->pushedResponses as $url => $response) { + $this->logger->debug(sprintf('Unused pushed response: "%s"', $url)); + } + } + + $this->pushedResponses = []; + $this->dnsCache->evictions = $this->dnsCache->evictions ?: $this->dnsCache->removals; + $this->dnsCache->removals = $this->dnsCache->hostnames = []; + + if (\is_resource($this->handle) || $this->handle instanceof \CurlMultiHandle) { + if (\defined('CURLMOPT_PUSHFUNCTION')) { + curl_multi_setopt($this->handle, \CURLMOPT_PUSHFUNCTION, null); + } + + $active = 0; + while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->handle, $active)); + } + + foreach ($this->openHandles as [$ch]) { + if (\is_resource($ch) || $ch instanceof \CurlHandle) { + curl_setopt($ch, \CURLOPT_VERBOSE, false); + } + } + + curl_multi_close($this->handle); + $this->handle = curl_multi_init(); + } + + public function __sleep(): array + { + throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + } + + public function __wakeup() + { + throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + } + + public function __destruct() + { + $this->reset(); + } } From 36d254a391837ac75a837ebe146c20b7d41881a9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 23:02:22 +0100 Subject: [PATCH 48/72] [Process] exclude argv/argc from possible default env vars --- src/Symfony/Component/Process/Process.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 7709482017534..b516344bb1b0c 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -1673,6 +1673,7 @@ private function getDefaultEnv(): array { $env = getenv(); $env = array_intersect_key($env, $_SERVER) ?: $env; + unset($env['argc'], $env['argv']); foreach ($_ENV as $k => $v) { if (\is_string($v)) { From 11ccbcd24c2e2d3f4e5897f159d1c1d23fc62a67 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 22 Nov 2021 23:30:31 +0100 Subject: [PATCH 49/72] [Process] filter env vars for "argc" & "argv" specifically --- src/Symfony/Component/Process/Process.php | 26 +++-------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index b516344bb1b0c..d5c697cf9c2d7 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -340,7 +340,7 @@ public function start(callable $callback = null, array $env = []) $envPairs = []; foreach ($env as $k => $v) { - if (false !== $v) { + if (false !== $v && 'argc' !== $k && 'argv' !== $k) { $envPairs[] = $k.'='.$v; } } @@ -1171,25 +1171,12 @@ public function getEnv() /** * Sets the environment variables. * - * Each environment variable value should be a string. - * If it is an array, the variable is ignored. - * If it is false or null, it will be removed when - * env vars are otherwise inherited. - * - * That happens in PHP when 'argv' is registered into - * the $_ENV array for instance. - * - * @param array $env The new environment variables + * @param array $env The new environment variables * * @return $this */ public function setEnv(array $env) { - // Process can not handle env values that are arrays - $env = array_filter($env, function ($value) { - return !\is_array($value); - }); - $this->env = $env; return $this; @@ -1673,14 +1660,7 @@ private function getDefaultEnv(): array { $env = getenv(); $env = array_intersect_key($env, $_SERVER) ?: $env; - unset($env['argc'], $env['argv']); - - foreach ($_ENV as $k => $v) { - if (\is_string($v)) { - $env[$k] = $v; - } - } - return $env; + return $_ENV + $env; } } From b0655d71c0150fe232b4b85e8badd883b219eb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 23 Nov 2021 09:13:39 +0100 Subject: [PATCH 50/72] Fix Config tests for branch 6.0 --- .../Config/AddToList/Messenger/ReceivingConfig.php | 4 ++-- .../Config/AddToList/Messenger/RoutingConfig.php | 5 +++-- .../Symfony/Config/AddToList/TranslatorConfig.php | 8 ++++---- .../Symfony/Config/ArrayExtraKeys/BarConfig.php | 7 ++++--- .../Symfony/Config/ArrayExtraKeys/BazConfig.php | 3 ++- .../Symfony/Config/ArrayExtraKeys/FooConfig.php | 7 ++++--- .../NodeInitialValues/Messenger/TransportsConfig.php | 9 +++++---- .../Config/NodeInitialValues/SomeCleverNameConfig.php | 4 ++-- .../Placeholders/Symfony/Config/PlaceholdersConfig.php | 9 +++++---- .../Symfony/Config/PrimitiveTypesConfig.php | 10 +++++----- .../VariableType/Symfony/Config/VariableTypeConfig.php | 3 ++- .../Config/Tests/Builder/GeneratedConfigTest.php | 3 ++- 12 files changed, 40 insertions(+), 32 deletions(-) diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php index ca4db117acd37..b408fb1f32de9 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php @@ -20,7 +20,7 @@ class ReceivingConfig * @param ParamConfigurator|int $value * @return $this */ - public function priority($value): self + public function priority($value): static { $this->priority = $value; @@ -32,7 +32,7 @@ public function priority($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function color($value): self + public function color($value): static { $this->color = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php index 7f44a8553f66f..744ffd9c40ffb 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/RoutingConfig.php @@ -15,10 +15,11 @@ class RoutingConfig private $senders; /** - * @param ParamConfigurator|list $value + * @param ParamConfigurator|list $value + * * @return $this */ - public function senders($value): self + public function senders(ParamConfigurator|array $value): static { $this->senders = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php index 570e415ce2830..10713b582cd49 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/TranslatorConfig.php @@ -16,10 +16,11 @@ class TranslatorConfig private $sources; /** - * @param ParamConfigurator|list $value + * @param ParamConfigurator|list $value + * * @return $this */ - public function fallbacks($value): self + public function fallbacks(ParamConfigurator|array $value): static { $this->fallbacks = $value; @@ -27,10 +28,9 @@ public function fallbacks($value): self } /** - * @param ParamConfigurator|mixed $value * @return $this */ - public function source(string $source_class, $value): self + public function source(string $source_class, mixed $value): static { $this->sources[$source_class] = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php index 87eba94c6b91f..4447d6db76984 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BarConfig.php @@ -20,7 +20,7 @@ class BarConfig * @param ParamConfigurator|mixed $value * @return $this */ - public function corge($value): self + public function corge($value): static { $this->corge = $value; @@ -32,7 +32,7 @@ public function corge($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function grault($value): self + public function grault($value): static { $this->grault = $value; @@ -71,9 +71,10 @@ public function toArray(): array /** * @param ParamConfigurator|mixed $value + * * @return $this */ - public function set(string $key, $value): self + public function set(string $key, mixed $value): static { if (null === $value) { unset($this->_extraKeys[$key]); diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php index fae09098ab103..6ba4de7a56a2e 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/BazConfig.php @@ -29,9 +29,10 @@ public function toArray(): array /** * @param ParamConfigurator|mixed $value + * * @return $this */ - public function set(string $key, $value): self + public function set(string $key, mixed $value): static { if (null === $value) { unset($this->_extraKeys[$key]); diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php index 46632c7f9a0e7..35cf66d3f169b 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/ArrayExtraKeys/Symfony/Config/ArrayExtraKeys/FooConfig.php @@ -20,7 +20,7 @@ class FooConfig * @param ParamConfigurator|mixed $value * @return $this */ - public function baz($value): self + public function baz($value): static { $this->baz = $value; @@ -32,7 +32,7 @@ public function baz($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function qux($value): self + public function qux($value): static { $this->qux = $value; @@ -71,9 +71,10 @@ public function toArray(): array /** * @param ParamConfigurator|mixed $value + * * @return $this */ - public function set(string $key, $value): self + public function set(string $key, mixed $value): static { if (null === $value) { unset($this->_extraKeys[$key]); diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php index a3fe5218f0678..e524f94e9c60b 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/Messenger/TransportsConfig.php @@ -21,7 +21,7 @@ class TransportsConfig * @param ParamConfigurator|mixed $value * @return $this */ - public function dsn($value): self + public function dsn($value): static { $this->dsn = $value; @@ -33,7 +33,7 @@ public function dsn($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function serializer($value): self + public function serializer($value): static { $this->serializer = $value; @@ -41,10 +41,11 @@ public function serializer($value): self } /** - * @param ParamConfigurator|list $value + * @param ParamConfigurator|list $value + * * @return $this */ - public function options($value): self + public function options(ParamConfigurator|array $value): static { $this->options = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php index 2db3d4cf95578..25f6a01fe496a 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/NodeInitialValues/Symfony/Config/NodeInitialValues/SomeCleverNameConfig.php @@ -20,7 +20,7 @@ class SomeCleverNameConfig * @param ParamConfigurator|mixed $value * @return $this */ - public function first($value): self + public function first($value): static { $this->first = $value; @@ -32,7 +32,7 @@ public function first($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function second($value): self + public function second($value): static { $this->second = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php index 909c95585b441..f05f40ce1eed6 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders/Symfony/Config/PlaceholdersConfig.php @@ -21,7 +21,7 @@ class PlaceholdersConfig implements \Symfony\Component\Config\Builder\ConfigBuil * @param ParamConfigurator|bool $value * @return $this */ - public function enabled($value): self + public function enabled($value): static { $this->enabled = $value; @@ -33,7 +33,7 @@ public function enabled($value): self * @param ParamConfigurator|float $value * @return $this */ - public function favoriteFloat($value): self + public function favoriteFloat($value): static { $this->favoriteFloat = $value; @@ -41,10 +41,11 @@ public function favoriteFloat($value): self } /** - * @param ParamConfigurator|list $value + * @param ParamConfigurator|list $value + * * @return $this */ - public function goodIntegers($value): self + public function goodIntegers(ParamConfigurator|array $value): static { $this->goodIntegers = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php index fd802032c28f6..313499b20cbb6 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/PrimitiveTypes/Symfony/Config/PrimitiveTypesConfig.php @@ -23,7 +23,7 @@ class PrimitiveTypesConfig implements \Symfony\Component\Config\Builder\ConfigBu * @param ParamConfigurator|bool $value * @return $this */ - public function booleanNode($value): self + public function booleanNode($value): static { $this->booleanNode = $value; @@ -35,7 +35,7 @@ public function booleanNode($value): self * @param ParamConfigurator|'foo'|'bar'|'baz' $value * @return $this */ - public function enumNode($value): self + public function enumNode($value): static { $this->enumNode = $value; @@ -47,7 +47,7 @@ public function enumNode($value): self * @param ParamConfigurator|float $value * @return $this */ - public function floatNode($value): self + public function floatNode($value): static { $this->floatNode = $value; @@ -59,7 +59,7 @@ public function floatNode($value): self * @param ParamConfigurator|int $value * @return $this */ - public function integerNode($value): self + public function integerNode($value): static { $this->integerNode = $value; @@ -71,7 +71,7 @@ public function integerNode($value): self * @param ParamConfigurator|mixed $value * @return $this */ - public function scalarNode($value): self + public function scalarNode($value): static { $this->scalarNode = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php b/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php index 0ee7efe7f362b..2ccd609255b17 100644 --- a/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php +++ b/src/Symfony/Component/Config/Tests/Builder/Fixtures/VariableType/Symfony/Config/VariableTypeConfig.php @@ -17,9 +17,10 @@ class VariableTypeConfig implements \Symfony\Component\Config\Builder\ConfigBuil /** * @default null * @param ParamConfigurator|mixed $value + * * @return $this */ - public function anyValue($value): self + public function anyValue(mixed $value): static { $this->anyValue = $value; diff --git a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php index 83b98d12ac363..e85558cac8d96 100644 --- a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php +++ b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php @@ -72,7 +72,8 @@ public function testConfig(string $name, string $alias) $expectedOutput = include $basePath.$name.'.output.php'; $expectedCode = $basePath.$name; - // to regenerate snapshot files, uncomment this line + // to regenerate snapshot files, uncomment these lines + // (new Filesystem())->remove($expectedCode); // $configBuilder = $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $expectedCode); $outputDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true); From 64988fe8ed4d4accb18e4d9ea194efbea8c5bf9e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 10:41:35 +0100 Subject: [PATCH 51/72] [Security] remove some legacy --- .../Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php | 4 ++++ .../Http/Tests/Authenticator/AbstractAuthenticatorTest.php | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index cf36765005ee5..819b438380393 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -30,6 +30,7 @@ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials; use Symfony\Component\Security\Http\Authenticator\Passport\Passport; +use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\Event\CheckPassportEvent; use Symfony\Contracts\Service\ServiceLocatorTrait; @@ -202,6 +203,9 @@ public function authenticate(Request $request): Passport { } + /** + * @internal for compatibility with Symfony 5.4 + */ public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface { } diff --git a/src/Symfony/Component/Security/Http/Tests/Authenticator/AbstractAuthenticatorTest.php b/src/Symfony/Component/Security/Http/Tests/Authenticator/AbstractAuthenticatorTest.php index 202a7ee2a9f9c..9562589581b5e 100644 --- a/src/Symfony/Component/Security/Http/Tests/Authenticator/AbstractAuthenticatorTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Authenticator/AbstractAuthenticatorTest.php @@ -43,11 +43,6 @@ public function createToken(Passport $passport, string $firewallName): TokenInte return parent::createToken($passport, $firewallName); } - public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface - { - return parent::createAuthenticatedToken($passport, $firewallName); - } - public function supports(Request $request): ?bool { return null; From e171a3e51ee9b763601d5629d1aeaa3abe6923b0 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 22 Nov 2021 23:12:26 +0100 Subject: [PATCH 52/72] Allow v3 contracts where possible --- src/Symfony/Bridge/Doctrine/composer.json | 4 ++-- src/Symfony/Bridge/Monolog/composer.json | 4 ++-- src/Symfony/Bridge/PhpUnit/composer.json | 2 +- src/Symfony/Bridge/Twig/composer.json | 2 +- src/Symfony/Bundle/FrameworkBundle/composer.json | 3 +-- src/Symfony/Bundle/SecurityBundle/composer.json | 2 +- src/Symfony/Bundle/TwigBundle/composer.json | 1 - src/Symfony/Component/Asset/composer.json | 2 +- src/Symfony/Component/Cache/composer.json | 4 ++-- src/Symfony/Component/Config/composer.json | 4 ++-- src/Symfony/Component/Console/composer.json | 4 ++-- src/Symfony/Component/DependencyInjection/composer.json | 2 +- src/Symfony/Component/DomCrawler/composer.json | 2 +- src/Symfony/Component/Dotenv/composer.json | 2 +- src/Symfony/Component/ErrorHandler/composer.json | 2 +- src/Symfony/Component/EventDispatcher/composer.json | 6 +++--- src/Symfony/Component/ExpressionLanguage/composer.json | 2 +- src/Symfony/Component/Form/composer.json | 4 ++-- src/Symfony/Component/HttpClient/composer.json | 4 ++-- src/Symfony/Component/HttpFoundation/composer.json | 2 +- src/Symfony/Component/HttpKernel/composer.json | 6 +++--- src/Symfony/Component/Inflector/composer.json | 2 +- src/Symfony/Component/Intl/composer.json | 2 +- src/Symfony/Component/Lock/composer.json | 2 +- src/Symfony/Component/Mailer/Bridge/Amazon/composer.json | 2 +- src/Symfony/Component/Mailer/composer.json | 6 +++--- .../Component/Messenger/Bridge/AmazonSqs/composer.json | 4 ++-- src/Symfony/Component/Messenger/Bridge/Amqp/composer.json | 2 +- .../Component/Messenger/Bridge/Doctrine/composer.json | 2 +- src/Symfony/Component/Messenger/Bridge/Redis/composer.json | 2 +- src/Symfony/Component/Messenger/composer.json | 4 ++-- src/Symfony/Component/Mime/composer.json | 2 +- .../Component/Notifier/Bridge/FakeChat/composer.json | 2 +- src/Symfony/Component/Notifier/Bridge/FakeSms/composer.json | 2 +- src/Symfony/Component/Notifier/Bridge/Mercure/composer.json | 2 +- src/Symfony/Component/Notifier/Bridge/Slack/composer.json | 2 +- src/Symfony/Component/Notifier/composer.json | 4 ++-- src/Symfony/Component/OptionsResolver/composer.json | 2 +- src/Symfony/Component/PropertyAccess/composer.json | 2 +- src/Symfony/Component/PropertyInfo/composer.json | 2 +- src/Symfony/Component/Routing/composer.json | 2 +- src/Symfony/Component/Security/Core/composer.json | 6 +++--- src/Symfony/Component/Security/Http/composer.json | 2 +- src/Symfony/Component/Serializer/composer.json | 2 +- src/Symfony/Component/Stopwatch/composer.json | 2 +- src/Symfony/Component/Translation/composer.json | 4 ++-- src/Symfony/Component/Validator/composer.json | 4 ++-- src/Symfony/Component/Yaml/composer.json | 2 +- src/Symfony/Contracts/Service/composer.json | 2 +- 49 files changed, 68 insertions(+), 70 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index c1feaf4e4213b..f9772266722e6 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -19,11 +19,11 @@ "php": ">=7.2.5", "doctrine/event-manager": "~1.0", "doctrine/persistence": "^2", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3" }, "require-dev": { "composer/package-versions-deprecated": "^1.8", diff --git a/src/Symfony/Bridge/Monolog/composer.json b/src/Symfony/Bridge/Monolog/composer.json index 8c0a9d239ad35..f9476b517737d 100644 --- a/src/Symfony/Bridge/Monolog/composer.json +++ b/src/Symfony/Bridge/Monolog/composer.json @@ -18,9 +18,9 @@ "require": { "php": ">=7.2.5", "monolog/monolog": "^1.25.1|^2", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/http-kernel": "^5.3|^6.0", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "require-dev": { diff --git a/src/Symfony/Bridge/PhpUnit/composer.json b/src/Symfony/Bridge/PhpUnit/composer.json index 60b5ac6fb4802..9627d2b40c12c 100644 --- a/src/Symfony/Bridge/PhpUnit/composer.json +++ b/src/Symfony/Bridge/PhpUnit/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1.3 EVEN ON LATEST SYMFONY VERSIONS TO ALLOW USING", "php": "THIS BRIDGE WHEN TESTING LOWEST SYMFONY VERSIONS.", "php": ">=7.1.3", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "require-dev": { "symfony/error-handler": "^4.4|^5.0|^6.0" diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index 3d79e39ca2244..63b072605582d 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1|^2", + "symfony/translation-contracts": "^1.1|^2|^3", "twig/twig": "^2.13|^3.0.4" }, "require-dev": { diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index d3694fa05bfc5..f8b44d39d3aaa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -21,7 +21,7 @@ "symfony/cache": "^5.2|^6.0", "symfony/config": "^5.3|^6.0", "symfony/dependency-injection": "^5.3|^6.0", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/event-dispatcher": "^5.1|^6.0", "symfony/error-handler": "^4.4.1|^5.0.1|^6.0", "symfony/http-foundation": "^5.3|^6.0", @@ -90,7 +90,6 @@ "symfony/property-info": "<4.4", "symfony/property-access": "<5.3", "symfony/serializer": "<5.2", - "symfony/service-contracts": ">=3.0", "symfony/security-csrf": "<5.3", "symfony/stopwatch": "<4.4", "symfony/translation": "<5.3", diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index ba0fd02c9ae7a..ee3e6e3e90008 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -20,7 +20,7 @@ "ext-xml": "*", "symfony/config": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^5.3|^6.0", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/event-dispatcher": "^5.1|^6.0", "symfony/http-kernel": "^5.3|^6.0", "symfony/http-foundation": "^5.3|^6.0", diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 5635bb430d8c5..43813bf5e8139 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -43,7 +43,6 @@ "conflict": { "symfony/dependency-injection": "<5.3", "symfony/framework-bundle": "<5.0", - "symfony/service-contracts": ">=3.0", "symfony/translation": "<5.0" }, "autoload": { diff --git a/src/Symfony/Component/Asset/composer.json b/src/Symfony/Component/Asset/composer.json index 0481671ca3dd2..06cc332d45a67 100644 --- a/src/Symfony/Component/Asset/composer.json +++ b/src/Symfony/Component/Asset/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "suggest": { diff --git a/src/Symfony/Component/Cache/composer.json b/src/Symfony/Component/Cache/composer.json index c8ce2947932e6..1ebcfc9b307e7 100644 --- a/src/Symfony/Component/Cache/composer.json +++ b/src/Symfony/Component/Cache/composer.json @@ -25,10 +25,10 @@ "psr/cache": "^1.0|^2.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^1.1.7|^2", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/Config/composer.json b/src/Symfony/Component/Config/composer.json index 3d4154b1ddfef..b357ed317b1fc 100644 --- a/src/Symfony/Component/Config/composer.json +++ b/src/Symfony/Component/Config/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/filesystem": "^4.4|^5.0|^6.0", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-php80": "^1.16", @@ -27,7 +27,7 @@ "symfony/event-dispatcher": "^4.4|^5.0|^6.0", "symfony/finder": "^4.4|^5.0|^6.0", "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/yaml": "^4.4|^5.0|^6.0" }, "conflict": { diff --git a/src/Symfony/Component/Console/composer.json b/src/Symfony/Component/Console/composer.json index aece50f614f06..2a7b429ac1f8b 100644 --- a/src/Symfony/Component/Console/composer.json +++ b/src/Symfony/Component/Console/composer.json @@ -17,11 +17,11 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.1|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index 0a0e488214f6a..36eda6eea9e21 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "psr/container": "^1.1.1", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16", "symfony/polyfill-php81": "^1.22", "symfony/service-contracts": "^1.1.6|^2" diff --git a/src/Symfony/Component/DomCrawler/composer.json b/src/Symfony/Component/DomCrawler/composer.json index dd5909116c6d9..f89432dacd1f2 100644 --- a/src/Symfony/Component/DomCrawler/composer.json +++ b/src/Symfony/Component/DomCrawler/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.16" diff --git a/src/Symfony/Component/Dotenv/composer.json b/src/Symfony/Component/Dotenv/composer.json index 8ef8831988bee..bec034f87a14b 100644 --- a/src/Symfony/Component/Dotenv/composer.json +++ b/src/Symfony/Component/Dotenv/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "require-dev": { "symfony/console": "^4.4|^5.0|^6.0", diff --git a/src/Symfony/Component/ErrorHandler/composer.json b/src/Symfony/Component/ErrorHandler/composer.json index f228d00f93e27..bc0d88e9d6884 100644 --- a/src/Symfony/Component/ErrorHandler/composer.json +++ b/src/Symfony/Component/ErrorHandler/composer.json @@ -23,7 +23,7 @@ "require-dev": { "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\ErrorHandler\\": "" }, diff --git a/src/Symfony/Component/EventDispatcher/composer.json b/src/Symfony/Component/EventDispatcher/composer.json index 9fe34f59d74ef..32b42e40848ae 100644 --- a/src/Symfony/Component/EventDispatcher/composer.json +++ b/src/Symfony/Component/EventDispatcher/composer.json @@ -17,8 +17,8 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/event-dispatcher-contracts": "^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", "symfony/polyfill-php80": "^1.16" }, "require-dev": { @@ -27,7 +27,7 @@ "symfony/config": "^4.4|^5.0|^6.0", "symfony/error-handler": "^4.4|^5.0|^6.0", "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/stopwatch": "^4.4|^5.0|^6.0", "psr/log": "^1|^2|^3" }, diff --git a/src/Symfony/Component/ExpressionLanguage/composer.json b/src/Symfony/Component/ExpressionLanguage/composer.json index e8feea5cb2544..93199741c94e8 100644 --- a/src/Symfony/Component/ExpressionLanguage/composer.json +++ b/src/Symfony/Component/ExpressionLanguage/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\ExpressionLanguage\\": "" }, diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index 8cca7280e4525..ff9e6b9af6aa7 100644 --- a/src/Symfony/Component/Form/composer.json +++ b/src/Symfony/Component/Form/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/event-dispatcher": "^4.4|^5.0|^6.0", "symfony/options-resolver": "^5.1|^6.0", "symfony/polyfill-ctype": "~1.8", @@ -26,7 +26,7 @@ "symfony/polyfill-php80": "^1.16", "symfony/polyfill-php81": "^1.23", "symfony/property-access": "^5.0.8|^6.0", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3" }, "require-dev": { "doctrine/collections": "~1.0", diff --git a/src/Symfony/Component/HttpClient/composer.json b/src/Symfony/Component/HttpClient/composer.json index 213495149b9d2..084c2581219f1 100644 --- a/src/Symfony/Component/HttpClient/composer.json +++ b/src/Symfony/Component/HttpClient/composer.json @@ -23,11 +23,11 @@ "require": { "php": ">=7.2.5", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/http-client-contracts": "^2.4", "symfony/polyfill-php73": "^1.11", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.0|^2" + "symfony/service-contracts": "^1.0|^2|^3" }, "require-dev": { "amphp/amp": "^2.5", diff --git a/src/Symfony/Component/HttpFoundation/composer.json b/src/Symfony/Component/HttpFoundation/composer.json index a61493232652b..d54bbfd16006b 100644 --- a/src/Symfony/Component/HttpFoundation/composer.json +++ b/src/Symfony/Component/HttpFoundation/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.1", "symfony/polyfill-php80": "^1.16" }, diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index dfa9820a856f5..09682db49d2e6 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -17,10 +17,9 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/error-handler": "^4.4|^5.0|^6.0", "symfony/event-dispatcher": "^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2", "symfony/http-foundation": "^5.3.7|^6.0", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9", @@ -36,11 +35,12 @@ "symfony/dom-crawler": "^4.4|^5.0|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2|^3", "symfony/process": "^4.4|^5.0|^6.0", "symfony/routing": "^4.4|^5.0|^6.0", "symfony/stopwatch": "^4.4|^5.0|^6.0", "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", + "symfony/translation-contracts": "^1.1|^2|^3", "psr/cache": "^1.0|^2.0|^3.0", "twig/twig": "^2.13|^3.0.4" }, diff --git a/src/Symfony/Component/Inflector/composer.json b/src/Symfony/Component/Inflector/composer.json index e7d648a60dde9..5b7280c1f42ce 100644 --- a/src/Symfony/Component/Inflector/composer.json +++ b/src/Symfony/Component/Inflector/composer.json @@ -24,7 +24,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16", "symfony/string": "^5.3.10|^6.0" }, diff --git a/src/Symfony/Component/Intl/composer.json b/src/Symfony/Component/Intl/composer.json index 5bc325d8e2c45..2a75c5662b5b9 100644 --- a/src/Symfony/Component/Intl/composer.json +++ b/src/Symfony/Component/Intl/composer.json @@ -25,7 +25,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "require-dev": { diff --git a/src/Symfony/Component/Lock/composer.json b/src/Symfony/Component/Lock/composer.json index 46de4d5b0102a..dbb01a0056ee4 100644 --- a/src/Symfony/Component/Lock/composer.json +++ b/src/Symfony/Component/Lock/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "require-dev": { diff --git a/src/Symfony/Component/Mailer/Bridge/Amazon/composer.json b/src/Symfony/Component/Mailer/Bridge/Amazon/composer.json index eae96452402b2..aad87e370e290 100644 --- a/src/Symfony/Component/Mailer/Bridge/Amazon/composer.json +++ b/src/Symfony/Component/Mailer/Bridge/Amazon/composer.json @@ -19,7 +19,7 @@ "php": ">=7.2.5", "async-aws/ses": "^1.0", "psr/event-dispatcher": "^1", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/mailer": "^4.4.21|^5.2.6|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/Mailer/composer.json b/src/Symfony/Component/Mailer/composer.json index 0975a077d101a..53cf0f5119ad0 100644 --- a/src/Symfony/Component/Mailer/composer.json +++ b/src/Symfony/Component/Mailer/composer.json @@ -20,14 +20,14 @@ "egulias/email-validator": "^2.1.10|^3", "psr/event-dispatcher": "^1", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/event-dispatcher": "^4.4|^5.0|^6.0", "symfony/mime": "^5.2.6|^6.0", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3" }, "require-dev": { - "symfony/http-client-contracts": "^1.1|^2", + "symfony/http-client-contracts": "^1.1|^2|^3", "symfony/messenger": "^4.4|^5.0|^6.0" }, "conflict": { diff --git a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/composer.json b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/composer.json index 633ef2b602289..b076649e7e1f6 100644 --- a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/composer.json +++ b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/composer.json @@ -20,11 +20,11 @@ "async-aws/core": "^1.5", "async-aws/sqs": "^1.0", "symfony/messenger": "^4.3|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "psr/log": "^1|^2|^3" }, "require-dev": { - "symfony/http-client-contracts": "^1.0|^2.0", + "symfony/http-client-contracts": "^1|^2|^3", "symfony/property-access": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0" }, diff --git a/src/Symfony/Component/Messenger/Bridge/Amqp/composer.json b/src/Symfony/Component/Messenger/Bridge/Amqp/composer.json index 7a6a5159726ed..dd0ecf90ef068 100644 --- a/src/Symfony/Component/Messenger/Bridge/Amqp/composer.json +++ b/src/Symfony/Component/Messenger/Bridge/Amqp/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/messenger": "^5.3|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/composer.json b/src/Symfony/Component/Messenger/Bridge/Doctrine/composer.json index 9ba0de6982a9a..5a360a30521f7 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/composer.json +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "symfony/messenger": "^5.1|^6.0", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3" }, "require-dev": { "doctrine/dbal": "^2.13|^3.0", diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/composer.json b/src/Symfony/Component/Messenger/Bridge/Redis/composer.json index a88a084410723..c663be4bc5ad9 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/composer.json +++ b/src/Symfony/Component/Messenger/Bridge/Redis/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/messenger": "^5.1|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/Messenger/composer.json b/src/Symfony/Component/Messenger/composer.json index 9faf9f5ced4a7..a62537cc63a97 100644 --- a/src/Symfony/Component/Messenger/composer.json +++ b/src/Symfony/Component/Messenger/composer.json @@ -19,7 +19,7 @@ "php": ">=7.2.5", "psr/log": "^1|^2|^3", "symfony/amqp-messenger": "^5.1|^6.0", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/doctrine-messenger": "^5.1|^6.0", "symfony/polyfill-php80": "^1.16", "symfony/redis-messenger": "^5.1|^6.0" @@ -34,7 +34,7 @@ "symfony/property-access": "^4.4|^5.0|^6.0", "symfony/routing": "^4.4|^5.0|^6.0", "symfony/serializer": "^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2", + "symfony/service-contracts": "^1.1|^2|^3", "symfony/stopwatch": "^4.4|^5.0|^6.0", "symfony/validator": "^4.4|^5.0|^6.0" }, diff --git a/src/Symfony/Component/Mime/composer.json b/src/Symfony/Component/Mime/composer.json index 66bd6aa4c771d..cd04969b9a9cc 100644 --- a/src/Symfony/Component/Mime/composer.json +++ b/src/Symfony/Component/Mime/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16" diff --git a/src/Symfony/Component/Notifier/Bridge/FakeChat/composer.json b/src/Symfony/Component/Notifier/Bridge/FakeChat/composer.json index c28580fd33b8d..0d2a4792a0010 100644 --- a/src/Symfony/Component/Notifier/Bridge/FakeChat/composer.json +++ b/src/Symfony/Component/Notifier/Bridge/FakeChat/composer.json @@ -24,7 +24,7 @@ "php": ">=7.2.5", "symfony/http-client": "^4.4|^5.2|^6.0", "symfony/notifier": "^5.3|^6.0", - "symfony/event-dispatcher-contracts": "^2", + "symfony/event-dispatcher-contracts": "^2|^3", "symfony/mailer": "^5.2|^6.0" }, "autoload": { diff --git a/src/Symfony/Component/Notifier/Bridge/FakeSms/composer.json b/src/Symfony/Component/Notifier/Bridge/FakeSms/composer.json index 0bd895212efc0..e7199872f3629 100644 --- a/src/Symfony/Component/Notifier/Bridge/FakeSms/composer.json +++ b/src/Symfony/Component/Notifier/Bridge/FakeSms/composer.json @@ -24,7 +24,7 @@ "php": ">=7.2.5", "symfony/http-client": "^4.4|^5.2|^6.0", "symfony/notifier": "^5.3|^6.0", - "symfony/event-dispatcher-contracts": "^2", + "symfony/event-dispatcher-contracts": "^2|^3", "symfony/mailer": "^5.2|^6.0" }, "autoload": { diff --git a/src/Symfony/Component/Notifier/Bridge/Mercure/composer.json b/src/Symfony/Component/Notifier/Bridge/Mercure/composer.json index 3e55c680468f8..54137dd9d3cc3 100644 --- a/src/Symfony/Component/Notifier/Bridge/Mercure/composer.json +++ b/src/Symfony/Component/Notifier/Bridge/Mercure/composer.json @@ -20,7 +20,7 @@ "ext-json": "*", "symfony/mercure": "^0.5.2", "symfony/notifier": "^5.3|^6.0", - "symfony/service-contracts": "^1.10|^2" + "symfony/service-contracts": "^1.10|^2|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Mercure\\": "" }, diff --git a/src/Symfony/Component/Notifier/Bridge/Slack/composer.json b/src/Symfony/Component/Notifier/Bridge/Slack/composer.json index 8d7b8efdc1252..f5c7b522b2e1d 100644 --- a/src/Symfony/Component/Notifier/Bridge/Slack/composer.json +++ b/src/Symfony/Component/Notifier/Bridge/Slack/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/http-client": "^4.3|^5.0|^6.0", "symfony/notifier": "^5.3|^6.0" }, diff --git a/src/Symfony/Component/Notifier/composer.json b/src/Symfony/Component/Notifier/composer.json index 3de18a4942ddb..dbc43a07154b6 100644 --- a/src/Symfony/Component/Notifier/composer.json +++ b/src/Symfony/Component/Notifier/composer.json @@ -21,8 +21,8 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "symfony/event-dispatcher-contracts": "^2", - "symfony/http-client-contracts": "^2", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/http-client-contracts": "^2|^3", "symfony/messenger": "^4.4|^5.0|^6.0" }, "conflict": { diff --git a/src/Symfony/Component/OptionsResolver/composer.json b/src/Symfony/Component/OptionsResolver/composer.json index 6e65a79e939a6..a38d1bd047a3d 100644 --- a/src/Symfony/Component/OptionsResolver/composer.json +++ b/src/Symfony/Component/OptionsResolver/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16" }, diff --git a/src/Symfony/Component/PropertyAccess/composer.json b/src/Symfony/Component/PropertyAccess/composer.json index 17f859f8cbbce..fb6103a5275b3 100644 --- a/src/Symfony/Component/PropertyAccess/composer.json +++ b/src/Symfony/Component/PropertyAccess/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16", "symfony/property-info": "^5.2|^6.0" }, diff --git a/src/Symfony/Component/PropertyInfo/composer.json b/src/Symfony/Component/PropertyInfo/composer.json index 0008ef0492ab1..e6a29c069e3e7 100644 --- a/src/Symfony/Component/PropertyInfo/composer.json +++ b/src/Symfony/Component/PropertyInfo/composer.json @@ -24,7 +24,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16", "symfony/string": "^5.1|^6.0" }, diff --git a/src/Symfony/Component/Routing/composer.json b/src/Symfony/Component/Routing/composer.json index 740c524e908d8..b978c06263f27 100644 --- a/src/Symfony/Component/Routing/composer.json +++ b/src/Symfony/Component/Routing/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "require-dev": { diff --git a/src/Symfony/Component/Security/Core/composer.json b/src/Symfony/Component/Security/Core/composer.json index 43b8d4078cb60..2270a04c7416b 100644 --- a/src/Symfony/Component/Security/Core/composer.json +++ b/src/Symfony/Component/Security/Core/composer.json @@ -17,10 +17,10 @@ ], "require": { "php": ">=7.2.5", - "symfony/event-dispatcher-contracts": "^1.1|^2", + "symfony/event-dispatcher-contracts": "^1.1|^2|^3", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1.6|^2", - "symfony/deprecation-contracts": "^2.1", + "symfony/service-contracts": "^1.1.6|^2|^3", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/password-hasher": "^5.3|^6.0" }, "require-dev": { diff --git a/src/Symfony/Component/Security/Http/composer.json b/src/Symfony/Component/Security/Http/composer.json index 2e7064dd9f648..dc0deba03d20e 100644 --- a/src/Symfony/Component/Security/Http/composer.json +++ b/src/Symfony/Component/Security/Http/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/security-core": "^5.4|^6.0", "symfony/http-foundation": "^5.3|^6.0", "symfony/http-kernel": "^5.3|^6.0", diff --git a/src/Symfony/Component/Serializer/composer.json b/src/Symfony/Component/Serializer/composer.json index 0374c9d3e9149..403d04c0c85db 100644 --- a/src/Symfony/Component/Serializer/composer.json +++ b/src/Symfony/Component/Serializer/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-php80": "^1.16" }, diff --git a/src/Symfony/Component/Stopwatch/composer.json b/src/Symfony/Component/Stopwatch/composer.json index 27224947e2c5a..ed918d36f1605 100644 --- a/src/Symfony/Component/Stopwatch/composer.json +++ b/src/Symfony/Component/Stopwatch/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/service-contracts": "^1.0|^2" + "symfony/service-contracts": "^1|^2|^3" }, "autoload": { "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json index 52312ec4eaccd..5c9266b7eed6d 100644 --- a/src/Symfony/Component/Translation/composer.json +++ b/src/Symfony/Component/Translation/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation-contracts": "^2.3" @@ -30,7 +30,7 @@ "symfony/http-kernel": "^5.0|^6.0", "symfony/intl": "^4.4|^5.0|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", + "symfony/service-contracts": "^1.1.2|^2|^3", "symfony/yaml": "^4.4|^5.0|^6.0", "symfony/finder": "^4.4|^5.0|^6.0", "psr/log": "^1|^2|^3" diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index 53e507a295f9c..1639a1603a1aa 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -17,12 +17,12 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1|^2" + "symfony/translation-contracts": "^1.1|^2|^3" }, "require-dev": { "symfony/console": "^4.4|^5.0|^6.0", diff --git a/src/Symfony/Component/Yaml/composer.json b/src/Symfony/Component/Yaml/composer.json index f8919aead29af..7fa6e2cc56acb 100644 --- a/src/Symfony/Component/Yaml/composer.json +++ b/src/Symfony/Component/Yaml/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { diff --git a/src/Symfony/Contracts/Service/composer.json b/src/Symfony/Contracts/Service/composer.json index e680798d73926..f058637010367 100644 --- a/src/Symfony/Contracts/Service/composer.json +++ b/src/Symfony/Contracts/Service/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" From e4bff3309a8a0852dfac308122f87bf94d8ef807 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:03:28 +0100 Subject: [PATCH 53/72] [HttpFoundation] Add Laravel as a backer to the README --- src/Symfony/Component/HttpFoundation/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/README.md b/src/Symfony/Component/HttpFoundation/README.md index 5cf9007444456..424f2c4f0b848 100644 --- a/src/Symfony/Component/HttpFoundation/README.md +++ b/src/Symfony/Component/HttpFoundation/README.md @@ -4,6 +4,16 @@ HttpFoundation Component The HttpFoundation component defines an object-oriented layer for the HTTP specification. +Sponsor +------- + +The HttpFoundation component for Symfony 5.4/6.0 is [backed][1] by [Laravel][2]. + +Laravel is a PHP web development framework that is passionate about maximum developer +happiness. Laravel is built using a variety of bespoke and Symfony based components. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -12,3 +22,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://laravel.com/ +[3]: https://symfony.com/sponsor From 3fd3cff9e8a684c6efc92a4622bcdadef06fb609 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:03:28 +0100 Subject: [PATCH 54/72] [HttpKernel][Console] Add Les-Tilleuls.coop as a backer to the README --- src/Symfony/Component/Console/README.md | 16 ++++++++++++++++ src/Symfony/Component/HttpKernel/README.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/Symfony/Component/Console/README.md b/src/Symfony/Component/Console/README.md index c89b4a1a2066b..c4c129989cbd9 100644 --- a/src/Symfony/Component/Console/README.md +++ b/src/Symfony/Component/Console/README.md @@ -4,6 +4,18 @@ Console Component The Console component eases the creation of beautiful and testable command line interfaces. +Sponsor +------- + +The Console component for Symfony 5.4/6.0 is [backed][1] by [Les-Tilleuls.coop][2]. + +Les-Tilleuls.coop is a team of 50+ Symfony experts who can help you design, develop and +fix your projects. We provide a wide range of professional services including development, +consulting, coaching, training and audits. We also are highly skilled in JS, Go and DevOps. +We are a worker cooperative! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -18,3 +30,7 @@ Credits `Resources/bin/hiddeninput.exe` is a third party binary provided within this component. Find sources and license at https://github.com/Seldaek/hidden-input. + +[1]: https://symfony.com/backers +[2]: https://les-tilleuls.coop +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/HttpKernel/README.md b/src/Symfony/Component/HttpKernel/README.md index 18d15f5ad835f..ca504178278c4 100644 --- a/src/Symfony/Component/HttpKernel/README.md +++ b/src/Symfony/Component/HttpKernel/README.md @@ -5,6 +5,18 @@ The HttpKernel component provides a structured process for converting a Request into a Response by making use of the EventDispatcher component. It's flexible enough to create full-stack frameworks, micro-frameworks or advanced CMS systems like Drupal. +Sponsor +------- + +The HttpKernel component for Symfony 5.4/6.0 is [backed][1] by [Les-Tilleuls.coop][2]. + +Les-Tilleuls.coop is a team of 50+ Symfony experts who can help you design, develop and +fix your projects. We provide a wide range of professional services including development, +consulting, coaching, training and audits. We also are highly skilled in JS, Go and DevOps. +We are a worker cooperative! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -13,3 +25,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://les-tilleuls.coop +[3]: https://symfony.com/sponsor From 7019bdd7771c30a3947203a84a2c2b6dc546c0e0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:18:55 +0100 Subject: [PATCH 55/72] [Messenger][Process] Add SensioLabs as a backer to the README --- src/Symfony/Component/Messenger/README.md | 15 +++++++++++++++ src/Symfony/Component/Process/README.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Symfony/Component/Messenger/README.md b/src/Symfony/Component/Messenger/README.md index a253171a5529c..644269c7f34a1 100644 --- a/src/Symfony/Component/Messenger/README.md +++ b/src/Symfony/Component/Messenger/README.md @@ -4,6 +4,17 @@ Messenger Component The Messenger component helps applications send and receive messages to/from other applications or via message queues. +Sponsor +------- + +The Messenger component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2]. + +As the creator of Symfony, SensioLabs supports companies using Symfony, with an +offering encompassing consultancy, expertise, services, training, and technical +assistance to ensure the success of web application development projects. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -12,3 +23,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://sensiolabs.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Process/README.md b/src/Symfony/Component/Process/README.md index afce5e45eee34..8777de4a65c52 100644 --- a/src/Symfony/Component/Process/README.md +++ b/src/Symfony/Component/Process/README.md @@ -3,6 +3,17 @@ Process Component The Process component executes commands in sub-processes. +Sponsor +------- + +The Process component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2]. + +As the creator of Symfony, SensioLabs supports companies using Symfony, with an +offering encompassing consultancy, expertise, services, training, and technical +assistance to ensure the success of web application development projects. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -11,3 +22,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://sensiolabs.com +[3]: https://symfony.com/sponsor From ea0a94cfbfe4501a459a6ab748adf63ccaa25e9c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:23:01 +0100 Subject: [PATCH 56/72] [Notifier] Add Mercure.rocks as a backer to the README --- src/Symfony/Component/Notifier/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Symfony/Component/Notifier/README.md b/src/Symfony/Component/Notifier/README.md index 79e516f69871d..4a9631653841e 100644 --- a/src/Symfony/Component/Notifier/README.md +++ b/src/Symfony/Component/Notifier/README.md @@ -3,6 +3,19 @@ Notifier Component The Notifier component sends notifications via one or more channels (email, SMS, ...). +Sponsor +------- + +The Notifier component for Symfony 5.4/6.0 is [backed][1] by [Mercure.rocks][2]. + +Create real-time experiences in minutes! Mercure.rocks provides a realtime API service +that is tightly integrated with Symfony: create UIs that update in live with UX Turbo, +send notifications with the Notifier component, expose async APIs with API Platform and +create low level stuffs with the Mercure component. We maintain and scale the complex +infrastructure for you! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -11,3 +24,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://mercure.rocks +[3]: https://symfony.com/sponsor From ea561b4c23864d364d1bb2c0e9a471b24ec10fb0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:27:36 +0100 Subject: [PATCH 57/72] [Security] Add SymfonyCasts as a backer to the READMEs --- src/Symfony/Component/Security/Core/README.md | 15 +++++++++++++++ src/Symfony/Component/Security/Csrf/README.md | 15 +++++++++++++++ src/Symfony/Component/Security/Guard/README.md | 15 +++++++++++++++ src/Symfony/Component/Security/Http/README.md | 15 +++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/src/Symfony/Component/Security/Core/README.md b/src/Symfony/Component/Security/Core/README.md index 6b3e5c990107c..290402487dc31 100644 --- a/src/Symfony/Component/Security/Core/README.md +++ b/src/Symfony/Component/Security/Core/README.md @@ -6,6 +6,17 @@ which makes it possible to easily separate the actual authorization logic from so called user providers that hold the users credentials. It is inspired by the Java Spring framework. +Sponsor +------- + +The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. + +Learn Symfony faster by watching real projects being built and actively coding +along with them. SymfonyCasts bridges that learning gap, bringing you video +tutorials and coding challenges. Code on! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -14,3 +25,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://symfonycasts.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Security/Csrf/README.md b/src/Symfony/Component/Security/Csrf/README.md index 8933061585ff9..ed6b5bb2bb064 100644 --- a/src/Symfony/Component/Security/Csrf/README.md +++ b/src/Symfony/Component/Security/Csrf/README.md @@ -4,6 +4,17 @@ Security Component - CSRF The Security CSRF (cross-site request forgery) component provides a class `CsrfTokenManager` for generating and validating CSRF tokens. +Sponsor +------- + +The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. + +Learn Symfony faster by watching real projects being built and actively coding +along with them. SymfonyCasts bridges that learning gap, bringing you video +tutorials and coding challenges. Code on! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -12,3 +23,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://symfonycasts.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Security/Guard/README.md b/src/Symfony/Component/Security/Guard/README.md index 968558f79f86a..d3bb14be030e8 100644 --- a/src/Symfony/Component/Security/Guard/README.md +++ b/src/Symfony/Component/Security/Guard/README.md @@ -5,6 +5,17 @@ The Guard component brings many layers of authentication together, making it much easier to create complex authentication systems where you have total control. +Sponsor +------- + +The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. + +Learn Symfony faster by watching real projects being built and actively coding +along with them. SymfonyCasts bridges that learning gap, bringing you video +tutorials and coding challenges. Code on! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -13,3 +24,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://symfonycasts.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Security/Http/README.md b/src/Symfony/Component/Security/Http/README.md index e12d19fbeb697..cfe12c4270a76 100644 --- a/src/Symfony/Component/Security/Http/README.md +++ b/src/Symfony/Component/Security/Http/README.md @@ -6,6 +6,17 @@ which makes it possible to easily separate the actual authorization logic from so called user providers that hold the users credentials. It is inspired by the Java Spring framework. +Sponsor +------- + +The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. + +Learn Symfony faster by watching real projects being built and actively coding +along with them. SymfonyCasts bridges that learning gap, bringing you video +tutorials and coding challenges. Code on! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -14,3 +25,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://symfonycasts.com +[3]: https://symfony.com/sponsor From 7742c23214cb411d48e08f73533ca33c89e86c78 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:35:35 +0100 Subject: [PATCH 58/72] [Translation] Add Crowdin as a backer to the READMEs --- .../Component/Translation/Bridge/Crowdin/README.md | 13 +++++++++++++ src/Symfony/Component/Translation/README.md | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/Symfony/Component/Translation/Bridge/Crowdin/README.md b/src/Symfony/Component/Translation/Bridge/Crowdin/README.md index 7caef72eee8d9..a1b8a1a6cc46c 100644 --- a/src/Symfony/Component/Translation/Bridge/Crowdin/README.md +++ b/src/Symfony/Component/Translation/Bridge/Crowdin/README.md @@ -20,6 +20,15 @@ where: [Generate Personal Access Token on Crowdin Enterprise](https://support.crowdin.com/enterprise/personal-access-tokens/) +Sponsor +------- + +This bridge for Symfony 5.4/6.0 is [backed][1] by [Crowdin][2]. + +Crowdin is a cloud-based localization management software helping teams to go global and stay agile. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -27,3 +36,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://crowdin.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Translation/README.md b/src/Symfony/Component/Translation/README.md index 720bee3b81086..901647410c47e 100644 --- a/src/Symfony/Component/Translation/README.md +++ b/src/Symfony/Component/Translation/README.md @@ -23,6 +23,15 @@ $translator->addResource('array', [ echo $translator->trans('Hello World!'); // outputs « Bonjour ! » ``` +Sponsor +------- + +The Translation component for Symfony 5.4/6.0 is [backed][1] by: + + * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -31,3 +40,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://crowdin.com +[3]: https://symfony.com/sponsor From 56efa187bf864ba851a742310c2241ba48a050d6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:40:33 +0100 Subject: [PATCH 59/72] [Translation] Add Lokalise as a backer to the READMEs --- .../Translation/Bridge/Lokalise/README.md | 14 ++++++++++++++ src/Symfony/Component/Translation/README.md | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Translation/Bridge/Lokalise/README.md b/src/Symfony/Component/Translation/Bridge/Lokalise/README.md index 64e6cd0de7800..e91ac094f3cab 100644 --- a/src/Symfony/Component/Translation/Bridge/Lokalise/README.md +++ b/src/Symfony/Component/Translation/Bridge/Lokalise/README.md @@ -19,6 +19,16 @@ Go to the Project Settings in Lokalise to find the Project ID. [Generate an API key on Lokalise](https://app.lokalise.com/api2docs/curl/#resource-authentication) +Sponsor +------- + +This bridge for Symfony 5.4/6.0 is [backed][1] by [Lokalise][2]. + +Lokalise is a continuous localization and translation management platform. It integrates +into your development workflow so you can ship localized products, faster. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -26,3 +36,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://lokalise.com +[3]: https://symfony.com/sponsor diff --git a/src/Symfony/Component/Translation/README.md b/src/Symfony/Component/Translation/README.md index 901647410c47e..adda9a5b21e55 100644 --- a/src/Symfony/Component/Translation/README.md +++ b/src/Symfony/Component/Translation/README.md @@ -29,8 +29,9 @@ Sponsor The Translation component for Symfony 5.4/6.0 is [backed][1] by: * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. + * [Lokalise][3], a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster. -Help Symfony by [sponsoring][3] its development! +Help Symfony by [sponsoring][4] its development! Resources --------- @@ -43,4 +44,5 @@ Resources [1]: https://symfony.com/backers [2]: https://crowdin.com -[3]: https://symfony.com/sponsor +[3]: https://lokalise.com +[4]: https://symfony.com/sponsor From 190a33bc4de55d7324c8a1a3e3a0f11bd1d1ed13 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 15:51:09 +0100 Subject: [PATCH 60/72] [HttpClient] Add Klaxoon as a backer to the README --- src/Symfony/Component/HttpClient/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Symfony/Component/HttpClient/README.md b/src/Symfony/Component/HttpClient/README.md index 214489b7e7f76..0c55ccc118876 100644 --- a/src/Symfony/Component/HttpClient/README.md +++ b/src/Symfony/Component/HttpClient/README.md @@ -3,6 +3,16 @@ HttpClient component The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously. +Sponsor +------- + +The Httpclient component for Symfony 5.4/6.0 is [backed][1] by [Klaxoon][2]. + +Klaxoon is a platform that empowers organizations to run effective and +productive workshops easily in a hybrid environment. Anytime, Anywhere. + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -11,3 +21,7 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://klaxoon.com +[3]: https://symfony.com/sponsor From 20ba02c1eee9e974452c27d4e2f631b9b6d6cbf6 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Tue, 23 Nov 2021 15:44:42 +0100 Subject: [PATCH 61/72] Add Suggestion class for more advanced completion suggestion --- .../Completion/CompletionSuggestions.php | 16 +++++--- .../Output/BashCompletionOutput.php | 6 +-- .../Console/Completion/Suggestion.php | 37 +++++++++++++++++++ .../Tester/CommandCompletionTester.php | 2 +- 4 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 src/Symfony/Component/Console/Completion/Suggestion.php diff --git a/src/Symfony/Component/Console/Completion/CompletionSuggestions.php b/src/Symfony/Component/Console/Completion/CompletionSuggestions.php index 13572472e4357..d8905e5ee77df 100644 --- a/src/Symfony/Component/Console/Completion/CompletionSuggestions.php +++ b/src/Symfony/Component/Console/Completion/CompletionSuggestions.php @@ -18,7 +18,7 @@ * * @author Wouter de Jong */ -class CompletionSuggestions +final class CompletionSuggestions { private $valueSuggestions = []; private $optionSuggestions = []; @@ -26,11 +26,13 @@ class CompletionSuggestions /** * Add a suggested value for an input option or argument. * + * @param string|Suggestion $value + * * @return $this */ - public function suggestValue(string $value): self + public function suggestValue($value): self { - $this->valueSuggestions[] = $value; + $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; return $this; } @@ -38,13 +40,15 @@ public function suggestValue(string $value): self /** * Add multiple suggested values at once for an input option or argument. * - * @param string[] $values + * @param list $values * * @return $this */ public function suggestValues(array $values): self { - $this->valueSuggestions = array_merge($this->valueSuggestions, $values); + foreach ($values as $value) { + $this->suggestValue($value); + } return $this; } @@ -86,7 +90,7 @@ public function getOptionSuggestions(): array } /** - * @return string[] + * @return Suggestion[] */ public function getValueSuggestions(): array { diff --git a/src/Symfony/Component/Console/Completion/Output/BashCompletionOutput.php b/src/Symfony/Component/Console/Completion/Output/BashCompletionOutput.php index cfe8415d1a2a0..8d5ffa6b67d4b 100644 --- a/src/Symfony/Component/Console/Completion/Output/BashCompletionOutput.php +++ b/src/Symfony/Component/Console/Completion/Output/BashCompletionOutput.php @@ -21,10 +21,10 @@ class BashCompletionOutput implements CompletionOutputInterface { public function write(CompletionSuggestions $suggestions, OutputInterface $output): void { - $options = $suggestions->getValueSuggestions(); + $values = $suggestions->getValueSuggestions(); foreach ($suggestions->getOptionSuggestions() as $option) { - $options[] = '--'.$option->getName(); + $values[] = '--'.$option->getName(); } - $output->writeln(implode("\n", $options)); + $output->writeln(implode("\n", $values)); } } diff --git a/src/Symfony/Component/Console/Completion/Suggestion.php b/src/Symfony/Component/Console/Completion/Suggestion.php new file mode 100644 index 0000000000000..6c7bc4dc4c3bb --- /dev/null +++ b/src/Symfony/Component/Console/Completion/Suggestion.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +/** + * Represents a single suggested value. + * + * @author Wouter de Jong + */ +class Suggestion +{ + private $value; + + public function __construct(string $value) + { + $this->value = $value; + } + + public function getValue(): string + { + return $this->value; + } + + public function __toString(): string + { + return $this->getValue(); + } +} diff --git a/src/Symfony/Component/Console/Tester/CommandCompletionTester.php b/src/Symfony/Component/Console/Tester/CommandCompletionTester.php index 95cec8982e70f..ade7327529c32 100644 --- a/src/Symfony/Component/Console/Tester/CommandCompletionTester.php +++ b/src/Symfony/Component/Console/Tester/CommandCompletionTester.php @@ -51,6 +51,6 @@ public function complete(array $input): array $options[] = '--'.$option->getName(); } - return array_merge($options, $suggestions->getValueSuggestions()); + return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); } } From 647d5017706aec9d93d97c4cd43f8464f7d1891a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 17:09:58 +0100 Subject: [PATCH 62/72] Skip deprecation coming from DBAL 3.2 --- .github/workflows/integration-tests.yml | 1 + .github/workflows/unit-tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 9832c8a9d09a2..09acdcd9dbbae 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -99,6 +99,7 @@ jobs: - name: Run tests run: ./phpunit --group integration -v env: + SYMFONY_DEPRECATIONS_HELPER: max[direct]=1 # to be removed once DbalLogger is compatible with dbal 3.2+ REDIS_HOST: localhost REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005' REDIS_SENTINEL_HOSTS: 'localhost:26379' diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 157f6462b4e67..edd59d3f188f6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -63,6 +63,7 @@ jobs: echo COLUMNS=120 >> $GITHUB_ENV echo PHPUNIT="$(readlink -f ./phpunit) --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV + echo SYMFONY_DEPRECATIONS_HELPER=max[direct]=1 >> $GITHUB_ENV # to be removed once DbalLogger is compatible with dbal 3.2+ SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V) SYMFONY_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+') From 73d6281bf0f612073f8d07fa06814e75774cef6b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 17:20:52 +0100 Subject: [PATCH 63/72] Fix appveyor config for deprecations --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index d3d4660290489..25dccd75db012 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,7 +12,7 @@ init: - SET SYMFONY_DEPRECATIONS_HELPER=strict - SET ANSICON=121x90 (121x90) - SET SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1 - - SET SYMFONY_DEPRECATIONS_HELPER=max[indirect]=170 + - SET SYMFONY_DEPRECATIONS_HELPER=max[direct]=1 - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f install: From 954db3faf0679ff10342184f24575d39ae6ab7e1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 17:29:43 +0100 Subject: [PATCH 64/72] [Cache] fix connecting to local Redis sockets --- src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php | 1 + src/Symfony/Component/Cache/Traits/RedisTrait.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php index 7bb16573db32f..b020ddc9f43a8 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php @@ -96,6 +96,7 @@ public function provideFailedCreateConnection(): array ['redis://localhost:1234'], ['redis://foo@localhost'], ['redis://localhost/123'], + ['redis:///some/local/path'], ]; } diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 5365a53b18f15..649d50704ff2b 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -151,7 +151,7 @@ public static function createConnection($dsn, array $options = []) if (preg_match('#/(\d+)$#', $params['path'], $m)) { $params['dbindex'] = $m[1]; $params['path'] = substr($params['path'], 0, -\strlen($m[0])); - } else { + } elseif (isset($params['host'])) { throw new InvalidArgumentException(sprintf('Invalid Redis DSN: "%s", the "dbindex" parameter must be a number.', $dsn)); } } From 37c5685e72db2ae973575bd833e43de165b82124 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 20:07:08 +0100 Subject: [PATCH 65/72] fix ws --- src/Symfony/Component/Security/Core/README.md | 2 +- src/Symfony/Component/Security/Csrf/README.md | 2 +- src/Symfony/Component/Security/Guard/README.md | 2 +- src/Symfony/Component/Security/Http/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Security/Core/README.md b/src/Symfony/Component/Security/Core/README.md index 290402487dc31..b47ab331c82b3 100644 --- a/src/Symfony/Component/Security/Core/README.md +++ b/src/Symfony/Component/Security/Core/README.md @@ -13,7 +13,7 @@ The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. Learn Symfony faster by watching real projects being built and actively coding along with them. SymfonyCasts bridges that learning gap, bringing you video -tutorials and coding challenges. Code on! +tutorials and coding challenges. Code on! Help Symfony by [sponsoring][3] its development! diff --git a/src/Symfony/Component/Security/Csrf/README.md b/src/Symfony/Component/Security/Csrf/README.md index ed6b5bb2bb064..a27d877284343 100644 --- a/src/Symfony/Component/Security/Csrf/README.md +++ b/src/Symfony/Component/Security/Csrf/README.md @@ -11,7 +11,7 @@ The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. Learn Symfony faster by watching real projects being built and actively coding along with them. SymfonyCasts bridges that learning gap, bringing you video -tutorials and coding challenges. Code on! +tutorials and coding challenges. Code on! Help Symfony by [sponsoring][3] its development! diff --git a/src/Symfony/Component/Security/Guard/README.md b/src/Symfony/Component/Security/Guard/README.md index d3bb14be030e8..7316a8dcb496d 100644 --- a/src/Symfony/Component/Security/Guard/README.md +++ b/src/Symfony/Component/Security/Guard/README.md @@ -12,7 +12,7 @@ The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. Learn Symfony faster by watching real projects being built and actively coding along with them. SymfonyCasts bridges that learning gap, bringing you video -tutorials and coding challenges. Code on! +tutorials and coding challenges. Code on! Help Symfony by [sponsoring][3] its development! diff --git a/src/Symfony/Component/Security/Http/README.md b/src/Symfony/Component/Security/Http/README.md index cfe12c4270a76..594f5adb3aece 100644 --- a/src/Symfony/Component/Security/Http/README.md +++ b/src/Symfony/Component/Security/Http/README.md @@ -13,7 +13,7 @@ The Security component for Symfony 5.4/6.0 is [backed][1] by [SymfonyCasts][2]. Learn Symfony faster by watching real projects being built and actively coding along with them. SymfonyCasts bridges that learning gap, bringing you video -tutorials and coding challenges. Code on! +tutorials and coding challenges. Code on! Help Symfony by [sponsoring][3] its development! From f9ab38b92cddf73ee2feca5a7dacc85ab4c3f6fc Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 22:36:27 +0100 Subject: [PATCH 66/72] [FrameworkBundle][TwigBundle] Revert breaking changes in composer.json --- src/Symfony/Bundle/FrameworkBundle/composer.json | 1 + src/Symfony/Bundle/TwigBundle/composer.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index f8b44d39d3aaa..71e4940ff0a4b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -90,6 +90,7 @@ "symfony/property-info": "<4.4", "symfony/property-access": "<5.3", "symfony/serializer": "<5.2", + "symfony/service-contracts": ">=3.0", "symfony/security-csrf": "<5.3", "symfony/stopwatch": "<4.4", "symfony/translation": "<5.3", diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 43813bf5e8139..5635bb430d8c5 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -43,6 +43,7 @@ "conflict": { "symfony/dependency-injection": "<5.3", "symfony/framework-bundle": "<5.0", + "symfony/service-contracts": ">=3.0", "symfony/translation": "<5.0" }, "autoload": { From 5cb40273bb4bcc654d06519eb0dc2308c575f507 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 22:37:04 +0100 Subject: [PATCH 67/72] Revert "minor #44175 [Ldap] Add missing security-http dependency (derrabus)" This reverts commit 7e96b12c13304f57afd459dc2a189f814f042d00, reversing changes made to 2e950c6f1e0061480f8ee8c1d1841f1f52fb38ad. --- .../Security/CheckLdapCredentialsListenerTest.php | 12 ++++++++++++ src/Symfony/Component/Ldap/composer.json | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index 3d5475d20039e..76394303fe07d 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -41,6 +41,10 @@ class CheckLdapCredentialsListenerTest extends TestCase protected function setUp(): void { + if (!interface_exists(AuthenticatorInterface::class)) { + $this->markTestSkipped('This test requires symfony/security-http:^5.1'); + } + $this->ldap = $this->createMock(LdapInterface::class); } @@ -57,6 +61,10 @@ public function testShouldNotCheckPassport($authenticator, $passport) public function provideShouldNotCheckPassport() { + if (!interface_exists(AuthenticatorInterface::class)) { + $this->markTestSkipped('This test requires symfony/security-http:^5.1'); + } + // no LdapBadge yield [new TestAuthenticator(), new Passport(new UserBadge('test'), new PasswordCredentials('s3cret'))]; @@ -102,6 +110,10 @@ public function testWrongPassport($passport) public function provideWrongPassportData() { + if (!interface_exists(AuthenticatorInterface::class)) { + $this->markTestSkipped('This test requires symfony/security-http:^5.1'); + } + // no password credentials yield [new SelfValidatingPassport(new UserBadge('test'), [new LdapBadge('app.ldap')])]; diff --git a/src/Symfony/Component/Ldap/composer.json b/src/Symfony/Component/Ldap/composer.json index 0468e28efbce1..dc6b0a5d5a796 100644 --- a/src/Symfony/Component/Ldap/composer.json +++ b/src/Symfony/Component/Ldap/composer.json @@ -22,13 +22,11 @@ "ext-ldap": "*" }, "require-dev": { - "symfony/security-core": "^5.3", - "symfony/security-http": "^5.2" + "symfony/security-core": "^5.3" }, "conflict": { "symfony/options-resolver": "<4.4", - "symfony/security-core": "<5.3", - "symfony/security-http": "<5.2" + "symfony/security-core": "<5.3" }, "autoload": { "psr-4": { "Symfony\\Component\\Ldap\\": "" }, From 0e1717af7728c3a4d9328f5133f37208a425f6c4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 19:40:30 +0100 Subject: [PATCH 68/72] Remove flex from appveyor --- .appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 25dccd75db012..c125ea3afb205 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -48,12 +48,10 @@ install: - IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/2.0.0/composer.phar) - php composer.phar self-update --2 - copy /Y .github\composer-config.json %APPDATA%\Composer\config.json - - php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex - git config --global user.email "" - git config --global user.name "Symfony" - FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -o '[0-9][0-9]*\.[0-9]'"`) DO (SET SYMFONY_VERSION=%%F) - php .github/build-packages.php HEAD^ %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit - - SET "SYMFONY_REQUIRE=>=%SYMFONY_VERSION%" - SET COMPOSER_ROOT_VERSION=%SYMFONY_VERSION%.x-dev - php composer.phar update --no-progress --ansi - php phpunit install From a91b5a1dd880461cf61292f51f06bd1299f00f37 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 23:01:50 +0100 Subject: [PATCH 69/72] [Ldap] Fix test --- .../CheckLdapCredentialsListenerTest.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index 76394303fe07d..9a879c22490ef 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -206,25 +206,27 @@ private function createListener() } } -class TestAuthenticator implements AuthenticatorInterface -{ - public function supports(Request $request): ?bool +if (interface_exists(AuthenticatorInterface::class)) { + class TestAuthenticator implements AuthenticatorInterface { - } + public function supports(Request $request): ?bool + { + } - public function authenticate(Request $request): PassportInterface - { - } + public function authenticate(Request $request): PassportInterface + { + } - public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface - { - } + public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface + { + } - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response - { - } + public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response + { + } - public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response - { + public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response + { + } } } From b4c7d185941f20c83ce76ef1de8719252e918a3f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 23:07:33 +0100 Subject: [PATCH 70/72] Fix bad merge --- .../Tests/Security/CheckLdapCredentialsListenerTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index 9fee399c6f6af..7de5e394c2660 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -244,9 +244,9 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token, public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response { } - } - public function createToken(Passport $passport, string $firewallName): TokenInterface - { + public function createToken(Passport $passport, string $firewallName): TokenInterface + { + } } } From 2507cd637e13541227ca7eef8bfa8d24717666fc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 24 Nov 2021 10:00:45 +0100 Subject: [PATCH 71/72] Update CHANGELOG for 6.0.0-RC1 --- CHANGELOG-6.0.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG-6.0.md b/CHANGELOG-6.0.md index 0023f5b2f2c73..969f4134161ff 100644 --- a/CHANGELOG-6.0.md +++ b/CHANGELOG-6.0.md @@ -7,6 +7,27 @@ in 6.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/v6.0.0...v6.0.1 +* 6.0.0-RC1 (2021-11-24) + + * security #cve-2021-41268 [SecurityBundle] Default signature_properties to the previous behavior (wouterj) + * security #cve-2021-41267 [HttpKernel] Fix missing extra trusted header in sub-request (jderusse) + * security #cve-2021-41270 [Serializer] Use single quote to escape formulas (jderusse) + * bug #44230 [Console] Add Suggestion class for more advanced completion suggestion (wouterj) + * bug #44232 [Cache] fix connecting to local Redis sockets (nicolas-grekas) + * bug #44204 [HttpClient] fix closing curl multi handle when destructing client (nicolas-grekas) + * bug #44208 [Process] exclude argv/argc from possible default env vars (nicolas-grekas) + * bug #44188 [VarExporter] fix exporting declared but unset properties when __sleep() is implemented (nicolas-grekas) + * bug #44176 [Console] Default ansi option to null (jderusse) + * bug #44179 [WebProfilerBundle] Fix JS error when toolbar is reloaded (jderusse) + * bug #44177 [SecurityBundle] Remove Guard (derrabus) + * bug #44172 [Security] Guard is incompatible with Symfony 6 (derrabus) + * bug #44119 [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance (j-bernard) + * bug #44139 [WebProfilerBundle] Prevent installation of incompatible mailer component versions (Anne-Julia Seitz) + * bug #43917 Allow autodetecting mapping type for any object (franmomu) + * bug #44130 [SecurityBundle] Remove outdated conditions based on authenticatorManagerEnabled (chalasr) + * bug #44131 [Yaml] properly parse quoted strings tagged with !!str (xabbuh) + * bug #42323 [TwigBridge] do not merge label classes into expanded choice labels (xabbuh) + * 6.0.0-BETA3 (2021-11-18) * feature #44125 Add a setter on DateTimeNormalizer to change the default context at runtime (Seldaek) From e35c1f43af7a1bcdfdd72d6f074d8734104d4b89 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 24 Nov 2021 10:00:49 +0100 Subject: [PATCH 72/72] Update VERSION for 6.0.0-RC1 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 28c499510d984..4fdfde448b00b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -78,12 +78,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.0.0-DEV'; + public const VERSION = '6.0.0-RC1'; public const VERSION_ID = 60000; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 0; public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = 'RC1'; public const END_OF_MAINTENANCE = '07/2022'; public const END_OF_LIFE = '07/2022'; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy