fix the issues reported by phpcs

Created on 27 June 2023, over 1 year ago
Updated 6 June 2024, 5 months ago

Fix the below issue reported by PHP_CodeSniffer

Use this command with arguments:-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/aimodels

FILE: C:\xamppnew\htdocs\sonam\web\modules\contrib\aimodels\aimodels.module
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
 16 | ERROR   | [x] Case breaking statements must be followed by a single blank
    |         |     line
 17 | WARNING | [ ] Code after the RETURN statement on line 16 cannot be
    |         |     executed
 17 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 19 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: C:\xamppnew\htdocs\sonam\web\modules\contrib\aimodels\aimodels.info.yml
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
 4 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

šŸ“Œ Task
Status

Closed: works as designed

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
  • Status changed to Needs work over 1 year 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.

    (Also, change the code to follow the coding standards is a task, not a bug fix.)

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    I have updated issue summary.

  • Status changed to Needs work 5 months ago
  • Hi @sonam_sharma,

    Applied your patch successfully, however it threw one warning.

    aimodels git:(main) curl https://www.drupal.org/files/issues/2023-06-27/3370534.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   763  100   763    0     0   3140      0 --:--:-- --:--:-- --:--:--  3260
    patching file aimodels.info.yml
    patching file aimodels.module
    āžœ  aimodels git:(main) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig aimodels
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/aimodels/aimodels.module
    -------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------
     18 | WARNING | Code after the RETURN statement on line 16 cannot be executed
    -------------------------------------------------------------------------------------------------
    
    Time: 104ms; Memory: 10MB

    Kindly check.

    Thanks,
    Jake

  • Status changed to Closed: works as designed 5 months ago
  • šŸ‡±šŸ‡¹Lithuania mindaugasd
  • Pipeline finished with Success
    5 months ago
    Total: 143s
    #192481
Production build 0.71.5 2024