Skip to content

Commit b4317c9

Browse files
committed
Declare the missing true return types
We have previously gave up on making these return types void.
1 parent 94d18cb commit b4317c9

24 files changed

+126
-121
lines changed

ext/fileinfo/fileinfo.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ public function file(string $filename, int $flags = FILEINFO_NONE, $context = nu
8383
public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}
8484

8585
/**
86-
* @return bool
8786
* @alias finfo_set_flags
87+
* @tentative-return-type
8888
*/
89-
public function set_flags(int $flags) {} // TODO make return type void
89+
public function set_flags(int $flags): true {}
9090
}
9191

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

9595
function finfo_close(finfo $finfo): bool {}
9696

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

9999
/**
100100
* @param resource|null $context

ext/fileinfo/fileinfo_arginfo.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/calendar/calendar.stub.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ public function after(IntlCalendar $other): bool {}
127127
public function before(IntlCalendar $other): bool {}
128128

129129
/**
130-
* @return true
130+
* @tentative-return-type
131131
* @alias intlcal_clear
132132
*/
133-
public function clear(?int $field = null) {} // TODO make return type void
133+
public function clear(?int $field = null): true {}
134134

135135
/**
136136
* @tentative-return-type
@@ -224,10 +224,10 @@ public function getMaximum(int $field): int|false {}
224224
public function getMinimalDaysInFirstWeek(): int|false {}
225225

226226
/**
227-
* @return true
227+
* @tentative-return-type
228228
* @alias intlcal_set_minimal_days_in_first_week
229229
*/
230-
public function setMinimalDaysInFirstWeek(int $days) {} // TODO make return void
230+
public function setMinimalDaysInFirstWeek(int $days): true {}
231231

232232
/**
233233
* @tentative-return-type
@@ -315,38 +315,38 @@ public function roll(int $field, $value): bool {}
315315
public function isSet(int $field): bool {}
316316

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

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

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

327327
/**
328-
* @return true
328+
* @tentative-return-type
329329
* @alias intlcal_set_first_day_of_week
330330
*/
331-
public function setFirstDayOfWeek(int $dayOfWeek) {} // TODO make return type void
331+
public function setFirstDayOfWeek(int $dayOfWeek): true {}
332332

333333
/**
334-
* @return true
334+
* @tentative-return-type
335335
* @alias intlcal_set_lenient
336336
*/
337-
public function setLenient(bool $lenient) {} // TODO make return type void
337+
public function setLenient(bool $lenient): true {}
338338

339339
/**
340-
* @return true
340+
* @tentative-return-type
341341
* @alias intlcal_set_repeated_wall_time_option
342342
*/
343-
public function setRepeatedWallTimeOption(int $option) {} // TODO make return type void
343+
public function setRepeatedWallTimeOption(int $option): true {}
344344

345345
/**
346-
* @return true
346+
* @tentative-return-type
347347
* @alias intlcal_set_skipped_wall_time_option
348348
*/
349-
public function setSkippedWallTimeOption(int $option) {} // TODO make return type void
349+
public function setSkippedWallTimeOption(int $option): true {}
350350

351351
/**
352352
* @tentative-return-type

ext/intl/calendar/calendar_arginfo.h

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/collator/collator.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ public function setAttribute(int $attribute, int $value): bool {}
126126
public function getStrength(): int {}
127127

128128
/**
129-
* @return bool
129+
* @tentative-return-type
130130
* @alias collator_set_strength
131131
*/
132-
public function setStrength(int $strength) {} // TODO make return type void
132+
public function setStrength(int $strength): true {}
133133

134134
/**
135135
* @tentative-return-type

ext/intl/collator/collator_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/locale/locale.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class Locale
3232
public static function getDefault(): string {}
3333

3434
/**
35-
* @return bool
35+
* @tentative-return-type
3636
* @alias locale_set_default
3737
*/
38-
public static function setDefault(string $locale) {} // TODO make return type void
38+
public static function setDefault(string $locale): true {}
3939

4040
/**
4141
* @tentative-return-type

ext/intl/locale/locale_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/php_intl.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function collator_set_attribute(Collator $object, int $attribute, int $value): b
300300

301301
function collator_get_strength(Collator $object): int {}
302302

303-
function collator_set_strength(Collator $object, int $strength): bool {}
303+
function collator_set_strength(Collator $object, int $strength): true {}
304304

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

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

462462
function locale_get_default(): string {}
463463

464-
function locale_set_default(string $locale): bool {}
464+
function locale_set_default(string $locale): true {}
465465

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

ext/intl/php_intl_arginfo.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/mysqli/mysqli.stub.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,10 @@ public function change_user(string $username, #[\SensitiveParameter] string $pas
774774
public function character_set_name(): string {}
775775

776776
/**
777-
* @return true
777+
* @tentative-return-type
778778
* @alias mysqli_close
779779
*/
780-
public function close() {} // TODO make return type void
780+
public function close(): true {}
781781

782782
/**
783783
* @tentative-return-type
@@ -806,11 +806,11 @@ public function connect(
806806
public function dump_debug_info(): bool {}
807807

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

815815
/**
816816
* @tentative-return-type
@@ -986,7 +986,7 @@ public function options(int $option, $value): bool {}
986986
public function set_opt(int $option, $value): bool {}
987987

988988
/**
989-
* @return true
989+
* @tentative-return-type
990990
* @alias mysqli_ssl_set
991991
*/
992992
public function ssl_set(
@@ -995,7 +995,7 @@ public function ssl_set(
995995
?string $ca_certificate,
996996
?string $ca_path,
997997
?string $cipher_algos
998-
) {} // TODO make return type void
998+
): true {}
999999

10001000
/**
10011001
* @tentative-return-type
@@ -1142,7 +1142,7 @@ public function fetch_column(int $column = 0): null|int|float|string|false {}
11421142
* @tentative-return-type
11431143
* @alias mysqli_field_seek
11441144
*/
1145-
public function field_seek(int $index): true {} // TODO make return type void
1145+
public function field_seek(int $index): true {}
11461146

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

12401240
/**
1241-
* @return true
1241+
* @tentative-return-type
12421242
* @alias mysqli_stmt_close
12431243
*/
1244-
public function close() {} // TODO make return type void
1244+
public function close(): true {}
12451245

12461246
/**
12471247
* @tentative-return-type
@@ -1360,7 +1360,7 @@ function mysqli_change_user(mysqli $mysql, string $username, #[\SensitiveParamet
13601360
/** @refcount 1 */
13611361
function mysqli_character_set_name(mysqli $mysql): string {}
13621362

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

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

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

13861386
function mysqli_dump_debug_info(mysqli $mysql): bool {}
13871387

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

13901390
function mysqli_errno(mysqli $mysql): int {}
13911391

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

14551455
function mysqli_field_count(mysqli $mysql): int {}
14561456

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

14591459
function mysqli_field_tell(mysqli_result $result): int {}
14601460

@@ -1652,7 +1652,7 @@ function mysqli_ssl_set(
16521652
?string $ca_certificate,
16531653
?string $ca_path,
16541654
?string $cipher_algos
1655-
): true {} // TODO make return type void
1655+
): true {}
16561656

16571657
/** @refcount 1 */
16581658
function mysqli_stat(mysqli $mysql): string|false {}

0 commit comments

Comments
 (0)