[FrameworkBundle] Fix setting default context for certain normalizers

by @HypeMC

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/symfony/symfony/57273/416c891d64c1fa9c09cbf51d78b4f0ec1892c41c/cs.diff | patch -p0
diff -ru src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
--- src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php	2024-06-11 02:01:06.544336417 +0000
+++ src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php	2024-06-11 02:01:40.636528125 +0000
@@ -647,9 +647,6 @@
         ]);
     }
 
-    /**
-     * {@inheritdoc}
-     */
     public function getConfiguration(array $config, ContainerBuilder $container)
     {
         return new Configuration($container->getParameter('kernel.debug'));
@@ -1565,8 +1562,8 @@
             $configDir = is_dir($bundle['path'].'/Resources/config') ? $bundle['path'].'/Resources/config' : $bundle['path'].'/config';
 
             if (
-                $container->fileExists($file = $configDir.'/validation.yaml', false) ||
-                $container->fileExists($file = $configDir.'/validation.yml', false)
+                $container->fileExists($file = $configDir.'/validation.yaml', false)
+                || $container->fileExists($file = $configDir.'/validation.yml', false)
             ) {
                 $fileRecorder('yml', $file);
             }
@@ -1823,8 +1820,8 @@
             }
 
             if (
-                $container->fileExists($file = $configDir.'/serialization.yaml', false) ||
-                $container->fileExists($file = $configDir.'/serialization.yml', false)
+                $container->fileExists($file = $configDir.'/serialization.yaml', false)
+                || $container->fileExists($file = $configDir.'/serialization.yml', false)
             ) {
                 $fileRecorder('yml', $file);
             }
@@ -2700,21 +2697,24 @@
 
         foreach ($headers as $h) {
             switch ($h) {
-                case 'forwarded': $trustedHeaders |= Request::HEADER_FORWARDED; break;
-                case 'x-forwarded-for': $trustedHeaders |= Request::HEADER_X_FORWARDED_FOR; break;
-                case 'x-forwarded-host': $trustedHeaders |= Request::HEADER_X_FORWARDED_HOST; break;
-                case 'x-forwarded-proto': $trustedHeaders |= Request::HEADER_X_FORWARDED_PROTO; break;
-                case 'x-forwarded-port': $trustedHeaders |= Request::HEADER_X_FORWARDED_PORT; break;
-                case 'x-forwarded-prefix': $trustedHeaders |= Request::HEADER_X_FORWARDED_PREFIX; break;
+                case 'forwarded': $trustedHeaders |= Request::HEADER_FORWARDED;
+                    break;
+                case 'x-forwarded-for': $trustedHeaders |= Request::HEADER_X_FORWARDED_FOR;
+                    break;
+                case 'x-forwarded-host': $trustedHeaders |= Request::HEADER_X_FORWARDED_HOST;
+                    break;
+                case 'x-forwarded-proto': $trustedHeaders |= Request::HEADER_X_FORWARDED_PROTO;
+                    break;
+                case 'x-forwarded-port': $trustedHeaders |= Request::HEADER_X_FORWARDED_PORT;
+                    break;
+                case 'x-forwarded-prefix': $trustedHeaders |= Request::HEADER_X_FORWARDED_PREFIX;
+                    break;
             }
         }
 
         return $trustedHeaders;
     }
 
-    /**
-     * {@inheritdoc}
-     */
     public function getXsdValidationBasePath()
     {
         return \dirname(__DIR__).'/Resources/config/schema';

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
YAML Files Syntax

0
File Permissions

0
Merge Commits

0
Exception Messages Formatting

0
Usage of void in test files

0
Use ::class whenever possible

0
Deprecation Messages