]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/Cache.php
Merge pull request #7754 from annando/aria
[friendica.git] / src / Core / Cache / Cache.php
index 4e24246e886e584f4c2d24b16b1c5aea2a5012ad..cf5b15d052afb877b36ac0b3a47c38abcc2ac3e2 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
         */
@@ -91,19 +84,19 @@ abstract class Cache implements ICache
         * Filters the keys of an array with a given prefix
         * Returns the filtered keys as an new array
         *
-        * @param array $array The array, which should get filtered
+        * @param array $keys The keys, which should get filtered
         * @param string|null $prefix The prefix (if null, all keys will get returned)
         *
         * @return array The filtered array with just the keys
         */
-       protected function filterArrayKeysByPrefix($array, $prefix = null)
+       protected function filterArrayKeysByPrefix(array $keys, string $prefix = null)
        {
                if (empty($prefix)) {
-                       return array_keys($array);
+                       return $keys;
                } else {
                        $result = [];
 
-                       foreach (array_keys($array) as $key) {
+                       foreach ($keys as $key) {
                                if (strpos($key, $prefix) === 0) {
                                        array_push($result, $key);
                                }