Skip to content

chore: add phpstan type assertion for assertContainsOnlyInstancesOf #6185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Framework/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,10 @@ final public static function assertContainsOnlyString(iterable $haystack, string

/**
* Asserts that a haystack contains only instances of a specified interface or class name.
*
* @param class-string $className
* @param iterable<mixed> $haystack
* @template T
* @phpstan-assert iterable<T> $haystack
* @param class-string<T> $className
* @param iterable<mixed> $haystack
*
* @throws Exception
* @throws ExpectationFailedException
Expand Down
6 changes: 4 additions & 2 deletions src/Framework/Assert/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,10 @@ function assertContainsOnlyString(iterable $haystack, string $message = ''): voi
/**
* Asserts that a haystack contains only instances of a specified interface or class name.
*
* @param class-string $className
* @param iterable<mixed> $haystack
* @template T
* @phpstan-assert iterable<T> $haystack
* @param class-string<T> $className
* @param iterable<mixed> $haystack
*
* @throws Exception
* @throws ExpectationFailedException
Expand Down
Loading