Found few places that misplaced @return & @throws tags in /core/lib/Drupal

core/lib/Drupal/Component/
core/lib/Drupal/Core/Access/AccessManager.php
core/lib/Drupal/Core/Config/ConfigImporter.php
core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php
core/lib/Drupal/Core/DependencyInjection/ClassResolverInterface.php
core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php
core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php
core/lib/Drupal/Core/Entity/FieldableEntityInterface.php
core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php
core/lib/Drupal/Core/Entity/Query/Sql/Query.php
core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php
core/lib/Drupal/Core/Executable/ExecutableManagerInterface.php
core/lib/Drupal/Core/Extension/module.api.php
core/lib/Drupal/Core/Field/FieldItemInterface.php
core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php
core/lib/Drupal/Core/ParamConverter/EntityConverter.php
core/lib/Drupal/Core/ParamConverter/ParamConverterManagerInterface.php
core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php
core/lib/Drupal/Core/Render/RendererInterface.php
core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php
core/lib/Drupal/Core/TypedData/ListDataDefinitionInterface.php
core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php
core/lib/Drupal.php
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

krknth created an issue. See original summary.

krknth’s picture

Title: Fixing order of documentation sections form /drupal/core/lib/Drupal » Fixing order of documentation sections for /drupal/core/lib/Drupal
krknth’s picture

Title: Fixing order of documentation sections for /drupal/core/lib/Drupal » Fixing order of documentation sections for /core/lib/Drupal
jhodgdon’s picture

Status: Needs work » Active

No patch yet, so just "active" not "needs work".

krknth’s picture

Title: Fixing order of documentation sections for /core/lib/Drupal » Fixing order of documentation sections for /core/lib/Drupal/Component
Issue summary: View changes
Status: Active » Needs review
FileSize
2.84 KB

Added patch

Needs review.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine, thanks!

blackra’s picture

blackra’s picture

Fixed a typo in the patch numbering.

rhett.prichard’s picture

Verified patch [#2599524-8.patch] from [#2599524] by reapplying all the children's patches of this issues's parent. git diff showed no differences.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Oh, that was my fault (partly). I suggested to krknth in IRC that the patches be "not too big and not too small" rather than all one big huge issue. So they were split up... maybe slightly smaller than they should have, but it was my suggestion.

Anyway, thanks for the combined patch. I actually prefer smaller patches for reviewing, but that's OK. :)

There are 3 problems with the docs in this patch, which are out of scope for this issue and should be addressed in a separate issue:

  1. +++ b/core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php
    @@ -45,13 +45,13 @@ public function __construct(SelectionPluginManagerInterface $selection_manager)
    +   *   Thrown when the current user doesn't have access to the specifies entity.
    

    Typo:

    specifies -> specified

  2. +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php
    @@ -92,11 +92,11 @@ public function execute() {
    +   *   Thrown if the base table does not exists.
    

    exists => exist

  3. 
    +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
    @@ -235,7 +235,9 @@ public function isFieldCaseSensitive($field_name) {
    
    @@ -235,7 +235,9 @@ public function isFieldCaseSensitive($field_name) {
        * Join entity table if necessary and return the alias for it.
        *
        * @param string $property
    +   *
        * @return string
    +   *
        * @throws \Drupal\Core\Entity\Query\QueryException
        */
    

    Sigh. This @param and @return need to have docs added to them. Having @param and @return with only a type and no documentation is not OK.

krknth’s picture

xjm’s picture

Issue tags: +rc eligible

Thanks @krknth!

  • xjm committed 4a1e1c0 on 8.0.x
    Issue #2599524 by blackra, krknth, jhodgdon, rhett.prichard: Fixing...
xjm’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

Regarding splitting up the patches, I agree for changes that actually involve different patterns of work or new work, e.g. for #2594909: Missing @return tags in function/method comments in the core/modules folder it would not make sense to try to write lots of missing @return docs in one patch since each one would be different. But for something like this where the changes are one or two of the same kinds of simple fixes (just moving lines around) throughout the whole file, it's preferable (and more fair in terms of issue credit) to have one 28K patch rather than five 5K patches or whatever. On the other hand, over a certain number of lines of code, the patch does become unreviewable. I remember reading some research about this but can't locate it. (See my related comment on #2572635-14: Fix 'Drupal.Commenting.DocComment.LongFullStop' coding standard). We have a long-outstanding todo to document such recommendations more clearly; an old draft is in https://docs.google.com/document/d/1zYDnu45djDBcU87sNgKk15C5XDBYzNHvahoq....

Note that as far as we could tell when looking into this at BADCamp, there is not yet a coder rule to check for the order of these documentation sections, meaning there's not an existing child of #2571965: [meta] Fix PHP coding standards in core that would fix this as far as I can see. There might be a rule for blank lines between each @whichever grouping; that I didn't check for. A followup would be to patch coder to add rules for the things fixed here (canonical ordering of documentation sections and blank lines separating them).

In any case, committed and pushed to 8.0.x. Thanks everyone to getting this issue sorted out consistently!

blackra’s picture

The current coder module does not appear to check this and I could not find an existing issue on this subject so I have created #2605986: Missing check for ordering of comment tags.

Status: Fixed » Closed (fixed)

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