Skip to content

Commit

Permalink
Fix using service locators with int keys (#337)
Browse files Browse the repository at this point in the history
Co-authored-by: Farhad Safarov <farhad.safarov@gmail.com>
  • Loading branch information
HypeMC and seferov authored Jun 5, 2024
1 parent 2ee2ae1 commit faf9050
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/ContainerMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<argument key="dummy_service_with_locator2" type="service" id="Psalm\SymfonyPsalmPlugin\Tests\Fixture\DummyPrivateService"/>
<argument key="dummy_service_with_locator3" type="service_closure" id="Psalm\SymfonyPsalmPlugin\Tests\Fixture\DummyPrivateService"/>
<argument key="validator" type="service" id="debug.validator"/>
<argument key="1234" type="service" id="Psalm\SymfonyPsalmPlugin\Tests\Fixture\DummyPrivateService"/>
</argument>
</service>
</services>
Expand Down

0 comments on commit faf9050

Please sign in to comment.