https://www.drupal.org/node/1354#return

was saying

The @return tag is followed by an optional data type indicator, and then a newline. The following paragraph is considered by the API module to be documentation.

We know mentioning data type is optional, every where drupal follows as * @return array but in 5 places it uses * @return array()

File : core/lib/Drupal/Core/Field/FormatterInterface.php
function - settingsSummary()

File : core/modules/block_content/block_content.module
function - block_content_add_body_field($block_type_id, $label = 'Body')

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

krknth created an issue. See original summary.

krknth’s picture

krknth’s picture

Status: Active » Needs review
Chi’s picture

Status: Needs review » Needs work

The return documentation lines should be ending in a period.

krknth’s picture

The last submitted patch, 2: 2594041-1.patch, failed testing.

Chi’s picture

Version: 8.0.0-rc1 » 8.0.x-dev
Status: Needs review » Reviewed & tested by the community

Looks good for me.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/block_content/block_content.module
index 6f5fbd0..71c43fc 100644
--- a/vendor/symfony/console/Helper/Table.php

--- a/vendor/symfony/console/Helper/Table.php
+++ b/vendor/symfony/console/Helper/Table.php

+++ b/vendor/symfony/console/Helper/Table.php
index e406f0a..3981546 100644
--- a/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php

--- a/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php
+++ b/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php

We should not be changing vendor code.

Feel free to open an upstream pull request for Symfony and Twig, though! ;-)

krknth’s picture

@tstoeckler : removed for vendor code.

patch attached

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Yay, back to RTBC. Thanks @krknth!

alexpott’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/lib/Drupal/Core/Field/FormatterInterface.php
    @@ -39,7 +39,7 @@ public function settingsForm(array $form, FormStateInterface $form_state);
    -   * @return array()
    +   * @return array
    

    This would be more helpful if it was string[] as it is an array of strings that are joined together to make a summary.

  2. +++ b/core/modules/block_content/block_content.module
    @@ -72,7 +72,7 @@ function block_content_entity_type_alter(array &$entity_types) {
    - * @return array()
    + * @return array
    

    This is not an array it is an instance of FieldConfig.

krknth’s picture

Hi @alexpott,
Updated your comments

Attached new patch

krknth’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: 2594041-4.patch, failed testing.

krknth’s picture

krknth’s picture

Status: Needs work » Needs review

The last submitted patch, 12: 2594041-4.patch, failed testing.

Chi’s picture

Status: Needs review » Needs work
+++ b/core/modules/block_content/block_content.module
@@ -72,8 +72,7 @@ function block_content_entity_type_alter(array &$entity_types) {
+ * @return \Drupal\field\Entity\FieldConfig Body field.

'Body field' should remain on the next line.

BTW, does it need to be prepended with 'A' or 'The'?

krknth’s picture

Hi @Chi,

Actually i referred from core/modules/node/node.module file :(

So now updated in both files with * The Body field. as new line.

Not sure about 'A' or 'The', But i used 'The'.

krknth’s picture

Status: Needs work » Needs review

The last submitted patch, 12: 2594041-4.patch, failed testing.

Chi’s picture

@krknth, you might find it useful.
https://www.drupal.org/node/2585781#comment-10458727

krknth’s picture

Assigned: Unassigned » krknth
Status: Needs review » Needs work
krknth’s picture

Assigned: krknth » Unassigned
Status: Needs work » Needs review
FileSize
1.83 KB

Improved comment block as suggested by @Chi

needs review

cilefen’s picture

This issue needs a title update and an issue summary update to explain its purpose for the documentation maintainer.

Chi’s picture

Title: Coding standards - '@return: Function return values' should be array or array() ? » Coding standards - replace array() with array in return values.
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs title update

Looks good for me.

The last submitted patch, 12: 2594041-4.patch, failed testing.

Chi’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs issue summary update

Committed 99c0b88 and pushed to 8.0.x. Thanks!

  • alexpott committed 99c0b88 on 8.0.x
    Issue #2594041 by krknth, Chi: Coding standards - replace array() with...

Status: Fixed » Closed (fixed)

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

N.kishorekumar’s picture