Fix the issues reported by phpcs

Created on 6 June 2023, over 1 year ago
Updated 17 July 2024, 5 months ago
šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Status changed to Needs work over 1 year ago
  • Hello urvashi_vora ,
    I have reviewed your patch & Implemented it on my website having version 9.5.9 And PHP version - 8.2
    I am adding some screenshots(before/after applying the patch) for your reference).
    Please have a look once at these screenshots.

    Thank You for your Support !!!

  • Assigned to nitin_lama
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    2 pass, 4 fail
  • šŸ‡®šŸ‡³India nitin_lama India

    Addressed #2. Updated patch.

  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    2 pass, 4 fail
  • šŸ‡®šŸ‡³India arpitk

    Updated patch.

  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡³India Kaustab_Roy

    Tried patch #7,
    applied cleanly & no errors reported by phpcs.

  • First commit to issue fork.
  • šŸ‡®šŸ‡³India pray_12

    Successfully applied and tested patch #7. No errors reported by PHPCS.

  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 5 months ago
  • Hi @arpitk,

    The patch you provided was applied not-so successfully, multiple errors were reported. Please see below:

    rut git:(8.x-1.x) āœ— curl https://www.drupal.org/files/issues/2023-06-13/coding-standard-fixes-7.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 20844  100 20844    0     0   185k      0 --:--:-- --:--:-- --:--:--  207k
    patching file includes/jquery.Rut.min.js
    patching file js/rut.js
    patching file modules/rut_field/config/schema/rut_field.views.schema.yml
    patching file modules/rut_field/rut_field.install
    patching file modules/rut_field/src/Feeds/Target/RutTarget.php
    patching file modules/rut_field/src/Plugin/Field/FieldWidget/RutWidget.php
    patching file modules/rut_field/src/Plugin/views/filter/RutEquality.php
    patching file modules/rut_field/tests/src/Functional/RutFieldTest.php
    Hunk #1 FAILED at 91.
    Hunk #2 FAILED at 112.
    2 out of 2 hunks FAILED -- saving rejects to file modules/rut_field/tests/src/Functional/RutFieldTest.php.rej
    patching file modules/rut_field/tests/src/Kernel/RutItemTest.php
    patching file src/Command/GenerateCommand.php
    patching file src/Command/ValidateCommand.php
    patching file src/Element/RutField.php
    patching file src/Rut.php
    patching file tests/modules/rut_test/rut_test.info.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n] n
    Apply anyway? [n] y
    Hunk #1 FAILED at 4.
    1 out of 1 hunk FAILED -- saving rejects to file tests/modules/rut_test/rut_test.info.yml.rej
    patching file tests/modules/rut_test/rut_test.routing.yml
    patching file tests/src/Functional/RutElementTest.php
    patching file tests/src/Kernel/RutTest.php
    āžœ  rut git:(8.x-1.x) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig rut
    
    FILE: ...l-orgissue/web/modules/contrib/rut/tests/src/Functional/RutElementTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is
       |       |     Drupal\Core\StringTranslation\StringTranslationTrait.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...-site/drupal-orgissue/web/modules/contrib/rut/tests/src/Kernel/RutTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\KernelTests\KernelTestBase.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...odules/contrib/rut/modules/rut_field/tests/src/Functional/RutFieldTest.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
      6 | ERROR | [x] Use statements should be sorted alphabetically. The first
        |       |     wrong one is Drupal\field\Entity\FieldConfig.
     98 | ERROR | [x] list(...) is forbidden, use [...] instead.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...web/modules/contrib/rut/modules/rut_field/tests/src/Kernel/RutItemTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Field\FieldItemInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...s/contrib/rut/modules/rut_field/src/Plugin/Field/FieldWidget/RutWidget.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Field\WidgetBase.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...dules/contrib/rut/modules/rut_field/src/Plugin/Field/FieldType/RutItem.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Field\FieldDefinitionInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...rib/rut/modules/rut_field/src/Plugin/Field/FieldFormatter/RutFormatter.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Field\FieldItemListInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ules/contrib/rut/modules/rut_field/src/Plugin/views/filter/RutEquality.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\rut\Rut.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...field/src/Plugin/Validation/Constraint/RutFieldTypeConstraintValidator.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\rut\Rut.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...te/drupal-orgissue/web/modules/contrib/rut/src/Command/ValidateCommand.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Console\Core\Command\Command.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...te/drupal-orgissue/web/modules/contrib/rut/src/Command/GenerateCommand.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first
        |       |     wrong one is Drupal\Console\Core\Style\DrupalStyle.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 504ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • First commit to issue fork.
  • Merge request !4Issue #3364993:Fixed the phpcs. ā†’ (Open) created by Unnamed author
  • Status changed to Needs review 5 months ago
  • Assigned to hetal.solanki
  • Status changed to RTBC 5 months ago
  • šŸ‡®šŸ‡³India hetal.solanki

    @urvashi_vora, @atul_ghate

    I have tested MR and it is working properly with no errors found. I will move it forward to RTBC.

    Thank you!!

  • Issue was unassigned.
  • šŸ‡®šŸ‡³India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
Production build 0.71.5 2024