Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formatting of return values #64

Closed
klonos opened this issue Jun 19, 2019 · 5 comments · Fixed by backdrop-contrib/api#3
Closed

Improve formatting of return values #64

klonos opened this issue Jun 19, 2019 · 5 comments · Fixed by backdrop-contrib/api#3

Comments

@klonos
Copy link
Member

klonos commented Jun 19, 2019

In code:

/**
 * Legacy wrapper to return the vocabulary object matching a vocabulary machine
 * name.
 *
 * @param $machine_name
 *   The vocabulary's machine name.
 *
 * @return TaxonomyVocabulary|false
 *   The taxonomy vocabulary, if it exists, FALSE otherwise. Results are
 *   statically cached.
 *
 * @see taxonomy_vocabulary_machine_name_load()
 */
function taxonomy_vocabulary_load($machine_name) {
  $vocabularies = taxonomy_vocabulary_load_multiple(array($machine_name));
  return reset($vocabularies);
}

How this gets rendered:

Screen Shot 2019-06-20 at 4 59 07 am

...there should be a line break there, or some other sort of separation between TaxonomyVocabulary|false and the rest of the sentence.

@klonos
Copy link
Member Author

klonos commented Jun 19, 2019

...perhaps bold the return value, and add a column after it (same as we do with params)? So that it is rendered like so instead:

Screen Shot 2019-06-20 at 5 18 52 am

@ghost ghost self-assigned this Aug 1, 2019
@ghost
Copy link

ghost commented Aug 1, 2019

Working on this...

@ghost
Copy link

ghost commented Aug 2, 2019

PR made to API module that addresses this.

As mentioned in the PR, this does a weird thing with @return tags with no following data type indicator (bolding the first line of the documentation instead), but I see this as a bug with the @return tags, not the regex here...

@jenlampton
Copy link
Member

jenlampton commented Nov 24, 2019

@BWPanda I applied your patch to the API module, but I'm not seeing a line-break on the taxonomy_vocabulary_load() page.

edit: oh, duh. I bet it needs to re-scan the files first... maybe I do that by running cron? Aha! I found the "reparse" button :) I'll leave this issue open until we can confirm this fix is working, but I expect it's just a matter of time now.

@jenlampton jenlampton reopened this Nov 24, 2019
@ghost
Copy link

ghost commented Mar 2, 2021

This is working (https://docs.backdropcms.org/api/backdrop/core%21modules%21taxonomy%21taxonomy.module/function/taxonomy_vocabulary_load/1), so we can close.

@ghost ghost closed this as completed Mar 2, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants