Fix the issue reported by phpcs

Created on 10 July 2024, 6 months ago
Updated 16 July 2024, 5 months ago

Problem/Motivation

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

FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/src/Controller/EdwMapsController.php
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 15 | ERROR | Description for the @return value is missing
----------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/src/Plugin/views/style/MapboxMapStyle.php
---------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------
 85 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 10
 86 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 10
 90 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/src/EdwMapsElementsTrait.php
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------
 408 | ERROR   | [x] Expected 1 space after "=>"; 2 found
 410 | WARNING | [ ] #options values usually have to run through t() for translation
 411 | WARNING | [ ] #options values usually have to run through t() for translation
 412 | WARNING | [ ] #options values usually have to run through t() for translation
 413 | WARNING | [ ] #options values usually have to run through t() for translation
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/src/Services/EdwMapsDataService.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
  13 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
 127 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/edw_maps.module
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 20 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/css/edw_mapbox.css
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 39 | ERROR | [x] CSS colours must be defined in lowercase; expected #ffd700 but found #FFD700
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/README.md
-------------------------------------------------------------------------
FOUND 1 ERROR AND 15 WARNINGS AFFECTING 15 LINES
-------------------------------------------------------------------------
   4 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
   5 | WARNING | [ ] Line exceeds 80 characters; contains 118 characters
  13 | WARNING | [ ] Line exceeds 80 characters; contains 162 characters
  29 | WARNING | [ ] Line exceeds 80 characters; contains 115 characters
  31 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
  32 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
  36 | WARNING | [ ] Line exceeds 80 characters; contains 131 characters
  72 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
  96 | WARNING | [ ] Line exceeds 80 characters; contains 169 characters
  98 | WARNING | [ ] Line exceeds 80 characters; contains 173 characters
 100 | WARNING | [ ] Line exceeds 80 characters; contains 191 characters
 102 | WARNING | [ ] Line exceeds 80 characters; contains 188 characters
 106 | WARNING | [ ] Line exceeds 80 characters; contains 188 characters
 108 | WARNING | [ ] Line exceeds 80 characters; contains 191 characters
 110 | WARNING | [ ] Line exceeds 80 characters; contains 208 characters
 110 | ERROR   | [x] Expected 1 newline at end of file; 3 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/js/edw_mapbox.js
----------------------------------------------------------------------------------------------
FOUND 27 ERRORS AFFECTING 27 LINES
----------------------------------------------------------------------------------------------
  47 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  52 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
  76 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  87 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 152 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 156 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 165 | ERROR | [x] Case breaking statements must be followed by a single blank line
 252 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 261 | ERROR | [x] Inline control structures are not allowed
 275 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 300 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 320 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 342 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 351 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 358 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 396 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 436 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 479 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 492 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 513 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 518 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 534 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 577 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 604 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 622 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 636 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 27 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/edw_maps.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: /var/www/html/drupal-contri-d10/modules/contrib/unep_maps/edw_maps.api.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
 6 | ERROR | [ ] Missing parameter type
 9 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 381ms; Memory: 20MB

Steps to reproduce

Run PHPCS on Config Pages module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR.

šŸ“Œ Task
Status

RTBC

Version

1.2

Component

Code

Created by

šŸ‡®šŸ‡³India bhaveshdas

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 @bhaveshdas
  • Issue was unassigned.
  • Assigned to kalash-j
  • šŸ‡®šŸ‡³India kalash-j jaipur

    I will have a look at this.

  • Issue was unassigned.
  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡³India kalash-j jaipur

    I have fixed the PHPCS errors

  • Status changed to RTBC 5 months ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi

    I reviewed MR!7, applied it against United Nations Maps & Geoservices 1.2.0, and confirmed it fixes the issues reported by phpcs.

    āžœ  unep_maps git:(main) āœ— curl https://git.drupalcode.org/project/unep_maps/-/merge_requests/7.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 11473    0 11473    0     0  27730      0 --:--:-- --:--:-- --:--:-- 28120
    patching file README.md
    patching file 'css/edw_mapbox.css'
    patching file edw_maps.api.php
    patching file edw_maps.module
    patching file 'src/Controller/EdwMapsController.php'
    patching file 'src/EdwMapsElementsTrait.php'
    patching file 'src/Plugin/views/style/MapboxMapStyle.php'
    patching file 'src/Services/EdwMapsDataService.php'
    āžœ  unep_maps git:(main) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig unep_maps
    āžœ  contrib git:(main) āœ—

    Thank you.

Production build 0.71.5 2024