Created on 23 January 2024, 10 months ago

PHPCS issue

webform_shs\src\Plugin\WebformElement\ShsTermSelect.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------------------------------------------------
69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
99 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
104 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
132 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.14 secs; Memory: 10MB

šŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India aadeshvermaster@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Assigned to mohd sahzad
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India mohd sahzad

    I have fixed phpcs issue in above attached patch, please review this

  • Status changed to Needs work 10 months ago
  • šŸ‡®šŸ‡³India pray_12

    Hi,
    I applied patch #4, and it applied cleanly; however, I encountered one error.

    FILE: /webform_shs/webform_shs.module
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
    10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
    | | Drupal\Core\Routing\RouteMatchInterface.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------

  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi Mohd Sahzad,

    I applied your patch #4 and I noticed after applying the patch that there are still many PHPCS issues that needs to be fixed.

    āžœ  webform_shs git:(master) āœ— curl https://www.drupal.org/files/issues/2024-01-23/PHPCS-issue-3416371.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3684  100  3684    0     0   7050      0 --:--:-- --:--:-- --:--:--  7153
    patching file 'src/Plugin/WebformElement/ShsTermSelect.php'
    āžœ  webform_shs git:(master) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml webform_shs 
    
    FILE: .../Projects/d9/d9-local/web/modules/contrib/webform_shs/webform_shs.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
    --------------------------------------------------------------------------------
    
    
    FILE: ...ng/Projects/d9/d9-local/web/modules/contrib/webform_shs/webform_shs.module
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first
        |       |     wrong one is Drupal\Core\Routing\RouteMatchInterface.
     12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
     13 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
     14 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...eb/modules/contrib/webform_shs/src/Plugin/WebformElement/ShsTermSelect.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     126 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../d9/d9-local/web/modules/contrib/webform_shs/src/Element/ShsTermSelect.php
    --------------------------------------------------------------------------------
    FOUND 20 ERRORS AND 3 WARNINGS AFFECTING 20 LINES
    --------------------------------------------------------------------------------
       5 | WARNING | [x] Unused use statement
       6 | WARNING | [x] Unused use statement
      10 | WARNING | [x] Unused use statement
      31 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      32 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      33 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      34 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      35 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      36 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      37 | ERROR   | [x] Array closing indentation error, expected 4 spaces but
         |         |     found 6
     116 | ERROR   | [x] Data types in @param tags need to be fully namespaced
     119 | ERROR   | [x] Expected 1 space before opening brace; found 0
     157 | ERROR   | [x] Missing function doc comment
     179 | ERROR   | [ ] @throws comment must be on the next line
     179 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
     221 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
     222 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
     244 | ERROR   | [ ] @throws comment must be on the next line
     244 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
     247 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
     270 | ERROR   | [ ] @throws comment must be on the next line
     270 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
     275 | ERROR   | [x] Data types in @var tags need to be fully namespaced
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 297ms; Memory: 12MB
    
    āžœ  contrib git:(master) āœ— 
    

    moving this to needs work

  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India mohd sahzad

    Hi @clarkssquared,
    please check again using apttached patch 2

  • šŸ‡®šŸ‡³India mohd sahzad

    Not found any error check above attached screenshot

  • Status changed to RTBC 10 months ago
  • Hi,
    I applied patch, and it applied cleanly.
    So changing the status to RTBC.
    Thankyou

  • Status changed to Fixed about 2 months ago
  • šŸ‡¬šŸ‡§United Kingdom hugronaphor
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024