我读过应用程序服务或命令处理程序不应该有任何条件。所以,我不知道在哪里我必须提出验证我的规范模式的条件
My code:
public function handle($request)
{
$email = new email($request['email']);
$emailSpecification = new EmailIsUnique($this->userRepository);
//this condition where do I have to put it?
if (!$emailSpecification->isSatisfiedBy($request['email'])) {
throw new ValueIsNotUniqueException("$request['email'] is already registered");
}
...
}