diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2014-05-11 15:17:27 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2014-05-11 15:17:27 +0200 |
commit | fc8be5abc3e51c99b9995b9bbd0f08d00470112f (patch) | |
tree | 050dc1237a3f626116ac3e07ee0ba37cdb85fb57 /apps/user_ldap/lib/proxy.php | |
parent | b6d76e9985105a245daf63f60b47e82df283019d (diff) | |
download | nextcloud-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/proxy.php')
-rw-r--r-- | apps/user_ldap/lib/proxy.php | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index 0eb294eb7a0..2d5210791c5 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -29,16 +29,26 @@ abstract class Proxy { static private $accesses = array(); private $ldap = null; + /** + * @param ILDAPWrapper $ldap + */ public function __construct(ILDAPWrapper $ldap) { $this->ldap = $ldap; $this->cache = \OC_Cache::getGlobalCache(); } + /** + * @param $configPrefix + */ private function addAccess($configPrefix) { $connector = new Connection($this->ldap, $configPrefix); self::$accesses[$configPrefix] = new Access($connector, $this->ldap); } + /** + * @param $configPrefix + * @return mixed + */ protected function getAccess($configPrefix) { if(!isset(self::$accesses[$configPrefix])) { $this->addAccess($configPrefix); @@ -46,30 +56,45 @@ abstract class Proxy { return self::$accesses[$configPrefix]; } + /** + * @param $uid + * @return string + */ protected function getUserCacheKey($uid) { return 'user-'.$uid.'-lastSeenOn'; } + /** + * @param $gid + * @return string + */ protected function getGroupCacheKey($gid) { return 'group-'.$gid.'-lastSeenOn'; } /** - * @param boolean $passOnWhen - * @param string $method + * @param $id + * @param $method + * @param $parameters + * @param bool $passOnWhen + * @return mixed */ abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); /** - * @param string $method + * @param $id + * @param $method + * @param $parameters + * @return mixed */ abstract protected function walkBackends($id, $method, $parameters); /** * @brief Takes care of the request to the User backend - * @param $uid string, the uid connected to the request + * @param $id * @param string $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed + * @param array $parameters an array of parameters to be passed + * @param bool $passOnWhen * @return mixed, the result of the specified method */ protected function handleRequest($id, $method, $parameters, $passOnWhen = false) { @@ -81,7 +106,8 @@ abstract class Proxy { } /** - * @param string|null $key + * @param $key + * @return string */ private function getCacheKey($key) { $prefix = 'LDAP-Proxy-'; @@ -92,7 +118,8 @@ abstract class Proxy { } /** - * @param string $key + * @param $key + * @return mixed|null */ public function getFromCache($key) { if(!$this->isCached($key)) { @@ -104,7 +131,8 @@ abstract class Proxy { } /** - * @param string $key + * @param $key + * @return bool */ public function isCached($key) { $key = $this->getCacheKey($key); @@ -112,7 +140,8 @@ abstract class Proxy { } /** - * @param string $key + * @param $key + * @param $value */ public function writeToCache($key, $value) { $key = $this->getCacheKey($key); |