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" : ''). "}"; } /**