Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Small refactor to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Aug 9, 2021
1 parent 98ec844 commit c2a8f72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Connections/ConnectionInterface.php
Expand Up @@ -120,7 +120,7 @@ public function getConnection();
*
* @link http://php.net/manual/en/function.ldap-get-entries.php
*
* @param $searchResult
* @param resource $searchResult
*
* @return mixed
*/
Expand All @@ -131,7 +131,7 @@ public function getEntries($searchResult);
*
* @link http://php.net/manual/en/function.ldap-count-entries.php
*
* @param $searchResult
* @param resource $searchResult
*
* @return int
*/
Expand All @@ -155,7 +155,7 @@ public function compare($dn, $attribute, $value);
*
* @link http://php.net/manual/en/function.ldap-first-entry.php
*
* @param $searchResult
* @param resource $searchResult
*
* @return mixed
*/
Expand Down
14 changes: 5 additions & 9 deletions src/Query/Builder.php
Expand Up @@ -593,17 +593,13 @@ protected function compatiblePaginationCallback($filter, $perPage, $isCritical)
*/
protected function parse($resource)
{
// Normalize entries. Get entries returns false on failure.
// We'll always want an array in this situation.
if ($resource === false) {
$entries = [];
} else {
$entries = $this->connection->getEntries($resource);
}

// Free up memory.
if (is_resource($resource)) {
$entries = $this->connection->getEntries($resource);

// Free up memory.
$this->connection->freeResult($resource);
} else {
$entries = [];
}

return $entries;
Expand Down

0 comments on commit c2a8f72

Please sign in to comment.