Skip to content

Commit

Permalink
Add another round of missing parameter types to stubs
Browse files Browse the repository at this point in the history
Closes GH-5950
  • Loading branch information
kocsismate committed Aug 7, 2020
1 parent 7b9f37c commit 046cc5e
Show file tree
Hide file tree
Showing 45 changed files with 255 additions and 213 deletions.
1 change: 1 addition & 0 deletions ext/com_dotnet/com_extension.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function com_create_guid(): string|false {}
/** @param array|string|null $sinkinterface */
function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = UNKNOWN): bool {}

/** @param com|dotnet|variant|string $comobject */
function com_print_typeinfo($comobject, ?string $dispinterface = null, bool $wantsink = false): bool {}

function com_message_pump(int $timeoutms = 0): bool {}
Expand Down
2 changes: 1 addition & 1 deletion ext/com_dotnet/com_extension_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: caec4bba1103a07a86803ac0192782fef7d6680f */
* Stub hash: 48167f9ee38966beaf550cd0a7b07d873575b48e */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
Expand Down
7 changes: 6 additions & 1 deletion ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,12 @@ public static function __set_state(array $array) {}

class DatePeriod implements IteratorAggregate
{
/* Has an overloaded signature */
/**
* @param DateTimeInterface|string $start
* @param DateInterval|int $interval
* @param DateTimeInterface|int $end
* @param int $options
*/
public function __construct($start, $interval = UNKNOWN, $end = UNKNOWN, $options = UNKNOWN) {}

/** @return DateTimeInterface */
Expand Down
2 changes: 1 addition & 1 deletion ext/date/php_date_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: aa0e2c059662d4015658b85c932126b34934b5a4 */
* Stub hash: fee95924adec03c89fdd677ec26bb6eea34d4b3c */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)
Expand Down
7 changes: 6 additions & 1 deletion ext/exif/exif.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ function exif_tagname(int $index): string|false {}
/** @param resource|string $filename */
function exif_read_data($filename, ?string $sections_needed = null, bool $sub_arrays = false, bool $read_thumbnail = false): array|false {}

/** @param resource|string $filename */
/**
* @param resource|string $filename
* @param int $width
* @param int $height
* @param int $imagetype
*/
function exif_thumbnail($filename, &$width = null, &$height = null, &$imagetype = null): string|false {}

function exif_imagetype(string $filename): int|false {}
2 changes: 1 addition & 1 deletion ext/exif/exif_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 62f6ca1a43c69d917711eae9118caf5a658722d9 */
* Stub hash: d8cb3719a7de74b27b306c30b6be0af0647b6af4 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_tagname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
Expand Down
10 changes: 9 additions & 1 deletion ext/intl/calendar/calendar.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function isSet(int $field) {}
* @return bool
* @alias intlcal_set
*/
public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {}
public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {}

/**
* @return bool
Expand Down Expand Up @@ -283,6 +283,14 @@ public function toDateTime() {}

class IntlGregorianCalendar extends IntlCalendar
{
/**
* @param DateTimeZone|IntlTimeZone|string|int|null $timeZoneOrYear
* @param string|int|null $localeOrMonth
* @param int $dayOfMonth
* @param int $hour
* @param int $minute
* @param int $second
*/
public function __construct($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN) {}

/**
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/calendar/calendar_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 8b8a98d5035880031ac42fda5e58bde54c1d85fc */
* Stub hash: 3facb6bdce18efae3d6b9594d1fcddfb220dd54d */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -115,7 +115,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar_set, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dayOfMonth, IS_LONG, 0)
ZEND_ARG_INFO(0, hour)
ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, second, IS_LONG, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/collator/collator.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function compare(string $str1, string $str2) {}
* @return bool
* @alias collator_sort
*/
public function sort(array &$arr, $sort_flag = Collator::SORT_REGULAR) {}
public function sort(array &$arr, int $sort_flag = Collator::SORT_REGULAR) {}

