diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-26 22:20:21 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-26 22:20:21 +0100 |
commit | 8cb6bb3987cef8bd536f35854ae4da15d390d7a0 (patch) | |
tree | 82cbe362d276b775c2e3e4593a864cd5aebeb9f5 /lib/public | |
parent | 695e32d0a66c6c5293291c3f31c5458fd5c248db (diff) | |
download | nextcloud-server-8cb6bb3987cef8bd536f35854ae4da15d390d7a0.tar.gz nextcloud-server-8cb6bb3987cef8bd536f35854ae4da15d390d7a0.zip |
Make ISession strict
* Make all implementations strict
* Add scalar types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/ISession.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/public/ISession.php b/lib/public/ISession.php index 2d234976862..411356b8dcc 100644 --- a/lib/public/ISession.php +++ b/lib/public/ISession.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -34,6 +35,8 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; +use OCP\Session\Exceptions\SessionNotAvailableException; + /** * Interface ISession * @@ -49,7 +52,7 @@ interface ISession { * @param mixed $value * @since 6.0.0 */ - public function set($key, $value); + public function set(string $key, $value); /** * Get a value from the session @@ -58,7 +61,7 @@ interface ISession { * @return mixed should return null if $key does not exist * @since 6.0.0 */ - public function get($key); + public function get(string $key); /** * Check if a named key exists in the session @@ -67,7 +70,7 @@ interface ISession { * @return bool * @since 6.0.0 */ - public function exists($key); + public function exists(string $key): bool; /** * Remove a $key/$value pair from the session @@ -75,7 +78,7 @@ interface ISession { * @param string $key * @since 6.0.0 */ - public function remove($key); + public function remove(string $key); /** * Reset and recreate the session @@ -96,7 +99,7 @@ interface ISession { * @return void * @since 9.0.0 */ - public function regenerateId($deleteOldSession = true); + public function regenerateId(bool $deleteOldSession = true); /** * Wrapper around session_id @@ -105,5 +108,5 @@ interface ISession { * @throws SessionNotAvailableException * @since 9.1.0 */ - public function getId(); + public function getId(): string; } |