public static function validateEmail($string)
    {
        if (filter_var($string, FILTER_VALIDATE_EMAIL)) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not a valid email.',
                $string
            )
        );
    }
public static function validateEmail($string)
    {
        if (filter_var($string, FILTER_VALIDATE_EMAIL)) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not a valid email.',
                $string
            )
        );
    }
public static function validateEmail ( $ string ) { if ( filter_var ( $ string , FILTER_VALIDATE_EMAIL ) ) { return ( string ) $ string ; } throw new InvalidArgumentException ( sprintf ( 'Provided string "%1$s" was not a valid email.' , $ string ) ) ; }
Verify that a string is an email or throw an Exception.

@since 0.1.0

@param string $string The string to validate.

@return string The validated string.
@throws InvalidArgumentException If the string is not an email.
Verify that a string is an email or throw an Exception .