Skip to content

Commit

Permalink
[phpstorm-stubs] mark some of parameters with psalm's positive-int
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Mar 7, 2022
1 parent ba04f8a commit 248e61f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function easter_date(?int $year, #[PhpStormStubsElementAvailable(from: '8.0')] i
/**
* Get number of days after March 21 on which Easter falls for a given year
* @link https://php.net/manual/en/function.easter-days.php
* @param int|null $year [optional] <p>
* @param positive-int|null $year [optional] <p>
* The year as a positive number
* </p>
* @param int $mode [optional] <p>
Expand Down
6 changes: 3 additions & 3 deletions gmp/gmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function gmp_sqrtrem(GMP|string|int $num): array {}
* </p>
* <p>It can be either a GMP number resource, or a
* numeric string given that it is possible to convert the latter to a number.</p>
* @param int $exponent <p>
* @param positive-int $exponent <p>
* The positive power to raise the <i>base</i>.
* </p>
* @return resource|GMP The new (raised) number, as a GMP number. The case of
Expand Down Expand Up @@ -693,7 +693,7 @@ function gmp_export(GMP|string|int $num, int $word_size = 1, int $flags = GMP_MS
* @link https://php.net/manual/en/function.gmp-root.php
* @param GMP|string|int $num <p>Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6
* and later, or a numeric string provided that it is possible to convert the latter to a number.</p>
* @param int $nth The positive root to take of a.
* @param positive-int $nth The positive root to take of a <b>num</b>.
* @return GMP The integer component of the resultant root, as a GMP number.
* @since 5.6
*/
Expand All @@ -705,7 +705,7 @@ function gmp_root(GMP|string|int $num, int $nth): GMP {}
* @link https://php.net/manual/en/function.gmp-rootrem.php
* @param GMP|string|int $num <p>Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6
* and later, or a numeric string provided that it is possible to convert the latter to a number.</p>
* @param int $nth The positive root to take of a.
* @param positive-int $nth The positive root to take of a <b>num</b>.
* @return array|GMP[] <p>A two element array, where the first element is the integer component of
* the root, and the second element is the remainder, both represented as GMP numbers.</p>
* @since 5.6
Expand Down
2 changes: 1 addition & 1 deletion openssl/openssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ function openssl_pkey_derive(
* <p>It also indicates if a cryptographically strong algorithm was used to produce the pseudo-random bytes,
* and does this via the optional crypto_strong parameter. It's rare for this to be FALSE, but some systems may be broken or old.</p>
* @link https://php.net/manual/en/function.openssl-random-pseudo-bytes.php
* @param int $length <p>
* @param positive-int $length <p>
* The length of the desired string of bytes. Must be a positive integer. PHP will
* try to cast this parameter to a non-null integer to use it.
* </p>
Expand Down
4 changes: 2 additions & 2 deletions standard/standard_0.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ function usleep(int $microseconds): void {}
/**
* Delay for a number of seconds and nanoseconds
* @link https://php.net/manual/en/function.time-nanosleep.php
* @param int $seconds <p>
* @param positive-int $seconds <p>
* Must be a positive integer.
* </p>
* @param int $nanoseconds <p>
* @param positive-int $nanoseconds <p>
* Must be a positive integer less than 1 billion.
* </p>
* @return bool|array true on success or false on failure.
Expand Down
2 changes: 1 addition & 1 deletion standard/standard_8.php
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ function array_fill_keys(array $keys, mixed $value): array {}
* @param mixed $end <p>
* The sequence is ended upon reaching the end value.
* </p>
* @param int|float $step [optional] <p>
* @param positive-int|float $step [optional] <p>
* If a step value is given, it will be used as the
* increment between elements in the sequence. step
* should be given as a positive number. If not specified,
Expand Down

0 comments on commit 248e61f

Please sign in to comment.