/** * @test */ public function proxyClassesStillContainDocCommentsFromItsOriginalClass() { $class = new ClassReflection(Fixtures\ClassWithDocComments::class); $expectedResult = 'This is a example doc comment which should be copied' . chr(10) . 'to the proxy class.'; $actualResult = $class->getDescription(); $this->assertSame($expectedResult, $actualResult); }
/** * Builds the class documentation block for the specified class keeping doc comments and vital annotations * * @return string $methodDocumentation DocComment for the given method */ protected function buildClassDocumentation() { $classDocumentation = "/**\n"; $classReflection = new ClassReflection($this->fullOriginalClassName); $classDescription = $classReflection->getDescription(); $classDocumentation .= ' * ' . str_replace("\n", "\n * ", $classDescription) . "\n"; foreach ($this->reflectionService->getClassAnnotations($this->fullOriginalClassName) as $annotation) { $classDocumentation .= ' * ' . Compiler::renderAnnotation($annotation) . "\n"; } $classDocumentation .= " */\n"; return $classDocumentation; }