Problem/Motivation
From #3575324: Add return type documentation to ResourceTestBase
We want to add @return void to inform humans and PHPStan that a method should not return a value, but we cannot add an actual return type yet because downstream code needs to update first.
However, just adding @return void results in MissingReturnComment from FunctionCommentSniff: "Description for the @return value is missing", so we need to add a somewhat pointless description of "Returns nothing."
Steps to reproduce
Proposed resolution
Allow a missing description if the @return type is void.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork coder-3575389
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
klausiHm, I think you should not document return void, right? The coding standards say "Functions without return values must not have @return documentation.". https://project.pages.drupalcode.org/coding_standards/php/documentation/...
Ah I see, you want to do it for PHPStan ... I agree that the coding standards sentence does not make sense anyway, let people document that a functions returns void, by all means.
So I think we can do this!
Comment #3
longwaveThis will also help with #3486376: Extend Symfony DebugClassLoader to report missing cross-module @return types where
@return voidin core will notify modules that they should add void return types and that core intends to in the future.Comment #6
klausiMerged, thanks for reporting!
I'm not planning to release this on Coder 8, let me know if you need it there. But I think Drupal core can just upgrade to Coder 9.
I'm also planning to release Coder 9.0 soon.
Comment #8
klausiActually released Coder 9.0.0 now - happy upgrading!