1d2aedb5145011caff4604470e422fef389c7f51
[yaffs-website] / vendor / symfony / expression-language / ParserCache / ArrayParserCache.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\ExpressionLanguage\ParserCache;
13
14 use Symfony\Component\ExpressionLanguage\ParsedExpression;
15
16 /**
17  * @author Adrien Brault <adrien.brault@gmail.com>
18  */
19 class ArrayParserCache implements ParserCacheInterface
20 {
21     /**
22      * @var array
23      */
24     private $cache = array();
25
26     /**
27      * {@inheritdoc}
28      */
29     public function fetch($key)
30     {
31         return isset($this->cache[$key]) ? $this->cache[$key] : null;
32     }
33
34     /**
35      * {@inheritdoc}
36      */
37     public function save($key, ParsedExpression $expression)
38     {
39         $this->cache[$key] = $expression;
40     }
41 }