Fix the issues reported by phpcs

Created on 9 May 2023, about 1 year ago
Updated 7 June 2024, 20 days ago

Problem/Motivation

FILE: /web/modules/contrib/ckeditor_quote/src/Plugin/CKEditorPlugin/Quote.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
33 | ERROR | [x] Short array syntax must be used to define arrays
34 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------
FILE: /web/modules/contrib/ckeditor_quote/README.md
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 142 characters
17 | WARNING | Line exceeds 80 characters; contains 111 characters
--------------------------------------------------------------------------------------------

FILE: /home/yogesh/Projects/my-first-drupal9-app/web/modules/custom/ckeditor_quote/src/Plugin/CKEditorPlugin/Quote.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
35 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /ckeditor_quote/

šŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India yogeshsevak

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 @yogeshsevak
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India yogeshsevak

    Providing patch with fixes.

  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡³India Anmol_Specbee

    The patch is not able to resolve all the issues reported by phpcs. Attaching a screenshot for reference, Moving it back to needs work.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • First commit to issue fork.
  • Assigned to nitin_lama
  • šŸ‡®šŸ‡³India nitin_lama

    #2 patch applies cleanly. @anmol Please use phpcs command with Drupal & DrupalPractice.

    There are some fixes on js file, which i'll be pushing in the MR.

    No violations of coding standards remain after correction.

    I'm using custom alias for the drupal and drupalPractice:

  • @nitin_lama opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India nitin_lama

    Changes committed to MR3. Please review.

  • Status changed to RTBC 21 days ago
  • Hi @nitin_lama,

    Applied your changes in MR3, it applied successfully and confirmed fixed all phpcs errors.

    ckeditor_quote git:(8.x-1.1) curl https://git.drupalcode.org/project/ckeditor_quote/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4176    0  4176    0     0  10893      0 --:--:-- --:--:-- --:--:-- 11256
    patching file README.md
    patching file js/plugins/quote/dialogs/quote.js
    patching file js/plugins/quote/plugin.js
    patching file src/Plugin/CKEditorPlugin/Quote.php
    āžœ  ckeditor_quote git:(8.x-1.1) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig ckeditor_quote
    āžœ  contrib git:(master) āœ—

    Will now move this to RTBC

    Thanks,
    Jake

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    apaderno ā†’ changed the visibility of the branch 3358992-fix-the-issues to hidden.

  • Pipeline finished with Success
    20 days ago
    Total: 137s
    #193743
  • Status changed to Closed: outdated 20 days ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The 8.x-1.x branch is no longer supported. If there are PHP_CodeSniffer warnings/errors which should be fixed, that should be done in the 3.0.x branch, which is also the suggested one.

Production build 0.69.0 2024