• File: ReflectionCacheArray.php
  • Full Path: /home/lef/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/auryn/lib/ReflectionCacheArray.php
  • File size: 538 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace WPML\Auryn;

class ReflectionCacheArray implements ReflectionCache
{
    private $cache = array();

    public function fetch($key)
    {
        // The additional isset() check here improves performance but we also
        // need array_key_exists() because some cached values === NULL.
        return (isset($this->cache[$key]) || array_key_exists($key, $this->cache))
            ? $this->cache[$key]
            : false;
    }

    public function store($key, $data)
    {
        $this->cache[$key] = $data;
    }
}