Fix the errors/warnings reported by PHP_CodeSniffer

Created on 27 January 2024, 5 months ago
Updated 10 February 2024, 4 months ago

Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/custom/leaflet/ --report-full --report-summary --report-source -s 

Result: check report.txt → to see all violations:

PHP CODE SNIFFER REPORT SUMMARY
-----------------------------------------------------------------------------
FILE                                                                    ERRORS  WARNINGS
-----------------------------------------------------------------------------
leaflet.api.php                                                         1       0
leaflet.install                                                         1       0
modules/leaflet_views/src/Controller/LeafletAjaxPopupController.php     1       0
modules/leaflet_views/src/Plugin/views/row/LeafletMarker.php            1       0
modules/leaflet_views/src/Plugin/views/style/LeafletMap.php             1       0
src/LeafletService.php                                                  2       3
src/LeafletSettingsElementsTrait.php                                    3       0
src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php             1       0
src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php                   1       0
-----------------------------------------------------------------------------
A TOTAL OF 12 ERRORS AND 3 WARNINGS WERE FOUND IN 9 FILES
-----------------------------------------------------------------------------
PHPCBF CAN FIX 13 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------
    SOURCE                                                                             COUNT
--------------------------------------------------------------------
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses  9
[x] Drupal.Classes.UnusedUseStatement.UnusedUse                                        3
[ ] Drupal.Arrays.Array.LongLineDeclaration                                            2
[x] Drupal.Commenting.FunctionComment.ParamCommentIndentation                          1
--------------------------------------------------------------------
A TOTAL OF 15 SNIFF VIOLATIONS WERE FOUND IN 4 SOURCES
--------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SOURCES AUTOMATICALLY (13 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

10.2

Component

Code

Created by

🇷🇺Russia zniki.ru

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

Production build 0.69.0 2024