Repository: symfony/ux
Pull request #2714 (2025-05-06 02:52:13)

[Toolkit] Fix deprecation Kernel > 7.3
Fix

```
  2x: Since symfony/framework-bundle 7.3: Not setting the "with_constructor_extractor" option explicitly is deprecated because its default value will change in version 8.0.
    2x in DebugKitCommandTest::testShouldBeAbleToDebug from Symfony\UX\Toolkit\Tests\Command
```


Kocal: I don't understand why it's failing (https://github.com/symfony/ux/actions/runs/14850628341/job/41693406801?pr=2714), but we now have: 
> 1) Symfony\UX\Toolkit\Tests\Command\DebugKitCommandTest::testShouldBeAbleToDebug
Symfony\Component\Config\Definition\Exception\InvalidConfigurationException: Unrecognized option "with_constructor_extractor" under "framework". Available options are "annotations", "asset_mapper", "assets", "cache", "csrf_protection", "default_locale", "disallow_search_engine_index", "enabled_locales", "error_controller", "esi", "exceptions", "form", "fragments", "handle_all_throwables", "html_sanitizer", "http_cache", "http_client", "http_method_override", "ide", "json_streamer", "lock", "mailer", "messenger", "notifier", "php_errors", "profiler", "property_access", "property_info", "rate_limiter", "remote-event", "request", "router", "scheduler", "secret", "secrets", "semaphore", "serializer", "session", "set_content_language_from_locale", "set_locale_from_accept_language", "ssi", "test", "translator", "trust_x_sendfile_type_header", "trusted_headers", "trusted_hosts", "trusted_proxies", "type_info", "uid", "validation", "web_link", "webhook", "workflows".
smnandre: omg 🤦 

I forgot a level of nesting here 

Patch:
diff --git a/src/StimulusBundle/assets/package.json b/src/StimulusBundle/assets/package.json
index d4f288fa..544fb357 100644
--- a/src/StimulusBundle/assets/package.json
+++ b/src/StimulusBundle/assets/package.json
@@ -1,7 +1,7 @@
 {
     "name": "@symfony/stimulus-bundle",
     "description": "Integration of @hotwired/stimulus into Symfony",
-    "private": true,
+    "private": "true",
     "license": "MIT",
     "version": "2.24.0",
     "keywords": [
diff --git a/src/Toolkit/src/Asset/Component.php b/src/Toolkit/src/Asset/Component.php
index 09dacbdf..0b0baf2b 100644
--- a/src/Toolkit/src/Asset/Component.php
+++ b/src/Toolkit/src/Asset/Component.php
@@ -13,7 +13,7 @@ namespace Symfony\UX\Toolkit\Asset;
 
 use Symfony\UX\Toolkit\Assert;
 use Symfony\UX\Toolkit\Dependency\ComponentDependency;
-use Symfony\UX\Toolkit\Dependency\DependencyInterface;
+use Symfony\UX\Toolkit\Dependency\Dependency;
 use Symfony\UX\Toolkit\Dependency\PhpPackageDependency;
 use Symfony\UX\Toolkit\Dependency\StimulusControllerDependency;
 use Symfony\UX\Toolkit\File\Doc;
@@ -43,7 +43,7 @@ final class Component
         }
     }
 
