ApiGen\Parser\Reflection\ReflectionElement::getAnnotationsFromReflection PHP 메소드

getAnnotationsFromReflection() 개인적인 메소드

private getAnnotationsFromReflection ( mixed $reflection ) : array
$reflection mixed
리턴 array
    private function getAnnotationsFromReflection($reflection)
    {
        $fileLevel = ['package' => true, 'subpackage' => true, 'author' => true, 'license' => true, 'copyright' => true];
        $annotations = [];
        if ($reflection instanceof ReflectionClass || $reflection instanceof ReflectionFunction || $reflection instanceof ReflectionConstant && $reflection->getDeclaringClassName() === null) {
            foreach ($reflection->getFileReflection()->getAnnotations() as $name => $value) {
                if (isset($fileLevel[$name]) && empty($annotations[$name])) {
                    $annotations[$name] = $value;
                }
            }
        }
        return $annotations;
    }