Skip to content

Commit

Permalink
zendframework#6288 - cleanups, removal of unused empty() checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius authored and dima committed Nov 27, 2014
1 parent 58bbe6b commit 65d8808
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions library/Zend/Code/Generator/ClassGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -861,6 +863,7 @@ public function generate()
}

$implemented = $this->getImplementedInterfaces();

if (!empty($implemented)) {
$output .= ' implements ' . implode(', ', $implemented);
}
Expand All @@ -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;
Expand Down

0 comments on commit 65d8808

Please sign in to comment.