Coding standards issue

Created on 24 January 2025, 4 months ago

Problem/Motivation

FILE: ...kraken/src/Plugin/ImageAPIOptimizeProcessor/kraken.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 5 WARNINGS AFFECTING 22 LINES
-----------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
24 | ERROR | [ ] Class name must begin with a capital letter
82 | ERROR | [x] Short array syntax must be used to define arrays
89 | ERROR | [x] Short array syntax must be used to define arrays
96 | ERROR | [x] Short array syntax must be used to define arrays
102 | ERROR | [x] Short array syntax must be used to define arrays
108 | ERROR | [x] Short array syntax must be used to define arrays
148 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
151 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
154 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
158 | ERROR | [x] Short array syntax must be used to define arrays
178 | WARNING | [x] '@todo: Make this timeout configurable.' should match the format '@todo Fix problem X here.'
181 | ERROR | [x] Short array syntax must be used to define arrays
200 | ERROR | [x] Array indentation error, expected 10 spaces but found 20
201 | ERROR | [x] Array indentation error, expected 10 spaces but found 20
202 | ERROR | [x] Array indentation error, expected 10 spaces but found 20
203 | ERROR | [x] Array indentation error, expected 10 spaces but found 20
204 | ERROR | [x] Array closing indentation error, expected 8 spaces but found 18
209 | ERROR | [x] Expected newline after closing brace
210 | ERROR | [x] Short array syntax must be used to define arrays
225 | ERROR | [x] Expected 1 blank line after function; 0 found
226 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

Time: 67ms; Memory: 10MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇴Colombia kinyein

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kinyein
  • Merge request !4Coding standards fix → (Open) created by kinyein
  • 🇨🇴Colombia kinyein

    Hi, I made a merge request to fix the coding standards issue in this module, I hope it can be reviewed soon.

  • 🇮🇳India Rohit Rana

    Hi @kinyein After applying your merge request, most of the errors are resolved, but there are a few errors that exist. Please find them below, so please resolve them.

    FILE: /var/www/html/drupal8.9/web/modules/contrib/kraken/src/Plugin/ImageAPIOptimizeProcessor/Kraken.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
    82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ------------------------------------------------------------------------------------------------------------------------------------------

Production build 0.71.5 2024