As described in #2471485: Standardize getter docblocks we want to standardize on using "Gets" instead of "Returns" on getter docblocks, matching the outside world and making core internally consistent. In general, we make the verb match the one in the method name.

Drupal\Component is the part of Drupal that's the most outwards facing, so it makes sense to start from there.

I will reroll any patch broken by these changes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
16.8 KB
anavarre’s picture

+++ b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
@@ -162,7 +162,14 @@ public function delete($name) {
-   * Gets the full path of the containing directory where the file is or should be stored.

Should be wrapped at 80 cols.

Else this looks good to me.

bojanz’s picture

Addressed #2.

Dom.’s picture

Status: Needs review » Needs work
FileSize
9.35 KB

Hi !
For me, a lot are missing to follow the convention strictly. I just added some of those per example in the file attached. What do you think ?

anavarre’s picture

bojanz’s picture

Status: Needs work » Needs review
FileSize
22.26 KB

I've fixed the "Get" instances.

Dom.’s picture

Still some missings.... sorry
Example DataTimePLus.php :

  /**
   * Retrieves error messages.
   *
   * Public function to return the error messages.
   */
  public function getErrors() {
    return $this->errors;
  }

You could look at all occurences of "function get" in Drupal/Component folder.

Dom.’s picture

Status: Needs review » Needs work
bojanz’s picture

Status: Needs work » Needs review
FileSize
22.7 KB

Done that one as well.
I'm stopping here, it's fine if we miss a few in the initial go, as long as most of them are covered.

dawehner’s picture

+++ b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
@@ -162,7 +162,15 @@ public function delete($name) {
+   * Gets the full path of the containing directory where the file is or should
+   * be stored.

So strictly we have the one line thing for the first row, should we tackle that here?

bojanz’s picture

Changed it to "Gets the full path of the file's containing directory.", the full description remains in @returns.

dawehner’s picture

Component: base system » documentation
Status: Needs review » Reviewed & tested by the community

Thank you!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: 2471571-11-standardize-getter-docblocks.patch, failed testing.

bojanz’s picture

Status: Needs work » Needs review

Come on, testbot.

Status: Needs review » Needs work

The last submitted patch, 11: 2471571-11-standardize-getter-docblocks.patch, failed testing.

Status: Needs work » Needs review
bojanz’s picture

Status: Needs review » Reviewed & tested by the community

And we're back.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: 2471571-11-standardize-getter-docblocks.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: 2471571-11-standardize-getter-docblocks.patch, failed testing.

bojanz’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
22.96 KB

Rebased.

  • xjm committed 20e4eda on 8.0.x
    Issue #2471571 by bojanz, Dom.: Standardize getter docblocks in Drupal\...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

This issue only changes documentation, so per https://www.drupal.org/core/beta-changes, this can be completed any time during the Drupal 8 beta phase. Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.