From ac4e33d0560166f40c75fc769ef8e493bfcafb3f Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Wed, 14 Apr 2010 14:17:55 -0400 Subject: [PATCH] Fixing issue with EntityGenerator spaces --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index b8c4d5002..b8a47c64d 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -192,8 +192,7 @@ public function () '', '', '', - '', - '' + '' ); $replacements = array( @@ -201,11 +200,11 @@ public function () $this->_generateEntityUse($metadata), $this->_generateEntityDocBlock($metadata), $this->_generateEntityClassName($metadata), - $this->_generateEntityBody($metadata), - $this->_spaces + $this->_generateEntityBody($metadata) ); - return str_replace($placeHolders, $replacements, self::$_classTemplate); + $code = str_replace($placeHolders, $replacements, self::$_classTemplate); + return str_replace('', $this->_spaces, $code); } /** @@ -220,9 +219,10 @@ public function () $currentCode = file_get_contents($path); $body = $this->_generateEntityBody($metadata); + $body = str_replace('', $this->_spaces, $body); $last = strrpos($currentCode, '}'); - return substr($currentCode, 0, $last) . $body . '}'; + return substr($currentCode, 0, $last) . $body . "\n}"; } /**