]> git.mxchange.org Git - friendica.git/commitdiff
Renamed __toString() to getName()
authorPhilipp Holzer <admin+github@philipp.info>
Sun, 4 Aug 2019 14:13:53 +0000 (16:13 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Sun, 4 Aug 2019 14:14:19 +0000 (16:14 +0200)
src/Console/Cache.php
src/Core/Cache/APCuCache.php
src/Core/Cache/ArrayCache.php
src/Core/Cache/Cache.php
src/Core/Cache/DatabaseCache.php
src/Core/Cache/ICache.php
src/Core/Cache/MemcacheCache.php
src/Core/Cache/MemcachedCache.php
src/Core/Cache/ProfilerCache.php
src/Core/Cache/RedisCache.php

index a13e003aab5fc43c7a136d179844a0a062f70e65..afb549f4dc68733c66fa853b4ba698f8751f086a 100644 (file)
@@ -87,7 +87,7 @@ HELP;
                }
 
                if ($this->getOption('v')) {
-                       $this->out('Cache Driver Name: ' . (string)$this->cache);
+                       $this->out('Cache Driver Name: ' . $this->cache->getName());
                        $this->out('Cache Driver Class: ' . get_class($this->cache));
                }
 
index 9afbf05c46783cbd31961ff80149a34d1c73f744..48880fe98609730baf77462e88af82c38e2d043f 100644 (file)
@@ -153,7 +153,10 @@ class APCuCache extends Cache implements IMemoryCache
                return true;
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_APCU;
        }
index 17fbe2f407ddcf2e1650989977e83d1d68214bf4..5add98cc2a8e69ef6929d52ce77d378ddaa91d39 100644 (file)
@@ -91,7 +91,10 @@ class ArrayCache extends Cache implements IMemoryCache
                }
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_ARRAY;
        }
index 4e24246e886e584f4c2d24b16b1c5aea2a5012ad..b40c129ae7fe20ba5716f3ba2de4513e5b02d550 100644 (file)
@@ -28,13 +28,6 @@ abstract class Cache implements ICache
        const MINUTE       = 60;
        const INFINITE     = 0;
 
-       /**
-        * Force each Cache implementation to define the ToString method
-        *
-        * @return string
-        */
-       abstract function __toString();
-
        /**
         * @var string The hostname
         */
index e0e371fe5ad10aa609b339ba1673127befad2b90..7fbbdb5e3ec3688a7a1d4d483314b28762b7aeab 100644 (file)
@@ -110,7 +110,10 @@ class DatabaseCache extends Cache implements ICache
                }
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_DATABASE;
        }
index 1ff6a8c52de5b8558c254b32265a2a503c8ba9aa..f8e98c568811af2ee019a9ff92689cdcf521327f 100644 (file)
@@ -54,4 +54,11 @@ interface ICache
         * @return bool
         */
        public function clear($outdated = true);
+
+       /**
+        * Returns the name of the current cache
+        *
+        * @return string
+        */
+       public function getName();
 }
index 002aabdfde68cfb44e5d532da42f1d23c6d686b7..717166952010d851bd50cf497a2738e77b45363c 100644 (file)
@@ -148,7 +148,10 @@ class MemcacheCache extends Cache implements IMemoryCache
                return $this->memcache->add($cachekey, serialize($value), MEMCACHE_COMPRESSED, $ttl);
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_MEMCACHE;
        }
index 9b54f05b02ab0884ec588eb7f9d3d1d277ee095c..ac0648a6ceeed06ff0ea702261cf1c37ce77c58e 100644 (file)
@@ -152,7 +152,10 @@ class MemcachedCache extends Cache implements IMemoryCache
                return $this->memcached->add($cachekey, $value, $ttl);
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_MEMCACHED;
        }
index d2b0092a8856eb659c961aa32a1e723385d48f96..d59b885609d6947766c8fceb216dd8d8cfd49df6 100644 (file)
@@ -152,8 +152,11 @@ class ProfilerCache implements ICache, IMemoryCache
                }
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function GetName()
        {
-               return (string)$this->cache . ' (with profiler)';
+               return $this->cache->getName() . ' (with profiler)';
        }
 }
index e3884e608657b5ac1f15906c27ee7554d1c1077a..5f8fd7e4ce35b56c872930f08899b443deb8b863 100644 (file)
@@ -192,7 +192,10 @@ class RedisCache extends Cache implements IMemoryCache
                return false;
        }
 
-       public function __toString()
+       /**
+        * {@inheritDoc}
+        */
+       public function getName()
        {
                return self::TYPE_REDIS;
        }