-    public function addDependency(DependencyInterface $dependency): void
+    public function addDependency(Dependency $dependency): void
     {
         foreach ($this->dependencies as $i => $existingDependency) {
             if ($existingDependency instanceof PhpPackageDependency && $existingDependency->name === $dependency->name) {
@@ -69,7 +69,7 @@ final class Component
     }
 
     /**
-     * @return list<DependencyInterface>
+     * @return list<Dependency>
      */
     public function getDependencies(): array
     {
diff --git a/src/Toolkit/src/Dependency/ComponentDependency.php b/src/Toolkit/src/Dependency/ComponentDependency.php
index 7811c3ae..ae9e231c 100644
--- a/src/Toolkit/src/Dependency/ComponentDependency.php
+++ b/src/Toolkit/src/Dependency/ComponentDependency.php
@@ -20,7 +20,7 @@ use Symfony\UX\Toolkit\Assert;
  *
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-final class ComponentDependency implements DependencyInterface
+final class ComponentDependency implements Dependency
 {
     /**
      * @param non-empty-string $name The name of the component, e.g. "Table" or "Table:Body"
diff --git a/src/Toolkit/src/Dependency/DependencyInterface.php b/src/Toolkit/src/Dependency/Dependency.php
similarity index 88%
rename from src/Toolkit/src/Dependency/DependencyInterface.php
rename to src/Toolkit/src/Dependency/Dependency.php
index 60957d99..4f6312fb 100644
--- a/src/Toolkit/src/Dependency/DependencyInterface.php
+++ b/src/Toolkit/src/Dependency/Dependency.php
@@ -18,6 +18,6 @@ namespace Symfony\UX\Toolkit\Dependency;
  *
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-interface DependencyInterface extends \Stringable
+interface Dependency extends \Stringable
 {
 }
diff --git a/src/Toolkit/src/Dependency/PhpPackageDependency.php b/src/Toolkit/src/Dependency/PhpPackageDependency.php
index fed6e153..c6628697 100644
--- a/src/Toolkit/src/Dependency/PhpPackageDependency.php
+++ b/src/Toolkit/src/Dependency/PhpPackageDependency.php
@@ -20,7 +20,7 @@ use Symfony\UX\Toolkit\Assert;
  *
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-final class PhpPackageDependency implements DependencyInterface
+final class PhpPackageDependency implements Dependency
 {
     /**
      * @param non-empty-string $name
diff --git a/src/Toolkit/src/Dependency/StimulusControllerDependency.php b/src/Toolkit/src/Dependency/StimulusControllerDependency.php
index f1319b18..00b3c8db 100644
--- a/src/Toolkit/src/Dependency/StimulusControllerDependency.php
+++ b/src/Toolkit/src/Dependency/StimulusControllerDependency.php
@@ -20,7 +20,7 @@ use Symfony\UX\Toolkit\Assert;
  *
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-final class StimulusControllerDependency implements DependencyInterface
+final class StimulusControllerDependency implements Dependency
 {
     /**
      * @param non-empty-string $name
diff --git a/src/Toolkit/src/Registry/GitHubRegistry.php b/src/Toolkit/src/Registry/GitHubRegistry.php
index 43f3104b..9fb9f2b4 100644
--- a/src/Toolkit/src/Registry/GitHubRegistry.php
+++ b/src/Toolkit/src/Registry/GitHubRegistry.php
@@ -24,7 +24,7 @@ use Symfony\UX\Toolkit\Kit\KitFactory;
  * @author Jean-François Lépine
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-final class GitHubRegistry implements RegistryInterface
+final class GitHubRegistry implements Registry
 {
     public function __construct(
         private readonly KitFactory $kitFactory,
diff --git a/src/Toolkit/src/Registry/LocalRegistry.php b/src/Toolkit/src/Registry/LocalRegistry.php
index dc8577ce..2cdb9b6e 100644
--- a/src/Toolkit/src/Registry/LocalRegistry.php
+++ b/src/Toolkit/src/Registry/LocalRegistry.php
@@ -23,7 +23,7 @@ use Symfony\UX\Toolkit\Kit\KitFactory;
  * @author Jean-François Lépine
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-final class LocalRegistry implements RegistryInterface
+final class LocalRegistry implements Registry
 {
     private static string $kitsDir = __DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'kits';
 
diff --git a/src/Toolkit/src/Registry/RegistryInterface.php b/src/Toolkit/src/Registry/Registry.php
similarity index 95%
rename from src/Toolkit/src/Registry/RegistryInterface.php
rename to src/Toolkit/src/Registry/Registry.php
index 246ddada..fb7e602c 100644
--- a/src/Toolkit/src/Registry/RegistryInterface.php
+++ b/src/Toolkit/src/Registry/Registry.php
@@ -19,7 +19,7 @@ use Symfony\UX\Toolkit\Kit\Kit;
  * @author Jean-François Lépine
  * @author Hugo Alliaume <hugo@alliau.me>
  */
-interface RegistryInterface
+interface Registry
 {
     public static function supports(string $kitName): bool;
 
diff --git a/src/Toolkit/src/Registry/RegistryFactory.php b/src/Toolkit/src/Registry/RegistryFactory.php
index e9a0e50e..d9ed7151 100644
--- a/src/Toolkit/src/Registry/RegistryFactory.php
+++ b/src/Toolkit/src/Registry/RegistryFactory.php
@@ -29,7 +29,7 @@ final class RegistryFactory
     /**
      * @throws \InvalidArgumentException
      */
-    public function getForKit(string $kit): RegistryInterface
+    public function getForKit(string $kit): Registry
     {
         $type = match (true) {
             GitHubRegistry::supports($kit) => Type::GitHub,


Test patch:
diff --git a/src/Toolkit/tests/Fixtures/Kernel.php b/src/Toolkit/tests/Fixtures/Kernel.php
index d1853b06..7ea7eb05 100644
--- a/src/Toolkit/tests/Fixtures/Kernel.php
+++ b/src/Toolkit/tests/Fixtures/Kernel.php
@@ -45,6 +45,10 @@ final class Kernel extends BaseKernel
             'property_access' => true,
             'http_client' => true,
             'handle_all_throwables' => true,
+
+            ...(self::VERSION_ID >= 70300 ? [
+                'property_info' => ['with_constructor_extractor' => false],
+            ] : []),
         ]);
 
         $container->extension('twig', [