Repository: symfony/ux
Pull request #1478 (2024-02-08 14:41:42)

[StimulusBundle/TwigComponent] Fix "use_yield" to "true" deprecation notice in CI
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Issues        | 
| License       | MIT

Only this one remains (in StimulusBundle), but I can't find a direct implementation related to the `Environment` in that test. Maybe also related to https://github.com/symfony/symfony/pull/53805 or thoughts anyone?

```
1x: Since twig/twig 3.9.0: Not setting "use_yield" to "true" is deprecated.
    1x in StimulusControllerLoaderFunctionalTest::testFullApplicationLoad from Symfony\UX\StimulusBundle\Tests\AssetMapper
```


Patch:
diff --git a/src/Autocomplete/CHANGELOG.md b/src/Autocomplete/CHANGELOG.md
index 39032dcc..905b13d4 100644
--- a/src/Autocomplete/CHANGELOG.md
+++ b/src/Autocomplete/CHANGELOG.md
@@ -11,8 +11,6 @@
 -   Added `tom-select/dist/css/tom-select.bootstrap4.css` to `autoimport` - this
     will cause this to appear in your `controllers.json` file by default, but disabled
     see.
--   Allow passing `extra_options` key in an array passed as a `3rd` argument of the `->add()` method.
-    It will be used during the Ajax call to fetch results.
 
 ## 2.13.2
 
diff --git a/src/Autocomplete/src/Checksum/ChecksumCalculator.php b/src/Autocomplete/src/Checksum/ChecksumCalculator.php
deleted file mode 100644
index d86ff570..00000000
--- a/src/Autocomplete/src/Checksum/ChecksumCalculator.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\UX\Autocomplete\Checksum;
-
-/** @internal */
-class ChecksumCalculator
-{
-    public function __construct(private readonly string $secret)
-    {
-    }
-
-    public function calculateForArray(array $data): string
-    {
-        $this->sortKeysRecursively($data);
-
-        return base64_encode(hash_hmac('sha256', json_encode($data), $this->secret, true));
-    }
-
-    private function sortKeysRecursively(array &$data): void
-    {
-        foreach ($data as &$value) {
-            if (\is_array($value)) {
-                $this->sortKeysRecursively($value);
-            }
-        }
-        ksort($data);
-    }
-}
diff --git a/src/Autocomplete/src/Controller/EntityAutocompleteController.php b/src/Autocomplete/src/Controller/EntityAutocompleteController.php
index 6188ca21..e65cb6da 100644
--- a/src/Autocomplete/src/Controller/EntityAutocompleteController.php
+++ b/src/Autocomplete/src/Controller/EntityAutocompleteController.php
@@ -14,27 +14,20 @@ namespace Symfony\UX\Autocomplete\Controller;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
 use Symfony\UX\Autocomplete\AutocompleteResultsExecutor;
 use Symfony\UX\Autocomplete\AutocompleterRegistry;
-use Symfony\UX\Autocomplete\Checksum\ChecksumCalculator;
-use Symfony\UX\Autocomplete\Form\AutocompleteChoiceTypeExtension;
-use Symfony\UX\Autocomplete\OptionsAwareEntityAutocompleterInterface;
 
 /**
  * @author Ryan Weaver <ryan@symfonycasts.com>
  */
 final class EntityAutocompleteController
 {
-    public const EXTRA_OPTIONS = 'extra_options';
-
     public function __construct(
         private AutocompleterRegistry $autocompleteFieldRegistry,
         private AutocompleteResultsExecutor $autocompleteResultsExecutor,
         private UrlGeneratorInterface $urlGenerator,
-        private ChecksumCalculator $checksumCalculator,
     ) {
     }
 
@@ -45,11 +38,6 @@ final class EntityAutocompleteController
             throw new NotFoundHttpException(sprintf('No autocompleter found for "%s". Available autocompleters are: (%s)', $alias, implode(', ', $this->autocompleteFieldRegistry->getAutocompleterNames())));
         }
 
-        if ($autocompleter instanceof OptionsAwareEntityAutocompleterInterface) {
-            $extraOptions = $this->getExtraOptions($request);
-            $autocompleter->setOptions([self::EXTRA_OPTIONS => $extraOptions]);
-        }
-
         $page = $request->query->getInt('page', 1);
         $nextPage = null;
 
@@ -66,48 +54,4 @@ final class EntityAutocompleteController
             'next_page' => $nextPage,
         ]);
     }
-
-    /**
-     * @return array<string, scalar|array|null>
-     */
-    private function getExtraOptions(Request $request): array
-    {
-        if (!$request->query->has(self::EXTRA_OPTIONS)) {
-            return [];
-        }
-
-        $extraOptions = $this->getDecodedExtraOptions($request->query->getString(self::EXTRA_OPTIONS));
-
-        if (!\array_key_exists(AutocompleteChoiceTypeExtension::CHECKSUM_KEY, $extraOptions)) {
-            throw new BadRequestHttpException('The extra options are missing the checksum.');
-        }
-
-        $this->validateChecksum($extraOptions[AutocompleteChoiceTypeExtension::CHECKSUM_KEY], $extraOptions);
-
-        return $extraOptions;
-    }
-
-    /**
-     * @return array<string, scalar>
-     */
-    private function getDecodedExtraOptions(string $extraOptions): array
-    {
-        return json_decode(base64_decode($extraOptions), true, flags: \JSON_THROW_ON_ERROR);
-    }
-
-    /**
-     * @param array<string, scalar> $extraOptions
-     */
-    private function validateChecksum(string $checksum, array $extraOptions): void
-    {
-        $extraOptionsWithoutChecksum = array_filter(
-            $extraOptions,
-            fn (string $key) => AutocompleteChoiceTypeExtension::CHECKSUM_KEY !== $key,
-            \ARRAY_FILTER_USE_KEY,
-        );
-
-        if ($checksum !== $this->checksumCalculator->calculateForArray($extraOptionsWithoutChecksum)) {
-            throw new BadRequestHttpException('The extra options have been tampered with.');
-        }
-    }
 }
