Files
cmsPRO/tests/stubs/CacheHandler.php
Jacek Pyziak 2e715e803e Fix: testy + bugfix SettingsRepository::allSettings() + migracja phpunit.xml
- SettingsRepository::allSettings() — inicjalizacja $settings = [] przed pętlą
  (bug: false ?? [] zwracało false gdy cache pusty a DB null)
- Stuby wydzielone do tests/stubs/CacheHandler.php + S.php
- phpunit.xml zmigurowany do schematu PHPUnit 10 (coverage → source)
- composer.lock dodany do repozytorium

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 23:56:00 +01:00

25 lines
498 B
PHP

<?php
namespace Shared\Cache;
class CacheHandler
{
private static array $store = [];
public static function reset(): void { self::$store = []; }
public static function fetch(string $key): mixed
{
return self::$store[$key] ?? false;
}
public static function store(string $key, mixed $value, int $ttl = 0): void
{
self::$store[$key] = $value;
}
public static function delete(string $key): void
{
unset(self::$store[$key]);
}
}