Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bundle_reference

FILE: ...dle_reference\src\Plugin\Field\FieldFormatter\BundleReferenceFormatter.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: ...p\task\bundle_reference\src\Plugin\Field\FieldType\BundleReferenceItem.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"
 84 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 87 | 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: ...sk\bundle_reference\src\Plugin\Field\FieldWidget\BundleReferenceWidget.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  89 | ERROR | [x] list(...) is forbidden, use [...] instead.
 103 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 134 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 556ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jay Jangid created an issue. See original summary.

jay jangid’s picture

Assigned: jay jangid » Unassigned
Status: Active » Needs review

Created MR , please review.

Thank you.

raubi gaur’s picture

Assigned: Unassigned » raubi gaur
raubi gaur’s picture

Assigned: raubi gaur » Unassigned

Thanks @Jay Jangid this mr solved above error.LGTM
Moved to rtbc.

raubi gaur’s picture

Status: Needs review » Reviewed & tested by the community

Pinesh made their first commit to this issue’s fork.

pinesh’s picture

Status: Reviewed & tested by the community » Needs review
nilesh.addweb’s picture

Assigned: Unassigned » nilesh.addweb
nilesh.addweb’s picture

Hello,

I have applied the patch cleanly, and the above errors are resolved.
Please check the Screenshots for the same.

nilesh.addweb’s picture

Assigned: nilesh.addweb » Unassigned
Status: Needs review » Reviewed & tested by the community

silvi.addweb made their first commit to this issue’s fork.

  • Pinesh committed 8d59a0c8 on 2.0.x authored by Jay Jangid
    Issue #3339857 by Jay Jangid, Pinesh, silvi.addweb, nilesh.addweb, raubi...
pinesh’s picture

Thank you all for your valuable contribution.

pinesh’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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