Fix the issues reported by phpcs

Created on 28 March 2023, about 1 year ago
Updated 1 March 2024, 4 months ago

Problem/Motivation

Getting the following errors/warnings.

FILE: /tooltip_ckeditor/README.txt
---------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------
 40 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 42 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
 56 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
 56 | ERROR   | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------


FILE: /tooltip_ckeditor/src/Form/EditorTooltipDialog.php
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
 55 | ERROR | [x] Inline comments must start with a capital letter
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------


FILE: /tooltip_ckeditor/src/Form/TooltipCkeditorAdminSettingsForm.php
------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
------------------------------------------------------------------------------------
 49 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 53 | ERROR   | [x] Expected 1 blank line after function; 4 found
 56 | ERROR   | [ ] More than 2 empty lines are not allowed
 57 | ERROR   | [ ] More than 2 empty lines are not allowed
 58 | ERROR   | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------


FILE: /tooltip_ckeditor/src/Plugin/CKEditorPlugin/Tooltip.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------
 40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the following command

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

Proposed resolution

The above errors need to be fixed.

๐Ÿ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia omkar_yewale Mumbai

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 @omkar_yewale
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia omkar_yewale Mumbai

    !5 MR created, Please review.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Ashutosh Ahirwal โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    I have resolve remaing issue but need to upgrade module from D8 to D10.

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

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/tooltip_ckeditor/tooltip_ckeditor.info.yml
    -------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
    1 | WARNING | "core_version_requirement" property is missing in the info.yml file
    -------------------------------------------------------------------------------------------------------------------

    Time: 147ms; Memory: 12MB

Production build 0.69.0 2024