Fix the issues reported by phpcs

Created on 8 July 2024, 7 months ago
Updated 9 July 2024, 7 months ago

Problem/Motivation

ommand -: vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/contrib/pages_restriction/

FILE: /var/www/html/drupal-contri-d10/modules/contrib/pages_restriction/src/Form/PagesRestrictionSettingsForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\Role.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/pages_restriction/src/Event/PagesRestrictionSubscriber.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpKernel\Event\RequestEvent.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/pages_restriction/pages_restriction.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: 186ms; Memory: 10MB

Steps to reproduce

Run PHPCS on Config Pages module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR.

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India bhaveshdas

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 @bhaveshdas
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India bhaveshdas

    I have fixed phpcs issuse please review it

    Thankyou!

  • Status changed to RTBC 7 months ago
  • šŸ‡®šŸ‡³India chandansha

    I have tested MR 13!. MR working properly i can't found any error.
    i move forward it to RTBC.

    Thanks!!

  • Status changed to Needs work 7 months ago
  • šŸ‡§šŸ‡·Brazil renatog Campinas

    Merge request is pointing to 8.x-1.x
    However issue is tagged to 2.0.1
    I'd suggest using 2.x version
    So the target branch must updated on MR

  • Status changed to Needs review 7 months ago
  • Status changed to Needs work 7 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @bhaveshdas,

    I applied MR!3 and it was applied smoothly. However I still encounter some issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

    āžœ  pages_restriction git:(main) āœ— curl https://git.drupalcode.org/project/pages_restriction/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2101    0  2101    0     0   1432      0 --:--:--  0:00:01 --:--:--  1433
    patching file src/Event/PagesRestrictionSubscriber.php
    patching file src/Form/PagesRestrictionSettingsForm.php
    āžœ  pages_restriction git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml pages_restriction
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/pages_restriction/pages_restriction.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: 218ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ—

    Please check and advise.
    Thank you.

  • Status changed to Needs review 7 months ago
  • šŸ‡®šŸ‡³India bhaveshdas

    Hey @cleavinjosh as #7 its not a issuse its by default drupal/composer behaviour its automatically comes

  • Status changed to RTBC 7 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @bhaveshdas,

    Thank you for the clarifications. I will now move the status to Reviewed & tested by the community since the other phpcs issues were fixed.

    Thank you.

Production build 0.71.5 2024