Skip to content

Commit 8f64893

Browse files
committed
Fix signatures
1 parent 881fb01 commit 8f64893

File tree

2 files changed

+26
-32
lines changed

2 files changed

+26
-32
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ function link(string $target, string $link): bool {}
648648
function ezmlm_hash(string $str): int {}
649649

650650
/** @param string|array $additional_headers */
651-
function mail(string $to, string $subject, string $message, $additional_headers = UNKNOWN, $additional_parameters = ""): bool {}
651+
function mail(string $to, string $subject, string $message, $additional_headers = UNKNOWN, string $additional_parameters = ""): bool {}
652652

653653
/* math.c */
654654

@@ -662,8 +662,7 @@ function ceil(float $number): float {}
662662

663663
function floor(float $number): float {}
664664

665-
/** @return float|false */
666-
function round($number, int $precision = 0, int $mode = PHP_ROUND_HALF_UP) {}
665+
function round($number, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float {}
667666

668667
function sin(float $number): float {}
669668

@@ -705,13 +704,13 @@ function intdiv(int $dividend, int $divisor): int {}
705704

706705
function is_infinite(float $number): bool {}
707706

708-
/** @return int|float */
707+
/** @return mixed */
709708
function pow($base, $exp) {}
710709

711710
function exp(float $number): float {}
712711

713712
/** @return float|false */
714-
function log(float $number, float $base = UNKNOWN) {}
713+
function log(float $number, float $base = M_E) {}
715714

716715
function log10(float $number): float {}
717716

@@ -738,10 +737,9 @@ function decoct($number): string {}
738737

739738
function dechex($number): string {}
740739

741-
/** @return string|false */
742-
function base_convert($number, int $frombase, int $tobase) {}
740+
function base_convert($number, int $frombase, int $tobase): string {}
743741

744-
function number_format(float $number, int $decimals = 0, string $decimal_point = "." , string $thousands_separator = ","): string {}
742+
function number_format(float $number, int $decimals = 0, ?string $decimal_point = "." , ?string $thousands_separator = ","): string {}
745743

746744
function fmod(float $x, float $y): float {}
747745

@@ -775,9 +773,9 @@ function unpack(string $format, string $data, int $offset = 0) {}
775773
function password_get_info(string $hash): ?array {}
776774

777775
/** @return string|false */
778-
function password_hash(string $password, $algo, $options = UNKNOWN) {}
776+
function password_hash(string $password, $algo, array $options = []) {}
779777

780-
function password_needs_rehash(string $hash, $algo, $options = UNKNOWN): bool {}
778+
function password_needs_rehash(string $hash, $algo, array $options = []): bool {}
781779

782780
function password_verify(string $password, string $hash): bool {}
783781

@@ -789,19 +787,13 @@ function password_algos(): array {}
789787
/** @return resource|false */
790788
function proc_open($cmd, array $descriptorspec, &$pipes, ?string $cwd = null, ?array $env = null, ?array $other_options = null) {}
791789

792-
/**
793-
* @param resource $process
794-
* @return int|false
795-
*/
796-
function proc_close($process) {}
790+
/** @param resource $process */
791+
function proc_close($process): int {}
797792

798-
function proc_terminate($process, $signal = SIGTERM): bool {}
793+
function proc_terminate($process, int $signal = SIGTERM): bool {}
799794

800-
/**
801-
* @param resource $process
802-
* @return array|false
803-
*/
804-
function proc_get_status($process) {}
795+
/** @param resource $process */
796+
function proc_get_status($process): array {}
805797
#endif
806798

807799
/* quot_print.c */
@@ -815,7 +807,7 @@ function quoted_printable_encode(string $str): string {}
815807
function mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {}
816808

817809
/** @return int|false */
818-
function mt_rand(int $min = 0, int $max = UNKNOWN) {}
810+
function mt_rand(int $min = 0, int $max = PHP_INT_MAX) {}
819811

820812
function mt_getrandmax(): int {}
821813

ext/standard/basic_functions_arginfo.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mail, 0, 3, _IS_BOOL, 0)
874874
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
875875
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
876876
ZEND_ARG_INFO(0, additional_headers)
877-
ZEND_ARG_INFO(0, additional_parameters)
877+
ZEND_ARG_TYPE_INFO(0, additional_parameters, IS_STRING, 0)
878878
ZEND_END_ARG_INFO()
879879

