Fix the issues reported by phpcs

Created on 5 July 2023, 12 months ago
Updated 25 September 2023, 9 months ago

Problem/Motivation

FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/search_api_view_modes.info.yml
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
 1 | WARNING | [ ] "core_version_requirement" property is missing in the info.yml file
 7 | WARNING | [ ] All dependencies must be prefixed with the project name, for example "drupal:"
 7 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/search_api_view_modes.module
------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
  9 | WARNING | [ ] Hook implementations should not duplicate @param documentation
  9 | ERROR   | [ ] Missing parameter comment
 31 | ERROR   | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/README.txt
------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 84 characters
 13 | WARNING | Line exceeds 80 characters; contains 85 characters
 16 | WARNING | Line exceeds 80 characters; contains 85 characters
 17 | WARNING | Line exceeds 80 characters; contains 102 characters
 18 | WARNING | Line exceeds 80 characters; contains 84 characters
 24 | WARNING | Line exceeds 80 characters; contains 109 characters
 27 | WARNING | Line exceeds 80 characters; contains 87 characters
------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/src/Tests/RenderedItemsTest.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 24 ERRORS AND 8 WARNINGS AFFECTING 23 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  10 | ERROR   | [ ] Class name doesn't match filename; expected "class RenderedItemsTest"
  17 | ERROR   | [ ] Class property $index_id should use lowerCamel naming without underscores
  33 | ERROR   | [x] Short array syntax must be used to define arrays
  33 | ERROR   | [x] Short array syntax must be used to define arrays
  44 | ERROR   | [x] Short array syntax must be used to define arrays
  44 | ERROR   | [x] Short array syntax must be used to define arrays
  57 | ERROR   | [x] Short array syntax must be used to define arrays
  70 | ERROR   | [x] Inline comments must start with a capital letter
  70 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  71 | ERROR   | [x] Short array syntax must be used to define arrays
  72 | ERROR   | [x] Short array syntax must be used to define arrays
  90 | WARNING | [x] There must be no blank line following an inline comment
  90 | WARNING | [ ] There must be no blank line following an inline comment
  90 | ERROR   | [x] Inline comments must start with a capital letter
  90 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  92 | WARNING | [ ] Unused variable $form.
  93 | ERROR   | [x] Short array syntax must be used to define arrays
  94 | ERROR   | [x] Short array syntax must be used to define arrays
  99 | ERROR   | [x] Short array syntax must be used to define arrays
 100 | ERROR   | [x] Short array syntax must be used to define arrays
 101 | ERROR   | [x] Short array syntax must be used to define arrays
 101 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 102 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 103 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 110 | WARNING | [ ] Line exceeds 80 characters; contains 94 characters
 113 | ERROR   | [x] Short array syntax must be used to define arrays
 120 | ERROR   | [x] Short array syntax must be used to define arrays
 122 | ERROR   | [x] Short array syntax must be used to define arrays
 122 | ERROR   | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
 125 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 135 | ERROR   | [x] Expected 1 newline at end of file; 0 found
 135 | ERROR   | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/src/Plugin/search_api/processor/RenderedItems.php
---------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 5 WARNINGS AFFECTING 19 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------
  16 | WARNING | [x] Unused use statement
  19 | WARNING | [ ] Line exceeds 80 characters; contains 109 characters
 149 | ERROR   | [x] Short array syntax must be used to define arrays
 150 | ERROR   | [x] Short array syntax must be used to define arrays
 151 | ERROR   | [x] Short array syntax must be used to define arrays
 163 | ERROR   | [x] Short array syntax must be used to define arrays
 166 | ERROR   | [x] Short array syntax must be used to define arrays
 173 | ERROR   | [x] Short array syntax must be used to define arrays
 184 | ERROR   | [x] Short array syntax must be used to define arrays
 186 | ERROR   | [x] Short array syntax must be used to define arrays
 196 | ERROR   | [x] Expected newline after closing brace
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 224 | WARNING | [ ] Unused variable $source.
 226 | ERROR   | [x] Short array syntax must be used to define arrays
 228 | ERROR   | [x] Short array syntax must be used to define arrays
 229 | ERROR   | [x] Short array syntax must be used to define arrays
 243 | WARNING | [ ] Unused variable $datasource.
 257 | ERROR   | [x] Short array syntax must be used to define arrays
 320 | WARNING | [ ] Unused variable $bundle.
---------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_view_modes/src/Plugin/views/field/SearchApiViewMode.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
 10 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 22 | ERROR   | [x] There must be exactly one blank line before the tags in a doc comment
 22 | ERROR   | [ ] Missing parameter comment
 22 | ERROR   | [ ] Missing parameter type
 23 | ERROR   | [ ] Missing parameter comment
 23 | ERROR   | [ ] Missing parameter type
 24 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 24 | ERROR   | [ ] Description for the @return value is missing
 26 | ERROR   | [ ] Public method name "SearchApiViewMode::render_item" is not in lowerCamel format
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

Time: 266ms; Memory: 12MB

Steps to reproduce

Please run this command:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig search_api_view_modes/

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇵🇭Philippines roberttabigue

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 @roberttabigue
  • Status changed to Needs review 12 months ago
  • 🇵🇭Philippines roberttabigue

    Created a patch to fix the issues reported by phpcs.

    Please review.
    Thank you!

  • Status changed to Needs work 10 months ago
  • Hii, @roberttabigue, Review your patch.

    These are the steps I followed:

    1. Took git clone 8.x-1 in drupal 10.1.x

    2. Applied patch and ran this command:

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

    3. Applied your patch and again ran phpcs command.

    found errors.

    Needs work.

  • 🇮🇳India Shreya_98

    I have Fixed all the issues reported by phpcs . Kindly review the patch file along with attached image .

  • Issue was unassigned.
  • Status changed to RTBC 9 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    I have applied #4 patch and it get applied cleanly for 8.x-1.x.
    Moving to RTBC.

Production build 0.69.0 2024