Fix the issues reported by phpcs

Created on 3 May 2023, about 1 year ago
Updated 20 May 2023, about 1 year ago

Problem/Motivation

There are very few coding standards issues in the module,

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/nice_login/

FILE: /var/www/html/vbd9/web/modules/contrib/nice_login/nice_login.libraries.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vbd9/web/modules/contrib/nice_login/nice_login.module
--------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
70 | ERROR | The array declaration extends to column 99 (the limit is 80).
| | The array content should be split up over multiple lines
70 | ERROR | The array declaration extends to column 98 (the limit is 80).
| | The array content should be split up over multiple lines
78 | ERROR | The array declaration extends to column 99 (the limit is 80).
| | The array content should be split up over multiple lines
78 | ERROR | The array declaration extends to column 98 (the limit is 80).
| | The array content should be split up over multiple lines
97 | ERROR | The array declaration extends to column 90 (the limit is 80).
| | The array content should be split up over multiple lines
97 | ERROR | The array declaration extends to column 89 (the limit is 80).
| | The array content should be split up over multiple lines
115 | ERROR | The array declaration extends to column 90 (the limit is 80).
| | The array content should be split up over multiple lines
115 | ERROR | The array declaration extends to column 89 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

RUN:

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/nice_login/

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Needs review

Version

2.1

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

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 @dineshkumarbollu
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines paraderojether

    Hi dineshkumarbollu

    I reviewed patch #2, and verified it resolved the errors reported by phpcs. Drupal core 9.5.8, Nice Login 2.10.

    I added screenshots for reference.
    Thank You.

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    -  $link->getUrl()->setOption('attributes', ['class' => ['nice-login', 'nice-login-reset-password']]);
    +  $link->getUrl()->setOption(
    +    'attributes',
    +    [
    +      'class' => ['nice-login', 'nice-login-reset-password'],
    +    ]
    +  );
    -  $link->getUrl()->setOption('attributes', ['class' => ['nice-login', 'nice-login-create-account']]);
    +  $link->getUrl()->setOption(
    +    'attributes',
    +    [
    +      'class' => ['nice-login', 'nice-login-create-account'],
    +    ]
    +  );
    -  $link->getUrl()->setOption('attributes', ['class' => ['nice-login', 'nice-login-login']]);
    +  $link->getUrl()->setOption(
    +    'attributes',
    +    [
    +      'class' => ['nice-login', 'nice-login-login'],
    +    ]
    +  );
    -  $link->getUrl()->setOption('attributes', ['class' => ['nice-login', 'nice-login-login']]);
    +  $link->getUrl()->setOption(
    +    'attributes',
    +    [
    +      'class' => ['nice-login', 'nice-login-login'],
    +    ]
    +  );

    Code lines are not required to be shorter than 81 characters. Line length and wrapping โ†’ , part of the Drupal coding standards, says:

    • Lines containing longer function names, function/class definitions, variable declarations, etc are allowed to exceed 80 characters.
    • Control structure conditions may exceed 80 characters, if they are simple to read and understand.

    (Emphasis is mine.)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    bharath-kondeti โ†’ made their first commit to this issueโ€™s fork.

  • @bharath-kondeti opened merge request.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    Made one change on top the patch and raised a MR. Please review

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

    The MR just changes the nice_login.libraries.yml file, while the patch changes more files.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    @aparderno, As per the comments #5 "Lines containing longer function names, function/class definitions, variable declarations, etc are allowed to exceed 80 characters.
    Control structure conditions may exceed 80 characters, if they are simple to read and understand."

    The code in nice_login.module is reverted to its existing state. Hence, we have only one file in the MR raised.

Production build 0.69.0 2024