-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add missing data type indicators to @return tags throughout core #3954
Comments
Have started on this, might take a while though... Also, some functions return values that could be different data types depending on what the parameters are, and there's no way of knowing ahead of time. For example, |
@BWPanda @return array|false
array of beautiful flower names if blah; otherwise false is a thing that happens. also see this initiative: #3213 |
Drupal used to use |
Yes, our documentation also says to separate multiple possible return data types with a vertical line, however I'm referring to situations where any data type could be returned. Do I then list all of them? I don't think that's ideal... Hence the |
😆
Thanks in advance for your time/effort @BWPanda 👍 |
It seems I have bitten off more than I can chew with this issue... So soon I'll post a PR of my work so far and then let others have a crack at the remainder. For anyone who wants to helps with this, I'll also post a list of the files where there are Here's how I've been doing it (but maybe there's a better way):
|
PR here. I made separate commits for folders/modules to make it easier to review than one huge commit. And here's the list of remaining files to fix:
|
Maybe we can commit multiple PRs for this so we at least make some progress. Most of it looks good @BWPanda though you'll need to replace "varied" with the actual types. |
@herbdool Multiple PRs are fine. Re 'varies', are you suggesting using |
Correct. Though in some cases it might not include object. Such as variable_get I think. |
Though just looked at config_get and it uses "mixed". Does it make it okay or should we correct those as well? https://github.com/backdrop/backdrop/blob/1.x/core/includes/config.inc |
Does someone have a link to the backdrop standard? I can't find it |
According to the documentation standards:
and:
Yet of the 2033
@return
tags I found in core, 1123 don't have a data type indicator (over 50%).Don't worry, I fix!
BTW, this is related to backdrop-ops/docs.backdropcms.org#64 because the fix I made there doesn't take into account
@return
tags without anything after them. And rather than try to account for those situations, why not just fix those situations?The text was updated successfully, but these errors were encountered: