Drupal Coding Standards Issues | phpcs

Created on 24 January 2023, almost 2 years ago
Updated 2 February 2023, almost 2 years ago

Problem/Motivation

Getting following warnings.

FILE: ...\drupalissues-9.5.x-dev\modules\charts_highcharts_maps\README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Line exceeds 80 characters; contains 109 characters
----------------------------------------------------------------------

FILE: ...ules\charts_highcharts_maps\src\Controller\MapDataController.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
11 | ERROR | Doc comment is empty
16 | ERROR | Doc comment is empty
24 | ERROR | Doc comment is empty
----------------------------------------------------------------------

FILE: ...ules\charts_highcharts_maps\src\Plugin\chart\Library\Highmap.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
223 | WARNING | Line exceeds 80 characters; contains 90 characters
347 | ERROR | The array declaration extends to column 103 (the
| | limit is 80). The array content should be split up
| | over multiple lines
388 | WARNING | Line exceeds 80 characters; contains 82 characters
388 | ERROR | Comment indentation error, expected only 1 spaces
391 | WARNING | Line exceeds 80 characters; contains 130 characters
392 | WARNING | Line exceeds 80 characters; contains 168 characters
467 | ERROR | The array declaration extends to column 101 (the
| | limit is 80). The array content should be split up
| | over multiple lines
530 | ERROR | The array declaration extends to column 85 (the
| | limit is 80). The array content should be split up
| | over multiple lines
----------------------------------------------------------------------

FILE: ...hcharts_maps\src\Plugin\views\style\HighMapsPluginStyleChart.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------
133 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
181 | ERROR | Doc comment is empty
185 | ERROR | The array declaration extends to column 85 (the
| | limit is 80). The array content should be split up
| | over multiple lines
189 | ERROR | Doc comment is empty
202 | ERROR | Doc comment is empty
248 | ERROR | Expected type hint "EntityFieldManager"; found
| | "EntityFieldManagerInterface" for
| | $entity_field_manager
----------------------------------------------------------------------

Steps to reproduce

Run following command

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

Proposed resolution

Above warnings need to be fixed.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Sonal Gyanani

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

Production build 0.71.5 2024