Skip to content

feat: add raw desc fields - #86

Open
OulipianSummer wants to merge 1 commit into
code-lts:mainfrom
OulipianSummer:raw_desc
Open

OulipianSummer wants to merge 1 commit into
code-lts:mainfrom
OulipianSummer:raw_desc

Conversation

@OulipianSummer

@OulipianSummer OulipianSummer commented Nov 18, 2026 •

Copy link
Copy Markdown

This PR introduces a new field for classes and functions called raw_desc. It is a raw, unprocessed, unparsed version of the docblock before the parser has touched it. This can be a useful target for custom theme support where you can reference the original docblock and pull any content out of it using whatever mothod you like without having to fight the internal parser first.

This can be a nice alternative to the longDesc field, especially if your documentation uses a lot of inline tags inside of text, which currently break the parser. See: #81. The linked issue will likely need a little extra help in order to get resolved, but this is a nice first step.

Sample output:

    "name": "Doctum\\Reflection\\MethodReflection",
   ....
    "properties": {
        "class": {
            "name": "class",
            "line": 21,
            "short_desc": "",
            "long_desc": "",
            "raw_desc": "\/** @var ClassReflection *\/",
            "hint": [
                [
                    "\\Doctum\\Reflection\\ClassReflection",
                    false
                ]
            ],
            "hint_desc": "",
            "tags": [],
            "modifiers": 2,
            "default": null,
            "errors": [],
            "is_read_only": false,
            "is_write_only": false,
            "is_intersection_type": false
        },
       ...
        "setModifiers": {
            "name": "setModifiers",
            "line": 56,
            "short_desc": "Set the modifier flags",
            "long_desc": "",
            "raw_desc": "\/**\n     * Set the modifier flags\n     *\n     * @phpstan-param self::MODIFIER_*|int $modifiers\n     *\/",
            "hint": [
                [
                    "void",
                    false
                ]
            ],
            "hint_desc": null,
            "tags": [],
            "see": [],
            "modifiers": 1,
            "is_by_ref": "",
            "is_intersection_type": false,
            "exceptions": [],
            "errors": [],
            "parameters": {
                "modifiers": {
                    "name": "modifiers",
                    "line": 56,
                    "short_desc": null,
                    "long_desc": null,
                    "raw_desc": null,
                    "hint": [
                        [
                            "int",
                            false
                        ]
                    ],
                    "tags": [],
                    "modifiers": 0,
                    "default": null,
                    "variadic": false,
                    "is_by_ref": false,
                    "is_read_only": false,
                    "is_intersection_type": false
                }
            }
        },
       ...

This addresses: #82

@OulipianSummer
OulipianSummer marked this pull request as ready for review November 20, 2026 02:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant