Skip to content


DDC-104: Junk annotation code generated using convert mapping #1629

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user rickdt:

When generating annotation from yaml
./doctrine convert-mapping --from=./yaml/ --to=annotation --dest=.

with one already generated yaml file and one new yaml file

annotation of first yaml is appended to the new annotations.

Cause of the problem is in AnnotationExporter. ($this->_currentCode is not cleared.)

public function exportClassMetadata(ClassMetadataInfo $metadata)
if (fileexists($this->outputPath)) {
$this->currentCode = file_get_contents($this->outputPath);

Solution :

if (fileexists($this->outputPath)) {
$this->currentCode = file_get_contents($this->outputPath);
else {
$this->_currentCode = '';


Comment created by rickdt:

This does not solve completely the issue.

Updating the same annotation class from yaml often generate junk code.


Issue was closed with resolution "Fixed"

@jwage jwage was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-ALPHA3 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.