diff --git a/src/Autocomplete/src/DependencyInjection/AutocompleteExtension.php b/src/Autocomplete/src/DependencyInjection/AutocompleteExtension.php
index c44103c8..859f1c4e 100644
--- a/src/Autocomplete/src/DependencyInjection/AutocompleteExtension.php
+++ b/src/Autocomplete/src/DependencyInjection/AutocompleteExtension.php
@@ -21,7 +21,6 @@ use Symfony\Component\Form\Form;
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 use Symfony\UX\Autocomplete\AutocompleteResultsExecutor;
 use Symfony\UX\Autocomplete\AutocompleterRegistry;
-use Symfony\UX\Autocomplete\Checksum\ChecksumCalculator;
 use Symfony\UX\Autocomplete\Controller\EntityAutocompleteController;
 use Symfony\UX\Autocomplete\Doctrine\DoctrineRegistryWrapper;
 use Symfony\UX\Autocomplete\Doctrine\EntityMetadataFactory;
@@ -117,7 +116,6 @@ final class AutocompleteExtension extends Extension implements PrependExtensionI
                 new Reference('ux.autocomplete.autocompleter_registry'),
                 new Reference('ux.autocomplete.results_executor'),
                 new Reference('router'),
-                new Reference('ux.autocomplete.checksum_calculator'),
             ])
             ->addTag('controller.service_arguments')
         ;
@@ -129,13 +127,6 @@ final class AutocompleteExtension extends Extension implements PrependExtensionI
             ])
             ->addTag('maker.command')
         ;
-
-        $container
-            ->register('ux.autocomplete.checksum_calculator', ChecksumCalculator::class)
-            ->setArguments([
-                '%kernel.secret%',
-            ])
-        ;
     }
 
     private function registerFormServices(ContainerBuilder $container): void
@@ -158,7 +149,6 @@ final class AutocompleteExtension extends Extension implements PrependExtensionI
         $container
             ->register('ux.autocomplete.choice_type_extension', AutocompleteChoiceTypeExtension::class)
             ->setArguments([
-                new Reference('ux.autocomplete.checksum_calculator'),
                 new Reference('translator', ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
             ])
             ->addTag('form.type_extension');
diff --git a/src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php b/src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php
index 9c40fd39..d22dd043 100644
--- a/src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php
+++ b/src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php
@@ -19,7 +19,6 @@ use Symfony\Component\Form\FormView;
 use Symfony\Component\OptionsResolver\Options;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\Contracts\Translation\TranslatorInterface;
-use Symfony\UX\Autocomplete\Checksum\ChecksumCalculator;
 
 /**
  * Initializes the autocomplete Stimulus controller for any fields with the "autocomplete" option.
@@ -28,12 +27,8 @@ use Symfony\UX\Autocomplete\Checksum\ChecksumCalculator;
  */
 final class AutocompleteChoiceTypeExtension extends AbstractTypeExtension
 {
-    public const CHECKSUM_KEY = '@checksum';
-
-    public function __construct(
-        private readonly ChecksumCalculator $checksumCalculator,
-        private readonly ?TranslatorInterface $translator = null,
-    ) {
+    public function __construct(private ?TranslatorInterface $translator = null)
+    {
     }
 
     public static function getExtendedTypes(): iterable
@@ -84,10 +79,6 @@ final class AutocompleteChoiceTypeExtension extends AbstractTypeExtension
             $values['min-characters'] = $options['min_characters'];
         }
 
-        if ($options['extra_options']) {
-            $values['url'] = $this->getUrlWithExtraOptions($values['url'], $options['extra_options']);
-        }
-
         $values['loading-more-text'] = $this->trans($options['loading_more_text']);
         $values['no-results-found-text'] = $this->trans($options['no_results_found_text']);
         $values['no-more-results-text'] = $this->trans($options['no_more_results_text']);
@@ -101,41 +92,6 @@ final class AutocompleteChoiceTypeExtension extends AbstractTypeExtension
         $view->vars['attr'] = $attr;
     }
 
-    private function getUrlWithExtraOptions(string $url, array $extraOptions): string
-    {
-        $this->validateExtraOptions($extraOptions);
-
-        $extraOptions[self::CHECKSUM_KEY] = $this->checksumCalculator->calculateForArray($extraOptions);
-        $extraOptions = base64_encode(json_encode($extraOptions));
-
-        return sprintf(
-            '%s%s%s',
-            $url,
-            $this->hasUrlParameters($url) ? '&' : '?',
-            http_build_query(['extra_options' => $extraOptions]),
-        );
-    }
-
-    private function hasUrlParameters(string $url): bool
-    {
-        $parsedUrl = parse_url($url);
-
-        return isset($parsedUrl['query']);
-    }
-
-    private function validateExtraOptions(array $extraOptions): void
-    {
-        foreach ($extraOptions as $optionKey => $option) {
-            if (!\is_scalar($option) && !\is_array($option) && null !== $option) {
-                throw new \InvalidArgumentException(sprintf('Extra option with key "%s" must be a scalar value, an array or null. Got "%s".', $optionKey, get_debug_type($option)));
-            }
-
-            if (\is_array($option)) {
-                $this->validateExtraOptions($option);
-            }
-        }
-    }
-
     public function configureOptions(OptionsResolver $resolver): void
     {
         $resolver->setDefaults([
@@ -150,7 +106,6 @@ final class AutocompleteChoiceTypeExtension extends AbstractTypeExtension
             'min_characters' => null,
             'max_results' => 10,
             'preload' => 'focus',
-            'extra_options' => [],
         ]);
 
         // if autocomplete_url is passed, then HTML options are already supported
diff --git a/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php b/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php
index 66615bda..61bb2bd8 100644
--- a/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php
+++ b/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php
@@ -22,18 +22,17 @@ use Symfony\Component\PropertyAccess\PropertyPathInterface;
 use Symfony\UX\Autocomplete\Doctrine\EntityMetadata;
 use Symfony\UX\Autocomplete\Doctrine\EntityMetadataFactory;
 use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
-use Symfony\UX\Autocomplete\OptionsAwareEntityAutocompleterInterface;
+use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
 
 /**
  * An entity auto-completer that wraps a form type to get its information.
  *
  * @internal
  */
-final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocompleterInterface
+final class WrappedEntityTypeAutocompleter implements EntityAutocompleterInterface
 {
     private ?FormInterface $form = null;
     private ?EntityMetadata $entityMetadata = null;
-    private array $options = [];
 
     public function __construct(
         private string $formType,
@@ -140,7 +139,7 @@ final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocomp
     private function getForm(): FormInterface
     {
         if (null === $this->form) {
-            $this->form = $this->formFactory->create($this->formType, options: $this->options);
+            $this->form = $this->formFactory->create($this->formType);
         }
 
         return $this->form;
@@ -169,13 +168,4 @@ final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocomp
 
         return $this->entityMetadata;
     }
-
-    public function setOptions(array $options): void
-    {
-        if (null !== $this->form) {
-            throw new \LogicException('The options can only be set before the form is created.');
-        }
-
-        $this->options = $options;
-    }
 }
diff --git a/src/Autocomplete/src/OptionsAwareEntityAutocompleterInterface.php b/src/Autocomplete/src/OptionsAwareEntityAutocompleterInterface.php
deleted file mode 100644
index 0a0b7875..00000000
--- a/src/Autocomplete/src/OptionsAwareEntityAutocompleterInterface.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\UX\Autocomplete;
-
-/**
- * Interface for classes that will have an "autocomplete" endpoint exposed with a possibility to pass additional form options.
- */
-interface OptionsAwareEntityAutocompleterInterface extends EntityAutocompleterInterface
-{
-    public function setOptions(array $options): void;
-}
diff --git a/src/StimulusBundle/src/Helper/StimulusHelper.php b/src/StimulusBundle/src/Helper/StimulusHelper.php
index a433caf1..a292e2f0 100644
--- a/src/StimulusBundle/src/Helper/StimulusHelper.php
+++ b/src/StimulusBundle/src/Helper/StimulusHelper.php
@@ -27,7 +27,9 @@ final class StimulusHelper
     public function __construct(?Environment $twig)
     {
         // Twig needed just for its escaping mechanism
-        $this->twig = $twig ?? new Environment(new ArrayLoader());
+        $this->twig = $twig ?? new Environment(new ArrayLoader(), [
+            'use_yield' => true,
+        ]);
     }
 
     public function createStimulusAttributes(): StimulusAttributes
diff --git a/src/Turbo/src/Doctrine/ClassUtil.php b/src/Turbo/src/Doctrine/ClassUtil.php
index cfd27836..c2c016d0 100644
--- a/src/Turbo/src/Doctrine/ClassUtil.php
+++ b/src/Turbo/src/Doctrine/ClassUtil.php
@@ -11,7 +11,6 @@
 
 namespace Symfony\UX\Turbo\Doctrine;
 
-use Doctrine\Common\Util\ClassUtils as LegacyClassUtils;
 use Symfony\Component\VarExporter\LazyObjectInterface;
 
 /**
@@ -31,8 +30,8 @@ final class ClassUtil
         }
 
         // @legacy for old versions of Doctrine
-        if (class_exists(LegacyClassUtils::class)) {
-            return LegacyClassUtils::getClass($entity);
+        if (class_exists(ClassUtils::class)) {
+            return ClassUtils::getClass($entity);
         }
 
         return $entity::class;
diff --git a/src/TwigComponent/CHANGELOG.md b/src/TwigComponent/CHANGELOG.md
index df794181..50f1e358 100644
--- a/src/TwigComponent/CHANGELOG.md
+++ b/src/TwigComponent/CHANGELOG.md
@@ -5,7 +5,6 @@
 -   Make `ComponentAttributes` traversable/countable
 -   Fixed lexing some `{# twig comments #}` with HTML Twig syntax
 -   Fix various usages of deprecated Twig code
--   Add attribute rendering system
 
 ## 2.13.0
 
diff --git a/src/TwigComponent/doc/index.rst b/src/TwigComponent/doc/index.rst
index 72e93491..967c2a2d 100644
--- a/src/TwigComponent/doc/index.rst
+++ b/src/TwigComponent/doc/index.rst
@@ -945,79 +945,6 @@ the exception of *class*. For ``class``, the defaults are prepended:
     {# renders as: #}
     <button class="bar foo" type="submit">Save</button>
 
-Render
-~~~~~~
-
-.. versionadded:: 2.15
-
-    The ability to *render* attributes was added in TwigComponents 2.15.
-
-You can take full control over the attributes that are rendered by using the
-``render()`` method.
-
-.. code-block:: html+twig
-
-    {# templates/components/MyComponent.html.twig #}
-    <div
-      style="{{ attributes.render('style') }} display:block;"
-      {{ attributes }} {# be sure to always render the remaining attributes! #}
-    >
-      My Component!
-    </div>
-
-    {# render component #}
-    {{ component('MyComponent', { style: 'color:red;' }) }}
-
-    {# renders as: #}
-    <div style="color:red; display:block;">
-      My Component!
-    </div>
-
-.. caution::
-
-    There are a few important things to know about using ``render()``:
-
-    1. You need to be sure to call your ``render()`` methods before calling ``{{ attributes }}`` or some
-       attributes could be rendered twice. For instance:
-
-            .. code-block:: html+twig
-
-                {# templates/components/MyComponent.html.twig #}
-                <div
-                    {{ attributes }} {# called before style is rendered #}
-                    style="{{ attributes.render('style') }} display:block;"
-                >
-                    My Component!
-                </div>
-
-                {# render component #}
-                {{ component('MyComponent', { style: 'color:red;' }) }}
-
-                {# renders as: #}
-                <div style="color:red;" style="color:red; display:block;"> {# style is rendered twice! #}
-                    My Component!
-                </div>
-
-    2. If you add an attribute without calling ``render()``, it will be rendered twice. For instance:
-
-         .. code-block:: html+twig
-
-              {# templates/components/MyComponent.html.twig #}
-              <div
-                 style="display:block;" {# not calling attributes.render('style') #}
-                 {{ attributes }}
-              >
-                 My Component!
-              </div>
-
-              {# render component #}
-              {{ component('MyComponent', { style: 'color:red;' }) }}
-
-              {# renders as: #}
-              <div style="display:block;" style="color:red;"> {# style is rendered twice! #}
-                 My Component!
-              </div>
-
 Only
 ~~~~
 
diff --git a/src/TwigComponent/src/ComponentAttributes.php b/src/TwigComponent/src/ComponentAttributes.php
index 8b7d10a0..8606a1c8 100644
--- a/src/TwigComponent/src/ComponentAttributes.php
+++ b/src/TwigComponent/src/ComponentAttributes.php
@@ -21,9 +21,6 @@ use Symfony\WebpackEncoreBundle\Dto\AbstractStimulusDto;
  */
 final class ComponentAttributes implements \IteratorAggregate, \Countable
 {
-    /** @var array<string,true> */
-    private array $rendered = [];
-
     /**
      * @param array<string, string|bool> $attributes
      */
@@ -34,10 +31,7 @@ final class ComponentAttributes implements \IteratorAggregate, \Countable
     public function __toString(): string
     {
         return array_reduce(
-            array_filter(
-                array_keys($this->attributes),
-                fn (string $key) => !isset($this->rendered[$key])
-            ),
+            array_keys($this->attributes),
             function (string $carry, string $key) {
                 $value = $this->attributes[$key];
 
@@ -60,26 +54,6 @@ final class ComponentAttributes implements \IteratorAggregate, \Countable
         );
     }
 
-    public function __clone(): void
-    {
-        $this->rendered = [];
-    }
-
-    public function render(string $attribute): ?string
-    {
-        if (null === $value = $this->attributes[$attribute] ?? null) {
-            return null;
-        }
-
-        if (!\is_string($value)) {
-            throw new \LogicException(sprintf('Can only get string attributes (%s is a %s).', $attribute, get_debug_type($value)));
-        }
-
-        $this->rendered[$attribute] = true;
-
-        return $value;
-    }
-
     /**
      * @return array<string, string|bool>
      */
@@ -115,10 +89,6 @@ final class ComponentAttributes implements \IteratorAggregate, \Countable
             $attributes[$key] = $value;
         }
 
-        foreach (array_keys($this->rendered) as $attribute) {
-            unset($attributes[$attribute]);
-        }
-
         return new self($attributes);
     }
 


Test patch:
diff --git a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php
index da942cab..c4407f00 100644
--- a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php
+++ b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php
@@ -1,16 +1,15 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter;
 
+use Doctrine\ORM\EntityRepository;
+use Doctrine\ORM\QueryBuilder;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Bundle\SecurityBundle\Security;
+use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
+use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
+use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
+
 class CustomGroupByProductAutocompleter extends CustomProductAutocompleter
 {
     public function getGroupBy(): mixed
diff --git a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php
index 912a864c..3ae0877a 100644
--- a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php
+++ b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php
@@ -1,20 +1,11 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter;
 
 use Doctrine\ORM\EntityRepository;
 use Doctrine\ORM\QueryBuilder;
-use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
 use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
 use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
@@ -23,8 +14,9 @@ class CustomProductAutocompleter implements EntityAutocompleterInterface
 {
     public function __construct(
         private RequestStack $requestStack,
-        private EntitySearchUtil $entitySearchUtil,
-    ) {
+        private EntitySearchUtil $entitySearchUtil
+    )
+    {
     }
 
     public function getEntityClass(): string
diff --git a/src/Autocomplete/tests/Fixtures/Entity/Category.php b/src/Autocomplete/tests/Fixtures/Entity/Category.php
index 174341cb..7774cf92 100644
--- a/src/Autocomplete/tests/Fixtures/Entity/Category.php
+++ b/src/Autocomplete/tests/Fixtures/Entity/Category.php
@@ -1,18 +1,10 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
 
 use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
+use Doctrine\DBAL\Types\Types;
 use Doctrine\ORM\Mapping as ORM;
 
 #[ORM\Entity()]
diff --git a/src/Autocomplete/tests/Fixtures/Entity/Ingredient.php b/src/Autocomplete/tests/Fixtures/Entity/Ingredient.php
index edea1c03..bc810d53 100644
--- a/src/Autocomplete/tests/Fixtures/Entity/Ingredient.php
+++ b/src/Autocomplete/tests/Fixtures/Entity/Ingredient.php
@@ -1,14 +1,5 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
diff --git a/src/Autocomplete/tests/Fixtures/Entity/Product.php b/src/Autocomplete/tests/Fixtures/Entity/Product.php
index 7db8056e..8640290b 100644
--- a/src/Autocomplete/tests/Fixtures/Entity/Product.php
+++ b/src/Autocomplete/tests/Fixtures/Entity/Product.php
@@ -1,14 +1,5 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
 
 use Doctrine\Common\Collections\ArrayCollection;
diff --git a/src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php b/src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php
index b7963066..e24abe09 100644
--- a/src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php
+++ b/src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php
@@ -1,39 +1,30 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
 
 use Doctrine\ORM\EntityRepository;
 use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
+use Zenstruck\Foundry\RepositoryProxy;
 use Zenstruck\Foundry\ModelFactory;
 use Zenstruck\Foundry\Proxy;
-use Zenstruck\Foundry\RepositoryProxy;
 
 /**
  * @extends ModelFactory<Category>
  *
- * @method static Category|Proxy                   createOne(array $attributes = [])
- * @method static Category[]|Proxy[]               createMany(int $number, array|callable $attributes = [])
- * @method static Category|Proxy                   find(object|array|mixed $criteria)
- * @method static Category|Proxy                   findOrCreate(array $attributes)
- * @method static Category|Proxy                   first(string $sortedField = 'id')
- * @method static Category|Proxy                   last(string $sortedField = 'id')
- * @method static Category|Proxy                   random(array $attributes = [])
- * @method static Category|Proxy                   randomOrCreate(array $attributes = []))
- * @method static Category[]|Proxy[]               all()
- * @method static Category[]|Proxy[]               findBy(array $attributes)
- * @method static Category[]|Proxy[]               randomSet(int $number, array $attributes = []))
- * @method static Category[]|Proxy[]               randomRange(int $min, int $max, array $attributes = []))
+ * @method static Category|Proxy createOne(array $attributes = [])
+ * @method static Category[]|Proxy[] createMany(int $number, array|callable $attributes = [])
+ * @method static Category|Proxy find(object|array|mixed $criteria)
+ * @method static Category|Proxy findOrCreate(array $attributes)
+ * @method static Category|Proxy first(string $sortedField = 'id')
+ * @method static Category|Proxy last(string $sortedField = 'id')
+ * @method static Category|Proxy random(array $attributes = [])
+ * @method static Category|Proxy randomOrCreate(array $attributes = []))
+ * @method static Category[]|Proxy[] all()
+ * @method static Category[]|Proxy[] findBy(array $attributes)
+ * @method static Category[]|Proxy[] randomSet(int $number, array $attributes = []))
+ * @method static Category[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
  * @method static EntityRepository|RepositoryProxy repository()
- * @method        Category|Proxy                   create(array|callable $attributes = [])
+ * @method Category|Proxy create(array|callable $attributes = [])
  */
 final class CategoryFactory extends ModelFactory
 {
diff --git a/src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php b/src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php
index 4669fa98..ee238ce1 100644
--- a/src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php
+++ b/src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php
@@ -1,40 +1,31 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
 
 use Doctrine\ORM\EntityRepository;
 use Symfony\Component\Uid\UuidV4;
 use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Ingredient;
+use Zenstruck\Foundry\RepositoryProxy;
 use Zenstruck\Foundry\ModelFactory;
 use Zenstruck\Foundry\Proxy;
-use Zenstruck\Foundry\RepositoryProxy;
 
 /**
  * @extends ModelFactory<Ingredient>
  *
- * @method static Ingredient|Proxy                 createOne(array $attributes = [])
- * @method static Ingredient[]|Proxy[]             createMany(int $number, array|callable $attributes = [])
- * @method static Ingredient|Proxy                 find(object|array|mixed $criteria)
- * @method static Ingredient|Proxy                 findOrCreate(array $attributes)
- * @method static Ingredient|Proxy                 first(string $sortedField = 'id')
- * @method static Ingredient|Proxy                 last(string $sortedField = 'id')
- * @method static Ingredient|Proxy                 random(array $attributes = [])
- * @method static Ingredient|Proxy                 randomOrCreate(array $attributes = []))
- * @method static Ingredient[]|Proxy[]             all()
- * @method static Ingredient[]|Proxy[]             findBy(array $attributes)
- * @method static Ingredient[]|Proxy[]             randomSet(int $number, array $attributes = []))
- * @method static Ingredient[]|Proxy[]             randomRange(int $min, int $max, array $attributes = []))
+ * @method static Ingredient|Proxy createOne(array $attributes = [])
+ * @method static Ingredient[]|Proxy[] createMany(int $number, array|callable $attributes = [])
+ * @method static Ingredient|Proxy find(object|array|mixed $criteria)
+ * @method static Ingredient|Proxy findOrCreate(array $attributes)
+ * @method static Ingredient|Proxy first(string $sortedField = 'id')
+ * @method static Ingredient|Proxy last(string $sortedField = 'id')
+ * @method static Ingredient|Proxy random(array $attributes = [])
+ * @method static Ingredient|Proxy randomOrCreate(array $attributes = []))
+ * @method static Ingredient[]|Proxy[] all()
+ * @method static Ingredient[]|Proxy[] findBy(array $attributes)
+ * @method static Ingredient[]|Proxy[] randomSet(int $number, array $attributes = []))
+ * @method static Ingredient[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
  * @method static EntityRepository|RepositoryProxy repository()
- * @method        Ingredient|Proxy                 create(array|callable $attributes = [])
+ * @method Ingredient|Proxy create(array|callable $attributes = [])
  */
 final class IngredientFactory extends ModelFactory
 {
diff --git a/src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php b/src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php
index 975c10be..4b99ac1f 100644
--- a/src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php
+++ b/src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php
@@ -1,39 +1,30 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
 
 use Doctrine\ORM\EntityRepository;
 use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
+use Zenstruck\Foundry\RepositoryProxy;
 use Zenstruck\Foundry\ModelFactory;
 use Zenstruck\Foundry\Proxy;
-use Zenstruck\Foundry\RepositoryProxy;
 
 /**
  * @extends ModelFactory<Product>
  *
- * @method static Product|Proxy                    createOne(array $attributes = [])
- * @method static Product[]|Proxy[]                createMany(int $number, array|callable $attributes = [])
- * @method static Product|Proxy                    find(object|array|mixed $criteria)
- * @method static Product|Proxy                    findOrCreate(array $attributes)
- * @method static Product|Proxy                    first(string $sortedField = 'id')
- * @method static Product|Proxy                    last(string $sortedField = 'id')
- * @method static Product|Proxy                    random(array $attributes = [])
- * @method static Product|Proxy                    randomOrCreate(array $attributes = []))
- * @method static Product[]|Proxy[]                all()
- * @method static Product[]|Proxy[]                findBy(array $attributes)
- * @method static Product[]|Proxy[]                randomSet(int $number, array $attributes = []))
- * @method static Product[]|Proxy[]                randomRange(int $min, int $max, array $attributes = []))
+ * @method static Product|Proxy createOne(array $attributes = [])
+ * @method static Product[]|Proxy[] createMany(int $number, array|callable $attributes = [])
+ * @method static Product|Proxy find(object|array|mixed $criteria)
+ * @method static Product|Proxy findOrCreate(array $attributes)
+ * @method static Product|Proxy first(string $sortedField = 'id')
+ * @method static Product|Proxy last(string $sortedField = 'id')
+ * @method static Product|Proxy random(array $attributes = [])
+ * @method static Product|Proxy randomOrCreate(array $attributes = []))
+ * @method static Product[]|Proxy[] all()
+ * @method static Product[]|Proxy[] findBy(array $attributes)
+ * @method static Product[]|Proxy[] randomSet(int $number, array $attributes = []))
+ * @method static Product[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
  * @method static EntityRepository|RepositoryProxy repository()
- * @method        Product|Proxy                    create(array|callable $attributes = [])
+ * @method Product|Proxy create(array|callable $attributes = [])
  */
 final class ProductFactory extends ModelFactory
 {
diff --git a/src/Autocomplete/tests/Fixtures/Form/AlternateRouteAutocompleteType.php b/src/Autocomplete/tests/Fixtures/Form/AlternateRouteAutocompleteType.php
index 2ef40251..264dafdc 100644
--- a/src/Autocomplete/tests/Fixtures/Form/AlternateRouteAutocompleteType.php
+++ b/src/Autocomplete/tests/Fixtures/Form/AlternateRouteAutocompleteType.php
@@ -1,14 +1,5 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
 
 use Symfony\Component\Form\AbstractType;
@@ -24,7 +15,7 @@ class AlternateRouteAutocompleteType extends AbstractType
     {
         $resolver->setDefaults([
             'class' => Ingredient::class,
-            'choice_label' => function (Ingredient $ingredient) {
+            'choice_label' => function(Ingredient $ingredient) {
                 return $ingredient->getName();
             },
             'multiple' => true,
diff --git a/src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php b/src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php
index 5f96dc3f..f4f1c5e3 100644
--- a/src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php
+++ b/src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php
@@ -1,24 +1,15 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
 
 use Doctrine\ORM\EntityRepository;
-use Symfony\Bundle\SecurityBundle\Security;
+use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
+use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\HttpFoundation\RequestStack;
 use Symfony\Component\OptionsResolver\OptionsResolver;
+use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
-use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
-use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
 
 #[AsEntityAutocompleteField]
 class CategoryAutocompleteType extends AbstractType
@@ -31,15 +22,15 @@ class CategoryAutocompleteType extends AbstractType
     {
         $resolver->setDefaults([
             'class' => Category::class,
-            'choice_label' => function (Category $category) {
+            'choice_label' => function(Category $category) {
                 return '<strong>'.$category->getName().'</strong>';
             },
-            'query_builder' => function (EntityRepository $repository) {
+            'query_builder' => function(EntityRepository $repository) {
                 return $repository->createQueryBuilder('category')
                     ->andWhere('category.name LIKE :search')
                     ->setParameter('search', '%foo%');
             },
-            'security' => function (Security $security) {
+            'security' => function(Security $security) {
                 if ($this->requestStack->getCurrentRequest()?->query->get('enforce_test_security')) {
                     return $security->isGranted('ROLE_USER');
                 }
diff --git a/src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php b/src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php
index 9b80ea84..4ca1a479 100644
--- a/src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php
+++ b/src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php
@@ -1,21 +1,12 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
 
+use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
+use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
-use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
-use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
 
 #[AsEntityAutocompleteField]
 class CategoryNoChoiceLabelAutocompleteType extends AbstractType
diff --git a/src/Autocomplete/tests/Fixtures/Form/IngredientAutocompleteType.php b/src/Autocomplete/tests/Fixtures/Form/IngredientAutocompleteType.php
index c2b636ce..2cb45555 100644
--- a/src/Autocomplete/tests/Fixtures/Form/IngredientAutocompleteType.php
+++ b/src/Autocomplete/tests/Fixtures/Form/IngredientAutocompleteType.php
@@ -1,19 +1,8 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
 
-use Doctrine\ORM\EntityRepository;
 use Symfony\Component\Form\AbstractType;
-use Symfony\Component\OptionsResolver\Options;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
 use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
@@ -26,22 +15,10 @@ class IngredientAutocompleteType extends AbstractType
     {
         $resolver->setDefaults([
             'class' => Ingredient::class,
-            'choice_label' => function (Ingredient $ingredient) {
+            'choice_label' => function(Ingredient $ingredient) {
                 return '<strong>'.$ingredient->getName().'</strong>';
             },
             'multiple' => true,
-            'query_builder' => function (Options $options): callable {
-                return function (EntityRepository $repository) use ($options) {
-                    $qb = $repository->createQueryBuilder('o');
-
-                    if ($options['extra_options']['banned_ingredient'] ?? false) {
-                        $qb->andWhere('o.name != :banned_ingredient')
-                            ->setParameter('banned_ingredient', $options['extra_options']['banned_ingredient']);
-                    }
-
-                    return $qb;
-                };
-            },
         ]);
     }
 
diff --git a/src/Autocomplete/tests/Fixtures/Form/ProductType.php b/src/Autocomplete/tests/Fixtures/Form/ProductType.php
index c2c5b35b..ce99325d 100644
--- a/src/Autocomplete/tests/Fixtures/Form/ProductType.php
+++ b/src/Autocomplete/tests/Fixtures/Form/ProductType.php
@@ -1,38 +1,21 @@
 <?php
 
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
 namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
 
+use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
 use Symfony\Component\Form\Extension\Core\Type\TextType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\OptionsResolver\OptionsResolver;
-use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
 
 class ProductType extends AbstractType
 {
     public function buildForm(FormBuilderInterface $builder, array $options): void
     {
         $builder
-            ->add('category', CategoryAutocompleteType::class, [
-                'extra_options' => [
-                    'some' => 'cool_option',
-                ],
-            ])
-            ->add('ingredients', IngredientAutocompleteType::class, [
-                'extra_options' => [
-                    'banned_ingredient' => 'Modified Flour',
-                ],
-            ])
+            ->add('category', CategoryAutocompleteType::class)
+            ->add('ingredients', IngredientAutocompleteType::class)
             ->add('portionSize', ChoiceType::class, [
                 'choices' => [
                     'extra small <span>🥨</span>' => 'xs',
diff --git a/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php b/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php
index 72d801b6..a7d647ed 100644
--- a/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php
+++ b/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php
@@ -31,7 +31,7 @@ class AutocompleteFormRenderingTest extends KernelTestCase
             ->throwExceptions()
             ->get('/test-form')
             ->assertElementAttributeContains('#product_category', 'data-controller', 'custom-autocomplete symfony--ux-autocomplete--autocomplete')
-            ->assertElementAttributeContains('#product_category', 'data-symfony--ux-autocomplete--autocomplete-url-value', '/test/autocomplete/category_autocomplete_type?extra_options=')
+            ->assertElementAttributeContains('#product_category', 'data-symfony--ux-autocomplete--autocomplete-url-value', '/test/autocomplete/category_autocomplete_type')
             ->assertElementAttributeContains('#product_category', 'data-symfony--ux-autocomplete--autocomplete-min-characters-value', '2')
             ->assertElementAttributeContains('#product_category', 'data-symfony--ux-autocomplete--autocomplete-max-results-value', '25')
 
@@ -123,58 +123,4 @@ class AutocompleteFormRenderingTest extends KernelTestCase
             ->assertElementCount('#product_ingredients option', 0)
         ;
     }
-
-    public function testItUsesPassedExtraOptions()
-    {
-        $ingredient1 = IngredientFactory::createOne(['name' => 'Flour']);
-        $ingredient2 = IngredientFactory::createOne(['name' => 'Sugar']);
-        $ingredient3 = IngredientFactory::createOne(['name' => 'Modified Flour']);
-
-        $this->browser()
-            ->throwExceptions()
-            ->get('/test-form')
-            ->assertElementCount('#product_ingredients option', 0)
-            ->assertNotContains('Flour')
-            ->assertNotContains('Sugar')
-            ->assertNotContains('Modified Flour')
-            // request all three ingredients
-            ->post('/test-form', [
-                'body' => [
-                    'product' => [
-                        'ingredients' => [
-                            (string) $ingredient1->getId(),
-                            (string) $ingredient2->getId(),
-                            (string) $ingredient3->getId(),
-                        ],
-                    ],
-                ],
-            ])
-            // assert that "Modified Flour" is not included
-            ->assertElementCount('#product_ingredients option', 2)
-            ->assertContains('Flour')
-            ->assertContains('Sugar')
-            ->assertNotContains('Modified Flour')
-        ;
-    }
-
-    public function testItReturnsErrorWhenSendingMalformedExtraOptions(): void
-    {
-        $extraOptionsWithoutChecksum = $this->encodeData(['foo' => 'bar']);
-        $extraOptionsWithInvalidChecksum = $this->encodeData(['foo' => 'bar', '@checksum' => 'invalid']);
-        $extraOptionsWithValidChecksum = $this->encodeData(['foo' => 'bar', '@checksum' => 'O2nYjcGr/l8GmUuYUSfE52hoyEL0NtDhBzUbn17KVHQ=']);
-
-        $this->browser()
-            ->post(sprintf('/test/autocomplete/category_autocomplete_type?extra_options=%s', $extraOptionsWithoutChecksum))
-            ->assertStatus(400)
-            ->post(sprintf('/test/autocomplete/category_autocomplete_type?extra_options=%s', $extraOptionsWithInvalidChecksum))
-            ->assertStatus(400)
-            ->post(sprintf('/test/autocomplete/category_autocomplete_type?extra_options=%s', $extraOptionsWithValidChecksum))
-            ->assertStatus(200)
-        ;
-    }
-
-    private function encodeData(array $data): string
-    {
-        return base64_encode(json_encode($data));
-    }
 }
diff --git a/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php b/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php
deleted file mode 100644
index 58bcd127..00000000
--- a/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\UX\Autocomplete\Tests\Unit\Calculator;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\UX\Autocomplete\Checksum\ChecksumCalculator;
-
-final class ChecksumCalculatorTest extends TestCase
-{
-    public function testCalculateChecksumForArray(): void
-    {
-        $this->assertSame(
-            'tZ34YQKgpttqybzPws0YJCOHV1QtMjQeuyy+rszdhXU=',
-            $this->createTestSubject()->calculateForArray(['test' => 'test']),
-        );
-    }
-
-    public function testCalculateTheSameChecksumForTheSameArrayButInDifferentOrder(): void
-    {
-        $this->assertSame(
-            $this->createTestSubject()->calculateForArray(['test' => 'test', 'test2' => 'test2']),
-            $this->createTestSubject()->calculateForArray(['test2' => 'test2', 'test' => 'test']),
-        );
-    }
-
-    private function createTestSubject(): ChecksumCalculator
-    {
-        return new ChecksumCalculator('s3cr3t');
-    }
-}
diff --git a/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php b/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php
index 7d76ebe2..1039ed17 100644
--- a/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php
+++ b/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php
@@ -24,7 +24,9 @@ final class StimulusAttributesTest extends TestCase
 
     protected function setUp(): void
     {
-        $this->stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
+        $this->stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
+            'use_yield' => true,
+        ]));
     }
 
     public function testAddAction(): void
diff --git a/src/TwigComponent/tests/Fixtures/templates/components/RenderAttributes.html.twig b/src/TwigComponent/tests/Fixtures/templates/components/RenderAttributes.html.twig
deleted file mode 100644
index 59f13268..00000000
--- a/src/TwigComponent/tests/Fixtures/templates/components/RenderAttributes.html.twig
+++ /dev/null
@@ -1,7 +0,0 @@
-<div
-    foo="{{ attributes.render('foo') }}"
-    bar="{{ attributes.render('bar')|default('default') }}"
-    baz="default {{ attributes.render('baz') }}"
-    qux="{{ attributes.render('qux') }} default"
-    {{ attributes }}
-/>
diff --git a/src/TwigComponent/tests/Integration/ComponentExtensionTest.php b/src/TwigComponent/tests/Integration/ComponentExtensionTest.php
index ee09fca9..a65c8f3e 100644
--- a/src/TwigComponent/tests/Integration/ComponentExtensionTest.php
+++ b/src/TwigComponent/tests/Integration/ComponentExtensionTest.php
@@ -216,51 +216,6 @@ final class ComponentExtensionTest extends KernelTestCase
         $this->assertStringContainsString('Hello FOO, 123, and 456', $output);
     }
 
-    /**
-     * @dataProvider renderingAttributesManuallyProvider
-     */
-    public function testRenderingAttributesManually(array $attributes, string $expected): void
-    {
-        $actual = trim($this->renderComponent('RenderAttributes', $attributes));
-
-        $this->assertSame($expected, trim($actual));
-    }
-
-    public static function renderingAttributesManuallyProvider(): iterable
-    {
-        yield [
-            ['class' => 'block'],
-            <<<HTML
-            <div
-                foo=""
-                bar="default"
-                baz="default "
-                qux=" default"
-                 class="block"
-            />
-            HTML,
-        ];
-
-        yield [
-            [
-                'class' => 'block',
-                'foo' => 'value',
-                'bar' => 'value',
-                'baz' => 'value',
-                'qux' => 'value',
-            ],
-            <<<HTML
-            <div
-                foo="value"
-                bar="value"
-                baz="default value"
-                qux="value default"
-                 class="block"
-            />
-            HTML,
-        ];
-    }
-
     private function renderComponent(string $name, array $data = []): string
     {
         return self::getContainer()->get(Environment::class)->render('render_component.html.twig', [
diff --git a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php
index 7cad387a..b24a93cb 100644
--- a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php
+++ b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php
@@ -133,7 +133,9 @@ final class ComponentAttributesTest extends TestCase
             'data-live-data-value' => '{}',
         ]);
 
-        $stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
+        $stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
+            'use_yield' => true,
+        ]));
         $stimulusAttributes->addController('foo', ['name' => 'ryan', 'some_array' => ['a', 'b']]);
         $attributes = $attributes->defaults($stimulusAttributes);
 
@@ -158,7 +160,9 @@ final class ComponentAttributesTest extends TestCase
             'data-action' => 'live#foo',
         ]);
 
-        $stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
+        $stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
+            'use_yield' => true,
+        ]));
         $stimulusAttributes->addAction('foo', 'barMethod');
         $attributes = $attributes->defaults([...$stimulusAttributes]);
 
@@ -199,29 +203,4 @@ final class ComponentAttributesTest extends TestCase
         $this->assertSame($attributes->all(), iterator_to_array($attributes));
         $this->assertCount(1, $attributes);
     }
-
-    public function testRenderSingleAttribute(): void
-    {
-        $attributes = new ComponentAttributes(['attr1' => 'value1', 'attr2' => 'value2']);
-
-        $this->assertSame('value1', $attributes->render('attr1'));
-        $this->assertNull($attributes->render('attr3'));
-    }
-
-    public function testRenderingSingleAttributeExcludesFromString(): void
-    {
-        $attributes = new ComponentAttributes(['attr1' => 'value1', 'attr2' => 'value2']);
-
-        $this->assertSame('value1', $attributes->render('attr1'));
-        $this->assertSame(' attr2="value2"', (string) $attributes);
-    }
-
-    public function testCannotRenderNonStringAttribute(): void
-    {
-        $attributes = new ComponentAttributes(['attr1' => false]);
-
-        $this->expectException(\LogicException::class);
-
-        $attributes->render('attr1');
-    }
 }