diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-01-16 20:44:51 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-01-16 21:58:20 +0100 |
commit | c5fcfb070991c94631a89480f66c97a1d18721d0 (patch) | |
tree | 7f4ca7f046cf99b3acfff9223b86735968461bac /lib/public | |
parent | 2b70c708abc667c3e3c4fd9a97626012bf1ded25 (diff) | |
download | nextcloud-server-c5fcfb070991c94631a89480f66c97a1d18721d0.tar.gz nextcloud-server-c5fcfb070991c94631a89480f66c97a1d18721d0.zip |
Made the cache factory strict
* Return types
* Typehints
* made strict
* fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/ICacheFactory.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/public/ICacheFactory.php b/lib/public/ICacheFactory.php index cc4d8fa3ec3..76145fe1f78 100644 --- a/lib/public/ICacheFactory.php +++ b/lib/public/ICacheFactory.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -36,11 +37,11 @@ interface ICacheFactory{ * All entries added trough the cache instance will be namespaced by $prefix to prevent collisions between apps * * @param string $prefix - * @return \OCP\ICache + * @return ICache * @since 7.0.0 * @deprecated 13.0.0 Use either createLocking, createDistributed or createLocal */ - public function create($prefix = ''); + public function create(string $prefix = ''): ICache; /** * Check if any memory cache backend is available @@ -48,32 +49,32 @@ interface ICacheFactory{ * @return bool * @since 7.0.0 */ - public function isAvailable(); + public function isAvailable(): bool; /** * create a cache instance for storing locks * * @param string $prefix - * @return \OCP\IMemcache + * @return IMemcache * @since 13.0.0 */ - public function createLocking($prefix = ''); + public function createLocking(string $prefix = ''): IMemcache; /** * create a distributed cache instance * * @param string $prefix - * @return \OCP\ICache + * @return ICache * @since 13.0.0 */ - public function createDistributed($prefix = ''); + public function createDistributed(string $prefix = ''): ICache; /** * create a local cache instance * * @param string $prefix - * @return \OCP\ICache + * @return ICache * @since 13.0.0 */ - public function createLocal($prefix = ''); + public function createLocal(string $prefix = ''): ICache; } |