matzeeable / wp-hookdoc

:star: An API documentation generator for your WordPress actions and filters.
https://devowl.io
MIT License
51 stars 4 forks source link

Parsing fails when referencing namespaced parameters #4

Open zackkatz opened 3 years ago

zackkatz commented 3 years ago

When referencing namespaced objects, instead of generating a row for the parameter, the table has an empty row:

I tried a bunch of things but I'm afraid none work:

Then these work, but they show the quotes, which I don't want:

Here's an example docblock:

/**
 * Modify the reserved embed slugs that trigger a warning.
 *
 * @hook gravityview/rewrite/reserved_slugs
 * @since 2.5
 *
 * @param {array} $reserved_slugs An array of strings, reserved slugs.
 * @param {\GV\Template_Context} $gravityview The context.
 *
 * @returns {array}
 */

I understand that you're simulating @class by replacing @hook with @class and that JS doesn't have that PHP namespace notation, but I'd appreciate guidance!

matzeeable commented 3 years ago

Hey!

Thanks for your issue. Yeah, this is a known issue. But I haven't found the time to look at it in more detail yet. Currently, I can also unfortunately promise no date because I have not yet needed this.

As a temporary workaround you can do something like this:

/**
 * Modify the reserved embed slugs that trigger a warning.
 *
 * @hook gravityview/rewrite/reserved_slugs
 * @since 2.5
 *
 * @param {array} $reserved_slugs An array of strings, reserved slugs.
 * @param {Template_Context} $gravityview The context. (`\GV\Template_Context`)
 *
 * @returns {array}
 */

PRs welcome 😊