Skip to content

Commit bbd8437

Browse files
Add return type union to cast_value() method
Use explicit union type (string|bool|int|float|array) instead of mixed for better type safety and documentation.
1 parent e75fd70 commit bbd8437

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/abilities/class-wp-settings-abilities.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ public static function execute_get_settings( $input = array() ): array {
334334
*
335335
* @param mixed $value The value to cast.
336336
* @param string $type The registered type (string, boolean, integer, number, array, object).
337-
* @return mixed The cast value.
337+
* @return string|bool|int|float|array The cast value.
338338
*/
339-
private static function cast_value( $value, string $type ) {
339+
private static function cast_value( $value, string $type ): string|bool|int|float|array {
340340
switch ( $type ) {
341341
case 'boolean':
342342
return (bool) $value;

0 commit comments

Comments
 (0)