namespace externalServices\Service;
class FirstService extends Exception {
}
现在没有定义异常。我知道我可以使用\ Exception AS Exception;但是如何将所有本机类导入命名空间
答案 0 :(得分:4)
无法完成。
解决方案是手动导入......
use Exception; //Notice leading \ is not needed
或使用绝对路径......
class FirstService extends \Exception {