function it_might_have_annotations(ReflectionClass $reflectionClass, AnnotationScanner $annotations) { $docBlock = <<<'BLOCK' /** * @Target("CLASS") */ BLOCK; $expectedAnnotations = [new Target(['value' => "CLASS"])]; $reflectionClass->getDocComment()->willReturn($docBlock); $annotations->scanForAnnotations($docBlock, $this->fileName, $this->imports)->willReturn(new Annotations($expectedAnnotations)); $this->annotations()->shouldBeLike(new Annotations($expectedAnnotations)); }
/** * {@inheritDoc} */ public function getDocComment() { return $this->betterReflectionClass->getDocComment(); }
/** * @param \BetterReflection\Reflection\ReflectionClass $class * * @return \phpDocumentor\Reflection\DocBlock */ public function getClassDocBlock(ReflectionClass $class) { return new DocBlock($class->getDocComment()); }
public function annotations() : Annotations { return $this->annotations->scanForAnnotations($this->reflectionClass->getDocComment(), $this->reflectionClass->getFileName(), $this->imports); }