Fix the issues reported by phpcs

Created on 11 April 2023, over 1 year ago
Updated 4 September 2024, 3 months ago

FILE: /var/www/html/contribution/web/modules/contrib/tmgmt_microsoft/src/MicrosoftTranslatorUi.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
34 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/web/modules/contrib/tmgmt_microsoft/src/Plugin/tmgmt/Translator/MicrosoftTranslator.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
119 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/web/modules/contrib/tmgmt_microsoft/tests/src/Functional/MicrosoftTest.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India himanshu_jhaloya Indore

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 @himanshu_jhaloya
  • Merge request !1fixed the phpcs issue ā†’ (Open) created by himanshu_jhaloya
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs work 6 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @himanshu_jhaloya,

    I applied MR!1 and it was applied smoothly.

    However, I still encounter some issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

    āžœ  tmgmt_microsoft git:(8.x-1.1) curl https://git.drupalcode.org/project/tmgmt_microsoft/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4987    0  4987    0     0  11039      0 --:--:-- --:--:-- --:--:-- 11033
    patching file src/MicrosoftTranslatorUi.php
    patching file src/Plugin/tmgmt/Translator/MicrosoftTranslator.php
    patching file tests/src/Functional/MicrosoftTest.php
    patching file tmgmt_microsoft_test/tmgmt_microsoft_test.routing.yml
    āžœ  tmgmt_microsoft git:(8.x-1.1) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml tmgmt_microsoft
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/tmgmt_microsoft/src/Plugin/tmgmt/Translator/MicrosoftTranslator.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
     13 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\tmgmt\TranslatorInterface.
    --------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/tmgmt_microsoft/src/MicrosoftTranslatorUi.php
    -----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
    -----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------
    
    Time: 301ms; Memory: 12MB
    
    āžœ  contrib git:(main) āœ—
  • First commit to issue fork.
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 6 months ago
    run-tests.sh fatal error
  • Status changed to Needs review 6 months ago
  • Status changed to RTBC 6 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi Sir @paraderojether,

    I applied MR!1, it was applied smoothly and fixed all the remaining issues.

    āžœ  tmgmt_microsoft git:(8.x-1.1) curl https://git.drupalcode.org/project/tmgmt_microsoft/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6268    0  6268    0     0   9771      0 --:--:-- --:--:-- --:--:--  9778
    patching file src/MicrosoftTranslatorUi.php
    patching file src/Plugin/tmgmt/Translator/MicrosoftTranslator.php
    patching file tests/src/Functional/MicrosoftTest.php
    patching file tmgmt_microsoft_test/tmgmt_microsoft_test.routing.yml
    āžœ  tmgmt_microsoft git:(8.x-1.1) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml tmgmt_microsoft
    āžœ  contrib git:(main) āœ—

    Thank you.

  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 6 months ago
    run-tests.sh fatal error
  • Pipeline finished with Failed
    6 months ago
    Total: 145s
    #185873
  • First commit to issue fork.
Production build 0.71.5 2024