Created on 23 January 2024, 5 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
------------------------------------------------------------------------------------------------------------------------------------------

docroot\modules\contrib\webform_shs\src\Element\ShsTermSelect.php
-----------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------
154 | ERROR | Doc comment is empty
179 | ERROR | @throws comment must be on the next line
244 | ERROR | @throws comment must be on the next line
269 | ERROR | @throws comment must be on the next line

šŸ› Bug report
Status

RTBC

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 5 months ago
  • šŸ‡®šŸ‡³India Mohd Sahzad

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

  • Status changed to Needs work 5 months ago
  • šŸ‡®šŸ‡³India Preethy_ray

    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 5 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 5 months ago
  • Hi,
    I applied patch, and it applied cleanly.
    So changing the status to RTBC.
    Thankyou

Production build 0.69.0 2024