private function generate_hook_info($type, $reflector, $args)
    {
        $output = [
            'type' => $type,
            'file_name' => $reflector->getFileName(),
            'line_number' => $reflector->getStartLine(),
            'class' => null,
            'name' => null,
            'is_internal' => false,
        ];

        if ($reflector instanceof ReflectionMethod) {
            $output['class'] = $reflector->getDeclaringClass()->getName();
        }

        if ('Closure' !== $type) {
            $output['name'] = $reflector->getName();
            $output['is_internal'] = $reflector->isInternal();
        }

        $output['accepted_args'] = $args;

        return $output;
    }