Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
[zendframework/zendframework#5364] Simplify conditional
Browse files Browse the repository at this point in the history
- we know we have a boolean; remove true === test
- combine if statement from body with else parent
  • Loading branch information
weierophinney committed Jan 3, 2014
1 parent b437ca2 commit accee7c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Hydrator/ClassMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ public function setUnderscoreSeparatedKeys($underscoreSeparatedKeys)
{
$this->underscoreSeparatedKeys = (bool) $underscoreSeparatedKeys;

if (true === $this->underscoreSeparatedKeys) {
if ($this->underscoreSeparatedKeys) {
$this->setNamingStrategy(new UnderscoreNamingStrategy);
} else {
if ($this->getNamingStrategy() instanceof UnderscoreNamingStrategy) {
$this->removeNamingStrategy();
}
} elseif ($this->getNamingStrategy() instanceof UnderscoreNamingStrategy) {
$this->removeNamingStrategy();
}

return $this;
Expand Down

0 comments on commit accee7c

Please sign in to comment.