Fix the issues reported by PHP_CodeSniffer

Created on 21 September 2024, 2 months ago
Updated 29 September 2024, about 2 months ago

Problem/Motivation

FILE: unstructured\src\Formatters\HtmlFormatter.php
-----------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 1 WARNING AFFECTING 14 LINES
-----------------------------------------------------------------------------------------------
66 | ERROR | [x] Case breaking statements must be followed by a single blank line
68 | ERROR | [x] Case breaking statements must be followed by a single blank line
70 | ERROR | [x] Case breaking statements must be followed by a single blank line
72 | ERROR | [x] Case breaking statements must be followed by a single blank line
74 | ERROR | [x] Case breaking statements must be followed by a single blank line
81 | ERROR | [x] Case breaking statements must be followed by a single blank line
83 | ERROR | [x] Case breaking statements must be followed by a single blank line
85 | ERROR | [x] Case breaking statements must be followed by a single blank line
87 | ERROR | [x] Case breaking statements must be followed by a single blank line
89 | ERROR | [x] Case breaking statements must be followed by a single blank line
115 | ERROR | [ ] Parameter $data is not described in comment
118 | ERROR | [ ] Doc comment for parameter $text does not match actual variable name $data
129 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
156 | ERROR | [x] Concat operator must be surrounded by a single space
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: unstructured\src\Formatters\MarkdownFormatter.php
-----------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 1 WARNING AFFECTING 14 LINES
-----------------------------------------------------------------------------------------------
66 | ERROR | [x] Case breaking statements must be followed by a single blank line
68 | ERROR | [x] Case breaking statements must be followed by a single blank line
70 | ERROR | [x] Case breaking statements must be followed by a single blank line
72 | ERROR | [x] Case breaking statements must be followed by a single blank line
74 | ERROR | [x] Case breaking statements must be followed by a single blank line
81 | ERROR | [x] Case breaking statements must be followed by a single blank line
83 | ERROR | [x] Case breaking statements must be followed by a single blank line
85 | ERROR | [x] Case breaking statements must be followed by a single blank line
87 | ERROR | [x] Case breaking statements must be followed by a single blank line
89 | ERROR | [x] Case breaking statements must be followed by a single blank line
112 | ERROR | [ ] Parameter $data is not described in comment
115 | ERROR | [ ] Doc comment for parameter $text does not match actual variable name $data
126 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
197 | ERROR | [x] Concat operator must be surrounded by a single space
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: unstructured\src\Formatters\TextFormatter.php
--------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------
63 | ERROR | [x] Case breaking statements must be followed by a single blank line
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: unstructured\src\Plugin\AiAutomatorType\FileToImage.php
------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------
57 | ERROR | [ ] Parameter $token is not described in comment
160 | ERROR | [x] Expected 1 blank line after function; 2 found
235 | ERROR | [x] Concat operator must be surrounded by a single space
241 | ERROR | [x] Expected 1 blank line after function; 0 found
242 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

FILE: unstructured\src\Plugin\AiAutomatorType\FileToTable.php
--------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
57 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
158 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

FILE: unstructured\src\Plugin\AiAutomatorType\FileToText.php
-----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
62 | ERROR | [x] Expected 1 blank line after function; 0 found
63 | 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: unstructured\src\Plugin\AiAutomatorType\FileToTextBase.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityInterface.
18 | ERROR | [x] Missing class doc comment
49 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: unstructured\src\UnstructuredApi.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactory.
7 | WARNING | [x] Unused use statement
56 | ERROR | [ ] Parameter $options is not described in comment
59 | ERROR | [x] Data types in @param tags need to be fully namespaced
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: unstructured\unstructured.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
-------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇺🇸United States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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