Problem/Motivation

FILE: /var/www/html/vb/d_cont/html_processors/README.md
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
47 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...var/www/html/vb/d_cont/html_processors/src/Service/HrefToMediaReplacer.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ww/html/vb/d_cont/html_processors/config/schema/html_processors.schema.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
50 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 567ms; 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 html_processors/

Remaining tasks

Patch review

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

urvashi_vora created an issue. See original summary.

ashutosh ahirwal’s picture

Status: Needs review » Needs work

Provided patch get applied cleanly but still some issure remains

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/html_processors

Remaining issues:-
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/modules/html_processors_tampers/src/Plugin/Tamper/HrefToMedia.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\html_processors\Service\MediaGenerator.
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/modules/html_processors_tampers/src/Plugin/Tamper/HtmlToGutenberg.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\html_processors\Service\HtmlGutenbergParser.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Plugin/Action/HrefToMedia.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Plugin/Action/ConvertToGutenberg.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\ContainerFactoryPluginInterface.
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Plugin/HtmlGutenbergProcessor/TableCell.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Plugin/HtmlGutenbergProcessor/Table.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Plugin/HtmlGutenbergProcessor/Image.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/HtmlGutenbergProcessorConfigTrait.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Service/MediaGenerator.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Utility\Token.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/html_processors/src/Service/HtmlGutenbergParser.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\html_processors\HtmlGutenbergProcessorBase.
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

Time: 479ms; Memory: 12MB

ashutosh ahirwal’s picture

Status: Needs work » Needs review
StatusFileSize
new8.5 KB

Providing updated patch with all fixes.

clarkssquared’s picture

Hi

I applied the patch #3 and. tested it and I confirmed that it fixes all the PHPCS issues, retaining the status to needs review so that others could confirm. RTBC +1 for me

➜  html_processors git:(1.0.x) curl https://www.drupal.org/files/issues/2023-10-30/phpcs-issue-fixes_0.patch | git apply -v
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8709  100  8709    0     0  17891      0 --:--:-- --:--:-- --:--:-- 18451
Checking patch README.md...
Checking patch config/schema/html_processors.schema.yml...
Checking patch modules/html_processors_tampers/src/Plugin/Tamper/HrefToMedia.php...
Checking patch modules/html_processors_tampers/src/Plugin/Tamper/HtmlToGutenberg.php...
Checking patch src/HtmlGutenbergProcessorConfigTrait.php...
Checking patch src/Plugin/Action/ConvertToGutenberg.php...
Checking patch src/Plugin/Action/HrefToMedia.php...
Checking patch src/Plugin/HtmlGutenbergProcessor/Image.php...
Checking patch src/Plugin/HtmlGutenbergProcessor/Table.php...
Checking patch src/Plugin/HtmlGutenbergProcessor/TableCell.php...
Checking patch src/Service/HrefToMediaReplacer.php...
Checking patch src/Service/HtmlGutenbergParser.php...
Checking patch src/Service/MediaGenerator.php...
Applied patch README.md cleanly.
Applied patch config/schema/html_processors.schema.yml cleanly.
Applied patch modules/html_processors_tampers/src/Plugin/Tamper/HrefToMedia.php cleanly.
Applied patch modules/html_processors_tampers/src/Plugin/Tamper/HtmlToGutenberg.php cleanly.
Applied patch src/HtmlGutenbergProcessorConfigTrait.php cleanly.
Applied patch src/Plugin/Action/ConvertToGutenberg.php cleanly.
Applied patch src/Plugin/Action/HrefToMedia.php cleanly.
Applied patch src/Plugin/HtmlGutenbergProcessor/Image.php cleanly.
Applied patch src/Plugin/HtmlGutenbergProcessor/Table.php cleanly.
Applied patch src/Plugin/HtmlGutenbergProcessor/TableCell.php cleanly.
Applied patch src/Service/HrefToMediaReplacer.php cleanly.
Applied patch src/Service/HtmlGutenbergParser.php cleanly.
Applied patch src/Service/MediaGenerator.php cleanly.
➜  html_processors git:(1.0.x) ✗ ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml html_processors 
➜  contrib git:(master) ✗ 

realsp made their first commit to this issue’s fork.

realsp’s picture

Status: Needs review » Reviewed & tested by the community

Applied the #3 patch cleanly, fixes all the phpcs issues, RTBC +1.
I've created MR applying the changes.