Fix the issues reported by phpcs

Created on 19 July 2024, 4 months ago

Problem/Motivation

There is a file that needs to be fixed with coding standards.
Here is the command: -

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml .

FILE: ...\wamp64\www\demo8\modules\contrib\allinone_backup\allinone_backup.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 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
 1 | WARNING | "core_version_requirement" property is missing in the info.yml
   |         | file
--------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\contrib\allinone_backup\allinone_backup.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Entity\EntityInterface.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\contrib\allinone_backup\js\default.js
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 13 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
 16 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...o8\modules\contrib\allinone_backup\src\Controller\BackuplogsController.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  8 | ERROR | [x] Use statements should be sorted alphabetically. The first
    |       |     wrong one is Drupal\Core\File\FileSystem.
 20 | ERROR | [ ] Missing member variable doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\modules\contrib\allinone_backup\src\Controller\ImportbackupController.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Render\Renderer.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\www\demo8\modules\contrib\allinone_backup\src\Form\DatabasebackupForm.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
   8 | ERROR | [x] Use statements should be sorted alphabetically. The first
     |       |     wrong one is Drupal\Core\Database\Database.
  18 | ERROR | [ ] Missing member variable doc comment
 138 | ERROR | [x] Each PHP statement must be on a line by itself
 145 | ERROR | [x] Each PHP statement must be on a line by itself
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.27 secs; Memory: 14MB

Steps to reproduce

Run PHPCS on this module.

Proposed resolution

Fix the coding standards.

Remaining tasks

Submit the MR.

📌 Task
Status

RTBC

Version

3.0

Component

Code

Created by

🇮🇳India amanbtr72

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 @amanbtr72
  • First commit to issue fork.
  • Assigned to hetal.solanki
  • Merge request !1Fixed Issue → (Open) created by hetal.solanki
  • Issue was unassigned.
  • Status changed to Needs review 4 months ago
  • Assigned to bhaveshdas
  • Status changed to Needs work 4 months ago
  • 🇮🇳India bhaveshdas

    I applied MR!1 and I still encountered some issues after I ran vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/custom/allinone_backup-3462538/

    FILE: /var/www/html/drupal-contri-d10/modules/custom/allinone_backup-3462538/js/default.js
    ---------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     13 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     16 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
    ---------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------
    
    Time: 235ms; Memory: 12MB
  • Issue was unassigned.
  • Status changed to RTBC 4 months ago
  • 🇮🇳India bhaveshdas

    Hey I have fixed remaining phpcs issues and tested also no error founds.
    I will move it forward to RTBC.

    RTBC+1

    Thankyou !

Production build 0.71.5 2024