Drupal coding standard issues

Created on 12 September 2022, almost 2 years ago
Updated 12 April 2023, about 1 year ago
FILE: /home/drupal/myproject/datetime_range_timezone/datetime_range_timezone.info.yml
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/datetime_range_timezone/src/Plugin/Field/FieldFormatter/DateRangeTimezoneFormatterBase.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | Doc comment is empty
-----------------------------------------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/datetime_range_timezone/src/Plugin/Field/FieldFormatter/DateRangeTimezoneSingleDate.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/drupal/myproject/datetime_range_timezone/src/Plugin/Field/FieldFormatter/DateRangeTimezone.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Dharti Patel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium joevagyok

    Patch needs a reroll over latest dev branch.

  • 🇮🇳India TanujJain-TJ

    For latest dev branch getting these below listed phpcs errors.

    FILE: /datetime_range_timezone.tokens.inc
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     142 | ERROR | [x] Use "elseif" in place of "else if"
     142 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: /datetime_range_timezone.info.yml
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     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
     8 | WARNING | All dependencies must be prefixed with the project name, for
       |         | example "drupal:"
    --------------------------------------------------------------------------------
    
    
    FILE: /tests/src/Kernel/DateRangeTimezoneHelperTrait.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     36 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: /tests/src/Kernel/TokenReplacementTest.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
      71 | ERROR | [x] Expected 1 blank line after function; 2 found
     111 | ERROR | [x] Expected 1 blank line after function; 0 found
     112 | ERROR | [x] The closing brace for the class must have an empty line
         |       |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: /src/Plugin/Field/FieldFormatter/DateRangeTimezone.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
     40 | ERROR   | [x] Expected 1 space between double arrow and "$item"; 2 found
     40 | ERROR   | [x] Expected 1 space after "=>"; 2 found
     42 | ERROR   | [x] Expected 1 space between double arrow and "$item"; 2 found
     42 | ERROR   | [x] Expected 1 space after "=>"; 2 found
     76 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     77 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: /src/Plugin/Field/FieldFormatter/DateRangeTimezoneSingleDate.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     71 | WARNING | t() calls should be avoided in classes, use
        |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         | $this->t() instead
     72 | WARNING | t() calls should be avoided in classes, use
        |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         | $this->t() instead
    --------------------------------------------------------------------------------
    
    
    FILE: /src/Plugin/Field/FieldFormatter/DateRangeTimezoneFormatterBase.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
      8 | ERROR | [x] Missing class doc comment
     43 | ERROR | [x] Expected 1 blank line after function; 0 found
     44 | ERROR | [x] The closing brace for the class must have an empty line
        |       |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------

    adding a new patch to fix all these errors, please review.

  • Status changed to Needs review about 1 year ago
  • Status changed to RTBC about 1 year ago
  • 🇧🇪Belgium joevagyok

    Looks good, thank you.

  • Status changed to Fixed about 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024