控制台缓存:清除-无法声明已在使用的类

问题描述

我在使用symfony 5.1和cache:clear命令行时遇到了问题。

我所有的工作在浏览器上都运行良好。我进行了一些重构,并移动了一些图片,但遇到了一个问题(这是由于错误的方式所致),但是在不知道这一点之前,我去清除了缓存进行验证。

这是终端告诉我的:

$ sc cache:clear

 // Clearing the cache for the dev environment with debug true                                                          

PHP Fatal error:  Cannot declare class App\Controller\Admin\Crud\UserCrudController,because the name is already in use in /home/mathieu/projets/alghazali/site/src/Controller/Admin/Crud/UserCrudController.PHP on line 15
10:37:38 CRITICAL  [PHP] Fatal Compile Error: Cannot declare class App\Controller\Admin\Crud\UserCrudController,because the name is already in use ["exception" => Symfony\Component\ErrorHandler\Error\FatalError { …}]

In UserCrudController.PHP line 15:
                                                                                                                        
  Compile Error: Cannot declare class App\Controller\Admin\Crud\UserCrudController,because the name is already in use  
                                                                                                                        

cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

exit status 255

我不知道该向您展示什么以便更好地理解。

您可能已经知道我正在使用EasyAdminBundle 3

这是我的树形结构:

My-project
|
└─ src/
    ├─ .../
    |
    ├─ Controller/
    |     ├─ Admin/
    |     |     ├─ Crud/
    |     |     |    ├─ PostCrudController.PHP
    |     |     |    └─ UserCrudController.PHP
    |     |     |    
    |     |     └─ AdminDashboardController.PHP
    |     |
    │     ├─ MainController.PHP
    │     ├─ PostController.PHP
    │     └─ SecurityController.PHP
    |
    ├─ Entity/
    |     ├─ ...
    |     ├─ Post.PHP
    |     └─ User.PHP
    |
    ├─ Repository/
    |     └─ ...
    |
    └─ Kernel.PHP

src/Controller/Admin/Crud/UserCrudController.PHP文件中,我知道:

<?PHP

namespace App\Controller\Admin\Crud;

use App\Entity\User;
use ...

class UserCrudController extends AbstractCrudController
{

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...