Fix the issues reported by phpcs

Created on 27 February 2024, 4 months ago
Updated 13 March 2024, 4 months ago

Problem/Motivation

There is a files need to fixed with coding standards.
Here is the command : -

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/custom/office_hours/

Result : - 

FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/office_hours.module
--------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------
 57 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/office_hours.theme.exceptions.inc
--------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------
 81 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 93 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/README.md
--------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------
 81 | WARNING | Line exceeds 80 characters; contains 95 characters
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/office_hours.api.php
--------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------
 79 | WARNING | Only string literals should be passed to t() where possible
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/office_hours.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: /home/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursDateHelper.php
--------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
--------------------
 167 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 0
 169 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 171 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
 171 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 173 | ERROR   | [x] Line indented incorrectly; expected 9 spaces, found 1
 188 | ERROR   | [x] Inline comments must start with a capital letter
 197 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursCacheHelper.php
--------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------
 74 | ERROR | [x] Inline comments must start with a capital letter
 74 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursSeason.php
--------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------
  5 | WARNING | [x] Unused use statement
  6 | WARNING | [x] Unused use statement
 15 | WARNING | [ ] There must be no blank line following an inline comment
--------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursFormatterTrait.php
--------------------
FOUND 4 ERRORS AND 8 WARNINGS AFFECTING 12 LINES
--------------------
 139 | WARNING | [ ] Unused variable $day_delta.
 171 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
 236 | WARNING | [ ] Unused variable $key.
 378 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "NULl"
 413 | WARNING | [ ] Unused variable $key.
 463 | WARNING | [ ] Only string literals should be passed to t() where possible
 468 | ERROR   | [x] Inline comments must start with a capital letter
 477 | WARNING | [ ] Only string literals should be passed to t() where possible
 491 | ERROR   | [x] Inline comments must start with a capital letter
 526 | ERROR   | [x] Missing function doc comment
 541 | WARNING | [ ] Unused variable $date.
 542 | WARNING | [ ] Unused variable $day_index.
--------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/WebformElement/WebformOfficeHours.php
--------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------
 421 | WARNING | Unused variable $key.
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItemBase.php
--------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------
 165 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 178 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursExceptionsItem.php
--------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
--------------------
 50 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 50 | WARNING | Only string literals should be passed to t() where possible
 89 | WARNING | Unused variable $today.
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItemListInterface.php
--------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------
 87 | ERROR | Parameter comment must start with a capital letter
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItemList.php
--------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------
 26 | WARNING | Possible useless method overriding detected
 83 | WARNING | Possible useless method overriding detected
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItem.php
--------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 7 LINES
--------------------
 189 | ERROR   | [x] Opening brace should be on the same line as the declaration
 227 | ERROR   | [x] Comments may not appear after statements
 228 | ERROR   | [x] Comments may not appear after statements
 229 | ERROR   | [x] Comments may not appear after statements
 230 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 230 | ERROR   | [x] Comments may not appear after statements
 539 | ERROR   | [ ] Missing short description in doc comment
 540 | ERROR   | [ ] The text '@deprecated in version 8.x-1.12.' does not match the standard format: @deprecated in %deprecation-version% and is removed
	 |         |     from %removal-version%. %extra-info%.
 540 | ERROR   | [ ] Each @deprecated tag must have a @see tag immediately following it
--------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursComplexWeekWidget.php
--------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
--------------------
 49 | WARNING | [x] There must be no blank line following an inline comment
 49 | WARNING | [ ] There must be no blank line following an inline comment
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursExceptionsWidget.php
--------------------
FOUND 4 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
--------------------
  49 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  52 | WARNING | [x] There must be no blank line following an inline comment
  52 | WARNING | [ ] There must be no blank line following an inline comment
  52 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  55 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  59 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 133 | WARNING | [ ] Unused variable $max.
 177 | WARNING | [ ] Possible useless method overriding detected
 233 | WARNING | [ ] Possible useless method overriding detected
