- π¦πΉAustria drunken monkey Vienna, Austria
Itβs documented a bit further down, under Indicating data types in documentation β . But yes, I also often struggle to find things in our documentation.
- π§πͺBelgium borisson_ Mechelen, π§πͺ
You may omit the description if using @return $this or @return static.
This is already in the docs. So that should be fine already? What do we need to do for this issue?
- π³πΏNew Zealand quietone
@borisson_, thanks for finding that sentence! I surely missed it.
So, the sentence is in the section "Indicating data types in documentation" which is the wrong place. It should be with the '@return'. I have updated the issue summary with the proposal. The difference is also to add
@return self
. - π³πΏNew Zealand quietone
Testing with Drupal.Commenting.FunctionComment.MissingReturnComment enabled and "@return $this", and "@return static" pass without a comment but "@return self" fails with "Description for the @return value is missing".
- π³πΏNew Zealand quietone
Updated title. I also changed the current and proposed text since the information is in a different section.
There is a TBA in the proposed text which needs to completed.
- π§πͺBelgium borisson_ Mechelen, π§πͺ
Filled in the when TBA,
return static is only useful because it can do late binding, which is really helpful when that class is extended by another one. However final classes cannot be extended, so they can use self instead. - π¦πΉAustria drunken monkey Vienna, Austria
Added a comma in the proposed text, but looks good otherwise.