Fix the issues reported by phpcs

Created on 6 February 2023, over 1 year ago
Updated 7 December 2023, 7 months ago

Problem/Motivation

C:\xampp\htdocs\abc\drupal\modules>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml config_plus

FILE: ...\xampp\htdocs\abc\drupal\modules\config_plus\config_plus.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...:\xampp\htdocs\abc\drupal\modules\config_plus\config_plus.module
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
6 | ERROR | [ ] Doc comment short description must be on a single
| | line, further text should be a separate paragraph
9 | ERROR | [x] When importing a class with "use", do not include a
| | leading \
21 | ERROR | [x] Opening brace must be the last content on the line
21 | ERROR | [x] Closing brace must be on a line by itself
21 | ERROR | [x] Each PHP statement must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: C:\xampp\htdocs\abc\drupal\modules\config_plus\README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 156 characters
7 | WARNING | Line exceeds 80 characters; contains 141 characters
11 | WARNING | Line exceeds 80 characters; contains 234 characters
15 | WARNING | Line exceeds 80 characters; contains 354 characters
16 | WARNING | Line exceeds 80 characters; contains 262 characters
----------------------------------------------------------------------

FILE: ...pp\htdocs\abc\drupal\modules\config_plus\src\ConfigInstaller.php
----------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 10 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
18 | ERROR | [x] Missing class doc comment
82 | ERROR | [x] Whitespace found at end of line
88 | ERROR | [ ] Missing parameter type
90 | ERROR | [ ] Missing parameter type
92 | ERROR | [ ] Missing parameter type
96 | ERROR | [ ] If there is no return value for a function, there
| | must not be a @return tag.
96 | ERROR | [ ] Description for the @return value is missing
97 | ERROR | [x] Separate the @return and @throws sections by a
| | blank line.
106 | ERROR | [x] Concat operator must be surrounded by a single
| | space
107 | ERROR | [x] Concat operator must be surrounded by a single
| | space
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...\src\EventSubscriber\ConfigEntityInstallValidationSubscriber.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
67 | ERROR | [x] There should be no white space before a closing ")"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 550ms; Memory: 10MB

Steps to reproduce

Run the command - phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /drupal/modules/contrib/config_plus

Proposed resolution

Fix all the PHP coding standard issues.

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @Charchil Khandelwal
  • @charchil-khandelwal opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Created MR !3 for this issue.
    Please review.

    Thanks.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany hchonov ๐Ÿ‡ช๐Ÿ‡บ๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ฌ
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Ashutosh Ahirwal โ†’ made their first commit to this issueโ€™s fork.

  • @ashutosh-ahirwal opened merge request.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Created MR 5 with phpcs issur fixes in module.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines paraderojether

    I reviewed MR5, and there are still remaining issues reported by phpcs shown below:

    FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/config_plus/src/ConfigInstaller.php
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 12 ERRORS AFFECTING 12 LINES
    ----------------------------------------------------------------------------------------------------------------------
      78 | ERROR | [x] Expected "\Drupal\config_rewrite\ConfigRewriter|null" but found
         |       |     "\Drupal\config_rewrite\ConfigRewriter|NULL" for @var tag in member variable comment
     110 | ERROR | [x] Expected "\Drupal\config_rewrite\ConfigRewriter|null" but found
         |       |     "\Drupal\config_rewrite\ConfigRewriter|NULL" for parameter type
     112 | ERROR | [x] Expected "\Drupal\Core\Logger\LoggerChannelInterface|null" but found
         |       |     "\Drupal\Core\Logger\LoggerChannelInterface|NULL" for parameter type
     134 | ERROR | [ ] Missing parameter type
     136 | ERROR | [ ] Missing parameter type
     138 | ERROR | [ ] Missing parameter type
     142 | ERROR | [ ] Description for the @return value is missing
     143 | ERROR | [x] Separate the @return and @throws sections by a blank line.
     208 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
     209 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
     211 | ERROR | [ ] Description for the @return value is missing
     260 | ERROR | [ ] The array declaration extends to column 159 (the limit is 80). The array content should be split
         |       |     up over multiple lines
    ----------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------
    
    Time: 207ms; Memory: 10MB

    Please check.
    Thank You.

  • Assigned to kbk1992
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    Looks like all phpcs issues are addressed in MR5

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama

    @nisha_j whenever there is an open MR, try to commit your changes in the MR itself instead of providing a patch. Also patch #12, doesn't applies to branch 1.0.x.

    I've reviewed both MR3 and MR5, and it seems like all PHPCS issues are addressed in both MRs. @ashutosh_ahirwal I'm not sure why MR5 was opened when there was already MR3. :/

  • Status changed to Needs review 7 months ago
  • Issue was unassigned.
Production build 0.69.0 2024