/**
* @return bool
Expand Down
9 changes: 3 additions & 6 deletions ext/intl/collator/collator_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 95fee5001472494653e6a83467c3c0079ea70728 */
* Stub hash: 4cb1470cf2566c9d947be638c7d14a14a10290dd */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
Expand All @@ -14,17 +14,14 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sort, 0, 0, 1)
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, sort_flag, "Collator::SORT_REGULAR")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flag, IS_LONG, 0, "Collator::SORT_REGULAR")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sortWithSortKeys, 0, 0, 1)
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_asort, 0, 0, 1)
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flag, IS_LONG, 0, "Collator::SORT_REGULAR")
ZEND_END_ARG_INFO()
#define arginfo_class_Collator_asort arginfo_class_Collator_sort

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getAttribute, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
Expand Down
10 changes: 8 additions & 2 deletions ext/intl/converter/converter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ public function __construct(?string $destination_encoding = null, ?string $sourc
/** @return string|false */
public function convert(string $str, bool $reverse = false) {}

/** @return string|null */
/**
* @param int $error
* @return string|null
*/
public function fromUCallback(int $reason, array $source, int $codePoint, &$error) {}

/** @return array|false|null */
Expand Down Expand Up @@ -54,7 +57,10 @@ public function setSourceEncoding(string $encoding) {}
/** @return bool */
public function setSubstChars(string $chars) {}

/** @return string|null */
/**
* @param int $error
* @return string|null
*/
public function toUCallback(int $reason, string $source, string $codeUnits, &$error) {}

/** @return string|false */
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/converter/converter_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 3c63c9077f864e122292eef8655489549de9277a */
* Stub hash: 9eef3fe293c07ab77f4c8b6d8d53a3798f8a9865 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_UConverter___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination_encoding, IS_STRING, 1, "null")
Expand Down
2 changes: 2 additions & 0 deletions ext/intl/dateformat/dateformat.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ public function format($value) {}
public static function formatObject($object, $format = null, ?string $locale = null) {}

/**
* @param int $position
* @return int|float|false
* @alias datefmt_parse
*/
public function parse(string $value, &$position = null) {}

/**
* @param int $position
* @return array|false
* @alias datefmt_localtime
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/dateformat/dateformat_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 86faf2e51b67db2801ce691d4d24bfdae5feb6fc */
* Stub hash: e98080c0b9107da6a2bf3ce99929554eb9a3c70e */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
Expand Down
3 changes: 3 additions & 0 deletions ext/intl/formatter/formatter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static function create(string $locale, int $style, string $pattern = "")
public function format(int|float $value, int $type = NumberFormatter::TYPE_DEFAULT) {}

/**
* @param int $position
* @return int|float|false
* @alias numfmt_parse
*/
Expand All @@ -31,6 +32,8 @@ public function parse(string $value, int $type = NumberFormatter::TYPE_DOUBLE, &
public function formatCurrency(float $value, string $currency) {}

/**
* @param string $currency
* @param int $position
* @return float|false
* @alias numfmt_parse_currency
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/formatter/formatter_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 3ff6f141d025bccb37ff597089f00bcc72462627 */
* Stub hash: 041569278b83b65f67fb4848d00d5423e6728165 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
Expand Down
13 changes: 12 additions & 1 deletion ext/intl/php_intl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ function intlcal_get_error_code(IntlCalendar $calendar): int|false {}

function intlcal_get_error_message(IntlCalendar $calendar): string|false {}

/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
/**
* @param DateTimeZone|IntlTimeZone|string|int|null $timeZoneOrYear
* @param string|int|null $localeOrMonth
* @param int $dayOfMonth
* @param int $hour
* @param int $minute
* @param int $second
*/
function intlgregcal_create_instance($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN): ?IntlGregorianCalendar {}

function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $change): bool {}
Expand Down Expand Up @@ -393,6 +400,10 @@ function intltz_get_gmt(): IntlTimeZone {}

function intltz_get_id(IntlTimeZone $tz): string|false {}

/**
* @param int $rawOffset
* @param int $dstOffset
*/
function intltz_get_offset(IntlTimeZone $tz, float $date, bool $local, &$rawOffset, &$dstOffset): bool {}

