Skip to content

Commit

Permalink
Merge pull request #201 from yguedidi/add-more-precise-types
Browse files Browse the repository at this point in the history
Add more precise types
  • Loading branch information
Yozhef authored Sep 12, 2023
2 parents 432d21b + 66bde5f commit c25f3f3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn
/** @var Suite */
private $suite;

/** @var Context[] */
/**
* @var array<class-string<Context>, Context>
* @psalm-var class-string-map<T as Context, T>
*/
private $contexts = [];

public function __construct(Suite $suite)
Expand Down Expand Up @@ -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<T> $class
*
* @return T
*
* @throws ContextNotFoundException
*/
public function getContext(string $class): Context
Expand Down

0 comments on commit c25f3f3

Please sign in to comment.