diff --git a/src/Collection.php b/src/Collection.php index 3f5b12aa4..68434c949 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -88,9 +88,8 @@ public function getFirst() if ($this->count() > 0) { $this->rewind(); return $this->current(); - } else { - return null; } + return null; } /** @@ -135,9 +134,8 @@ public function current() $this->cache[$this->current] = $this->createEntry($current); } return $this->cache[$this->current]; - } else { - return null; } + return null; } /** @@ -163,9 +161,8 @@ public function dn() $this->rewind(); } return $this->iterator->key(); - } else { - return null; } + return null; } /** @@ -181,9 +178,8 @@ public function key() $this->rewind(); } return $this->current; - } else { - return null; } + return null; } /** @@ -221,8 +217,7 @@ public function valid() { if (isset($this->cache[$this->current])) { return true; - } else { - return $this->iterator->valid(); } + return $this->iterator->valid(); } } diff --git a/src/Dn.php b/src/Dn.php index 008f2e15c..0a0234f13 100644 --- a/src/Dn.php +++ b/src/Dn.php @@ -57,9 +57,8 @@ public static function factory($dn, $caseFold = null) return self::fromArray($dn, $caseFold); } elseif (is_string($dn)) { return self::fromString($dn, $caseFold); - } else { - throw new Exception\LdapException(null, 'Invalid argument type for $dn'); } + throw new Exception\LdapException(null, 'Invalid argument type for $dn'); } /** @@ -168,9 +167,8 @@ public function get($index, $length = 1, $caseFold = null) } if ($length === 1) { return self::caseFoldRdn($this->dn[$index], $caseFold); - } else { - return self::caseFoldDn(array_slice($this->dn, $index, $length, false), $caseFold); } + return self::caseFoldDn(array_slice($this->dn, $index, $length, false), $caseFold); } /** @@ -325,9 +323,8 @@ public function toArray($caseFold = null) if ($caseFold === self::ATTR_CASEFOLD_NONE) { return $this->dn; - } else { - return self::caseFoldDn($this->dn, $caseFold); } + return self::caseFoldDn($this->dn, $caseFold); } /** @@ -387,9 +384,8 @@ public function offsetExists($offset) $offset = (int)$offset; if ($offset < 0 || $offset >= count($this->dn)) { return false; - } else { - return true; } + return true; } /** diff --git a/src/Ldap.php b/src/Ldap.php index f3d997740..afb9b572c 100644 --- a/src/Ldap.php +++ b/src/Ldap.php @@ -982,9 +982,8 @@ public function count($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB) } catch (Exception\LdapException $e) { if ($e->getCode() === Exception\LdapException::LDAP_NO_SUCH_OBJECT) { return 0; - } else { - throw $e; } + throw $e; } return $result->count(); diff --git a/src/Node.php b/src/Node.php index b3ab434df..887c7a069 100644 --- a/src/Node.php +++ b/src/Node.php @@ -395,9 +395,9 @@ public function willBeMoved() return false; } elseif ($this->newDn !== null) { return ($this->dn != $this->newDn); - } else { - return false; } + + return false; } /** @@ -995,12 +995,10 @@ public function hasChildren() if (!is_array($this->children)) { if ($this->isAttached()) { return ($this->countChildren() > 0); - } else { - return false; } - } else { - return (count($this->children) > 0); + return false; } + return (count($this->children) > 0); } /**