Fix the issues reported by phpcs

Created on 5 July 2023, over 1 year ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

FILE: ...ar/www/html/vb/d_cont/simple_media_bulk_upload/src/Form/BulkUploadForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
129 | WARNING | Exceptions should not be translated
298 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
308 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
316 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
389 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

Time: 187ms; 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 simple_media_bulk_upload/

Remaining tasks

Patch review

šŸ“Œ Task
Status

Fixed

Version

2.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

Comments & Activities

  • Issue created by @urvashi_vora
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    I reviewed provided patch and it get applied cleanly.
    There are one remaining issue.
    Providing updated patch too.
    Please review.

  • Status changed to RTBC about 1 year ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied your patch #2 and I confirmed that it fixes all the PHPCS issues except for the project, datestamp, and version in info.yml file which I believe will appear when I install the module via composer. I will retain the status to needs review to give way for other people to give their feedback regarding your patch, RTBC +1 from me.

    āžœ  simple_media_bulk_upload git:(master) āœ— curl https://www.drupal.org/files/issues/2023-10-05/phpcs-issue-fixes.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4560  100  4560    0     0  17386      0 --:--:-- --:--:-- --:--:-- 17952
    patching file 'src/Form/BulkUploadForm.php'
    āžœ  simple_media_bulk_upload git:(master) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml simple_media_bulk_upload 
    
    FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/simple_media_bulk_upload/simple_media_bulk_upload.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: 348ms; Memory: 12MB
    
    
  • Status changed to Needs review 3 months ago
  • šŸ‡­šŸ‡ŗHungary nagy.balint

    The patch is a bit outdated.

    Here is a reroll for 2.0.x, but likely applies to 1.0.x too.

  • šŸ‡­šŸ‡ŗHungary nagy.balint

    Actually the FormBase already have
    use LoggerChannelTrait;
    use MessengerTrait;
    So we don't even need some of those injections.

  • Status changed to Fixed 3 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024