From aaeb79cc198d40b9942f39285d20e962c219b1a6 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 6 Jan 2025 10:21:53 +0900 Subject: [PATCH] Remove unnecessary singleton scopes and add new binding. Removed singleton scope from several bindings to allow better flexibility and lifecycle control. Added a new binding for `RefreshSameCommand` to expand functionality. --- src/QueryRepositoryModule.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/QueryRepositoryModule.php b/src/QueryRepositoryModule.php index e78b9adb..6b3e12a8 100644 --- a/src/QueryRepositoryModule.php +++ b/src/QueryRepositoryModule.php @@ -60,12 +60,12 @@ protected function configure(): void // core $this->bind(QueryRepositoryInterface::class)->to(QueryRepository::class)->in(Scope::SINGLETON); $this->bind(CacheDependencyInterface::class)->to(CacheDependency::class); - $this->bind(EtagSetterInterface::class)->to(EtagSetter::class)->in(Scope::SINGLETON); - $this->bind(NamedParameterInterface::class)->to(NamedParameter::class)->in(Scope::SINGLETON); + $this->bind(EtagSetterInterface::class)->to(EtagSetter::class); + $this->bind(NamedParameterInterface::class)->to(NamedParameter::class); $this->bind(ResourceStorageInterface::class)->to(ResourceStorage::class)->in(Scope::SINGLETON); - $this->bind(MatchQueryInterface::class)->to(MatchQuery::class)->in(Scope::SINGLETON); - $this->bind(UriTag::class)->in(Scope::SINGLETON); + $this->bind(MatchQueryInterface::class)->to(MatchQuery::class); $this->bind(RefreshAnnotatedCommand::class); + $this->bind(RefreshSameCommand::class); $this->bind(ResourceStorageSaver::class); // #[Cacheable] $this->install(new CacheableModule());