From 65d88088cccb52478de43274b77de187f9e199af Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 27 Jul 2014 23:18:44 +0200 Subject: [PATCH] #6288 - cleanups, removal of unused `empty()` checks --- library/Zend/Code/Generator/ClassGenerator.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/library/Zend/Code/Generator/ClassGenerator.php b/library/Zend/Code/Generator/ClassGenerator.php index a998130e952..33d2e856947 100644 --- a/library/Zend/Code/Generator/ClassGenerator.php +++ b/library/Zend/Code/Generator/ClassGenerator.php @@ -838,10 +838,12 @@ public function generate() } $uses = $this->getUses(); + if (!empty($uses)) { foreach ($uses as $use) { $output .= 'use ' . $use . ';' . self::LINE_FEED; } + $output .= self::LINE_FEED; } @@ -861,6 +863,7 @@ public function generate() } $implemented = $this->getImplementedInterfaces(); + if (!empty($implemented)) { $output .= ' implements ' . implode(', ', $implemented); } @@ -874,17 +877,15 @@ public function generate() } $properties = $this->getProperties(); - if (!empty($properties)) { - foreach ($properties as $property) { - $output .= $property->generate() . self::LINE_FEED . self::LINE_FEED; - } + + foreach ($properties as $property) { + $output .= $property->generate() . self::LINE_FEED . self::LINE_FEED; } $methods = $this->getMethods(); - if (!empty($methods)) { - foreach ($methods as $method) { - $output .= $method->generate() . self::LINE_FEED; - } + + foreach ($methods as $method) { + $output .= $method->generate() . self::LINE_FEED; } $output .= self::LINE_FEED . '}' . self::LINE_FEED;