DDC-855: [patch] EntityGenerator add an extra return line at each call ... #5376

Closed
doctrinebot opened this Issue Nov 3, 2010 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user rande:

When using the php kooqit/console doctrine:generate:entities command (from the symfony2 framework), the EntityGenerator add an extra return line every time the command is called ....

diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php
index f2fa583..b0c8320 100644
--- a/lib/Doctrine/ORM/Tools/EntityGenerator.php
<ins></ins><ins> b/lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -218,7 </ins>218,7 @@ public function <methodName>()
         $body = str*replace('<spaces>', $this->*spaces, $body);
         $last = strrpos($currentCode, '}');

-        return substr($currentCode, 0, $last) . $body . "\n}";
+        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}";
     }

     /****

@doctrinebot

Comment created by @beberlei:

Fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-RC1 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