Fix the warnings/errors reported by PHP_CodeSniffer

Created on 4 July 2023, almost 2 years ago
Updated 5 July 2023, almost 2 years ago

Problem/Motivation

FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_scheduler/src/Form/TimeSlotsForm.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 138 | WARNING | Unused variable $start_time.
--------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_scheduler/event_platform_scheduler.module
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_sponsors/event_platform_sponsors.install
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 5 | WARNING | Line exceeds 80 characters; contains 82 characters
------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_details/src/Plugin/Block/CopyrightBlock.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\config_pages\Entity\ConfigPages.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------


FILE: ...lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_details/src/Plugin/Block/EventPlatformHeaderCtaBlock.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\config_pages\Entity\ConfigPages.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------


FILE: .../lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_details/src/Plugin/Block/EventPlatformHomeHeroBlock.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\config_pages\Entity\ConfigPages.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_details/event_platform_details.module
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------
  8 | ERROR   | [x] Missing function doc comment
 14 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 20 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 32 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/event_platform_sessions/event_platform_sessions.install
------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 1 WARNING AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------
  5 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 40 | ERROR   | [x] Array closing indentation error, expected 2 spaces but found 3
 41 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 41 | ERROR   | [x] Object operator not indented correctly; expected 4 spaces but found 3
 42 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 52 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 52 | ERROR   | [x] Object operator not indented correctly; expected 4 spaces but found 2
 58 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 69 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 69 | ERROR   | [x] Object operator not indented correctly; expected 4 spaces but found 2
 74 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/event_platform/README.md
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 10 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------

Time: 251ms; Memory: 12MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig event_platform-3372274/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India roshni27

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

  • Issue created by @roshni27
  • Status changed to Needs work almost 2 years 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.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India roshni27

    HI Guys,
    I have fixed all the issues except for those related to filling out documentation, which I think should be ideally done by the maintainers.
    Please review the patch.

  • 🇮🇳India roshni27

    Hi Guys,
    Above by mistake send ,Sorry
    This one is right.
    I have fixed all the issues except for those related to filling out documentation, which I think should be ideally done by the maintainers.
    Please review the patch.

  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary does not yet show the command and the arguments used to get the quoted report. Saying that PHP_CodeSniffer has been used is not sufficient.

  • @roshni27 opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India roshni27

    Please review MR

  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Assigned to imustakim
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇨🇦Canada imustakim Canada

    Since the description comment is exceeding to 82 characters and, the unused variable is in the try statement, assuming these remaining errors can be ignored.

    FILE: /Users/specbee/Sites/Projects/event_platform-3372274/event_platform_scheduler/src/Form/TimeSlotsForm.php
    --------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------
     138 | WARNING | Unused variable $start_time.
    --------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/specbee/Sites/Projects/event_platform-3372274/event_platform_sessions/event_platform_sessions.install
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
     5 | WARNING | Line exceeds 80 characters; contains 82 characters
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/specbee/Sites/Projects/event_platform-3372274/event_platform_sponsors/event_platform_sponsors.install
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
     5 | WARNING | Line exceeds 80 characters; contains 82 characters
    ------------------------------------------------------------------------------------------------------------------
    
    Time: 290ms; Memory: 14MB
    
Production build 0.71.5 2024