@@ -96,14 +96,14 @@ |
||
96 | 96 | return ldap_modify_batch($this->resource, $dn, $values); |
97 | 97 | } |
98 | 98 | |
99 | - /** |
|
100 | - * Add attribute values to current attributes. |
|
101 | - * |
|
102 | - * @param string $dn |
|
103 | - * @param array $entry |
|
104 | - * |
|
105 | - * @return mixed |
|
106 | - */ |
|
99 | + /** |
|
100 | + * Add attribute values to current attributes. |
|
101 | + * |
|
102 | + * @param string $dn |
|
103 | + * @param array $entry |
|
104 | + * |
|
105 | + * @return mixed |
|
106 | + */ |
|
107 | 107 | public function modAdd($dn, array $entry) |
108 | 108 | { |
109 | 109 | return ldap_mod_add($this->resource, $dn, $entry); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param string $dn |
103 | 103 | * @param array $entry |
104 | 104 | * |
105 | - * @return mixed |
|
105 | + * @return boolean |
|
106 | 106 | */ |
107 | 107 | public function modAdd($dn, array $entry) |
108 | 108 | { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string $dn |
116 | 116 | * @param array $entry |
117 | 117 | * |
118 | - * @return mixed |
|
118 | + * @return boolean |
|
119 | 119 | */ |
120 | 120 | public function modReplace($dn, array $entry) |
121 | 121 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param string $dn |
129 | 129 | * @param array $entry |
130 | 130 | * |
131 | - * @return mixed |
|
131 | + * @return boolean |
|
132 | 132 | */ |
133 | 133 | public function modDelete($dn, array $entry) |
134 | 134 | { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @param $searchResult |
167 | 167 | * |
168 | - * @return mixed |
|
168 | + * @return resource |
|
169 | 169 | */ |
170 | 170 | public function getFirstEntry($searchResults) |
171 | 171 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * |
178 | 178 | * @param $entry |
179 | 179 | * |
180 | - * @return mixed |
|
180 | + * @return resource |
|
181 | 181 | */ |
182 | 182 | public function getNextEntry($entry) |
183 | 183 | { |
@@ -220,10 +220,8 @@ discard block |
||
220 | 220 | /** |
221 | 221 | * Sets an option on the current connection. |
222 | 222 | * |
223 | - * @param int $option |
|
224 | - * @param mixed $value |
|
225 | 223 | * |
226 | - * @return mixed |
|
224 | + * @return boolean |
|
227 | 225 | */ |
228 | 226 | public function setRebindCallback(callable $callback) |
229 | 227 | { |
@@ -233,7 +231,7 @@ discard block |
||
233 | 231 | /** |
234 | 232 | * Starts a connection using TLS. |
235 | 233 | * |
236 | - * @return mixed |
|
234 | + * @return boolean |
|
237 | 235 | */ |
238 | 236 | public function startTLS() |
239 | 237 | { |
@@ -244,7 +242,7 @@ discard block |
||
244 | 242 | * Returns the error number of the last command |
245 | 243 | * executed on the current connection. |
246 | 244 | * |
247 | - * @return mixed |
|
245 | + * @return integer |
|
248 | 246 | */ |
249 | 247 | public function getErrNo() |
250 | 248 | { |
@@ -288,7 +288,7 @@ |
||
288 | 288 | */ |
289 | 289 | protected $wWWHomePage; |
290 | 290 | |
291 | - public function rules (){ |
|
291 | + public function rules() { |
|
292 | 292 | return [['cn'], 'required']; |
293 | 293 | } |
294 | 294 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $parts[] = "$column=$value"; |
99 | 99 | } |
100 | 100 | } |
101 | - return count($parts) === 1 ? '('.$parts[0].')' : '$(' . implode(') (', $parts) . ')'; |
|
101 | + return count($parts) === 1 ? '('.$parts[0].')' : '$('.implode(') (', $parts).')'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | if (!empty($parts)) { |
125 | - return '('.$this->operator[$operator].'(' . implode(") (", $parts) . ')'.implode($other).' )'; |
|
125 | + return '('.$this->operator[$operator].'('.implode(") (", $parts).')'.implode($other).' )'; |
|
126 | 126 | } else { |
127 | 127 | return ''; |
128 | 128 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | return ''; |
151 | 151 | } |
152 | 152 | |
153 | - return '('.$this->operator['NOT'].'('.key($operands) .'='.$operand.'))'; |
|
153 | + return '('.$this->operator['NOT'].'('.key($operands).'='.$operand.'))'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | if (count($sqlValues) > 1) { |
212 | - return "$column $operator (" . implode(', ', $sqlValues) . ')'; |
|
212 | + return "$column $operator (".implode(', ', $sqlValues).')'; |
|
213 | 213 | } else { |
214 | 214 | $operator = $operator === 'IN' ? '=' : '<>'; |
215 | - return $column . $operator . reset($sqlValues); |
|
215 | + return $column.$operator.reset($sqlValues); |
|
216 | 216 | } |
217 | 217 | } |
218 | 218 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $columns[$i] = $this->db->quoteColumnName($col); |
234 | 234 | } |
235 | 235 | } |
236 | - return '(' . implode(', ', $columns) . ") $operator ($sql)"; |
|
236 | + return '('.implode(', ', $columns).") $operator ($sql)"; |
|
237 | 237 | } else { |
238 | 238 | if (strpos($columns, '(') === false) { |
239 | 239 | $columns = $this->db->quoteColumnName($columns); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $vs[] = 'NULL'; |
265 | 265 | } |
266 | 266 | } |
267 | - $vss[] = '(' . implode(', ', $vs) . ')'; |
|
267 | + $vss[] = '('.implode(', ', $vs).')'; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | if (empty($vss)) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $sqlColumns[] = strpos($column, '(') === false ? $this->db->quoteColumnName($column) : $column; |
277 | 277 | } |
278 | 278 | |
279 | - return '(' . implode(', ', $sqlColumns) . ") $operator (" . implode(', ', $vss) . ')'; |
|
279 | + return '('.implode(', ', $sqlColumns).") $operator (".implode(', ', $vss).')'; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -324,15 +324,15 @@ discard block |
||
324 | 324 | return $not ? '' : '0=1'; |
325 | 325 | } |
326 | 326 | |
327 | - $not = ($operator == 'NOT LIKE') ? '(' . $this->operator['NOT'] : false; |
|
327 | + $not = ($operator == 'NOT LIKE') ? '('.$this->operator['NOT'] : false; |
|
328 | 328 | |
329 | 329 | $parts = []; |
330 | 330 | foreach ($values as $value) { |
331 | 331 | $value = empty($escape) ? $value : strtr($value, $escape); |
332 | - $parts[] = $not . '(' . $column .'=*'.$value . '*)' . ($not? ')':''); |
|
332 | + $parts[] = $not.'('.$column.'=*'.$value.'*)'.($not ? ')' : ''); |
|
333 | 333 | } |
334 | 334 | |
335 | - return '('.$this->operator[trim($andor)] . implode($parts). ')'; |
|
335 | + return '('.$this->operator[trim($andor)].implode($parts).')'; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * Get the current resource of connection. |
96 | - * @return mixed |
|
96 | + * @return resource |
|
97 | 97 | */ |
98 | 98 | public function getResource() |
99 | 99 | { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * Add attribute values to current attributes. |
283 | 283 | * @param string $dn |
284 | 284 | * @param array $entry |
285 | - * @return mixed |
|
285 | + * @return boolean |
|
286 | 286 | */ |
287 | 287 | public function modAdd($dn, array $entry) |
288 | 288 | { |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * Replaces attribute values with new ones. |
294 | 294 | * @param string $dn |
295 | 295 | * @param array $entry |
296 | - * @return mixed |
|
296 | + * @return boolean |
|
297 | 297 | */ |
298 | 298 | public function modReplace($dn, array $entry) |
299 | 299 | { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * Delete attribute values from current attributes. |
305 | 305 | * @param string $dn |
306 | 306 | * @param array $entry |
307 | - * @return mixed |
|
307 | + * @return boolean |
|
308 | 308 | */ |
309 | 309 | public function modDelete($dn, array $entry) |
310 | 310 | { |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | /** |
325 | 325 | * Returns the number of entries from a search result. |
326 | - * @param $searchResult |
|
326 | + * @param resource $searchResult |
|
327 | 327 | * @return int |
328 | 328 | */ |
329 | 329 | public function countEntries($searchResult) |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | /** |
335 | 335 | * Retrieves the first entry from a search result. |
336 | 336 | * @param $searchResult |
337 | - * @return mixed |
|
337 | + * @return resource |
|
338 | 338 | */ |
339 | 339 | public function getFirstEntry($searchResult) |
340 | 340 | { |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | /** |
345 | 345 | * Retrieves the next entry from a search result. |
346 | 346 | * @param $entry |
347 | - * @return mixed |
|
347 | + * @return resource |
|
348 | 348 | */ |
349 | 349 | public function getNextEntry($entry) |
350 | 350 | { |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * Sets an option on the current connection. |
366 | 366 | * @param int $option |
367 | 367 | * @param mixed $value |
368 | - * @return mixed |
|
368 | + * @return boolean |
|
369 | 369 | */ |
370 | 370 | public function setOption($option, $value) |
371 | 371 | { |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | |
393 | 393 | /** |
394 | 394 | * Returns the number of the last error on the current connection. |
395 | - * @return mixed |
|
395 | + * @return integer |
|
396 | 396 | */ |
397 | 397 | public function getErrNo() |
398 | 398 | { |
@@ -278,12 +278,12 @@ |
||
278 | 278 | return ldap_modify_batch($this->resource, $dn, $values); |
279 | 279 | } |
280 | 280 | |
281 | - /** |
|
282 | - * Add attribute values to current attributes. |
|
283 | - * @param string $dn |
|
284 | - * @param array $entry |
|
285 | - * @return mixed |
|
286 | - */ |
|
281 | + /** |
|
282 | + * Add attribute values to current attributes. |
|
283 | + * @param string $dn |
|
284 | + * @param array $entry |
|
285 | + * @return mixed |
|
286 | + */ |
|
287 | 287 | public function modAdd($dn, array $entry) |
288 | 288 | { |
289 | 289 | return ldap_mod_add($this->resource, $dn, $entry); |
@@ -139,7 +139,7 @@ |
||
139 | 139 | $protocol = $this::PROTOCOL; |
140 | 140 | |
141 | 141 | if (is_array($hostname)) { |
142 | - $hostname = $protocol . implode(' ' . $protocol, $hostname); |
|
142 | + $hostname = $protocol.implode(' '.$protocol, $hostname); |
|
143 | 143 | } |
144 | 144 | $this->resource = ldap_connect($hostname, $port); |
145 | 145 |
@@ -82,7 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $this->filter = (new FilterBuilder)->build($this->where); |
85 | - if(empty($this->filter)){ |
|
85 | + if (empty($this->filter)) { |
|
86 | 86 | throw new InvalidValueException('You must define a filter for the search.'); |
87 | 87 | } |
88 | 88 |