protected function obfuscate($mail)
    {
        return preg_replace_callback('/^([^@]+)(.*)$/', function ($matches) {
            $lenght = floor(strlen($matches[1]) / 2);
            $name = substr($matches[1], 0, $lenght) . str_repeat('*', $lenght);

            return $name . $matches[2];
        }, $mail);
    }
protected function obfuscate($mail)
    {
        return preg_replace_callback('/^([^@]+)(.*)$/', function ($matches) {
            $lenght = floor(strlen($matches[1]) / 2);
            $name = substr($matches[1], 0, $lenght) . str_repeat('*', $lenght);

            return $name . $matches[2];
        }, $mail);
    }
protected function obfuscate ( $ mail ) { return preg_replace_callback ( '/^([^@]+)(.*)$/' , function ( $ matches ) { $ lenght = floor ( strlen ( $ matches [ 1 ] ) / 2 ) ; $ name = substr ( $ matches [ 1 ] , 0 , $ lenght ) . str_repeat ( '*' , $ lenght ) ; return $ name . $ matches [ 2 ] ; } , $ mail ) ; }
Internal method to obfuscate an email address
@param string $mail Mail address
@return string
Internal method to obfuscate an email address