--------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursWeekWidget.php
--------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
--------------------
  40 | WARNING | [x] There must be no blank line following an inline comment
  40 | WARNING | [ ] There must be no blank line following an inline comment
 133 | WARNING | [ ] Unused variable $default_value.
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursSeasonWidget.php
--------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------
  58 | WARNING | Unused variable $name.
 121 | WARNING | Unused variable $key.
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterBase.php
--------------------
FOUND 33 ERRORS AND 12 WARNINGS AFFECTING 41 LINES
--------------------
 103 | ERROR   | [x] Comments may not appear after statements
 156 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 157 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 160 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 161 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 162 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 163 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 10
 164 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 10
 165 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 10
 166 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 10
 167 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 168 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 171 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 212 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
 213 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
 214 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
 215 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
 412 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 413 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 414 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 415 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 416 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 417 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
 417 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 418 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 421 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 422 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 423 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 424 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 425 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 449 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 455 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 462 | ERROR   | [x] Array closing indentation error, expected 4 spaces but found 6
 464 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 465 | ERROR   | [x] Array indentation error, expected 8 spaces but found 6
 467 | ERROR   | [x] Array indentation error, expected 8 spaces but found 6
 468 | WARNING | [ ] Only string literals should be passed to t() where possible
 469 | ERROR   | [x] Array indentation error, expected 8 spaces but found 6
 471 | ERROR   | [x] Array closing indentation error, expected 6 spaces but found 4
 475 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 476 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 476 | WARNING | [ ] Only string literals should be passed to t() where possible
 476 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 481 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 481 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
--------------------
PHPCBF CAN FIX THE 34 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterStatus.php
--------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------
 62 | WARNING | [ ] Only string literals should be passed to t() where possible
 63 | WARNING | [ ] Only string literals should be passed to t() where possible
 66 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterTableSelectList.php
--------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------
 84 | WARNING | Only string literals should be passed to t() where possible
 90 | WARNING | Only string literals should be passed to t() where possible
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterSchema.php
--------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------
 50 | ERROR | [x] Comments may not appear after statements
 51 | ERROR | [x] Comments may not appear after statements
 60 | ERROR | [x] Comments may not appear after statements
--------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/views/field/TimeSlot.php
--------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------
  69 | WARNING | [ ] Possible useless method overriding detected
 205 | ERROR   | [x] Inline comments must start with a capital letter
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/views/field/FieldBase.php
--------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------
 23 | WARNING | Unused variable $field_type.
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/views/field/Season.php
--------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
--------------------
 20 | WARNING | [ ] Possible useless method overriding detected
 35 | WARNING | [ ] Possible useless method overriding detected
 43 | WARNING | [ ] Possible useless method overriding detected
 69 | ERROR   | [x] Inline comments must start with a capital letter
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Controller/StatusUpdateController.php
--------------------
FOUND 13 ERRORS AND 1 WARNING AFFECTING 13 LINES
--------------------
  97 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  98 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  99 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 100 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 101 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 103 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 104 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 105 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 107 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 108 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
 108 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 109 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 110 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 111 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
--------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Element/OfficeHoursDatetime.php
--------------------
FOUND 2 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
--------------------
 25 | ERROR   | [x] Comments may not appear after statements
 27 | ERROR   | [x] Comments may not appear after statements
 80 | WARNING | [ ] Unused variable $validate.
 81 | WARNING | [ ] Unused variable $required_start.
 82 | WARNING | [ ] Unused variable $limit_start.
 83 | WARNING | [ ] Unused variable $required_end.
 84 | WARNING | [ ] Unused variable $limit_end.
--------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Element/OfficeHoursBaseSlot.php
--------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------
 142 | WARNING | [ ] Unused variable $day.
 160 | ERROR   | [x] Comments may not appear after statements
 312 | WARNING | [ ] Only string literals should be passed to t() where possible
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/Element/OfficeHoursSeasonHeader.php
--------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------
  48 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  61 | ERROR   | [x] Comments may not appear after statements
  77 | ERROR   | [x] Comments may not appear after statements
 140 | WARNING | [ ] Unused variable $label.
 146 | ERROR   | [x] Comments may not appear after statements
 251 | WARNING | [ ] Only string literals should be passed to t() where possible
