Fix the issues reported by phpcs

Created on 7 July 2023, over 1 year ago
Updated 10 January 2024, 11 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/document_ocr_ai21/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 93 characters
21 | WARNING | Line exceeds 80 characters; contains 90 characters
31 | WARNING | Line exceeds 80 characters; contains 81 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/document_ocr_ai21/src/AI21.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
10 | WARNING | [ ] The class short comment should describe what the class does
| | and not simply repeat the class name
22 | ERROR | [ ] Missing @var tag in member variable comment
23 | ERROR | [ ] Class property $api_endpoint should use lowerCamel naming
| | without underscores
75 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | )
77 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
86 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ment_ocr_ai21/src/Plugin/document_ocr/transformer/AI21TextSegmentation.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
35 | ERROR | [ ] join() is a function name alias, use implode() instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../d_cont/document_ocr_ai21/src/Plugin/document_ocr/transformer/AI21Base.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 80ms; Memory: 10MB

Steps to reproduce

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

Remaining tasks

Patch review

📌 Task
Status

RTBC

Version

1.0

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 11 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    Found one error after patch

    Use command with arguments:-
    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/document_ocr_ai21

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/document_ocr_ai21/src/Plugin/document_ocr/transformer/AI21Base.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
    8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\document_ocr\Plugin\TransformerBase.
    -------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------

    Time: 126ms; Memory: 10MB

  • Status changed to Needs review 11 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    Providing updated patch

  • Status changed to RTBC 11 months ago
  • 🇵🇭Philippines paraderojether

    Hi Ashutosh Ahirwal,

    I reviewed patch #3, applied against Document OCR AI21 Studio 1.0.0-alpha1 with Drupal core version 10.1.7, and confirmed it fixes the issue reported by phpcs.

    I added screenshots for reference.
    Thank you.

Production build 0.71.5 2024