Skip to content

Commit c9bc72c

Browse files
authored
chore: symfony dev (#5801)
1 parent 50999d6 commit c9bc72c

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

tests/Fixtures/app/AppKernel.php

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
3535
use Symfony\Component\DependencyInjection\ContainerBuilder;
3636
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
37+
use Symfony\Component\HttpClient\Messenger\PingWebhookMessageHandler;
3738
use Symfony\Component\HttpFoundation\Session\SessionFactory;
3839
use Symfony\Component\HttpKernel\Kernel;
3940
use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher;
@@ -112,21 +113,45 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
112113
],
113114
];
114115

115-
$c->prependExtensionConfig('framework', [
116-
'secret' => 'dunglas.fr',
117-
'validation' => ['enable_annotations' => true],
118-
'serializer' => ['enable_annotations' => true],
119-
'test' => null,
120-
'session' => class_exists(SessionFactory::class) ? ['storage_factory_id' => 'session.storage.factory.mock_file'] : ['storage_id' => 'session.storage.mock_file'],
121-
'profiler' => [
122-
'enabled' => true,
123-
'collect' => false,
124-
],
125-
'messenger' => $messengerConfig,
126-
'router' => ['utf8' => true],
127-
'http_method_override' => false,
128-
'annotations' => false,
129-
]);
116+
// This class is introduced in Symfony 6.4 just using it to use the new configuration and to avoid unnecessary deprecations
117+
if (class_exists(PingWebhookMessageHandler::class)) {
118+
$config = [
119+
'secret' => 'dunglas.fr',
120+
'validation' => ['enable_attributes' => true, 'email_validation_mode' => 'html5'],
121+
'serializer' => ['enable_attributes' => true],
122+
'test' => null,
123+
'session' => ['cookie_secure' => true, 'cookie_samesite' => 'lax', 'handler_id' => 'session.handler.native_file'],
124+
'profiler' => [
125+
'enabled' => true,
126+
'collect' => false,
127+
],
128+
'php_errors' => ['log' => true],
129+
'messenger' => $messengerConfig,
130+
'router' => ['utf8' => true],
131+
'http_method_override' => false,
132+
'annotations' => false,
133+
'handle_all_throwables' => true,
134+
'uid' => ['default_uuid_version' => 7, 'time_based_uuid_version' => 7],
135+
];
136+
} else {
137+
$config = [
138+
'secret' => 'dunglas.fr',
139+
'validation' => ['enable_annotations' => true],
140+
'serializer' => ['enable_annotations' => true],
141+
'test' => null,
142+
'session' => class_exists(SessionFactory::class) ? ['storage_factory_id' => 'session.storage.factory.mock_file'] : ['storage_id' => 'session.storage.mock_file'],
143+
'profiler' => [
144+
'enabled' => true,
145+
'collect' => false,
146+
],
147+
'messenger' => $messengerConfig,
148+
'router' => ['utf8' => true],
149+
'http_method_override' => false,
150+
'annotations' => false,
151+
];
152+
}
153+
154+
$c->prependExtensionConfig('framework', $config);
130155

131156
$alg = class_exists(NativePasswordHasher::class, false) || class_exists('Symfony\Component\Security\Core\Encoder\NativePasswordEncoder') ? 'auto' : 'bcrypt';
132157
$securityConfig = [

0 commit comments

Comments
 (0)