- Issue created by @quietone
- Merge request !111843504776: Fixed Drupal commenting description value. → (Closed) created by Vighneshh
- 🇺🇸United States smustgrave
Only looked at like 3
* @return array * The render array.
Render array of what?
- 🇳🇿New Zealand quietone
I did some research on
@return void
. I searched the Coder issue queue and found #1519442: Add sniff for @return void → which led me to #1510838: Define and document @return void policy → . Comment #1 of that issue says the when there is no return value then the @return is not needed. I then checked the standards for @return → and it states,Drupal standards: The documentation is indented two spaces (see example). Data types are required to be included as of Drupal 8.x. Functions without return values must not have @return documentation.
and there at Drupal API documentation standards for functions →
If there is no return value for a function, there must not be a @return tag.
I then looked at the instances of
@return void
in tests and used git blame (using PHPStorm) to see when they were committed. All were committed in 2024 or 2025 and in issues not related to standards. Perhaps people are working to be thorough?So, to enable the sniff, we need to remove
@return void
. - First commit to issue fork.
- 🇬🇧United Kingdom oily Greater London
I understand from #6 that any non-test files with a @return void should have the @return removed. i have committed that one edit. The other @return void blocks are in test files so i have left those alone.
- First commit to issue fork.
- 🇮🇳India annmarysruthy
Updated comments for return values as per review comment #5.
- 🇳🇿New Zealand quietone
I went to rebase this due to recent commits and there are a huge number of conflicts. On a closer look this has changes to core/tests, which is done in another issue. All of those are out of scope and unfortunately, duplicating work in another issue. I didn't look at the scope when I visited this issue a few days ago. That seems like a good reminder to all of us to check the scope of an issue.
I have rebased, removing the out of scope changes.
This does need a followup work for '@return void'. I guess one in coding standards to sort that out.
- 🇳🇿New Zealand quietone
Did cleanup here and removed the out of scope changes and the '@return void'.
I think what is left is to improve the comments in core/modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php, some of which are incomplete sentences.
- 🇳🇿New Zealand quietone
I read the test \Drupal\Tests\system\Functional\Render\PlaceholderMessageTest::testMessagePlaceholder to improve the descriptions for the @return descriptions in RenderPlaceholderMessageTestController.php.
Linting has passed, so back to NR.
- 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
To me, this looks like it is good to go. While not all the documentation is perfect, it's a lot better than nothing.
- First commit to issue fork.
Automatically closed - issue fixed for 2 weeks with no activity.