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

doctrinebot opened this Issue Nov 2, 2009 · 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 Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-ALPHA3 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment