Fix the issues reported by phpcs

Created on 20 January 2023, almost 2 years ago
Updated 3 April 2024, 9 months ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/custom/taxonomy_machine_name shows the following errors/warnings, which should be fixed.

FILE: ...pi_taxonomy_machine_name\search_api_taxonomy_machine_name.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...taxonomy_machine_name\search_api_taxonomy_machine_name.views.inc
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n"
    |         |     but found "\r\n"
 21 | WARNING | [ ] Unused variable $field_alias.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...my_machine_name\src\Plugin\search_api\processor\AddHierarchy.php
----------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 11 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n"
     |       |     but found "\r\n"
  32 | ERROR | [ ] Missing member variable doc comment
  34 | ERROR | [ ] Missing short description in doc comment
  39 | ERROR | [ ] Missing short description in doc comment
  95 | ERROR | [ ] Description for the @return value is missing
 121 | ERROR | [ ] Missing parameter comment
 122 | ERROR | [ ] Missing parameter comment
 157 | ERROR | [x] Comma not allowed after last value in single-line
     |       |     array declaration
 157 | ERROR | [x] There should be no white space before a closing
     |       |     "]"
 187 | ERROR | [ ] Missing parameter comment
 188 | ERROR | [ ] Missing parameter comment
 189 | ERROR | [ ] Missing parameter comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ne_name\src\Plugin\views\filter\SearchApiTaxonomyMachineName.php
----------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n"
     |         |     but found "\r\n"
  78 | ERROR   | [ ] Doc comment short description must be on a
     |         |     single line, further text should be a separate
     |         |     paragraph
  80 | ERROR   | [ ] Missing parameter comment
  81 | ERROR   | [ ] Missing parameter comment
  85 | ERROR   | [ ] Type hint "array" missing for $form
 121 | ERROR   | [x] Object operator not indented correctly; expected
     |         |     14 spaces but found 16
 203 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait
     |         |     and $this->t() instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ne_name\src\Plugin\migrate\source\d7\TaxonomyMachineNameTerm.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 53 | ERROR | [x] Expected 1 blank line after function; 2 found
 56 | 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: ...ine_name\src\Plugin\views\argument_validator\TermMachineName.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n"
    |         |     but found "\r\n"
 74 | WARNING | [ ] Unused variable $operator.
 78 | WARNING | [ ] Unused variable $operator.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...achine_name\src\Plugin\views\filter\TaxonomyIndexMachineName.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n"
     |         |     but found "\r\n"
 149 | ERROR   | [ ] The array declaration extends to column 95 (the
     |         |     limit is 80). The array content should be split
     |         |     up over multiple lines
 276 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait
     |         |     and $this->t() instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...upal\modules\taxonomy_machine_name\taxonomy_machine_name.api.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...l\modules\taxonomy_machine_name\taxonomy_machine_name.deploy.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 30 | ERROR | [x] No space found before comment text; expected "//
    |       |     $sandbox['message'] = t('No terms updated');" but
    |       |     found "//$sandbox['message'] = t('No terms
    |       |     updated');"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...upal\modules\taxonomy_machine_name\taxonomy_machine_name.install
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 49 | ERROR | [ ] Type hint "array" missing for $context
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...rupal\modules\taxonomy_machine_name\taxonomy_machine_name.module
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n"
     |       |     but found "\r\n"
 145 | ERROR | [ ] All functions defined in a module file must be
     |       |     prefixed with the module's name, found
     |       |     "taxonomy_term_machine_name_load" but expected
     |       |     "taxonomy_machine_name_taxonomy_term_machine_name_load"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...al\modules\taxonomy_machine_name\taxonomy_machine_name.views.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...\Kernel\Plugin\migrate\source\d7\TaxonomyMachineNameTermTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Other

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia noorulshameera

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

Not all content is available!

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

Production build 0.71.5 2024