Skip to content

Commit e8dfd3b

Browse files
Merge branch '11.4' into 11.5
2 parents 60d34d3 + 2631bd2 commit e8dfd3b

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

build/scripts/generate-global-assert-wrappers.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@
112112
$buffer .= <<<'EOT'
113113
if (!function_exists('PHPUnit\Framework\callback')) {
114114
/**
115-
* @psalm-template CallbackInput of mixed
115+
* @template CallbackInput of mixed
116116
*
117-
* @psalm-param callable(CallbackInput $callback): bool $callback
117+
* @param callable(CallbackInput $callback): bool $callback
118118
*
119-
* @psalm-return Callback<CallbackInput>
119+
* @return Callback<CallbackInput>
120120
*/
121121
function callback(callable $callback): Callback
122122
{
@@ -208,6 +208,9 @@ function returnValue(mixed $value): ReturnStub
208208
}
209209
210210
if (!function_exists('PHPUnit\Framework\returnValueMap')) {
211+
/**
212+
* @param array<mixed> $valueMap
213+
*/
211214
function returnValueMap(array $valueMap): ReturnValueMapStub
212215
{
213216
return new ReturnValueMapStub($valueMap);

src/Framework/Assert.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ final public static function assertArrayNotHasKey(int|string $key, array|ArrayAc
195195
}
196196

197197
/**
198+
* @phpstan-assert list $array
199+
*
198200
* @throws ExpectationFailedException
199201
*/
200202
final public static function assertIsList(mixed $array, string $message = ''): void

src/Framework/Assert/Functions.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ function assertArrayNotHasKey(int|string $key, array|ArrayAccess $array, string
193193

194194
if (!function_exists('PHPUnit\Framework\assertIsList')) {
195195
/**
196+
* @phpstan-assert list $array
197+
*
196198
* @throws ExpectationFailedException
197199
*
198200
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@@ -279,7 +281,8 @@ function assertNotContainsEquals(mixed $needle, iterable $haystack, string $mess
279281
/**
280282
* Asserts that a haystack contains only values of a given type.
281283
*
282-
* @param iterable<mixed> $haystack
284+
* @param 'array'|'bool'|'boolean'|'callable'|'double'|'float'|'int'|'integer'|'iterable'|'null'|'numeric'|'object'|'real'|'resource (closed)'|'resource'|'scalar'|'string' $type
285+
* @param iterable<mixed> $haystack
283286
*
284287
* @throws Exception
285288
* @throws ExpectationFailedException
@@ -298,6 +301,7 @@ function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeTyp
298301
/**
299302
* Asserts that a haystack contains only instances of a given class name.
300303
*
304+
* @param class-string $className
301305
* @param iterable<mixed> $haystack
302306
*
303307
* @throws Exception
@@ -317,7 +321,8 @@ function assertContainsOnlyInstancesOf(string $className, iterable $haystack, st
317321
/**
318322
* Asserts that a haystack does not contain only values of a given type.
319323
*
320-
* @param iterable<mixed> $haystack
324+
* @param 'array'|'bool'|'boolean'|'callable'|'double'|'float'|'int'|'integer'|'iterable'|'null'|'numeric'|'object'|'real'|'resource (closed)'|'resource'|'scalar'|'string' $type
325+
* @param iterable<mixed> $haystack
321326
*
322327
* @throws Exception
323328
* @throws ExpectationFailedException

0 commit comments

Comments
 (0)