Skip to content

Commit

Permalink
refactor(Elasticsearch): update container type hint in connection method
Browse files Browse the repository at this point in the history
- Change container type hint from Hyperf\Di\Container to Psr\Container\ContainerInterface for better compatibility and adherence to PSR standards.
  • Loading branch information
huangdijia committed Dec 13, 2024
1 parent 919180d commit ce18db3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Facade/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function __callStatic(mixed $method, mixed $params): mixed

public static function connection(string $connection = 'default'): Client
{
/** @var \Hyperf\Di\Container $container */
/** @var \Psr\Container\ContainerInterface $container */
$container = ApplicationContext::getContainer();
/** @var array{hosts?:string|array} $config */
$config = $container->get(ConfigInterface::class)->get('elasticsearch.' . $connection, null);
Expand Down

0 comments on commit ce18db3

Please sign in to comment.