->scalarNode('default_locale')->defaultValue('en')->end() ->booleanNode('set_locale_from_accept_language') ->info('Whether to use the Accept-Language HTTP header to set the Request locale (only when the "_locale" request attribute is not passed).') ->defaultFalse() ->end() ->booleanNode('set_content_language_from_locale') ->info('Whether to set the Content-Language HTTP header on the Response using the Request locale.') ->defaultFalse() ->end() ->arrayNode('enabled_locales') ->info('Defines the possible locales for the application. This list is used for generating translations files, but also to restrict which locales are allowed when it is set from Accept-Language header (using "set_locale_from_accept_language").') ->prototype('scalar')->end() ->end() ->arrayNode('trusted_hosts') ->beforeNormalization()->ifString()->then(fn($v) => [$v])->end() ->prototype('scalar')->end() ->end() ->scalarNode('trusted_proxies')->end() ->arrayNode('trusted_headers') ->fixXmlConfig('trusted_header') ->performNoDeepMerging() ->defaultValue(['x-forwarded-for', 'x-forwarded-port', 'x-forwarded-proto']) ->beforeNormalization()->ifString()->then(fn($v) => $v ? array_map('trim', explode(',', $v)) : [])->end()
/**
* @param ArrayNodeDefinition $builder
*/ publicfunctionaddConfiguration(NodeDefinition $builder): void { $builder ->info('An array of service ids for all of your "authenticators"') ->requiresAtLeastOneElement() ->prototype('scalar')->end();
// get the parent array node builder ("firewalls") from inside the children builder
$factoryRootNode = $builder->end()->end(); $factoryRootNode ->fixXmlConfig('custom_authenticator') ->validate() ->ifTrue(fn($v) => isset($v['custom_authenticators']) && empty($v['custom_authenticators'])) ->then(function D$v){ unset($v['custom_authenticators']);
$builder ->scalarNode('check_route') ->isRequired() ->info('Route that will validate the login link - e.g. "app_login_link_verify".') ->end() ->scalarNode('check_post_only') ->defaultFalse() ->info('If true, only HTTP POST requests to "check_route" will be handled by the authenticator.') ->end() ->arrayNode('signature_properties') ->isRequired() ->prototype('scalar')->end() ->requiresAtLeastOneElement() ->info('An array of properties on your User that are used to sign the link. If any of these change, all existing links will become invalid.') ->example(['email', 'password']) ->end() ->integerNode('lifetime') ->defaultValue(600) ->info('The lifetime of the login link in seconds.') ->end() ->integerNode('max_uses') ->defaultNull() ->info('Max number of times a login link can be used - null means unlimited within lifetime.')