--------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursItemListSorter.php
--------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------
  62 | WARNING | Unused variable $slot.
 225 | WARNING | Unused variable $day_index.
--------------------

Time: 1.39 secs; Memory: 16MB

Steps to reproduce

Run PHPCS on office_hours module.

Proposed resolution

Fixed the coding standards.

📌 Task
Status

Fixed

Version

1.16

Component

Code

Created by

🇮🇳India Prem Suthar gujrat

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

Merge Requests

Comments & Activities

  • Issue created by @Prem Suthar
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update 4 months ago
    10 pass
  • Pipeline finished with Success
    4 months ago
    Total: 144s
    #105009
  • Status changed to Needs review 4 months ago
  • 🇮🇳India Prem Suthar gujrat

    fixed the 80% issue of phpcs but there is remaining issue they need to be done by modify the logic.

    FILE: ...e/prem/Documents/drupal11/modules/custom/office_hours/src/OfficeHoursFormatterTrait.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     463 | WARNING | Only string literals should be passed to t() where possible
     477 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursExceptionsItem.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     50 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItemList.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     26 | WARNING | Possible useless method overriding detected
     83 | WARNING | Possible useless method overriding detected
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...nts/drupal11/modules/custom/office_hours/src/Plugin/Field/FieldType/OfficeHoursItem.php
    ---------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     551 | ERROR | The text '@deprecated Deprecated in version 8.x-1.12 and is removed from
         |       | %removal-version%. %extra-info%.' does not match the standard format:
         |       | @deprecated in %deprecation-version% and is removed from %removal-version%.
         |       | %extra-info%.
     551 | ERROR | Each @deprecated tag must have a @see tag immediately following it
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...odules/custom/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursExceptionsWidget.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     175 | WARNING | Possible useless method overriding detected
     231 | WARNING | Possible useless method overriding detected
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...odules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterBase.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------
     468 | WARNING | Only string literals should be passed to t() where possible
     469 | WARNING | Only string literals should be passed to t() where possible
     475 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...ules/custom/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterStatus.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     62 | WARNING | Only string literals should be passed to t() where possible
     63 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...om/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterTableSelectList.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------
     84 | WARNING | Only string literals should be passed to t() where possible
     90 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/views/field/TimeSlot.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     69 | WARNING | Possible useless method overriding detected
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...e/prem/Documents/drupal11/modules/custom/office_hours/src/Plugin/views/field/Season.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------
     20 | WARNING | Possible useless method overriding detected
     35 | WARNING | Possible useless method overriding detected
     43 | WARNING | Possible useless method overriding detected
    ---------------------------------------------------------------------------------------------
    
    
    FILE: ...prem/Documents/drupal11/modules/custom/office_hours/src/Element/OfficeHoursBaseSlot.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     312 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    
    FILE: .../Documents/drupal11/modules/custom/office_hours/src/Element/OfficeHoursSeasonHeader.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     253 | WARNING | Only string literals should be passed to t() where possible
    ---------------------------------------------------------------------------------------------
    
    • johnv committed c7d1a18c on 8.x-1.x
      Issue #3424066 by Prem Suthar: Fix the issues reported by phpcs
      
  • Status changed to Fixed 4 months ago
  • 🇳🇱Netherlands johnv

    Thank you,
    I will cherry-pick some remarks.
    I regularly do a clean-up in 📌 Clean code Postponed , but do not want to adhere to all the rules.

    I guess you downloaded a copy , instead of using git, since the remarks for office_hours.info.yml are not valid.
    I would appreciate some help with the following:
    - The text '@deprecated in version 8.x-1.12.' does not match the standard format;
    - Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
    I will leave all others untouched.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024