Skip to content

Commit 0820e10

Browse files
Merge branch '3.4' into 4.4
* 3.4: Various cleanups
2 parents e574241 + 53f1cfc commit 0820e10

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Adapter/ExtLdap/EntryManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function add(Entry $entry)
3838
$con = $this->getConnectionResource();
3939

4040
if (!@ldap_add($con, $entry->getDn(), $entry->getAttributes())) {
41-
throw new LdapException(sprintf('Could not add entry "%s": '.ldap_error($con), $entry->getDn()));
41+
throw new LdapException(sprintf('Could not add entry "%s": ', $entry->getDn()).ldap_error($con));
4242
}
4343

4444
return $this;
@@ -52,7 +52,7 @@ public function update(Entry $entry)
5252
$con = $this->getConnectionResource();
5353

5454
if (!@ldap_modify($con, $entry->getDn(), $entry->getAttributes())) {
55-
throw new LdapException(sprintf('Could not update entry "%s": '.ldap_error($con), $entry->getDn()));
55+
throw new LdapException(sprintf('Could not update entry "%s": ', $entry->getDn()).ldap_error($con));
5656
}
5757
}
5858

@@ -64,7 +64,7 @@ public function remove(Entry $entry)
6464
$con = $this->getConnectionResource();
6565

6666
if (!@ldap_delete($con, $entry->getDn())) {
67-
throw new LdapException(sprintf('Could not remove entry "%s": '.ldap_error($con), $entry->getDn()));
67+
throw new LdapException(sprintf('Could not remove entry "%s": ', $entry->getDn()).ldap_error($con));
6868
}
6969
}
7070

@@ -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: '.ldap_error($con), $entry->getDn(), $attribute));
82+
throw new LdapException(sprintf('Could not add values to entry "%s", attribute %s: ', $entry->getDn(), $attribute).ldap_error($con));
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: '.ldap_error($con), $entry->getDn(), $attribute));
97+
throw new LdapException(sprintf('Could not remove values from entry "%s", attribute %s: ', $entry->getDn(), $attribute).ldap_error($con));
9898
}
9999
}
100100

@@ -106,7 +106,7 @@ public function rename(Entry $entry, $newRdn, $removeOldRdn = true)
106106
$con = $this->getConnectionResource();
107107

108108
if (!@ldap_rename($con, $entry->getDn(), $newRdn, null, $removeOldRdn)) {
109-
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": '.ldap_error($con), $entry->getDn(), $newRdn));
109+
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": ', $entry->getDn(), $newRdn).ldap_error($con));
110110
}
111111
}
112112

@@ -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": '.ldap_error($con), $entry->getDn(), $newParent));
125+
throw new LdapException(sprintf('Could not move entry "%s" to "%s": ', $entry->getDn(), $newParent).ldap_error($con));
126126
}
127127
}
128128

0 commit comments

Comments
 (0)