Skip to content

Commit 22054b2

Browse files
committed
fix(symfony): xkey default value configuration
1 parent fe30e9e commit 22054b2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,12 @@ private function addHttpCacheSection(ArrayNodeDefinition $rootNode): void
416416
->end()
417417
->info('To pass options to the client charged with the request.')
418418
->end()
419-
->scalarNode('purger')->defaultValue('api_platform.http_cache.purger.varnish')->info('Specify a varnish purger to use (available values: "api_platform.http_cache.purger.varnish.ban" or "api_platform.http_cache.purger.varnish.xkey").')->end()
419+
->scalarNode('purger')
420+
->defaultValue('api_platform.http_cache.purger.varnish')
421+
->info('Specify a varnish purger to use (available values: "api_platform.http_cache.purger.varnish.ban" or "api_platform.http_cache.purger.varnish.xkey").')
422+
->end()
420423
->arrayNode('xkey')
424+
->addDefaultsIfNotSet()
421425
->children()
422426
->scalarNode('glue')
423427
->defaultValue(' ')
@@ -663,4 +667,4 @@ private function buildDeprecationArgs(string $version, string $message): array
663667
}
664668
}
665669

666-
class_alias(Configuration::class, \ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Configuration::class);
670+
class_alias(Configuration::class, \ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Configuration::class);

tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ private function runDefaultConfigTests(array $doctrineIntegrationsToLoad = ['orm
190190
'request_options' => [],
191191
'max_header_length' => 7500,
192192
'purger' => 'api_platform.http_cache.purger.varnish',
193+
'xkey' => ['glue' => ' '],
193194
],
194195
'etag' => true,
195196
'max_age' => null,

0 commit comments

Comments
 (0)