Problem/Motivation

FILE: /home/lenovo/d7to9/web/modules/contrib/ckeditor_accordion/src/Plugin/CKEditorPlugin/CKEditorAccordion.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
-----------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/ckeditor_accordion/src/Plugin/CKEditor4To5Upgrade/Accordion.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------
  8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\ckeditor5\HTMLRestrictions.
 12 | ERROR | [ ] Missing short description in doc comment
 32 | ERROR | [ ] Public method name "Accordion::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem" is not in lowerCamel format
 45 | ERROR | [ ] Public method name "Accordion::mapCKEditor4SettingsToCKEditor5Configuration" is not in lowerCamel format
 52 | ERROR | [ ] Public method name "Accordion::computeCKEditor5PluginSubsetConfiguration" is not in lowerCamel format
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/ckeditor_accordion/src/Form/CkeditorAccordionSettingsForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
 12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 61 | WARNING | [x] A comma should follow the last multiline array item. Found: )
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/ckeditor_accordion/css/accordion.frontend.css
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
 121 | ERROR | [x] Blank lines are not allowed in class definitions
 127 | ERROR | [ ] Class definition is empty
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/ckeditor_accordion/ckeditor_accordion.install
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

Time: 81ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig ckeditor_accordion/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

roshni27 created an issue. See original summary.

roshni27’s picture

Assigned: roshni27 » Unassigned
Status: Active » Needs review
StatusFileSize
new3.03 KB

Some issues which are better know to maintainer are pending and all remaining issues solve by me. Please review the patch.

clarkssquared’s picture

StatusFileSize
new379.85 KB

Hi roshni27

I applied your patch #2 and confirmed that it fixed most of the PHPCS issues, will retain this to needs review for maintainer's response about the remaining PHPCS issues, for convenience below are the remaining issues that is shown in my terminal.

FILE: /Users/studenttrainees/ckeditor_accordion/css/accordion.frontend.css
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
126 | ERROR | Class definition is empty
--------------------------------------------------------------------------

FILE: /Users/studenttrainees/ckeditor_accordion/src/Plugin/CKEditor4To5Upgrade/Accordion.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------
12 | ERROR | Missing short description in doc comment
32 | ERROR | Public method name "Accordion::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem" is not in lowerCamel format
45 | ERROR | Public method name "Accordion::mapCKEditor4SettingsToCKEditor5Configuration" is not in lowerCamel format
52 | ERROR | Public method name "Accordion::computeCKEditor5PluginSubsetConfiguration" is not in lowerCamel format
--------------------------------------------------------------------------------------------------------------------------

Time: 259ms; Memory: 10MB

Command I executed: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ckeditor_accordion

Please look at the attached file for your reference,

Thank you

roshni27’s picture

Hi clarkssquared,
Thanks to review.
I have mention on above comment some issues are remain which better know to maintainer.

shyam_bhatt’s picture

StatusFileSize
new4.59 KB

Added a new patch, to fix all warnings/errors reported by PHP_CodeSniffer. Please check and review.

+ Needs Review.

clarkssquared’s picture

Status: Needs review » Reviewed & tested by the community

Hi Shyam

I applied your patch #5 and I confirmed that it fixes all the PHPCS issues.

➜  ckeditor_accordion git:(2.0.x) curl https://www.drupal.org/files/issues/2023-11-10/3373944-5.patch | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4698  100  4698    0     0   4772      0 --:--:-- --:--:-- --:--:--  4798
patching file ckeditor_accordion.install
patching file 'css/accordion.frontend.css'
patching file 'src/Form/CkeditorAccordionSettingsForm.php'
patching file 'src/Plugin/CKEditor4To5Upgrade/Accordion.php'
patching file 'src/Plugin/CKEditorPlugin/CKEditorAccordion.php'
➜  ckeditor_accordion git:(2.0.x) ✗ ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ckeditor_accordion 
➜  contrib git:(master) ✗ 

Thanks

j-vee’s picture

Status: Reviewed & tested by the community » Fixed

Fixed all but the function renaming, thanks!

Status: Fixed » Closed (fixed)

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