Fix the issues reported by phpcs

Created on 26 May 2023, over 1 year ago
Updated 14 March 2024, 7 months ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\css\domain_path_redirect.admin.css
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\domain_path_redirect.install
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\domain_path_redirect.module
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\DomainPathRedirectRepository.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\DomainPathRedirectStorageSchema.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\DomainPathRedirectViewsData.php
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\Entity\DomainPathRedirect.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: ...endassignment\web\modules\contrib\domain_path_redirect\src\EventSubscriber\DomainPathRedirectRequestSubscriber.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 292 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up
     |       |     over multiple lines
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: ...\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\Form\DomainPathRedirectDeleteForm.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 18 | ERROR   | [ ] The array declaration extends to column 203 (the limit is 80). The array content should be split up
    |         |     over multiple lines
 40 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait
    |         |     and $this->t() instead
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\Form\DomainPathRedirectForm.php
--------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 168 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 169 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: ...p\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\src\Plugin\views\filter\DomainAutocomplete.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 19 | ERROR | [ ] Missing member variable doc comment
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: ...p\htdocs\backendassignment\web\modules\contrib\domain_path_redirect\tests\src\Kernel\DomainPathRedirectAPITest.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 138 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait
     |         |     and $this->t() instead
 148 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait
     |         |     and $this->t() instead
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: ...kendassignment\web\modules\contrib\domain_path_redirect\tests\src\Unit\DomainPathRedirectRequestSubscriberTest.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

Time: 8.18 secs; Memory: 6MB

Steps to reproduce

Run following command:
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/dynamic_entity_reference/

Proposed resolution

Above error/warnings need to be fixed

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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 @sidharth_soman
  • Merge request !5Fixed phpcs issues. → (Closed) created by sidharth_soman
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi sidharth_soman,

    I applied your MR !5 to my local and noticed that there are still PHPCS errors being flagged of the module.

    FILE: ...ontrib/domain_path_redirect/src/Plugin/views/filter/DomainAutocomplete.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
    19 | ERROR | Missing member variable doc comment
    --------------------------------------------------------------------------------

    FILE: ..._path_redirect/src/EventSubscriber/DomainPathRedirectRequestSubscriber.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
    292 | ERROR | The array declaration extends to column 85 (the limit is 80).
    | | The array content should be split up over multiple lines
    --------------------------------------------------------------------------------

    Time: 690ms; Memory: 10MB

    ➜ docroot git:(master) ✗ phpcs --standard=DrupalPractice,Drupal --extensions=php,module,info,txt,yml modules/contrib/domain_path_redirect

    FILE: /Users/studenttrainees/Drupal/drupalissues/docroot/modules/contrib/domain_path_redirect/src/Plugin/views/filter/DomainAutocomplete.php
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------
    19 | ERROR | Missing member variable doc comment
    --------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal/drupalissues/docroot/modules/contrib/domain_path_redirect/src/EventSubscriber/DomainPathRedirectRequestSubscriber.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    292 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------------------------

    Time: 585ms; Memory: 10MB

    Please look at the screenshot attached for your reference.

    Thank you

  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sakthi_dev

    Please review.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case of coding standards issues, show which command and arguments have been used and which report that command shown.

  • Assigned to nitin_lama
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
    • webflo committed 2506debc on 8.x-1.x
      Issue #3362835 by sidharth_soman, nitin_lama, sakthi_dev, clarkssquared...
  • Status changed to Fixed 7 months ago
  • 🇩🇪Germany webflo

    The patches did not apply after 📌 Automated Drupal 10 compatibility fixes RTBC has been comittted. I fixed it myself, gave you commit credit anyways.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024