880880
ZEND_BEGIN_ARG_INFO_EX(arginfo_abs, 0, 0, 1)
@@ -887,7 +887,7 @@ ZEND_END_ARG_INFO()
887887

888888
#define arginfo_floor arginfo_ceil
889889

890-
ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
890+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_round, 0, 1, IS_DOUBLE, 0)
891891
ZEND_ARG_INFO(0, number)
892892
ZEND_ARG_TYPE_INFO(0, precision, IS_LONG, 0)
893893
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
@@ -986,7 +986,7 @@ ZEND_END_ARG_INFO()
986986

987987
#define arginfo_dechex arginfo_decbin
988988

989-
ZEND_BEGIN_ARG_INFO_EX(arginfo_base_convert, 0, 0, 3)
989+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base_convert, 0, 3, IS_STRING, 0)
990990
ZEND_ARG_INFO(0, number)
991991
ZEND_ARG_TYPE_INFO(0, frombase, IS_LONG, 0)
992992
ZEND_ARG_TYPE_INFO(0, tobase, IS_LONG, 0)
@@ -995,8 +995,8 @@ ZEND_END_ARG_INFO()
995995
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_number_format, 0, 1, IS_STRING, 0)
996996
ZEND_ARG_TYPE_INFO(0, number, IS_DOUBLE, 0)
997997
ZEND_ARG_TYPE_INFO(0, decimals, IS_LONG, 0)
998-
ZEND_ARG_TYPE_INFO(0, decimal_point, IS_STRING, 0)
999-
ZEND_ARG_TYPE_INFO(0, thousands_separator, IS_STRING, 0)
998+
ZEND_ARG_TYPE_INFO(0, decimal_point, IS_STRING, 1)
999+
ZEND_ARG_TYPE_INFO(0, thousands_separator, IS_STRING, 1)
10001000
ZEND_END_ARG_INFO()
10011001

10021002
#define arginfo_fmod arginfo_hypot
@@ -1042,13 +1042,13 @@ ZEND_END_ARG_INFO()
10421042
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_hash, 0, 0, 2)
10431043
ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
10441044
ZEND_ARG_INFO(0, algo)
1045-
ZEND_ARG_INFO(0, options)
1045+
ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0)
10461046
ZEND_END_ARG_INFO()
10471047

10481048
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_needs_rehash, 0, 2, _IS_BOOL, 0)
10491049
ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
10501050
ZEND_ARG_INFO(0, algo)
1051-
ZEND_ARG_INFO(0, options)
1051+
ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0)
10521052
ZEND_END_ARG_INFO()
10531053

10541054
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_verify, 0, 2, _IS_BOOL, 0)
@@ -1070,20 +1070,22 @@ ZEND_END_ARG_INFO()
10701070
#endif
10711071

10721072
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
1073-
ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_close, 0, 0, 1)
1073+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_close, 0, 1, IS_LONG, 0)
10741074
ZEND_ARG_INFO(0, process)
10751075
ZEND_END_ARG_INFO()
10761076
#endif
10771077

10781078
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
10791079
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_terminate, 0, 1, _IS_BOOL, 0)
10801080
ZEND_ARG_INFO(0, process)
1081-
ZEND_ARG_INFO(0, signal)
1081+
ZEND_ARG_TYPE_INFO(0, signal, IS_LONG, 0)
10821082
ZEND_END_ARG_INFO()
10831083
#endif
10841084

10851085
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
1086-
#define arginfo_proc_get_status arginfo_proc_close
1086+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_get_status, 0, 1, IS_ARRAY, 0)
1087+
ZEND_ARG_INFO(0, process)
1088+
ZEND_END_ARG_INFO()
10871089
#endif
10881090

10891091
#define arginfo_quoted_printable_decode arginfo_base64_encode

0 commit comments

Comments
 (0)