/** * @param string $docComment * @return AnnotationList */ private function getCachedAnnotations($docComment) { if (self::$cacheContainer === null) { return null; } $annotations = self::$cacheContainer->fetch($docComment); return $annotations; }
/** * Test if can fetch a previous stored annotation list. */ public function testFetchAnnotationList() { /* @var \com\mohiva\common\lang\AnnotationReflector $class */ $class = new ReflectionClass(self::TEST_CLASS); $docReflector = new ReflectionDocComment($class); $annotationList = $docReflector->getAnnotationList(); $key = new HashKey(Hash::ALGO_SHA1, 'php://temp'); $adapter = new ResourceAdapter(new TempResourceContainer(TempFileResource::TYPE)); $container = new AnnotationContainer($adapter, $key); $container->store($class->getDocComment(), $annotationList); $this->assertEquals($container->fetch($class->getDocComment()), $annotationList); }