I'm currently using Symfony 4. I have written an entity with ORM and annotions
#src/Entity/User.php
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
*
* User
*
* @ORM\Table(name="user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
*/
private $motdepasse;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
...
I generate the entity using "php bin/console doctrine:generate:entities App\Entity\User". Unfortunately, it generates an entity in the php file "src/App/Entity/User.php" with the namespace "App\Entity". However the namespace should be "App\App\Entity" because of psr-4 rules. If I add a second "App", I get problems linked to repository and to console generations. If I let one "App", Symfony thinks the namespace is wrong. This is my service configuration : config/services.yml This is my doctrine configuration : config/packages/doctrine.yml
I've looked for the answers for 2 days everywhere (Documentation, tutorials, stackoverflow,...). Symfony 4 has really changed compared to Symfony 3. Thanks for the help. (Any link can help me)