public static function getRecursiveClassAnnotations(Reader $reader, ReflectionClass $class, string $annotationName): array
    {
        $result = [];

        $annotation = $reader->getClassAnnotation($class, $annotationName);
        if ($annotation) {
            $result[$class->getName()] = $annotation;
        }

        foreach ($class->getTraits() as $trait) {
            $result = array_merge($result, self::getRecursiveClassAnnotations($reader, $trait, $annotationName));
        }

        $parent = $class->getParentClass();
        if ($parent) {
            $result = array_merge($result, self::getRecursiveClassAnnotations($reader, $parent, $annotationName));
        }

        return $result;
    }