Skip to content

Declare the missing true return types #13709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/fileinfo/fileinfo.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ public function file(string $filename, int $flags = FILEINFO_NONE, $context = nu
public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}

/**
* @return bool
* @alias finfo_set_flags
* @tentative-return-type
*/
public function set_flags(int $flags) {} // TODO make return type void
public function set_flags(int $flags): true {}
}

/** @refcount 1 */
function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): finfo|false {}

function finfo_close(finfo $finfo): bool {}

function finfo_set_flags(finfo $finfo, int $flags): bool {} // TODO make return type void
function finfo_set_flags(finfo $finfo, int $flags): true {}

/**
* @param resource|null $context
Expand Down
6 changes: 3 additions & 3 deletions ext/fileinfo/fileinfo_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions ext/intl/calendar/calendar.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ public function after(IntlCalendar $other): bool {}
public function before(IntlCalendar $other): bool {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_clear
*/
public function clear(?int $field = null) {} // TODO make return type void
public function clear(?int $field = null): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -224,10 +224,10 @@ public function getMaximum(int $field): int|false {}
public function getMinimalDaysInFirstWeek(): int|false {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_set_minimal_days_in_first_week
*/
public function setMinimalDaysInFirstWeek(int $days) {} // TODO make return void
public function setMinimalDaysInFirstWeek(int $days): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -315,38 +315,38 @@ public function roll(int $field, $value): bool {}
public function isSet(int $field): bool {}

/**
* @return true
* @tentative-return-type
* @implementation-alias intlcal_set
*/
public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {} // TODO make return type void
public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): true {}

public function setDate(int $year, int $month, int $dayOfMonth): void {}

public function setDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, ?int $second = null): void {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_set_first_day_of_week
*/
public function setFirstDayOfWeek(int $dayOfWeek) {} // TODO make return type void
public function setFirstDayOfWeek(int $dayOfWeek): true {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_set_lenient
*/
public function setLenient(bool $lenient) {} // TODO make return type void
public function setLenient(bool $lenient): true {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_set_repeated_wall_time_option
*/
public function setRepeatedWallTimeOption(int $option) {} // TODO make return type void
public function setRepeatedWallTimeOption(int $option): true {}

/**
* @return true
* @tentative-return-type
* @alias intlcal_set_skipped_wall_time_option
*/
public function setSkippedWallTimeOption(int $option) {} // TODO make return type void
public function setSkippedWallTimeOption(int $option): true {}

/**
* @tentative-return-type
Expand Down
14 changes: 7 additions & 7 deletions ext/intl/calendar/calendar_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/intl/collator/collator.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ public function setAttribute(int $attribute, int $value): bool {}
public function getStrength(): int {}

/**
* @return bool
* @tentative-return-type
* @alias collator_set_strength
*/
public function setStrength(int $strength) {} // TODO make return type void
public function setStrength(int $strength): true {}

/**
* @tentative-return-type
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/collator/collator_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/intl/locale/locale.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class Locale
public static function getDefault(): string {}

/**
* @return bool
* @tentative-return-type
* @alias locale_set_default
*/
public static function setDefault(string $locale) {} // TODO make return type void
public static function setDefault(string $locale): true {}

/**
* @tentative-return-type
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/locale/locale_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/intl/php_intl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function collator_set_attribute(Collator $object, int $attribute, int $value): b

function collator_get_strength(Collator $object): int {}

function collator_set_strength(Collator $object, int $strength): bool {}
function collator_set_strength(Collator $object, int $strength): true {}

function collator_sort(Collator $object, array &$array, int $flags = Collator::SORT_REGULAR): bool {}

Expand Down Expand Up @@ -461,7 +461,7 @@ function idn_to_utf8(string $domain, int $flags = IDNA_DEFAULT, int $variant = I

function locale_get_default(): string {}

function locale_set_default(string $locale): bool {}
function locale_set_default(string $locale): true {}

function locale_get_primary_language(string $locale): ?string {}

Expand Down
6 changes: 3 additions & 3 deletions ext/intl/php_intl_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions ext/mysqli/mysqli.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,10 @@ public function change_user(string $username, #[\SensitiveParameter] string $pas
public function character_set_name(): string {}

/**
* @return true
* @tentative-return-type
* @alias mysqli_close
*/
public function close() {} // TODO make return type void
public function close(): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -806,11 +806,11 @@ public function connect(
public function dump_debug_info(): bool {}

/**
* @return true
* @tentative-return-type
* @alias mysqli_debug
* @no-verify Should really be a static method
*/
public function debug(string $options) {} // TODO make return type void
public function debug(string $options): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -986,7 +986,7 @@ public function options(int $option, $value): bool {}
public function set_opt(int $option, $value): bool {}

/**
* @return true
* @tentative-return-type
* @alias mysqli_ssl_set
*/
public function ssl_set(
Expand All @@ -995,7 +995,7 @@ public function ssl_set(
?string $ca_certificate,
?string $ca_path,
?string $cipher_algos
) {} // TODO make return type void
): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -1142,7 +1142,7 @@ public function fetch_column(int $column = 0): null|int|float|string|false {}
* @tentative-return-type
* @alias mysqli_field_seek
*/
public function field_seek(int $index): true {} // TODO make return type void
public function field_seek(int $index): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -1238,10 +1238,10 @@ public function bind_param(string $types, mixed &...$vars): bool {}
public function bind_result(mixed &...$vars): bool {}

/**
* @return true
* @tentative-return-type
* @alias mysqli_stmt_close
*/
public function close() {} // TODO make return type void
public function close(): true {}

/**
* @tentative-return-type
Expand Down Expand Up @@ -1360,7 +1360,7 @@ function mysqli_change_user(mysqli $mysql, string $username, #[\SensitiveParamet
/** @refcount 1 */
function mysqli_character_set_name(mysqli $mysql): string {}

function mysqli_close(mysqli $mysql): true {} // TODO make return type void
function mysqli_close(mysqli $mysql): true {}

function mysqli_commit(mysqli $mysql, int $flags = 0, ?string $name = null): bool {}

Expand All @@ -1385,7 +1385,7 @@ function mysqli_data_seek(mysqli_result $result, int $offset): bool {}

function mysqli_dump_debug_info(mysqli $mysql): bool {}

function mysqli_debug(string $options): true {} // TODO make return type void
function mysqli_debug(string $options): true {}

function mysqli_errno(mysqli $mysql): int {}

Expand Down Expand Up @@ -1454,7 +1454,7 @@ function mysqli_fetch_column(mysqli_result $result, int $column = 0): null|int|f

function mysqli_field_count(mysqli $mysql): int {}

function mysqli_field_seek(mysqli_result $result, int $index): true {} // TODO make return type void
function mysqli_field_seek(mysqli_result $result, int $index): true {}

function mysqli_field_tell(mysqli_result $result): int {}

Expand Down Expand Up @@ -1652,7 +1652,7 @@ function mysqli_ssl_set(
?string $ca_certificate,
?string $ca_path,
?string $cipher_algos
): true {} // TODO make return type void
): true {}

/** @refcount 1 */
function mysqli_stat(mysqli $mysql): string|false {}
Expand Down
Loading