@@ -966,27 +966,19 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
966966
967967 $ container ->setDefinition ('ai.store.distance_calculator. ' .$ name , $ distanceCalculatorDefinition );
968968
969- $ arguments = [
970- new Reference ($ store ['service ' ]),
971- new Reference ('ai.store.distance_calculator. ' .$ name ),
972- $ store ['cache_key ' ] ?? $ name ,
973- ];
974-
975969 if (\array_key_exists ('strategy ' , $ store ) && null !== $ store ['strategy ' ]) {
976- if (!$ container ->hasDefinition ('ai.store.distance_calculator. ' .$ name )) {
977- $ distanceCalculatorDefinition = new Definition (DistanceCalculator::class);
978- $ distanceCalculatorDefinition ->setLazy (true );
979- $ distanceCalculatorDefinition ->setArgument (0 , DistanceStrategy::from ($ store ['strategy ' ]));
980-
981- $ container ->setDefinition ('ai.store.distance_calculator. ' .$ name , $ distanceCalculatorDefinition );
982-
983- $ arguments [1 ] = new Reference ('ai.store.distance_calculator. ' .$ name );
970+ $ distanceCalculatorDefinition = $ container ->getDefinition ('ai.store.distance_calculator. ' .$ name );
971+ $ distanceCalculatorDefinition ->setArgument (0 , DistanceStrategy::from ($ store ['strategy ' ]));
984972 }
985973
986974 $ definition = new Definition (LocalCacheStore::class);
987975 $ definition
988976 ->setLazy (true )
989- ->setArguments ($ arguments )
977+ ->setArguments ([
978+ new Reference ($ store ['service ' ]),
979+ new Reference ('ai.store.distance_calculator. ' .$ name ),
980+ $ store ['cache_key ' ] ?? $ name ,
981+ ])
990982 ->addTag ('proxy ' , ['interface ' => StoreInterface::class])
991983 ->addTag ('proxy ' , ['interface ' => ManagedStoreInterface::class])
992984 ->addTag ('ai.store ' );
@@ -1338,6 +1330,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
13381330 ->setLazy (true )
13391331 ->setArguments ($ arguments )
13401332 ->addTag ('proxy ' , ['interface ' => StoreInterface::class])
1333+ ->addTag ('proxy ' , ['interface ' => ManagedStoreInterface::class])
13411334 ->addTag ('ai.store ' );
13421335
13431336 $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
0 commit comments