Skip to content

Commit 100bb8e

Browse files
committed
chore: add phpstan type assertion for assertContainsOnlyInstancesOf
1 parent f681fb1 commit 100bb8e

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/Framework/Assert.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,10 @@ final public static function assertContainsOnlyString(iterable $haystack, string
568568

569569
/**
570570
* Asserts that a haystack contains only instances of a specified interface or class name.
571-
*
572-
* @param class-string $className
573-
* @param iterable<mixed> $haystack
571+
* @template T
572+
* @phpstan-assert iterable<T> $haystack
573+
* @param class-string<T> $className
574+
* @param iterable<mixed> $haystack
574575
*
575576
* @throws Exception
576577
* @throws ExpectationFailedException

src/Framework/Assert/Functions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,10 @@ function assertContainsOnlyString(iterable $haystack, string $message = ''): voi
531531
/**
532532
* Asserts that a haystack contains only instances of a specified interface or class name.
533533
*
534-
* @param class-string $className
535-
* @param iterable<mixed> $haystack
534+
* @template T
535+
* @phpstan-assert iterable<T> $haystack
536+
* @param class-string<T> $className
537+
* @param iterable<mixed> $haystack
536538
*
537539
* @throws Exception
538540
* @throws ExpectationFailedException

0 commit comments

Comments
 (0)