Fix issues reported by PHPCS

Created on 8 January 2025, about 2 months ago

Problem/Motivation

It would be great to address the below minor PHPCS issues :

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

FILE: /var/www/web/modules/contrib/paragraphs_paste/paragraphs_paste.routing.yml
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
  7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
 15 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/paragraphs_paste/tests/modules/paragraphs_paste_test/paragraphs_paste_test.info.yml
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | "Description" property is missing in the info.yml file
----------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/paragraphs_paste/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------
  3 | WARNING | [ ] Line exceeds 80 characters; contains 122 characters
  4 | WARNING | [ ] Line exceeds 80 characters; contains 128 characters
  5 | WARNING | [ ] Line exceeds 80 characters; contains 182 characters
  8 | WARNING | [ ] Line exceeds 80 characters; contains 114 characters
 12 | ERROR   | [x] Expected 1 newline at end of file; 3 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/paragraphs_paste/paragraphs_paste.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

Time: 615ms; Memory: 14MB

Steps to reproduce

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

Proposed resolution

Fix the PHPCS issues.

๐Ÿ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia abhiyanshu

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 @abhiyanshu
  • First commit to issue fork.
  • Pipeline finished with Success
    5 days ago
    Total: 189s
    #434869
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia GGH
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied MR !13 and I can still see PHPCS errors in the module,

    โžœ  paragraphs_paste git:(2.0.0-beta7) curl https://git.drupalcode.org/project/paragraphs_paste/-/merge_requests/13.diff | patch -p1 
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3263    0  3263    0     0   6108      0 --:--:-- --:--:-- --:--:--  6191
    patching file README.md
    patching file paragraphs_paste.routing.yml
    patching file 'tests/modules/paragraphs_paste_test/paragraphs_paste_test.info.yml'
    โžœ  paragraphs_paste git:(2.0.0-beta7) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paragraphs_paste
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/modules/contrib/paragraphs_paste/tests/src/FunctionalJavascript/ParagraphsPasteJavascriptTestBase.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\dblog\Controller\DbLogController.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/modules/contrib/paragraphs_paste/tests/src/Kernel/Controller/PropertyPathAutocompleteControllerTest.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\paragraphs_paste\Controller\PropertyPathAutocompleteController.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 400ms; Memory: 12MB
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom aaron.ferris

    aaron.ferris โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom aaron.ferris

    Reordered those in the MR, not seeing any phpcs complaints...

    aaronferris@Mac Drupal % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paragraphs_paste-3498144
    aaronferris@Mac Drupal % 
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom aaron.ferris
Production build 0.71.5 2024