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

Open
opened 2026-01-22 12:28:08 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 2, 2009).

Originally assigned to: @jwage on GitHub.

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 (file_exists($this->_outputPath)) {
$this->_currentCode = file_get_contents($this->_outputPath);
}

Solution :

if (file_exists($this->_outputPath)) {
$this->_currentCode = file_get_contents($this->_outputPath);
}
else {
$this->_currentCode = '';
}

Originally created by @doctrinebot on GitHub (Nov 2, 2009). Originally assigned to: @jwage on GitHub. 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 (file_exists($this->_outputPath)) { $this->_currentCode = file_get_contents($this->_outputPath); } Solution : if (file_exists($this->_outputPath)) { $this->_currentCode = file_get_contents($this->_outputPath); } else { $this->_currentCode = ''; }
admin added the Bug label 2026-01-22 12:28:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#128