Fix the issues reported by phpcs

Created on 5 July 2023, 12 months ago
Updated 11 March 2024, 4 months ago

Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8/document_ocr_mindee/src/Repository/ApisRepository.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
13 | ERROR | [ ] Missing member variable doc comment
14 | ERROR | [ ] Missing member variable doc comment
15 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8/document_ocr_mindee/src/Mindee.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 4 WARNINGS AFFECTING 12 LINES
---------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\File\FileSystemInterface.
11 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
32 | ERROR | [ ] Missing @var tag in member variable comment
33 | ERROR | [ ] Class property $api_key should use lowerCamel naming without underscores
37 | ERROR | [ ] Missing @var tag in member variable comment
38 | ERROR | [ ] Class property $api_endpoint should use lowerCamel naming without underscores
49 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
50 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
52 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
87 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
89 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
92 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8/document_ocr_mindee/src/Plugin/document_ocr/processor/Mindee.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\File\FileSystemInterface.
165 | ERROR | [ ] join() is a function name alias, use implode() instead
------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8/document_ocr_mindee/README.md
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 96 characters
20 | WARNING | Line exceeds 80 characters; contains 90 characters
35 | WARNING | Line exceeds 80 characters; contains 87 characters
-------------------------------------------------------------------------------------------------------------------

Steps to reproduce
Run the command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/document_ocr_mindee-1.0.0-alpha8

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India Indra patil Bangalore

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 @Indra patil
  • Merge request !1Fixed the coding standards. → (Open) created by Unnamed author
  • Issue was unassigned.
  • Status changed to Needs review 12 months ago
  • 🇮🇳India Indra patil Bangalore
  • Status changed to Needs work 11 months ago
  • 🇵🇭Philippines paraderojether

    Hi I reviewed MR!1, and there are still remaining issues reported by phpcs after applying the MR shown below:

    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/document_ocr_mindee/src/Mindee.php
    --------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------
     58 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     98 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/document_ocr_mindee/src/Plugin/document_ocr/processor/Mindee.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     31 | ERROR | [x] Expected "\Drupal\document_ocr_mindee\MindeeasMindeeService" but found "\Drupal\document_ocr_mindee\Mindee as MindeeService" for @var tag in member variable comment
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 186ms; Memory: 10MB

    Please check.
    Thank you.

  • Assigned to imustakim
  • 🇮🇳India imustakim Ahmedabad
  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • 🇮🇳India imustakim Ahmedabad

    MR updated.
    Please review.

  • Assigned to realsp
  • 🇮🇳India realsp

    Found the following phpcs issue in the MR #5

    FILE: /home/contribution/drupal/web/modules/contrib/document_ocr_mindee/src/Mindee.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\document_ocr_mindee\Repository\ApisRepository.
    ----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
  • Issue was unassigned.
  • 🇮🇳India realsp

    The MR fixes all the reported phpcs issues, RTBC +1.
    Thank you.

  • 🇮🇳India Yashaswi18

    Hello, checked out to the branch 'phpcs' and ran the command phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig. Found no errors or warnings, RTBC +1.

Production build 0.69.0 2024