I have a problem with symfony 5.1 and the cache:clear
command line.
All of my work is working great on the browser. I've make some refactoring and move some pictures and I had a problem (it was due to a bad way), but before know this I went to clear the cache to verify.
This is what the terminal tells me:
$ 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
I don't know what can I show you for better understanding.
You have maybe to know I'm using the EasyAdminBundle 3.
This is my tree structure:
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
In the src/Controller/Admin/Crud/UserCrudController.php
file, I have that:
<?php
namespace App\Controller\Admin\Crud;
use App\Entity\User;
use ...
class UserCrudController extends AbstractCrudController
{