From faf90501175ce994f13918f414d0662aa5b9962f Mon Sep 17 00:00:00 2001 From: HypeMC <2445045+HypeMC@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:00:38 +0200 Subject: [PATCH] Fix using service locators with int keys (#337) Co-authored-by: Farhad Safarov --- src/Symfony/ContainerMeta.php | 5 ++++- tests/acceptance/container.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/ContainerMeta.php b/src/Symfony/ContainerMeta.php index e7d86bb..433c021 100644 --- a/src/Symfony/ContainerMeta.php +++ b/src/Symfony/ContainerMeta.php @@ -125,7 +125,10 @@ private function init(array $containerXmlPaths): void } } - private function addServiceLocator(string $key, string $id, Reference $reference): void + /** + * @param array-key $id + */ + private function addServiceLocator(string $key, mixed $id, Reference $reference): void { $this->serviceLocators[$key][$id] = (string) $reference; diff --git a/tests/acceptance/container.xml b/tests/acceptance/container.xml index 409c7d9..7b34076 100644 --- a/tests/acceptance/container.xml +++ b/tests/acceptance/container.xml @@ -84,6 +84,7 @@ +