1: <?php
2: /**
3: * Sastrawi (https://github.com/sastrawi/sastrawi)
4: *
5: * @link http://github.com/sastrawi/sastrawi for the canonical source repository
6: * @license https://github.com/sastrawi/sastrawi/blob/master/LICENSE The MIT License (MIT)
7: */
8:
9: namespace Sastrawi\Stemmer\Cache;
10:
11: class ArrayCache implements CacheInterface
12: {
13: protected $data = array();
14:
15: public function set($key, $value)
16: {
17: $this->data[$key] = $value;
18: }
19:
20: public function get($key)
21: {
22: if (isset($this->data[$key])) {
23: return $this->data[$key];
24: }
25: }
26:
27: public function has($key)
28: {
29: return isset($this->data[$key]);
30: }
31: }
32: