Skip to content

Commit

Permalink
More precise assert type for Assert::integerish methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-zacek authored and ondrejmirtes committed Aug 5, 2024
1 parent 923bd58 commit e2ee76a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions stubs/Assert.stub
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,44 @@ class Assert
*/
public static function isNonEmptyMap($array, $message = ''): void;

/**
* @phpstan-assert int|numeric-string $value
*
* @param mixed $value
* @param string $message
*
* @throws InvalidArgumentException
*/
public static function integerish($value, $message = ''): void;

/**
* @phpstan-assert int|numeric-string|null $value
*
* @param mixed $value
* @param string $message
*
* @throws InvalidArgumentException
*/
public static function nullOrIntegerish($value, $message = ''): void;

/**
* @phpstan-assert iterable<int|numeric-string> $value
*
* @param mixed $value
* @param string $message
*
* @throws InvalidArgumentException
*/
public static function allIntegerish($value, $message = ''): void;

/**
* @phpstan-assert iterable<int|numeric-string|null> $value
*
* @param mixed $value
* @param string $message
*
* @throws InvalidArgumentException
*/
public static function allNullOrIntegerish($value, $message = ''): void;

}

0 comments on commit e2ee76a

Please sign in to comment.