function intltz_get_raw_offset(IntlTimeZone $tz): int {}
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/php_intl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: ef46b927a82d0bdecea9438ff6ba0000b73b3b56 */
* Stub hash: 57c63e06f2c6cf6c58a63081f19fe3e6d6901e88 */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
Expand Down
10 changes: 8 additions & 2 deletions ext/intl/spoofchecker/spoofchecker.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ class Spoofchecker
{
public function __construct() {}

/** @return bool */
/**
* @param int $error
* @return bool
*/
public function isSuspicious(string $text, &$error = null) {}

/** @return bool */
/**
* @param int $error
* @return bool
*/
public function areConfusable(string $s1, string $s2, &$error = null) {}

/** @return void */
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/spoofchecker/spoofchecker_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: dbcdb94753d19921594c48a735d6bd9194b02996 */
* Stub hash: 5f4ea7ab66c1748a8de076fca4b62a7d0a235598 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down
3 changes: 3 additions & 0 deletions ext/intl/timezone/timezone.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static function createTimeZoneIDEnumeration(int $zoneType, ?string $regio
public static function fromDateTimeZone(DateTimeZone $zone) {}

/**
* @param bool $isSystemID
* @return string|false
* @alias intltz_get_canonical_id
*/
Expand Down Expand Up @@ -92,6 +93,8 @@ public static function getGMT() {}
public function getID() {}

/**
* @param int $rawOffset
* @param int $dstOffset
* @return bool
* @alias intltz_get_offset
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/timezone/timezone_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: df98b2edbdf806c52a9c165b52124b6b0de7acb2 */
* Stub hash: 94e3c8228a0625a2c5825b0747fb1e5e08808b50 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/uchar/uchar.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function enumCharTypes(callable $callback) {}
public static function foldCase(int|string $codepoint, int $options = IntlChar::FOLD_CASE_DEFAULT) {}

/** @return int */
public static function forDigit(int $digit, $radix = 10) {}
public static function forDigit(int $digit, int $radix = 10) {}

#if U_ICU_VERSION_MAJOR_NUM >= 52
/** @return int|string|null */
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/uchar/uchar_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 2f9658fe9c23180244786ed48a5ca542b7ed95ea */
* Stub hash: 61f9c0a6c5048d25e070379f2f98fa10f8ce25ee */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 0, 2)
ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL)
Expand Down Expand Up @@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_forDigit, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, digit, IS_LONG, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, radix, "10")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, radix, IS_LONG, 0, "10")
ZEND_END_ARG_INFO()

#if U_ICU_VERSION_MAJOR_NUM >= 52
Expand Down
5 changes: 5 additions & 0 deletions ext/ldap/ldap.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ function ldap_parse_reference($link, $entry, &$referrals): bool {}
/**
* @param resource $link
* @param resource $result
* @param int $errcode
* @param string $matcheddn
* @param string $errmsg
* @param array $referrals
* @param array $serverctrls
*/
function ldap_parse_result($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, &$referrals = null, &$serverctrls = null): bool {}
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/ldap/ldap_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: fb889b72e823f3033a54209059f8c6803961cef3 */
* Stub hash: 6b5e8ddfbdc436fab3a263d6922146ca7c2f3845 */

#if defined(HAVE_ORALDAP)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/mysqli.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function bind_param(string $types, mixed &...$vars) {}
* @return bool
* @alias mysqli_stmt_bind_result
*/
public function bind_result(&...$vars) {}
public function bind_result(mixed &...$vars) {}

/**
* @return bool
Expand Down
4 changes: 2 additions & 2 deletions ext/mysqli/mysqli_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 0fb73727b9ca9f4fa9827fecd948b60948ddc423 */
* Stub hash: 9f7063a0495441cb184f15b895771a32e8ef3195 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0)
Expand Down Expand Up @@ -641,7 +641,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, 0)
ZEND_ARG_VARIADIC_INFO(1, vars)
ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0)
ZEND_END_ARG_INFO()

#define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_character_set_name
Expand Down
10 changes: 8 additions & 2 deletions ext/pcntl/pcntl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

function pcntl_fork(): int {}

/** @param int $status */
/**
* @param int $status
* @param array $rusage
*/
function pcntl_waitpid(int $pid, &$status, int $options = 0, &$rusage = []): int {}

/** @param int $status */
/**
* @param int $status
* @param array $rusage
*/
function pcntl_wait(&$status, int $options = 0, &$rusage = []): int {}

/** @param callable|int $handler */
Expand Down
2 changes: 1 addition & 1 deletion ext/pcntl/pcntl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 243017c5440bff0b3ee3296705d8455d0fac5b7e */
* Stub hash: df744f88533ce9b84864fa2aa4dd7a5b7373231d */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/pdo_dbh.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function lastInsertId(?string $name = null) {}
public function prepare(string $statement, array $driver_options = []) {}

/** @return PDOStatement|false */
public function query(string $statement, ?int $fetch_mode = null, ...$fetch_mode_args) {}
public function query(string $statement, ?int $fetch_mode = null, mixed ...$fetch_mode_args) {}

/** @return string|false */
public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {}
Expand Down

0 comments on commit 046cc5e

Please sign in to comment.