mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-104: Junk annotation code generated using convert mapping #131
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 = '';
}
@doctrinebot commented on GitHub (Nov 2, 2009):
Comment created by rickdt:
This does not solve completely the issue.
Updating the same annotation class from yaml often generate junk code.
@doctrinebot commented on GitHub (Nov 11, 2009):
Issue was closed with resolution "Fixed"