From 66bde5f4c5025d566ceb8b1376d52e24e7c54166 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Tue, 2 May 2023 18:42:48 +0200 Subject: [PATCH] Add more precise types --- .../InitializedSymfonyExtensionEnvironment.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Context/Environment/InitializedSymfonyExtensionEnvironment.php b/src/Context/Environment/InitializedSymfonyExtensionEnvironment.php index 1a38591..8a40dd2 100644 --- a/src/Context/Environment/InitializedSymfonyExtensionEnvironment.php +++ b/src/Context/Environment/InitializedSymfonyExtensionEnvironment.php @@ -27,7 +27,10 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn /** @var Suite */ private $suite; - /** @var Context[] */ + /** + * @var array, Context> + * @psalm-var class-string-map + */ private $contexts = []; public function __construct(Suite $suite) @@ -74,6 +77,12 @@ public function hasContextClass($class): bool /** * @see http://behat.org/en/latest/cookbooks/accessing_contexts_from_each_other.html * + * @template T of Context + * + * @param class-string $class + * + * @return T + * * @throws ContextNotFoundException */ public function getContext(string $class): Context