adaptor = new $class($expire); } else { throw new \Exception('Error: Could not load cache adaptor ' . $adaptor . ' cache!'); } } /** * Gets a cache by key name. * * @param string $key The cache key name * * @return string */ public function get(string $key): array|string|null { return $this->adaptor->get($key); } /** * Set * * Sets a cache by key value. * * @param string $key The cache key * @param string $value The cache value * * @return string */ public function set(string $key, array|string|null $value, int $expire = 0): void { $this->adaptor->set($key, $value, $expire); } /** * Deletes a cache by key name. * * @param string $key The cache key */ public function delete(string $key): void { $this->adaptor->delete($key); } }