Problem/Motivation

Inline @var declarations should use the /** */ delimiters

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork flag-3296129

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sharayurajput created an issue. See original summary.

urvashi_vora’s picture

Hey @sharayurajput,

since there is no activity for 5 days. I am assigning this to myself.

urvashi_vora’s picture

Hi,

I have resolved all issues where the @var tag were declared inline and needed "/** */" delimiters.

I will upload a patch.

Thanks

urvashi_vora’s picture

Assigned: urvashi_vora » Unassigned
Status: Active » Needs review
StatusFileSize
new4.48 KB

Hi,

Please review this patch.

Thanks

sharayurajput’s picture

Assigned: Unassigned » sharayurajput

I will review this patch

sharayurajput’s picture

These coding standards were encountered -
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
and the error of trailing whitespaces is encountered so adding patch here

sharayurajput’s picture

Assigned: sharayurajput » Unassigned
StatusFileSize
new5.18 KB
Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Status: Needs review » Needs work
StatusFileSize
new84.76 KB

#7 having whitespace errors.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.18 KB
atul_ghate’s picture

Assigned: Unassigned » atul_ghate

Hi,
i will review this patch.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
Status: Needs review » Needs work

#9patch resolved a number of coding standards issues, but there are still many remaining, so moving to needs work

ayush.khare’s picture

Status: Needs work » Needs review
StatusFileSize
new12.78 KB
new8.44 KB

Resolved remaining phpcs issues in #9 patch.

erikaagp’s picture

I'll review it

erikaagp’s picture

Status: Needs review » Needs work

The phpcs errors are still appearing, actually there are too many...

erikaagp’s picture

Status: Needs work » Reviewed & tested by the community

sorry, I didn't see something. The coding standards related with Inline @var declarations are already fixed! Btw... There are other issues related with flag that are shown.

ptmkenny’s picture

Priority: Normal » Minor
Status: Reviewed & tested by the community » Needs work

The patch in #12 is making changes unrelated to the coding standard fix:

-    $flags = \Drupal::service('flag')->getAllFlags($type);
-    $object = $data[$type];
-    foreach ($flags as $flag) {
-      foreach ($tokens as $name => $original) {
-        $flag_count_token = 'flag-' . str_replace('_', '-', $flag->name) . '-count';
-        $flag_link_token = 'flag-' . str_replace('_', '-', $flag->name) . '-link';
-        if ($name == $flag_count_token) {
-          $replacements[$original] = $flag->get_count($flag->get_entity_id($object));
-        }
-        elseif ($name == $flag_link_token) {
-          $replacements[$original] = flag_create_link($flag->name, $flag->get_entity_id($object));
-        }
-      }
-    }
+  $flags = \Drupal::service('flag')->getAllFlags($type);
+  $object = $data[$type];
+  foreach ($flags as $flag) {
+  foreach ($tokens as $name => $original) {
+  $flag_count_token = 'flag-' . str_replace('_', '-', $flag->name) . '-count';
+  $flag_link_token = 'flag-' . str_replace('_', '-', $flag->name) . '-link';
+  if ($name == $flag_count_token) {
+  $replacements[$original] = $flag->get_count($flag->get_entity_id($object));
+  }
+  elseif ($name == $flag_link_token) {
+  $replacements[$original] = flag_create_link($flag->name, $flag->get_entity_id($object));
+  }
+  }
+  }

This is a violation of the indentation standard and needs to be fixed.

ptmkenny’s picture

Status: Needs work » Needs review

Upon closer inspection, #12 is a reroll of #9, but #9 is actually fine, while #12 has indentation problems. So #9 should be the correct patch, as the issue title is "Fix coding standard - Inline @var declarations should use the /** */ delimiters", not "fix all coding standards."

Actually, #7 would be ok too I think, except the # in the patch file name breaks composer patching.

I'm setting this back to "needs review" as someone else should also confirm this analysis that #9 is the patch that best solves this issue at present.

gabrieldv’s picture

Status: Needs review » Reviewed & tested by the community

Tested here and the #9 patch does the job in the issue scope, so i'm moving it to RTBC.

Remember to use the #9 patch as the final one.

ivnish’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs reroll to MR

tr made their first commit to this issue’s fork.

tr’s picture

Status: Needs work » Active

None of the above patches fixed the error correctly, and all except #4 by @urvashi_vora had out-of-scope changes. I created a MR to fix just the phpcs errors mentioned in the title.

tr’s picture

Status: Active » Needs review

Test results show that all these errors are eliminated by the MR. This can be confirmed by searching for the sniff Drupal.Commenting.InlineVariableComment.VarInline in the phpcs test results.

tr’s picture

Issue tags: -Needs reroll
ivnish’s picture

Status: Needs review » Needs work

MR fixed some phpcs issues but added new 4 phpstan issues

  • ivnish committed 757f045c on 8.x-4.x authored by tr
    Issue #3296129 by tr: Fix coding standard - Inline @var declarations...
ivnish’s picture

Ok, I don't see any code that can add new phpstan issues. Merged

ivnish’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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