Skip to content

Commit

Permalink
Merge 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Sep 8, 2023
2 parents 92f2db9 + c9bc72c commit 731ceac
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"symfony/property-access": "^6.1",
"symfony/property-info": "^6.1",
"symfony/serializer": "^6.1",
"symfony/translation-contracts": "^3.3",
"symfony/web-link": "^6.1",
"willdurand/negotiation": "^3.0"
},
Expand Down
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 731ceac

Please sign in to comment.