*/ public static function arr( mixed $value ): array { return is_array( $value ) ? $value : array(); } /** * Returns the value as a string, or null. * * @param mixed $value Raw value. * @return string|null */ public static function str( mixed $value ): ?string { return is_string( $value ) ? $value : null; } /** * Returns the value as an integer, or null. * * @param mixed $value Raw value. * @return int|null */ public static function int( mixed $value ): ?int { return is_numeric( $value ) ? (int) round( (float) $value ) : null; } /** * Returns the value as a float, or null. * * @param mixed $value Raw value. * @return float|null */ public static function float( mixed $value ): ?float { return is_numeric( $value ) ? (float) $value : null; } }