Fix the issues reported by phpcs

Created on 22 February 2024, 10 months ago
Updated 11 June 2024, 6 months ago

Problem/Motivation

------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 130 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Time: 190ms; Memory: 10MB

Steps to reproduce

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/contrib/ckeditor5_entity_browser/

Remaining tasks

Patch Review

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India bhaveshdas

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 @bhaveshdas
  • Merge request !13423193-Fix-the-issues-phpcs → (Merged) created by bhaveshdas
  • Status changed to Needs review 10 months ago
  • 🇵🇭Philippines paraderojether

    Hi bhaveshdas,

    I reviewed MR!1, applied against Ckeditor5 entity browser 1.0.x-dev with Drupal core version 10.1.7, and confirmed it fixes the issue reported by phpcs.

    Command used: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,yml,twig ckeditor5_entity_browser

    jetherparadero@PrometSources-MacBook-Pro contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,yml,twig ckeditor5_entity_browser
    
    FILE: /Users/jetherparadero/d_o/drupal-issues/web/modules/contrib/ckeditor5_entity_browser/src/Plugin/CKEditor5Plugin/CkeditorEntityBrowser.php
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------------
     130 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    -----------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 121ms; Memory: 10MB
    
    jetherparadero@PrometSources-MacBook-Pro contrib % cd ckeditor5_entity_browser
    jetherparadero@PrometSources-MacBook-Pro ckeditor5_entity_browser % curl https://git.drupalcode.org/project/ckeditor5_entity_browser/-/merge_requests/1.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   699    0   699    0     0   1661      0 --:--:-- --:--:-- --:--:--  1688
    Checking patch src/Plugin/CKEditor5Plugin/CkeditorEntityBrowser.php...
    Applied patch src/Plugin/CKEditor5Plugin/CkeditorEntityBrowser.php cleanly.
    jetherparadero@PrometSources-MacBook-Pro ckeditor5_entity_browser % cd ..
    jetherparadero@PrometSources-MacBook-Pro contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,yml,twig ckeditor5_entity_browser
    jetherparadero@PrometSources-MacBook-Pro contrib %

    Thank you.

  • Status changed to RTBC 10 months ago
  • 🇮🇳India bhaveshdas

    As per #4 i resolve all errors

    i used below command for checking
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml web/modules/contrib/ckeditor5_entity_browser/

    could you please review it.

    Thankyou!!

  • 🇮🇳India pray_12

    Hi,
    Applied the patch #6 and found no errors and warning.
    Applied MR!1 and found no errors and warnings.
    Thank you!!

  • Status changed to Fixed 8 months ago
  • 🇳🇱Netherlands askibinski

    @bhaveshdas merged the MR for the PHP fix.

    Note however that JS support in phpcs has been removed for a while now (for that eslinters are recommeded) and cause lots of false positives. Like the issues in the template literal in the patch at #6.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024