summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/ldap.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2014-05-11 15:17:27 +0200
committerLukas Reschke <lukas@statuscode.ch>2014-05-11 15:17:27 +0200
commitfc8be5abc3e51c99b9995b9bbd0f08d00470112f (patch)
tree050dc1237a3f626116ac3e07ee0ba37cdb85fb57 /apps/user_ldap/lib/ldap.php
parentb6d76e9985105a245daf63f60b47e82df283019d (diff)
downloadnextcloud-server-fc8be5abc3e51c99b9995b9bbd0f08d00470112f.tar.gz
nextcloud-server-fc8be5abc3e51c99b9995b9bbd0f08d00470112f.zip
Use proper PHPDoc and variable names in the LDAP lib
My IDE was so sad about this that it marked the whole file in red and yellow and forced me to fix this.
Diffstat (limited to 'apps/user_ldap/lib/ldap.php')
-rw-r--r--apps/user_ldap/lib/ldap.php121
1 files changed, 111 insertions, 10 deletions
diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php
index d1ca91045b2..9962d1267b8 100644
--- a/apps/user_ldap/lib/ldap.php
+++ b/apps/user_ldap/lib/ldap.php
@@ -27,14 +27,31 @@ class LDAP implements ILDAPWrapper {
protected $curFunc = '';
protected $curArgs = array();
+ /**
+ * @param resource $link
+ * @param string $dn
+ * @param string $password
+ * @return bool|mixed
+ */
public function bind($link, $dn, $password) {
return $this->invokeLDAPMethod('bind', $link, $dn, $password);
}
+ /**
+ * @param string $host
+ * @param string $port
+ * @return mixed
+ */
public function connect($host, $port) {
return $this->invokeLDAPMethod('connect', $host, $port);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @param $cookie
+ * @return bool|LDAP
+ */
public function controlPagedResultResponse($link, $result, &$cookie) {
$this->preFunctionCall('ldap_control_paged_result_response',
array($link, $result, $cookie));
@@ -44,64 +61,144 @@ class LDAP implements ILDAPWrapper {
return $result;
}
- public function controlPagedResult($link, $pagesize, $isCritical, $cookie) {
- return $this->invokeLDAPMethod('control_paged_result', $link, $pagesize,
+ /**
+ * @param LDAP $link
+ * @param int $pageSize
+ * @param bool $isCritical
+ * @param array $cookie
+ * @return mixed|true
+ */
+ public function controlPagedResult($link, $pageSize, $isCritical, $cookie) {
+ return $this->invokeLDAPMethod('control_paged_result', $link, $pageSize,
$isCritical, $cookie);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @return mixed
+ */
public function countEntries($link, $result) {
return $this->invokeLDAPMethod('count_entries', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @return mixed|string
+ */
public function errno($link) {
return $this->invokeLDAPMethod('errno', $link);
}
+ /**
+ * @param LDAP $link
+ * @return int|mixed
+ */
public function error($link) {
return $this->invokeLDAPMethod('error', $link);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @return mixed
+ */
public function firstEntry($link, $result) {
return $this->invokeLDAPMethod('first_entry', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @return array|mixed
+ */
public function getAttributes($link, $result) {
return $this->invokeLDAPMethod('get_attributes', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @return mixed|string
+ */
public function getDN($link, $result) {
return $this->invokeLDAPMethod('get_dn', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @return array|mixed
+ */
public function getEntries($link, $result) {
return $this->invokeLDAPMethod('get_entries', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @param resource $result
+ * @return mixed|an
+ */
public function nextEntry($link, $result) {
return $this->invokeLDAPMethod('next_entry', $link, $result);
}
+ /**
+ * @param LDAP $link
+ * @param string $baseDN
+ * @param string $filter
+ * @param array $attr
+ * @return mixed
+ */
public function read($link, $baseDN, $filter, $attr) {
return $this->invokeLDAPMethod('read', $link, $baseDN, $filter, $attr);
}
- public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0) {
- return $this->invokeLDAPMethod('search', $link, $baseDN, $filter,
- $attr, $attrsonly, $limit);
+ /**
+ * @param LDAP $link
+ * @param string $baseDN
+ * @param string $filter
+ * @param array $attr
+ * @param int $attrsOnly
+ * @param int $limit
+ * @return mixed
+ */
+ public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) {
+ return $this->invokeLDAPMethod('search', $link, $baseDN, $filter, $attr, $attrsOnly, $limit);
}
+ /**
+ * @param LDAP $link
+ * @param string $option
+ * @param int $value
+ * @return bool|mixed
+ */
public function setOption($link, $option, $value) {
return $this->invokeLDAPMethod('set_option', $link, $option, $value);
}
- public function sort($link, $result, $sortfilter) {
- return $this->invokeLDAPMethod('sort', $link, $result, $sortfilter);
+ /**
+ * @param LDAP $link
+ * @param LDAP $result
+ * @param string $sortFilter
+ * @return mixed
+ */
+ public function sort($link, $result, $sortFilter) {
+ return $this->invokeLDAPMethod('sort', $link, $result, $sortFilter);
}
+ /**
+ * @param LDAP $link
+ * @return mixed|true
+ */
public function startTls($link) {
return $this->invokeLDAPMethod('start_tls', $link);
}
+ /**
+ * @param resource $link
+ * @return bool|mixed
+ */
public function unbind($link) {
return $this->invokeLDAPMethod('unbind', $link);
}
@@ -126,13 +223,16 @@ class LDAP implements ILDAPWrapper {
/**
* @brief Checks whether the submitted parameter is a resource
- * @param $resource the resource variable to check
- * @return boolean if it is a resource, false otherwise
+ * @param Resource $resource the resource variable to check
+ * @return bool true if it is a resource, false otherwise
*/
public function isResource($resource) {
return is_resource($resource);
}
+ /**
+ * @return mixed
+ */
private function invokeLDAPMethod() {
$arguments = func_get_args();
$func = 'ldap_' . array_shift($arguments);
@@ -148,6 +248,7 @@ class LDAP implements ILDAPWrapper {
/**
* @param string $functionName
+ * @param $args
*/
private function preFunctionCall($functionName, $args) {
$this->curFunc = $functionName;
@@ -181,4 +282,4 @@ class LDAP implements ILDAPWrapper {
$this->curFunc = '';
$this->curArgs = array();
}
-} \ No newline at end of file
+}