From 0f92944edd77dd83555a9116b414ec8f1a77ac9d Mon Sep 17 00:00:00 2001 From: Nick Masters Date: Tue, 30 Oct 2012 22:22:04 +0000 Subject: [PATCH 1/3] Do not add trailing whitespace to blank lines --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 550cc5a3a..a2b8b41b5 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1207,7 +1207,9 @@ public function __construct() $lines = explode("\n", $code); foreach ($lines as $key => $value) { - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; + if (!empty($value)) { + $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; + } } return implode("\n", $lines); From 0a2ba38e58e0656c09ffc2884b3d97eded60622f Mon Sep 17 00:00:00 2001 From: Nick Masters Date: Tue, 30 Oct 2012 22:42:01 +0000 Subject: [PATCH 2/3] Add new line to end of file --- 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 a2b8b41b5..7de148bee 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -363,7 +363,7 @@ public function __construct() $body = str_replace('', $this->spaces, $body); $last = strrpos($currentCode, '}'); - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}"; + return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}\n"; } /** From e402a0c078fc13449e70d98023280554355d5b8d Mon Sep 17 00:00:00 2001 From: Nick Masters Date: Sun, 4 Nov 2012 15:22:32 +0000 Subject: [PATCH 3/3] Spaces around ! sign --- 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 1ba44ba63..977cc0f95 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1213,7 +1213,7 @@ public function __construct() $lines = explode("\n", $code); foreach ($lines as $key => $value) { - if (!empty($value)) { + if ( ! empty($value)) { $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; } }