Fix the issues reported by phpcs

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

Problem/Motivation

Running :-
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/webform_field_mapper/
returns the following warnings/errors, which should be fixed.

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/webform_field_mapper/src/Plugin/WebformHandler/FieldMapperPost.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
47 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
48 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
49 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
50 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
217 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
219 | ERROR | [x] Expected 1 blank line after function; 0 found
220 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/webform_field_mapper/webform_field_mapper.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: 129ms; Memory: 10MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

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 @prem suthar
  • First commit to issue fork.
  • Assigned to bhaveshdas
  • šŸ‡®šŸ‡³India riddhi.addweb

    riddhi.addweb ā†’ changed the visibility of the branch 3459909-fix-the-issues to hidden.

  • šŸ‡®šŸ‡³India riddhi.addweb

    riddhi.addweb ā†’ changed the visibility of the branch 3459909-fix-the-issues to active.

  • Issue was unassigned.
  • šŸ‡®šŸ‡³India bhaveshdas

    I have fixed all phpcs issues could you please review it.

    Thankyou !

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

    Hi @bhaveshdas,

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

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

    Please check and advise.
    Thank you.

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

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

  • Status changed to RTBC 6 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