request->getPost(); $securityValidator = new SecurityValidator(); $securityValidator->checkVerifyCode($post['phone'], $post['verify_code']); $accountValidator = new AccountValidator(); $data = []; $data['phone'] = $accountValidator->checkPhone($post['phone']); $data['password'] = $accountValidator->checkPassword($post['password']); $accountValidator->checkIfPhoneTaken($post['phone']); $account = new AccountModel(); $account->create($data); return $account; } }