X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdflydev%2Fplaceholder-resolver%2Fsrc%2FDflydev%2FPlaceholderResolver%2FCache%2FCache.php;fp=vendor%2Fdflydev%2Fplaceholder-resolver%2Fsrc%2FDflydev%2FPlaceholderResolver%2FCache%2FCache.php;h=8defa31bfaa9454a6db2c61e6b62d6b0fa45fe56;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/dflydev/placeholder-resolver/src/Dflydev/PlaceholderResolver/Cache/Cache.php b/vendor/dflydev/placeholder-resolver/src/Dflydev/PlaceholderResolver/Cache/Cache.php new file mode 100644 index 000000000..8defa31bf --- /dev/null +++ b/vendor/dflydev/placeholder-resolver/src/Dflydev/PlaceholderResolver/Cache/Cache.php @@ -0,0 +1,62 @@ +cache); + } + + /** + * {@inheritdoc} + */ + public function get($placeholder) + { + if (is_array($placeholder)) { + throw new \RuntimeException('Placeholder is an array'); + } + + return array_key_exists((string) $placeholder, $this->cache) + ? $this->cache[(string) $placeholder] + : null; + } + + /** + * {@inheritdoc} + */ + public function set($placeholder, $value = null) + { + if (is_array($placeholder)) { + throw new \RuntimeException('Placeholder is an array'); + } + $this->cache[(string) $placeholder] = $value; + } + + /** + * {@inheritdoc} + */ + public function flush() + { + $this->cache = array(); + } +}