request->getPost(); $captchaValidator = new CaptchaValidator(); $captchaValidator->checkCode($post['ticket'], $post['rand']); if (CommonValidator::phone($post['account'])) { $service = new VerifySmsService(); $service->handle($post['account']); } elseif (CommonValidator::email($post['account'])) { $service = new VerifyMailService(); $service->handle($post['account']); } } }