@@ -38,7 +38,7 @@ public function add(Entry $entry)
38
38
$ con = $ this ->getConnectionResource ();
39
39
40
40
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 ));
42
42
}
43
43
44
44
return $ this ;
@@ -52,7 +52,7 @@ public function update(Entry $entry)
52
52
$ con = $ this ->getConnectionResource ();
53
53
54
54
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 ));
56
56
}
57
57
}
58
58
@@ -64,7 +64,7 @@ public function remove(Entry $entry)
64
64
$ con = $ this ->getConnectionResource ();
65
65
66
66
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 ));
68
68
}
69
69
}
70
70
@@ -79,7 +79,7 @@ public function addAttributeValues(Entry $entry, string $attribute, array $value
79
79
$ con = $ this ->getConnectionResource ();
80
80
81
81
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 ));
83
83
}
84
84
}
85
85
@@ -94,7 +94,7 @@ public function removeAttributeValues(Entry $entry, string $attribute, array $va
94
94
$ con = $ this ->getConnectionResource ();
95
95
96
96
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 ));
98
98
}
99
99
}
100
100
@@ -106,7 +106,7 @@ public function rename(Entry $entry, $newRdn, $removeOldRdn = true)
106
106
$ con = $ this ->getConnectionResource ();
107
107
108
108
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 ));
110
110
}
111
111
}
112
112
@@ -122,7 +122,7 @@ public function move(Entry $entry, string $newParent)
122
122
$ rdn = $ this ->parseRdnFromEntry ($ entry );
123
123
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
124
124
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 ));
126
126
}
127
127
}
128
128
0 commit comments