Skip to content

Commit e2ee76a

Browse files
kamil-zacekondrejmirtes
authored andcommitted
More precise assert type for Assert::integerish methods
1 parent 923bd58 commit e2ee76a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

stubs/Assert.stub

+40
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,44 @@ class Assert
2323
*/
2424
public static function isNonEmptyMap($array, $message = ''): void;
2525

26+
/**
27+
* @phpstan-assert int|numeric-string $value
28+
*
29+
* @param mixed $value
30+
* @param string $message
31+
*
32+
* @throws InvalidArgumentException
33+
*/
34+
public static function integerish($value, $message = ''): void;
35+
36+
/**
37+
* @phpstan-assert int|numeric-string|null $value
38+
*
39+
* @param mixed $value
40+
* @param string $message
41+
*
42+
* @throws InvalidArgumentException
43+
*/
44+
public static function nullOrIntegerish($value, $message = ''): void;
45+
46+
/**
47+
* @phpstan-assert iterable<int|numeric-string> $value
48+
*
49+
* @param mixed $value
50+
* @param string $message
51+
*
52+
* @throws InvalidArgumentException
53+
*/
54+
public static function allIntegerish($value, $message = ''): void;
55+
56+
/**
57+
* @phpstan-assert iterable<int|numeric-string|null> $value
58+
*
59+
* @param mixed $value
60+
* @param string $message
61+
*
62+
* @throws InvalidArgumentException
63+
*/
64+
public static function allNullOrIntegerish($value, $message = ''): void;
65+
2666
}

0 commit comments

Comments
 (0)