Fix the issues reported by PHPCS

Created on 20 April 2023, about 1 year ago
Updated 6 October 2023, 9 months ago

Problem/Motivation

FILE: ...odules/contrib/taxonomy_search_admin_form/src/TaxonomySearchInterface.php
-------------------------------------------------------------------------------
FOUND 15 ERRORS AFFECTING 11 LINES
-------------------------------------------------------------------------------
6 | ERROR | [x] Doc comment short description must end with a full stop
11 | ERROR | [x] Doc comment short description must end with a full stop
12 | ERROR | [x] Whitespace found at end of line
13 | ERROR | [x] Parameter comment must be on the next line
13 | ERROR | [x] Parameter comment must end with a full stop
14 | ERROR | [ ] Parameter comment must start with a capital letter
14 | ERROR | [x] Parameter comment must be on the next line
14 | ERROR | [x] Parameter comment must end with a full stop
16 | ERROR | [ ] Description for the @return value is missing
21 | ERROR | [x] Doc comment short description must end with a full stop
22 | ERROR | [x] Whitespace found at end of line
23 | ERROR | [ ] Description for the @return value must be on the next line
23 | ERROR | [x] Whitespace found at end of line
25 | ERROR | [x] Expected 1 blank line after function; 0 found
26 | ERROR | [x] The closing brace for the interface must have an empty line
| | before it
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: .../modules/contrib/taxonomy_search_admin_form/src/TaxonomySearchManager.php
-------------------------------------------------------------------------------
FOUND 25 ERRORS AFFECTING 19 LINES
-------------------------------------------------------------------------------
8 | ERROR | [x] Doc comment short description must end with a full stop
12 | ERROR | [x] Doc comment short description must end with a full stop
17 | ERROR | [x] Whitespace found at end of line
19 | ERROR | [x] Doc comment short description must end with a full stop
25 | ERROR | [ ] Missing short description in doc comment
31 | ERROR | [x] Whitespace found at end of line
33 | ERROR | [x] Doc comment short description must end with a full stop
34 | ERROR | [x] Whitespace found at end of line
35 | ERROR | [x] Parameter comment must be on the next line
35 | ERROR | [x] Parameter comment must end with a full stop
36 | ERROR | [ ] Parameter comment must start with a capital letter
36 | ERROR | [x] Parameter comment must be on the next line
36 | ERROR | [x] Parameter comment must end with a full stop
38 | ERROR | [ ] Description for the @return value is missing
47 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
47 | ERROR | [x] Object operator not indented correctly; expected 6 spaces
| | but found 4
49 | ERROR | [x] Whitespace found at end of line
51 | ERROR | [x] Doc comment short description must end with a full stop
52 | ERROR | [x] Whitespace found at end of line
53 | ERROR | [ ] Description for the @return value must be on the next line
53 | ERROR | [x] Whitespace found at end of line
57 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
57 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
60 | ERROR | [x] Expected 1 blank line after function; 0 found
61 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: ...al10/web/modules/contrib/taxonomy_search_admin_form/src/Form/EditForm.php
-------------------------------------------------------------------------------
FOUND 66 ERRORS AND 4 WARNINGS AFFECTING 59 LINES
-------------------------------------------------------------------------------
12 | ERROR | [x] Doc comment short description must end with a full stop
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
16 | ERROR | [x] Doc comment short description must end with a full stop
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Doc comment short description must end with a full stop
25 | ERROR | [ ] Missing parameter comment
25 | ERROR | [ ] Missing parameter name
26 | ERROR | [x] Separate the @param and @return sections by a blank line.
28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Whitespace found at end of line
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
33 | ERROR | [x] Doc comment short description must start with a capital
| | letter
33 | ERROR | [x] Doc comment short description must end with a full stop
35 | ERROR | [ ] Missing parameter comment
35 | ERROR | [x] Data types in @param tags need to be fully namespaced
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
51 | ERROR | [x] Doc comment short description must end with a full stop
52 | ERROR | [x] Whitespace found at end of line
53 | ERROR | [ ] Missing parameter comment
53 | ERROR | [x] Expected 1 spaces after parameter type; 14 found
54 | ERROR | [ ] Missing parameter comment
54 | ERROR | [x] Data types in @param tags need to be fully namespaced
56 | ERROR | [ ] Description for the @return value is missing
58 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
59 | ERROR | [x] Whitespace found at end of line
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
61 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
64 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
65 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
66 | ERROR | [x] Whitespace found at end of line
67 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
72 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: true
72 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
79 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: true
79 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
82 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
85 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: "Search"
88 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
91 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
94 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
96 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
97 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
98 | ERROR | [x] Whitespace found at end of line
99 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
101 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
102 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
102 | WARNING | [ ] \Drupal calls should be avoided in classes, use
| | dependency injection instead
103 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
104 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
104 | ERROR | [x] Expected newline after closing brace
105 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
106 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
108 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
109 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
109 | ERROR | [x] Expected 1 blank line after function; 0 found
109 | ERROR | [x] Whitespace found at end of line
110 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 63 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

Time: 333ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix the issues reported for Drupal and DrupalPractice standards

Remaining tasks

Patch Review and fix remaining issues:
FILE: .../modules/contrib/taxonomy_search_admin_form/src/TaxonomySearchManager.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------
65 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes,
| | use dependency injection instead
-------------------------------------------------------------------------------

FILE: ...al10/web/modules/contrib/taxonomy_search_admin_form/src/Form/EditForm.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------
109 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
-------------------------------------------------------------------------------

Time: 486ms; Memory: 10MB

📌 Task
Status

Fixed

Version

1.1

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Status changed to Needs work about 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi urvashi_vora,

    I applied the patch coding-standard-fixes.patch → to the "Taxonomy admin search form" against version 1.0.x-dev and noticed there are still phpcs warnings being flagged.

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/taxonomy_search_admin_form/src/Form/EditForm.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------
    109 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/taxonomy_search_admin_form/src/TaxonomySearchManager.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
    65 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------------------------------------------

    Time: 194ms; Memory: 10MB

    Please look at the screenshot attached for your reference.

    Thanks.

  • Assigned to racol
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    Hi I have fixed the phpcs issue.
    providing patch with fixes.

  • 🇮🇳India Jaspreet-Kaur

    MR! 4 successfully applied on Drupal 9.5.x

  • Assigned to racol
  • 🇫🇷France racol
  • 🇫🇷France racol

    Hi !

    Thanks a lot for your participation !

    Sorry for the time I took, I'm working on others subjects actually :)

    A new release will be available tomorrow of Taxonomy admin search form! 1.1.0 :) It's a lot of PHP issues (CS).

    To tell you the truth, I would like to integrate Taxonomy admin search form to Drupal View system. I haven't understood why the list of terms are not included in the view module as nodes ...

    Anyway, see you tomorrow for this minor release :) And if you want to help me, let me know ;)

    Pleasure !

  • Status changed to Fixed 9 months ago
  • 🇫🇷France racol
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024