【发布时间】:2020-01-14 19:54:43
【问题描述】:
尝试从命名空间“Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation”加载接口“NotExistingInterface”。 您是否忘记了另一个名称空间的“使用”语句?无法理解这个错误
Symfony\组件\调试\异常\ ClassNotFoundException 在 \vendor/symfony/framework-bundle/Tests/Fixtures/Validation/Article.php(第 5 行)
<?php
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation;
class Article implements NotExistingInterface
{
public $category;
}
我不知道错误。请帮忙。
【问题讨论】:
-
当 symfony 抛出这个错误时,你能分享一下你在做什么吗?可以分享一些代码吗?
-
你正在实现
NotExistingInterface接口,你还没有使用use语句导入。 -
使用PHPStorm之类的IDE很好。它会导入你需要的东西
-
您展示的代码来自 Symfony 框架内的测试。我完全不希望您的代码使用它。是什么导致该文件运行?