Fix the issues reported by phpcs

Created on 21 July 2023, over 1 year ago
Updated 20 December 2023, 11 months ago

Problem/Motivation

FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_ai/css/chat.css
------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
 77 | ERROR | [x] Expected 1 newline at end of file; 2 found
 78 | ERROR | [x] Additional whitespace found at end of file
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_ai/search_api_ai.routing.yml
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
-------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_ai/src/Form/ChatForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AND 2 WARNINGS AFFECTING 21 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 177 | ERROR   | [x] Expected newline after closing brace
 207 | ERROR   | [x] Expected "\Drupal\search_api\Query\ResultSetInterface|null" but found "\Drupal\search_api\Query\ResultSetInterface|NULL" for function return type
 217 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
 220 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 299 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 300 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 301 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 302 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 303 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 304 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 305 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 306 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 307 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 308 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 309 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 310 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 311 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 312 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 313 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 314 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 320 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_ai/src/Plugin/Block/ChatFormBlock.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 6 WARNINGS AFFECTING 18 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
  31 | ERROR   | Missing member variable doc comment
  38 | ERROR   | Missing member variable doc comment
 180 | WARNING | #options values usually have to run through t() for translation
 181 | WARNING | #options values usually have to run through t() for translation
 182 | WARNING | #options values usually have to run through t() for translation
 183 | WARNING | #options values usually have to run through t() for translation
 205 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
 276 | WARNING | #options values usually have to run through t() for translation
 300 | ERROR   | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 301 | ERROR   | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 302 | ERROR   | The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
 303 | ERROR   | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
 304 | ERROR   | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 307 | ERROR   | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 308 | ERROR   | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
 309 | ERROR   | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
 310 | ERROR   | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
 311 | ERROR   | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/search_api_ai/src/TextChunker.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 73 | ERROR | Expected type hint "string"; found "mixed" for $haystack
-------------------------------------------------------------------------------------------------------------

Time: 541ms; Memory: 12MB

Steps to reproduce

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

📌 Task
Status

Needs work

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

Merge Requests

Comments & Activities

  • Issue created by @roberttabigue
  • First commit to issue fork.
  • Assigned to nitin_lama
  • Issue was unassigned.
  • 🇮🇳India nitin_lama India

    Error/Warning remaining:

    FILE: /home/system/Documents/contribution/search_api_ai-3376141/src/TextChunker.php
    -----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------
     73 | ERROR | Expected type hint "string"; found "mixed" for $haystack
    -----------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/search_api_ai-3376141/src/Form/ChatForm.php
    -------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------
     218 | WARNING | Line exceeds 80 characters; contains 85 characters
    -------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/search_api_ai-3376141/src/Plugin/Block/ChatFormBlock.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 10 ERRORS AFFECTING 10 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------
     300 | ERROR | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
     301 | ERROR | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
     302 | ERROR | The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
     303 | ERROR | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
     304 | ERROR | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
     307 | ERROR | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
     308 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
     309 | ERROR | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
     310 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
     311 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 107ms; Memory: 10MB
    
    FILE: /home/system/Documents/contribution/search_api_ai-3376141/src/Form/ChatForm.php
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------
     221 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------
    
    Time: 83ms; Memory: 8MB
  • First commit to issue fork.
  • Status changed to Needs review 11 months ago
  • 🇮🇳India sakthi_dev

    Fixed remaining PHPCS issues. Please review.

  • Status changed to Needs work 11 months ago
  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama India

    Please review. Thanks.

  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 11 months ago
  • 🇷🇺Russia zniki.ru

    Thanks for update, please check all my comments.
    Please check documentation about property promotion.

Production build 0.71.5 2024