Reputation: 1122
namespace externalServices\Service;
class FirstService extends Exception {
}
now Exception is not defined. I know I can do use \Exception AS Exception; But how can I import all native classes to the namespace
Upvotes: 1
Views: 113
Reputation: 43243
Can't be done.
The solution is to either manually import...
use Exception; //Notice leading \ is not needed
Or use an absolute path...
class FirstService extends \Exception {
Upvotes: 4