Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
<?php

namespace PhpOffice\PhpSpreadsheet\Collection;

> use DateInterval;
use Psr\SimpleCache\CacheInterface; /** * This is the default implementation for in-memory cell collection. * * Alternatives implementation should leverage off-memory, non-volatile storage * to reduce overall memory usage. */ class Memory implements CacheInterface { private $cache = [];
> /** public function clear() > * @return bool { > */
$this->cache = []; return true; }
> /** public function delete($key) > * @param string $key { > * unset($this->cache[$key]); > * @return bool > */
return true; }
> /** public function deleteMultiple($keys) > * @param iterable $keys { > * foreach ($keys as $key) { > * @return bool $this->delete($key); > */
} return true; }
> /** public function get($key, $default = null) > * @param string $key { > * @param mixed $default if ($this->has($key)) { > * return $this->cache[$key]; > * @return mixed } > */
return $default; }
> /** public function getMultiple($keys, $default = null) > * @param iterable $keys { > * @param mixed $default $results = []; > * foreach ($keys as $key) { > * @return iterable $results[$key] = $this->get($key, $default); > */
} return $results; }
> /** public function has($key) > * @param string $key { > * return array_key_exists($key, $this->cache); > * @return bool } > */
> /** public function set($key, $value, $ttl = null) > * @param string $key { > * @param mixed $value $this->cache[$key] = $value; > * @param null|DateInterval|int $ttl > * return true; > * @return bool } > */
> /** public function setMultiple($values, $ttl = null) > * @param iterable $values { > * @param null|DateInterval|int $ttl foreach ($values as $key => $value) { > * $this->set($key, $value); > * @return bool } > */
return true; } }