diff --git a/modules/riak/lib/Store/Store.php b/modules/riak/lib/Store/Store.php index a1ddcb013bb2338156a979e1d7c941fa5ca77a9e..baa44039344582aaaac0fd3dd79c33a984d6c01b 100644 --- a/modules/riak/lib/Store/Store.php +++ b/modules/riak/lib/Store/Store.php @@ -22,8 +22,13 @@ * and Information Technology. */ -class sspmod_riak_Store_Store extends SimpleSAML\Store { - protected function __construct() { +class sspmod_riak_Store_Store extends SimpleSAML\Store +{ + public $client; + public $bucket; + + protected function __construct() + { $config = SimpleSAML_Configuration::getConfig('module_riak.php'); $path = $config->getString('path', 'riak-php-client/riak.php'); @@ -43,19 +48,20 @@ class sspmod_riak_Store_Store extends SimpleSAML\Store { * @param string $key The key. * @return mixed|NULL The value. */ - public function get($type, $key) { + public function get($type, $key) + { assert(is_string($type)); assert(is_string($key)); $v = $this->bucket->getBinary("$type.$key"); if (!$v->exists()) { - return (NULL); + return null; } $expires = $v->getIndex('Expires', 'int'); if (sizeof($expires) && (int)array_shift($expires) <= time()) { $v->delete(); - return (NULL); + return null; } return (unserialize($v->getData())); @@ -70,7 +76,8 @@ class sspmod_riak_Store_Store extends SimpleSAML\Store { * @param mixed $value The value. * @param int|NULL $expire The expiration time (unix timestamp), or NULL if it never expires. */ - public function set($type, $key, $value, $expire = NULL) { + public function set($type, $key, $value, $expire = null) + { assert(is_string($type)); assert(is_string($key)); assert($expire === null || (is_int($expire) && $expire > 2592000)); @@ -89,7 +96,8 @@ class sspmod_riak_Store_Store extends SimpleSAML\Store { * @param string $type The datatype. * @param string $key The key. */ - public function delete($type, $key) { + public function delete($type, $key) + { assert(is_string($type)); assert(is_string($key));