Skip to content

Commit 30b2143

Browse files
come-ncbackportbot[bot]
authored andcommitted
Inherit doc from interface in LDAP class
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent a103ab6 commit 30b2143

File tree

1 file changed

+22
-66
lines changed

1 file changed

+22
-66
lines changed

apps/user_ldap/lib/LDAP.php

Lines changed: 22 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,14 @@ public function __construct() {
4949
}
5050

5151
/**
52-
* @param resource $link
53-
* @param string $dn
54-
* @param string $password
55-
* @return bool|mixed
52+
* {@inheritDoc}
5653
*/
5754
public function bind($link, $dn, $password) {
5855
return $this->invokeLDAPMethod('bind', $link, $dn, $password);
5956
}
6057

6158
/**
62-
* @param string $host
63-
* @param string $port
64-
* @return mixed
59+
* {@inheritDoc}
6560
*/
6661
public function connect($host, $port) {
6762
if (strpos($host, '://') === false) {
@@ -74,6 +69,9 @@ public function connect($host, $port) {
7469
return $this->invokeLDAPMethod('connect', $host);
7570
}
7671

72+
/**
73+
* {@inheritDoc}
74+
*/
7775
public function controlPagedResultResponse($link, $result, &$cookie): bool {
7876
$this->preFunctionCall(
7977
$this->pagedResultsAdapter->getResponseCallFunc(),
@@ -91,10 +89,7 @@ public function controlPagedResultResponse($link, $result, &$cookie): bool {
9189
}
9290

9391
/**
94-
* @param LDAP $link
95-
* @param int $pageSize
96-
* @param bool $isCritical
97-
* @return mixed|true
92+
* {@inheritDoc}
9893
*/
9994
public function controlPagedResult($link, $pageSize, $isCritical) {
10095
$fn = $this->pagedResultsAdapter->getRequestCallFunc();
@@ -114,25 +109,21 @@ public function controlPagedResult($link, $pageSize, $isCritical) {
114109
}
115110

116111
/**
117-
* @param LDAP $link
118-
* @param LDAP $result
119-
* @return mixed
112+
* {@inheritDoc}
120113
*/
121114
public function countEntries($link, $result) {
122115
return $this->invokeLDAPMethod('count_entries', $link, $result);
123116
}
124117

125118
/**
126-
* @param LDAP $link
127-
* @return integer
119+
* {@inheritDoc}
128120
*/
129121
public function errno($link) {
130122
return $this->invokeLDAPMethod('errno', $link);
131123
}
132124

133125
/**
134-
* @param LDAP $link
135-
* @return string
126+
* {@inheritDoc}
136127
*/
137128
public function error($link) {
138129
return $this->invokeLDAPMethod('error', $link);
@@ -150,71 +141,50 @@ public function explodeDN($dn, $withAttrib) {
150141
}
151142

152143
/**
153-
* @param LDAP $link
154-
* @param LDAP $result
155-
* @return mixed
144+
* {@inheritDoc}
156145
*/
157146
public function firstEntry($link, $result) {
158147
return $this->invokeLDAPMethod('first_entry', $link, $result);
159148
}
160149

161150
/**
162-
* @param LDAP $link
163-
* @param LDAP $result
164-
* @return array|mixed
151+
* {@inheritDoc}
165152
*/
166153
public function getAttributes($link, $result) {
167154
return $this->invokeLDAPMethod('get_attributes', $link, $result);
168155
}
169156

170157
/**
171-
* @param LDAP $link
172-
* @param LDAP $result
173-
* @return mixed|string
158+
* {@inheritDoc}
174159
*/
175160
public function getDN($link, $result) {
176161
return $this->invokeLDAPMethod('get_dn', $link, $result);
177162
}
178163

179164
/**
180-
* @param LDAP $link
181-
* @param LDAP $result
182-
* @return array|mixed
165+
* {@inheritDoc}
183166
*/
184167
public function getEntries($link, $result) {
185168
return $this->invokeLDAPMethod('get_entries', $link, $result);
186169
}
187170

188171
/**
189-
* @param LDAP $link
190-
* @param resource $result
191-
* @return mixed
172+
* {@inheritDoc}
192173
*/
193174
public function nextEntry($link, $result) {
194175
return $this->invokeLDAPMethod('next_entry', $link, $result);
195176
}
196177

197178
/**
198-
* @param LDAP $link
199-
* @param string $baseDN
200-
* @param string $filter
201-
* @param array $attr
202-
* @return mixed
179+
* {@inheritDoc}
203180
*/
204181
public function read($link, $baseDN, $filter, $attr) {
205182
$this->pagedResultsAdapter->setReadArgs($link, $baseDN, $filter, $attr);
206183
return $this->invokeLDAPMethod('read', ...$this->pagedResultsAdapter->getReadArgs($link));
207184
}
208185

209186
/**
210-
* @param LDAP $link
211-
* @param string[] $baseDN
212-
* @param string $filter
213-
* @param array $attr
214-
* @param int $attrsOnly
215-
* @param int $limit
216-
* @return mixed
217-
* @throws \Exception
187+
* {@inheritDoc}
218188
*/
219189
public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) {
220190
$oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) {
@@ -237,47 +207,35 @@ public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit =
237207
}
238208

239209
/**
240-
* @param LDAP $link
241-
* @param string $userDN
242-
* @param string $password
243-
* @return bool
210+
* {@inheritDoc}
244211
*/
245212
public function modReplace($link, $userDN, $password) {
246213
return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
247214
}
248215

249216
/**
250-
* @param LDAP $link
251-
* @param string $userDN
252-
* @param string $oldPassword
253-
* @param string $password
254-
* @return bool
217+
* {@inheritDoc}
255218
*/
256219
public function exopPasswd($link, $userDN, $oldPassword, $password) {
257220
return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
258221
}
259222

260223
/**
261-
* @param LDAP $link
262-
* @param string $option
263-
* @param int $value
264-
* @return bool|mixed
224+
* {@inheritDoc}
265225
*/
266226
public function setOption($link, $option, $value) {
267227
return $this->invokeLDAPMethod('set_option', $link, $option, $value);
268228
}
269229

270230
/**
271-
* @param LDAP $link
272-
* @return mixed|true
231+
* {@inheritDoc}
273232
*/
274233
public function startTls($link) {
275234
return $this->invokeLDAPMethod('start_tls', $link);
276235
}
277236

278237
/**
279-
* @param resource $link
280-
* @return bool|mixed
238+
* {@inheritDoc}
281239
*/
282240
public function unbind($link) {
283241
return $this->invokeLDAPMethod('unbind', $link);
@@ -292,9 +250,7 @@ public function areLDAPFunctionsAvailable() {
292250
}
293251

294252
/**
295-
* Checks whether the submitted parameter is a resource
296-
* @param Resource $resource the resource variable to check
297-
* @return bool true if it is a resource, false otherwise
253+
* {@inheritDoc}
298254
*/
299255
public function isResource($resource) {
300256
return is_resource($resource);

0 commit comments

Comments
 (0)