Skip to content

Commit

Permalink
chore: symfony dev (#5801)
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Sep 8, 2023
1 parent 50999d6 commit c9bc72c
Showing 1 changed file with 40 additions and 15 deletions.
55 changes: 40 additions & 15 deletions tests/Fixtures/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\HttpClient\Messenger\PingWebhookMessageHandler;
use Symfony\Component\HttpFoundation\Session\SessionFactory;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher;
Expand Down Expand Up @@ -112,21 +113,45 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
],
];

$c->prependExtensionConfig('framework', [
'secret' => 'dunglas.fr',
'validation' => ['enable_annotations' => true],
'serializer' => ['enable_annotations' => true],
'test' => null,
'session' => class_exists(SessionFactory::class) ? ['storage_factory_id' => 'session.storage.factory.mock_file'] : ['storage_id' => 'session.storage.mock_file'],
'profiler' => [
'enabled' => true,
'collect' => false,
],
'messenger' => $messengerConfig,
'router' => ['utf8' => true],
'http_method_override' => false,
'annotations' => false,
]);
// This class is introduced in Symfony 6.4 just using it to use the new configuration and to avoid unnecessary deprecations
if (class_exists(PingWebhookMessageHandler::class)) {
$config = [
'secret' => 'dunglas.fr',
'validation' => ['enable_attributes' => true, 'email_validation_mode' => 'html5'],
'serializer' => ['enable_attributes' => true],
'test' => null,
'session' => ['cookie_secure' => true, 'cookie_samesite' => 'lax', 'handler_id' => 'session.handler.native_file'],
'profiler' => [
'enabled' => true,
'collect' => false,
],
'php_errors' => ['log' => true],
'messenger' => $messengerConfig,
'router' => ['utf8' => true],
'http_method_override' => false,
'annotations' => false,
'handle_all_throwables' => true,
'uid' => ['default_uuid_version' => 7, 'time_based_uuid_version' => 7],
];
} else {
$config = [
'secret' => 'dunglas.fr',
'validation' => ['enable_annotations' => true],
'serializer' => ['enable_annotations' => true],
'test' => null,
'session' => class_exists(SessionFactory::class) ? ['storage_factory_id' => 'session.storage.factory.mock_file'] : ['storage_id' => 'session.storage.mock_file'],
'profiler' => [
'enabled' => true,
'collect' => false,
],
'messenger' => $messengerConfig,
'router' => ['utf8' => true],
'http_method_override' => false,
'annotations' => false,
];
}

$c->prependExtensionConfig('framework', $config);

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

0 comments on commit c9bc72c

Please sign in to comment.