From 51922a1ff03796e934cfe9a40b2282fae48172d4 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 27 Nov 2010 19:57:37 +0100 Subject: [PATCH] DDC-855 - Fix EntityGenerator annoyance when run successive times. --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index f2fa583c8..b0c83203d 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -218,7 +218,7 @@ public function () $body = str_replace('', $this->_spaces, $body); $last = strrpos($currentCode, '}'); - return substr($currentCode, 0, $last) . $body . "\n}"; + return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}"; } /**