From 0ed18fb062470a8d267a1bd88656430116b63e9f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 26 Nov 2016 06:44:53 +0100 Subject: [PATCH] #5914 removed unused conditional inside `EntityGenerator`, replaced with `array_filter()` instead --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index e678ea8be..22d5b412a 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1267,13 +1267,11 @@ public function __construct() foreach ($metadata->lifecycleCallbacks as $name => $callbacks) { foreach ($callbacks as $callback) { - if ($code = $this->generateLifecycleCallbackMethod($name, $callback, $metadata)) { - $methods[] = $code; - } + $methods[] = $this->generateLifecycleCallbackMethod($name, $callback, $metadata); } } - return implode("\n\n", $methods); + return implode("\n\n", array_filter($methods)); } /**