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

Commit

Permalink
Merge branch 'master' of https://github.com/Yousha/zf2 into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
15 changes: 5 additions & 10 deletions src/Collection.php
Expand Up @@ -88,9 +88,8 @@ public function getFirst()
if ($this->count() > 0) {
$this->rewind();
return $this->current();
} else {
return null;
}
return null;
}

/**
Expand Down Expand Up @@ -135,9 +134,8 @@ public function current()
$this->cache[$this->current] = $this->createEntry($current);
}
return $this->cache[$this->current];
} else {
return null;
}
return null;
}

/**
Expand All @@ -163,9 +161,8 @@ public function dn()
$this->rewind();
}
return $this->iterator->key();
} else {
return null;
}
return null;
}

/**
Expand All @@ -181,9 +178,8 @@ public function key()
$this->rewind();
}
return $this->current;
} else {
return null;
}
return null;
}

/**
Expand Down Expand Up @@ -221,8 +217,7 @@ public function valid()
{
if (isset($this->cache[$this->current])) {
return true;
} else {
return $this->iterator->valid();
}
return $this->iterator->valid();
}
}
12 changes: 4 additions & 8 deletions src/Dn.php
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Ldap.php
Expand Up @@ -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();
Expand Down
10 changes: 4 additions & 6 deletions src/Node.php
Expand Up @@ -395,9 +395,9 @@ public function willBeMoved()
return false;
} elseif ($this->newDn !== null) {
return ($this->dn != $this->newDn);
} else {
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 28a177e

Please sign in to comment.