Skip to content

Commit 1e10443

Browse files
committed
Tweak the code to avoid fabbot false positives
1 parent 7ef5081 commit 1e10443

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Adapter/ExtLdap/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function count()
5353
foreach ($searches as $search) {
5454
$searchCount = ldap_count_entries($con, $search);
5555
if (false === $searchCount) {
56-
throw new LdapException(sprintf('Error while retrieving entry count: %s.', ldap_error($con)));
56+
throw new LdapException('Error while retrieving entry count: '.ldap_error($con));
5757
}
5858
$count += $searchCount;
5959
}
@@ -76,7 +76,7 @@ public function getIterator()
7676
$current = ldap_first_entry($con, $search);
7777

7878
if (false === $current) {
79-
throw new LdapException(sprintf('Could not rewind entries array: %s.', ldap_error($con)));
79+
throw new LdapException('Could not rewind entries array: '.ldap_error($con));
8080
}
8181

8282
yield $this->getSingleEntry($con, $current);

Adapter/ExtLdap/EntryManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function addAttributeValues(Entry $entry, string $attribute, array $value
7979
$con = $this->getConnectionResource();
8080

8181
if (!@ldap_mod_add($con, $entry->getDn(), [$attribute => $values])) {
82-
throw new LdapException(sprintf('Could not add values to entry "%s", attribute %s: %s.', $entry->getDn(), $attribute, ldap_error($con)));
82+
throw new LdapException(sprintf('Could not add values to entry "%s", attribute %s: '.ldap_error($con), $entry->getDn(), $attribute));
8383
}
8484
}
8585

@@ -94,7 +94,7 @@ public function removeAttributeValues(Entry $entry, string $attribute, array $va
9494
$con = $this->getConnectionResource();
9595

9696
if (!@ldap_mod_del($con, $entry->getDn(), [$attribute => $values])) {
97-
throw new LdapException(sprintf('Could not remove values from entry "%s", attribute %s: %s.', $entry->getDn(), $attribute, ldap_error($con)));
97+
throw new LdapException(sprintf('Could not remove values from entry "%s", attribute %s: '.ldap_error($con), $entry->getDn(), $attribute));
9898
}
9999
}
100100

@@ -122,7 +122,7 @@ public function move(Entry $entry, string $newParent)
122122
$rdn = $this->parseRdnFromEntry($entry);
123123
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
124124
if (!@ldap_rename($con, $entry->getDn(), $rdn, $newParent, true)) {
125-
throw new LdapException(sprintf('Could not move entry "%s" to "%s": %s.', $entry->getDn(), $newParent, ldap_error($con)));
125+
throw new LdapException(sprintf('Could not move entry "%s" to "%s": '.ldap_error($con), $entry->getDn(), $newParent));
126126
}
127127
}
128128

0 commit comments

Comments
 (0)