Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class SimpleCacheAdaptor implements ValidatorCache |
||
19 | { |
||
20 | /** |
||
21 | * @param string $class |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | public static function normalizeKey($class) |
||
26 | { |
||
27 | return strtr($class, '\\', '.'); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @var SimpleCache |
||
32 | */ |
||
33 | private $cache; |
||
34 | |||
35 | /** |
||
36 | * @param SimpleCache $cache |
||
37 | */ |
||
38 | public function __construct(SimpleCache $cache) |
||
39 | { |
||
40 | $this->cache = $cache; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | public function has($class) |
||
47 | { |
||
48 | return $this->cache->has(self::normalizeKey($class)); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritdoc |
||
53 | */ |
||
54 | public function read($class) |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | public function write(ClassMetadata $metadata) |
||
67 | } |
||
68 | } |
||
69 |