CakePHP validation for two fields -- Email or Phone no. not working?

 $validator        
       ->notEmptyString('email', __("Required phone_no or email is empty."), function ($context) {
        if(!$context['data']['email']){
            if(!$context['data']['phone']){
                return true;
            } else{
                return false;
            }            
        }else{
            return false;
        }   
    });

Please any suggestion