Fix IDE warnings/notices in `UserStorageHandler`
authorMatthias Schmidt <gravatronics@live.com>
Sat, 22 Oct 2016 07:12:57 +0000 (09:12 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 22 Oct 2016 07:12:57 +0000 (09:12 +0200)
wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php

index df44919e39590b2d3b45c800a37a363cd64fac91..cd4980c60476010357083c20639cefa4b95d8f35 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\user\storage;
 use wcf\system\cache\source\RedisCacheSource;
 use wcf\system\cache\CacheHandler;
+use wcf\system\database\Redis;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
@@ -35,16 +36,17 @@ class UserStorageHandler extends SingletonFactory {
        
        /**
         * redis instance
-        * @var Redis
+        * @var Redis
         */
-       protected $redis = null;
+       protected $redis;
        
        /**
         * Checks whether Redis is available.
         */
        protected function init() {
-               if (CacheHandler::getInstance()->getCacheSource() instanceof RedisCacheSource) {
-                       $this->redis = CacheHandler::getInstance()->getCacheSource()->getRedis();
+               $cacheSource = CacheHandler::getInstance()->getCacheSource();
+               if ($cacheSource instanceof RedisCacheSource) {
+                       $this->redis = $cacheSource->getRedis();
                }
        }