Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identifier ends with ::class from Traits has an invalid namespace #378

Open
hason opened this issue Nov 5, 2020 · 0 comments
Open

Identifier ends with ::class from Traits has an invalid namespace #378

hason opened this issue Nov 5, 2020 · 0 comments

Comments

@hason
Copy link

hason commented Nov 5, 2020

How to reproduce
Create the following class and traits using doctrine/orm:

namespace App\Behaviour;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Embeddable()
 */
class State
{
}
namespace App\Behaviour;

use Doctrine\ORM\Mapping as ORM;

trait StateMachineTrait
{
    /**
     * @ORM\Embedded(class=State::class)
     */
    private ?State $state;
}
namespace App\Entity;

use App\Behaviour\StateMachineTrait;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class Article
{
    use StateMachineTrait;
}

Trying to create a mapping for this setup will throw an MappingException:

Class 'App\Entity\State' does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant