Merge pull request #201 from yguedidi/add-more-precise-types

Add more precise types
This commit is contained in:
Yozhef
2023-09-12 12:36:17 +03:00
committed by GitHub

View File

@@ -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)
@@ -74,6 +77,12 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn
/**
* @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