Skip to content

Commit c7d29ed

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 bf48dc0 commit c7d29ed

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
@@ -355,9 +355,9 @@ public static function execute_get_settings( $input = array() ): array {
355355
*
356356
* @param mixed $value The value to cast.
357357
* @param string $type The registered type (string, boolean, integer, number, array, object).
358-
* @return mixed The cast value.
358+
* @return string|bool|int|float|array The cast value.
359359
*/
360-
private static function cast_value( $value, string $type ) {
360+
private static function cast_value( $value, string $type ): string|bool|int|float|array {
361361
switch ( $type ) {
362362
case 'boolean':
363363
return (bool) $value;

0 commit comments

Comments
 (0)