Fix the issues reported by phpcs

Created on 1 July 2023, 12 months ago
Updated 25 May 2024, about 1 month ago

GitLab Ci reports PHP_CodeSniffer warnings/errors, which should be fixed, if they are not false positives.

šŸ“Œ Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @sonam_sharma
  • Issue was unassigned.
  • Status changed to Needs work 12 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary should always describe what the issue is trying to fix and, in the case of coding standards issues, show which command and arguments have been used and which report that command shown. In this way, project maintainers can verify the patch/MR fixes all the warnings/errors.

  • Status changed to Needs review 12 months ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    I have updated issue summary.

  • Status changed to Needs work 12 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • First commit to issue fork.
  • Merge request !3Did the required changes ā†’ (Open) created by kalash-j
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The report is for 22 files, but the MR changes less files.

  • Assigned to imustakim
  • šŸ‡®šŸ‡³India imustakim Ahmedabad
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India imustakim Ahmedabad

    MR Updated, but still these errors remain.

    FILE: C:\Sites\Projects\ssom-3371743\oauth2_server\oauth2_server.routing.yml
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------------------------------
      7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     13 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     19 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     27 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Sites\Projects\ssom-3371743\oauth2_server\src\Controller\OAuth2Controller.php
    --------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------
     373 | WARNING | There must be no blank line following an inline comment
    --------------------------------------------------------------------------------------
    
    
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs review 4 months ago
  • šŸ‡®šŸ‡³India kalash-j jaipur

    Added a commit to MR!3
    tried to solved the issue and i didnt faced any warning

  • Status changed to Needs work about 1 month ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @kalash-j,

    I applied MR!3 and it applied smoothly.

    However, I still encountered some issues when I run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

    āžœ  ssom git:(main) āœ— curl https://git.drupalcode.org/project/ssom/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 44334    0 44334    0     0  94338      0 --:--:-- --:--:-- --:--:-- 94327
    patching file oauth2_server/oauth2_server.info.yml
    Hunk #1 FAILED at 4.
    1 out of 1 hunk FAILED -- saving rejects to file oauth2_server/oauth2_server.info.yml.rej
    patching file oauth2_server/src/Authentication/Provider/OAuth2DrupalAuthProvider.php
    patching file oauth2_server/src/Controller/OAuth2Controller.php
    patching file oauth2_server/src/Controller/ServerClientController.php
    patching file oauth2_server/src/Controller/ServerScopeController.php
    patching file oauth2_server/src/Entity/Client.php
    patching file oauth2_server/src/Entity/Scope.php
    patching file oauth2_server/src/Entity/Server.php
    patching file oauth2_server/src/Form/AuthorizeForm.php
    patching file oauth2_server/src/Form/ClientForm.php
    patching file oauth2_server/src/Form/ServerForm.php
    patching file oauth2_server/src/OAuth2Helper.php
    patching file oauth2_server/src/OAuth2Storage.php
    patching file oauth2_server/src/OAuth2StorageInterface.php
    patching file oauth2_server/src/ScopeUtility.php
    patching file oauth2_server/src/Utility.php
    patching file oauth2_server/tests/modules/oauth2_server_test/oauth2_server_test.info.yml
    Hunk #1 FAILED at 4.
    1 out of 1 hunk FAILED -- saving rejects to file oauth2_server/tests/modules/oauth2_server_test/oauth2_server_test.info.yml.rej
    patching file oauth2_server/tests/modules/oauth2_server_test/src/Controller/ResourceController.php
    patching file oauth2_server/tests/src/Functional/OAuth2ServerAdminTest.php
    patching file oauth2_server/tests/src/Functional/OAuth2ServerTest.php
    āžœ  ssom git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ssom
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/css/oauth2-server-auth-dialog.css
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     18 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
    -----------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/tests/modules/oauth2_server_test/oauth2_server_test.info.yml
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/oauth2_server.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/oauth2_server.routing.yml
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------------------------------
      7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     13 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     19 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     27 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/src/OAuth2Helper.php
    ----------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------
     26 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    ----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/src/OAuth2Storage.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 7 ERRORS AFFECTING 6 LINES
    -----------------------------------------------------------------------------------------------------------
     78 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     79 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     80 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     81 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     82 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     83 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     83 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    -----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/ssom/oauth2_server/src/Authentication/Provider/OAuth2DrupalAuthProvider.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 5 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
     72 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     73 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     74 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     75 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     76 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 6
     76 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    ----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 1.41 secs; Memory: 16MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

  • Pipeline finished with Success
    about 1 month ago
    Total: 149s
    #181991
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Closed: outdated about 1 month ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    This project contains just a copy of the OAuth2 Server project. If you want to contribute patches/MRs, please do it for that project.

Production build 0.69.0 2024