/** * @param string $key * @param string $tag * * @return \Psr\Cache\CacheItemInterface */ private function getCacheItemFromKey($key, $tag) { $item = $this->cache->getItem(KeyNormalizer::noInvalid($key)); if ($item instanceof TaggableItemInterface) { $item->setTags(['router', $tag]); } return $item; }
public function testNoInvalid() { $input = '{foo@bar}'; $expected = 'foobar'; $this->assertEquals($expected, KeyNormalizer::noInvalid($input)); }