Problem/Motivation

FILE: /home/thallesvf/Desktop/lando/d8-contrib/modules/ctools/src/Form/RequiredContextDelete.php
---------------------------------------------------------------------------------------------------
FOUND 36 ERRORS AND 1 WARNING AFFECTING 31 LINES
---------------------------------------------------------------------------------------------------
  17 | ERROR   | [ ] Missing short description in doc comment
  22 | ERROR   | [ ] Missing short description in doc comment
  25 | ERROR   | [ ] Class property $tempstore_id should use lowerCamel naming without underscores
  27 | ERROR   | [ ] Missing short description in doc comment
  28 | ERROR   | [x] Expected "string" but found "string;" for @var tag in member variable comment
  30 | ERROR   | [ ] Class property $machine_name should use lowerCamel naming without underscores
  32 | ERROR   | [ ] Missing short description in doc comment
  33 | ERROR   | [x] Expected "int" but found "int;" for @var tag in member variable comment
  44 | ERROR   | [ ] Missing short description in doc comment
  45 | ERROR   | [ ] Missing parameter comment
  47 | ERROR   | [x] Visibility must be declared on method "__construct"
  67 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  69 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  70 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  70 | ERROR   | [x] Short array syntax must be used to define arrays
  71 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  71 | ERROR   | [x] Short array syntax must be used to define arrays
  74 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  75 | ERROR   | [x] Space found before square bracket; expected "$form[" but found "$form ["
  77 | ERROR   | [x] Short array syntax must be used to define arrays
 100 | ERROR   | [x] Short array syntax must be used to define arrays
 123 | ERROR   | [x] Short array syntax must be used to define arrays
 124 | ERROR   | [x] Short array syntax must be used to define arrays
 127 | ERROR   | [x] Short array syntax must be used to define arrays
 128 | ERROR   | [x] Short array syntax must be used to define arrays
 130 | ERROR   | [x] Short array syntax must be used to define arrays
 131 | ERROR   | [x] Short array syntax must be used to define arrays
 164 | ERROR   | [ ] Missing parameter comment
 164 | ERROR   | [ ] Missing parameter type
 168 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
 175 | ERROR   | [ ] Missing parameter comment
 175 | ERROR   | [ ] Missing parameter type
 177 | ERROR   | [ ] Description for the @return value is missing
 184 | ERROR   | [ ] Missing parameter comment
 184 | ERROR   | [ ] Missing parameter type
 186 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 186 | ERROR   | [ ] Missing parameter type
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

Comments

thalles created an issue. See original summary.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.39 KB

Follow a patch!

guilhermevp’s picture

StatusFileSize
new4.31 KB

The issue remains, but RequiredContextDelete.php has been upgraded and as such, the demands changed.

FILE: /home/guilhermevp/Ambientes/drupal-9.1.5/modules/contrib/ctools/src/Form/RequiredContextDelete.php
--------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 1 WARNING AFFECTING 14 LINES
--------------------------------------------------------------------------------------------------------
  17 | ERROR   | Missing short description in doc comment
  22 | ERROR   | Missing short description in doc comment
  25 | ERROR   | Class property $tempstore_id should use lowerCamel naming without underscores
  27 | ERROR   | Missing short description in doc comment
  30 | ERROR   | Class property $machine_name should use lowerCamel naming without underscores
  32 | ERROR   | Missing short description in doc comment
  44 | ERROR   | Missing short description in doc comment
  45 | ERROR   | Missing parameter comment
 164 | ERROR   | Missing parameter comment
 164 | ERROR   | Missing parameter type
 168 | WARNING | Line exceeds 80 characters; contains 92 characters
 175 | ERROR   | Missing parameter comment
 175 | ERROR   | Missing parameter type
 177 | ERROR   | Description for the @return value is missing
 184 | ERROR   | Missing parameter comment
 184 | ERROR   | Missing parameter type
 186 | ERROR   | Parameter tags must be grouped together in a doc comment
 186 | ERROR   | Missing parameter type
-------------------------------------------------------------------------------------------------------- 

This patch address this demands.

adalbertov’s picture

Status: Needs review » Needs work

Hello, I have just looked into the patchs and found a warning, should it be fixed?

FILE: /home/adalbertov/Drupal/ctools/src/Form/RequiredContextDelete.php
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------
180 | WARNING | Line exceeds 80 characters; contains 90 characters
-----------------------------------------------------------------------

suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new4.33 KB
new513 bytes

Updated patch.

adalbertov’s picture

Status: Needs review » Reviewed & tested by the community

Hello, I have just checked the patch and didn't find any phpcs errors so I'm moving it to RTBC

joelpittet’s picture

Status: Reviewed & tested by the community » Needs work

Changing the name of a protected property/variable is an API change AFAIK because anything extending this class can use those properties.

Also the multi line array in comment needs a further indent.

andregp’s picture

Assigned: Unassigned » andregp

I'll make these changes and resend send the patch.

andregp’s picture

Assigned: andregp » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.33 KB
new2.66 KB

Here is the new patch based on #5 with the corrections.

joelpittet’s picture

Status: Needs review » Fixed

Thanks for fixing those issues and the coding standard ignore is a nice touch!

  • joelpittet committed 42353cf on 8.x-3.x authored by andregp
    Issue #3101650 by andregp, Suresh Prabhu Parkala, thalles, guilhermevp,...

Status: Fixed » Closed (fixed)

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