Skip to content

Commit b06c95b

Browse files
authored
Declare the missing true return types (php#13709)
1 parent fcdcfe9 commit b06c95b

26 files changed

+138
-133
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.

0 commit comments

Comments
 (0)