Repository: symfony/symfony
File: src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php (PHP)

Code before:
/**
 * TwigExtension configuration structure.
 *
 * @author Jeremy Mikola <jmikola@gmail.com>
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     */
    public function getConfigTreeBuilder(): TreeBuilder
    {
        $treeBuilder = new TreeBuilder('twig');
        $rootNode = $treeBuilder->getRootNode();

        $rootNode
            ->docUrl('https://symfony.com/doc/{version:major}.{version:minor}/reference/configuration/twig.html', 'symfony/twig-bundle')
            ->beforeNormalization()
            ->ifTrue(fn ($v) => \is_array($v) && \array_key_exists('exception_controller', $v))
            ->then(function ($v) {
                if (isset($v['exception_controller'])) {
                    throw new InvalidConfigurationException('Option "exception_controller" under "twig" must be null or unset, use "error_controller" under "framework" instead.');
                }

                unset($v['exception_controller']);
                trigger_deprecation('symfony/twig-bundle', '7.4', 'Setting the "exception_controller" option under "twig" to null is deprecated.  Omit this legacy no-op option instead.');

                return $v;
            })
        ->end();

        $this->addFormThemesSection($rootNode);
        $this->addGlobalsSection($rootNode);
        $this->addTwigOptions($rootNode);
        $this->addTwigFormatOptions($rootNode);
        $this->addMailerSection($rootNode);

        return $treeBuilder;
    }

    private function addFormThemesSection(ArrayNodeDefinition $rootNode): void
    {
        $rootNode
            ->children()
                ->arrayNode('form_themes', 'form_theme')
                    ->addDefaultChildrenIfNoneSet()
                    ->prototype('scalar')->defaultValue('form_div_layout.html.twig')->end()
                    ->example(['@My/form.html.twig'])
                    ->validate()
                        ->ifTrue(fn ($v) => !\in_array('form_div_layout.html.twig', $v, true))
                        ->then(fn ($v) => array_merge(['form_div_layout.html.twig'], $v))

Review comment (suggestion):
extra whitespace 🕵️‍♂️
```suggestion
                trigger_deprecation('symfony/twig-bundle', '7.4', 'Setting the "exception_controller" option under "twig" to null is deprecated. Omit this legacy no-op option instead.');
```

Code after:
/**
 * TwigExtension configuration structure.
 *
 * @author Jeremy Mikola <jmikola@gmail.com>
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     */
    public function getConfigTreeBuilder(): TreeBuilder
    {
        $treeBuilder = new TreeBuilder('twig');
        $rootNode = $treeBuilder->getRootNode();

        $rootNode
            ->docUrl('https://symfony.com/doc/{version:major}.{version:minor}/reference/configuration/twig.html', 'symfony/twig-bundle')
            ->beforeNormalization()
                ->ifArray()
                ->then(function ($v) {
                    if (!\array_key_exists('exception_controller', $v)) {
                        return $v;
                    }

                    if (isset($v['exception_controller'])) {
                        throw new InvalidConfigurationException('Option "exception_controller" under "twig" must be null or unset, use "error_controller" under "framework" instead.');
                    }

                    unset($v['exception_controller']);
                    trigger_deprecation('symfony/twig-bundle', '7.4', 'Setting the "exception_controller" option under "twig" to null is deprecated. Omit this legacy no-op option instead.');

                    return $v;
                })
            ->end();

        $this->addFormThemesSection($rootNode);
        $this->addGlobalsSection($rootNode);
        $this->addTwigOptions($rootNode);
        $this->addTwigFormatOptions($rootNode);
        $this->addMailerSection($rootNode);

        return $treeBuilder;
    }

    private function addFormThemesSection(ArrayNodeDefinition $rootNode): void
    {
        $rootNode
            ->children()
                ->arrayNode('form_themes', 'form_theme')
                    ->addDefaultChildrenIfNoneSet()
                    ->prototype('scalar')->defaultValue('form_div_layout.html.twig')->end()