Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用异常作为跳出当前上下文到某个更高架构层的简单方法,以避免例行返回代码检查(有点if ($response['code'] != CodeStatus::SUCCESS) return null;)?我所说的例外通常可能意味着无效的用户帐户或某种东西,即它不是紧急情况。
if ($response['code'] != CodeStatus::SUCCESS) return null;
我想我找到的最佳答案在这里。
还有一些谷歌研究。