calc/src/Cache.php
2025-06-07 14:11:28 +02:00

25 lines
493 B
PHP

<?php
namespace PSC\Library\Calc;
class Cache {
private static $instance = null;
private $cache = [];
private function __construct() {}
public static function getInstance() {
if (self::$instance === null) {
self::$instance = new Cache();
}
return self::$instance;
}
public function set($key, $value) {
$this->cache[$key] = $value;
}
public function get($key) {
return $this->cache[$key] ?? null;
}
}