Skip to content

Commit c25f3f3

Browse files
authored
Merge pull request #201 from yguedidi/add-more-precise-types
Add more precise types
2 parents 432d21b + 66bde5f commit c25f3f3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Context/Environment/InitializedSymfonyExtensionEnvironment.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn
2727
/** @var Suite */
2828
private $suite;
2929

30-
/** @var Context[] */
30+
/**
31+
* @var array<class-string<Context>, Context>
32+
* @psalm-var class-string-map<T as Context, T>
33+
*/
3134
private $contexts = [];
3235

3336
public function __construct(Suite $suite)
@@ -74,6 +77,12 @@ public function hasContextClass($class): bool
7477
/**
7578
* @see http://behat.org/en/latest/cookbooks/accessing_contexts_from_each_other.html
7679
*
80+
* @template T of Context
81+
*
82+
* @param class-string<T> $class
83+
*
84+
* @return T
85+
*
7786
* @throws ContextNotFoundException
7887
*/
7988
public function getContext(string $class): Context

0 commit comments

Comments
 (0)