diff --git a/src/Toolkit/src/Asset/Component.php b/src/Toolkit/src/Asset/Component.php index 0b0baf2b037..09dacbdf7d9 100644 --- a/src/Toolkit/src/Asset/Component.php +++ b/src/Toolkit/src/Asset/Component.php @@ -13,7 +13,7 @@ use Symfony\UX\Toolkit\Assert; use Symfony\UX\Toolkit\Dependency\ComponentDependency; -use Symfony\UX\Toolkit\Dependency\Dependency; +use Symfony\UX\Toolkit\Dependency\DependencyInterface; use Symfony\UX\Toolkit\Dependency\PhpPackageDependency; use Symfony\UX\Toolkit\Dependency\StimulusControllerDependency; use Symfony\UX\Toolkit\File\Doc; @@ -43,7 +43,7 @@ public function __construct( } } - public function addDependency(Dependency $dependency): void + public function addDependency(DependencyInterface $dependency): void { foreach ($this->dependencies as $i => $existingDependency) { if ($existingDependency instanceof PhpPackageDependency && $existingDependency->name === $dependency->name) { @@ -69,7 +69,7 @@ public function addDependency(Dependency $dependency): void } /** - * @return list + * @return list */ public function getDependencies(): array { diff --git a/src/Toolkit/src/Dependency/ComponentDependency.php b/src/Toolkit/src/Dependency/ComponentDependency.php index ae9e231c0f3..7811c3ae34c 100644 --- a/src/Toolkit/src/Dependency/ComponentDependency.php +++ b/src/Toolkit/src/Dependency/ComponentDependency.php @@ -20,7 +20,7 @@ * * @author Hugo Alliaume */ -final class ComponentDependency implements Dependency +final class ComponentDependency implements DependencyInterface { /** * @param non-empty-string $name The name of the component, e.g. "Table" or "Table:Body" diff --git a/src/Toolkit/src/Dependency/Dependency.php b/src/Toolkit/src/Dependency/DependencyInterface.php similarity index 88% rename from src/Toolkit/src/Dependency/Dependency.php rename to src/Toolkit/src/Dependency/DependencyInterface.php index 4f6312fb39e..60957d99ce7 100644 --- a/src/Toolkit/src/Dependency/Dependency.php +++ b/src/Toolkit/src/Dependency/DependencyInterface.php @@ -18,6 +18,6 @@ * * @author Hugo Alliaume */ -interface Dependency extends \Stringable +interface DependencyInterface extends \Stringable { } diff --git a/src/Toolkit/src/Dependency/PhpPackageDependency.php b/src/Toolkit/src/Dependency/PhpPackageDependency.php index c66286979fc..fed6e153540 100644 --- a/src/Toolkit/src/Dependency/PhpPackageDependency.php +++ b/src/Toolkit/src/Dependency/PhpPackageDependency.php @@ -20,7 +20,7 @@ * * @author Hugo Alliaume */ -final class PhpPackageDependency implements Dependency +final class PhpPackageDependency implements DependencyInterface { /** * @param non-empty-string $name diff --git a/src/Toolkit/src/Dependency/StimulusControllerDependency.php b/src/Toolkit/src/Dependency/StimulusControllerDependency.php index 00b3c8db9b2..f1319b18033 100644 --- a/src/Toolkit/src/Dependency/StimulusControllerDependency.php +++ b/src/Toolkit/src/Dependency/StimulusControllerDependency.php @@ -20,7 +20,7 @@ * * @author Hugo Alliaume */ -final class StimulusControllerDependency implements Dependency +final class StimulusControllerDependency implements DependencyInterface { /** * @param non-empty-string $name diff --git a/src/Toolkit/src/Registry/GitHubRegistry.php b/src/Toolkit/src/Registry/GitHubRegistry.php index 9fb9f2b4b3a..43f3104b7b0 100644 --- a/src/Toolkit/src/Registry/GitHubRegistry.php +++ b/src/Toolkit/src/Registry/GitHubRegistry.php @@ -24,7 +24,7 @@ * @author Jean-François Lépine * @author Hugo Alliaume */ -final class GitHubRegistry implements Registry +final class GitHubRegistry implements RegistryInterface { public function __construct( private readonly KitFactory $kitFactory, diff --git a/src/Toolkit/src/Registry/LocalRegistry.php b/src/Toolkit/src/Registry/LocalRegistry.php index 2cdb9b6e4a7..dc8577ce955 100644 --- a/src/Toolkit/src/Registry/LocalRegistry.php +++ b/src/Toolkit/src/Registry/LocalRegistry.php @@ -23,7 +23,7 @@ * @author Jean-François Lépine * @author Hugo Alliaume */ -final class LocalRegistry implements Registry +final class LocalRegistry implements RegistryInterface { private static string $kitsDir = __DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'kits'; diff --git a/src/Toolkit/src/Registry/RegistryFactory.php b/src/Toolkit/src/Registry/RegistryFactory.php index d9ed7151899..e9a0e50ecda 100644 --- a/src/Toolkit/src/Registry/RegistryFactory.php +++ b/src/Toolkit/src/Registry/RegistryFactory.php @@ -29,7 +29,7 @@ public function __construct( /** * @throws \InvalidArgumentException */ - public function getForKit(string $kit): Registry + public function getForKit(string $kit): RegistryInterface { $type = match (true) { GitHubRegistry::supports($kit) => Type::GitHub, diff --git a/src/Toolkit/src/Registry/Registry.php b/src/Toolkit/src/Registry/RegistryInterface.php similarity index 95% rename from src/Toolkit/src/Registry/Registry.php rename to src/Toolkit/src/Registry/RegistryInterface.php index fb7e602c843..246ddadac99 100644 --- a/src/Toolkit/src/Registry/Registry.php +++ b/src/Toolkit/src/Registry/RegistryInterface.php @@ -19,7 +19,7 @@ * @author Jean-François Lépine * @author Hugo Alliaume */ -interface Registry +interface RegistryInterface { public static function supports(string $kitName): bool;