diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 3e5b4f954174d..5a46b8c786b22 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -3384,11 +3384,6 @@ providers]]> - - - - - diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 1dfbd6cc06de8..8bc0887be64fb 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1188,7 +1188,6 @@ 'OC\\BinaryFinder' => $baseDir . '/lib/private/BinaryFinder.php', 'OC\\Blurhash\\Listener\\GenerateBlurhashMetadata' => $baseDir . '/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php', 'OC\\Broadcast\\Events\\BroadcastEvent' => $baseDir . '/lib/private/Broadcast/Events/BroadcastEvent.php', - 'OC\\Cache\\CappedMemoryCache' => $baseDir . '/lib/private/Cache/CappedMemoryCache.php', 'OC\\Cache\\File' => $baseDir . '/lib/private/Cache/File.php', 'OC\\Calendar\\AvailabilityResult' => $baseDir . '/lib/private/Calendar/AvailabilityResult.php', 'OC\\Calendar\\CalendarEventBuilder' => $baseDir . '/lib/private/Calendar/CalendarEventBuilder.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 4666d78706383..631b7664b6643 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1229,7 +1229,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\BinaryFinder' => __DIR__ . '/../../..' . '/lib/private/BinaryFinder.php', 'OC\\Blurhash\\Listener\\GenerateBlurhashMetadata' => __DIR__ . '/../../..' . '/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php', 'OC\\Broadcast\\Events\\BroadcastEvent' => __DIR__ . '/../../..' . '/lib/private/Broadcast/Events/BroadcastEvent.php', - 'OC\\Cache\\CappedMemoryCache' => __DIR__ . '/../../..' . '/lib/private/Cache/CappedMemoryCache.php', 'OC\\Cache\\File' => __DIR__ . '/../../..' . '/lib/private/Cache/File.php', 'OC\\Calendar\\AvailabilityResult' => __DIR__ . '/../../..' . '/lib/private/Calendar/AvailabilityResult.php', 'OC\\Calendar\\CalendarEventBuilder' => __DIR__ . '/../../..' . '/lib/private/Calendar/CalendarEventBuilder.php', diff --git a/lib/private/Cache/CappedMemoryCache.php b/lib/private/Cache/CappedMemoryCache.php deleted file mode 100644 index 999ed8a7a74e2..0000000000000 --- a/lib/private/Cache/CappedMemoryCache.php +++ /dev/null @@ -1,109 +0,0 @@ -capacity = $capacity; - } - - public function hasKey($key): bool { - return isset($this->cache[$key]); - } - - /** - * @return ?T - */ - public function get($key) { - return $this->cache[$key] ?? null; - } - - /** - * @param string $key - * @param T $value - * @param int $ttl - * @return bool - */ - public function set($key, $value, $ttl = 0): bool { - if (is_null($key)) { - $this->cache[] = $value; - } else { - $this->cache[$key] = $value; - } - $this->garbageCollect(); - return true; - } - - public function remove($key) { - unset($this->cache[$key]); - return true; - } - - public function clear($prefix = '') { - $this->cache = []; - return true; - } - - public function offsetExists($offset): bool { - return $this->hasKey($offset); - } - - /** - * @return T - */ - #[\ReturnTypeWillChange] - public function &offsetGet($offset) { - return $this->cache[$offset]; - } - - /** - * @param string $offset - * @param T $value - * @return void - */ - public function offsetSet($offset, $value): void { - $this->set($offset, $value); - } - - public function offsetUnset($offset): void { - $this->remove($offset); - } - - /** - * @return T[] - */ - public function getData() { - return $this->cache; - } - - - private function garbageCollect() { - while (count($this->cache) > $this->capacity) { - reset($this->cache); - $key = key($this->cache); - $this->remove($key); - } - } - - public static function isAvailable(): bool { - return true; - } -}